This application claims priority to Chinese Patent Application No. 202011480940.7, filed on Dec. 15, 2020, the contents of which are hereby incorporated by reference in their entireties.
Embodiments of the present disclosure mainly relate to the Internet field, and more specifically, to an information search method and apparatus, an electronic device, a computer-readable storage medium, and a computer program product.
When a user performs an information search with a client, and the client often needs to present two parts of information to the user: one is a suggested word associated with a search word entered by the user, and the other is a search result acquired by a search engine of a server. Therefore, the client needs to separately send, based on the search word entered by the user, a request to a suggested word service function entity for determining a suggested word and a prefetch service function entity for prefetching a search result in a server system, and present, to the user as quickly as possible, a suggested word acquired from the suggested word service function entity and present a prefetched search result to the user when the user sends a search instruction. If the user changes the search word, the client still needs to send a request twice as described above. In other words, each time the user enters a search word, a request needs to be sent twice, and a response also needs to be received twice. Therefore, a conventional information search manner wastes computing resources and network bandwidth of the client.
According to example embodiments of the present disclosure, a solution of searching for information is provided.
In a first aspect of the present disclosure, an information search method is provided. The method including receiving, from a client, a request message including query information. The method further includes determining, based on the request message, a suggested word result and a prefetched search result corresponding to the query information. Further, the method includes returning the suggested word result as a first response message for the request message to a client. In addition, the method further includes returning the prefetched search result as a second response message for the request message to the client.
In a second aspect of the present disclosure, an information search method is provided. The method includes sending a request message to a server system based on query information entered by a user, wherein the request message includes the query information. In addition, the method further includes receiving, from at least one service function entity in the server system, a first response message and a second response message for the request message. The first response message indicates a suggested word result corresponding to the query information and to be presented to the user, and the second response message indicates a prefetched search result corresponding to the query information and to be presented to the user.
In a third aspect of the present disclosure, an electronic device is provided, including: one or more processors; and a memory storing one or more programs configured to be executed by the one or more processors, the one or more programs including instructions for: receiving, from a client, a request message comprising query information; determining, based on the request message, a suggested word result and a prefetched search result corresponding to the query information; returning the suggested word result as a first response message for the request message to the client; and returning the prefetched search result as a second response message for the request message to the client.
In a fourth aspect of the present disclosure, an electronic device is provided, including: one or more processors; and a memory storing one or more programs configured to be executed by the one or more processors, the one or more programs including instructions for: sending a request message to a server system based on query information entered by a user, wherein the request message comprises the query information; and receiving, from at least one service function entity in the server system, a first response message and a second response message for the request message, wherein the first response message indicates a suggested word result corresponding to the query information and to be presented to the user, and wherein the second response message indicates a prefetched search result corresponding to the query information and to be presented to the user.
In a fifth aspect of the present disclosure, a computer-readable storage medium storing one or more programs, the one or more programs including instructions, which when executed by one or more processors of an electronic device, cause the electronic device to: receive, from a client, a request message comprising query information; determine, based on the request message, a suggested word result and a prefetched search result corresponding to the query information; return the suggested word result as a first response message for the request message to the client; and return the prefetched search result as a second response message for the request message to the client.
In a sixth aspect of the present disclosure, a computer-readable storage medium storing one or more programs, the one or more programs including instructions, which when executed by one or more processors of an electronic device, cause the electronic device to: send a request message to a server system based on query information entered by a user, wherein the request message comprises the query information; and receive, from at least one service function entity in the server system, a first response message and a second response message for the request message, wherein the first response message indicates a suggested word result corresponding to the query information and to be presented to the user, and wherein the second response message indicates a prefetched search result corresponding to the query information and to be presented to the user.
In a seventh aspect of the present disclosure, an information search apparatus is provided, which includes: a request message receiving module configured to receive, from a client, a request message including query information; a result determination module configured to determine, based on the request message, a suggested word result and a prefetched search result corresponding to the query information; a first response message sending module configured to return the suggested word result as a first response message for the request message to the client; and a second response message sending module configured to return the prefetched search result as a second response message for the request message to the client.
In an eighth aspect of the present disclosure, an information search apparatus is provided, which includes: a request message sending module configured to send a request message to a server system based on query information entered by a user, wherein the request message includes the query information; and a response message receiving module configured to receive, from at least one service function entity in the server system, a first response message and a second response message for the request message, wherein the first response message indicates a suggested word result corresponding to the query information and to be presented to the user, and wherein the second response message indicates a prefetched search result corresponding to the query information and to be presented to the user.
In a ninth aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the methods according to the first aspect and the second aspect of the present disclosure are implemented.
It should be understood that the content described in the summary is not intended to limit critical or significant features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will be easily comprehensible from the following description.
The above and other features, advantages, and aspects of various embodiments of the present disclosure will be described in conjunction with the drawings and with reference to the following detailed description. In the accompanying drawings, the same or similar reference signs denote the same or similar elements. In the figures:
Example embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although some embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the accompanying drawings and the embodiments of the present disclosure are merely for illustrative purposes, and are not intended to limit the scope of protection of the present disclosure.
In the description of the embodiments of the present disclosure, the term “comprises,” “comprising,” “includes,” “including,” and similar terms should be understood as non-exclusive inclusion, that is, “including but not limited to.” The term “based on” should be understood as “at least partially based on.” The terms “an embodiment” or “the embodiment” should be understood as “at least one embodiment.” The terms “first,” “second,” and the like may refer to different or same objects. Other explicit and implicit definitions may also be included below.
As described above, in the conventional information search manner, request sending and response receiving each need to be performed twice in response to each input by the user for a search, such that computing resources of a user device of a client are occupied, and overheads of network bandwidth are increased. For example, if the user wants to enter query information “bei jing tian qi” (which means Beijing weather), the user may enter “bei jing,” “tian,” and “qi” one by one in the entering process. When the user enters “bei jing,” the client encapsulates the query information “bei jing” into a suggested word request message and send the message to a suggested word service function entity on a server system side, and the client further encapsulates the query information “bei jing” into a prefetch service request message and sends the message to a prefetch service function entity on the server system side. Then, the client presents, to the user, suggested word results related to “bei jing” based on a response message. In addition, the client may further store prefetched search results related to “bei jing.” Before the user sends a search instruction, each time the user adds or changes the query information, the client sends a request message twice and receives a response message corresponding to the request twice.
The present disclosure provides an information search method to quickly, efficiently, and cost-effectively complete the process of presenting suggested words and prefetching search results for query information entered by a user.
According to an embodiment of the present disclosure, an information search solution is proposed. In this solution, a transfer function entity may be disposed in a server to receive a request message from a client, and then the transfer function entity asks a corresponding service function entity for a suggested word result and a prefetched search result based on the request message, and returns the two results to the client in the form of a response message corresponding to the request message. For example, a suggested word service function entity located in the server may generate a suggested word response message in response to receiving a suggested word request message generated by the client, and return the response message to the client based on chunked transfer encoding of HyperText Transfer Protocol (HTTP). In addition, the suggested word service function entity further sends a prefetch service request message to a prefetch service function entity based on the suggested word request message, and after a prefetch service response message returned by the prefetch service function entity is received, the suggested word service function entity returns a prefetched search result to the client based on chunked transfer encoding of HyperText Transfer Protocol.
The example embodiments of the present disclosure are described with reference to the accompanying drawings.
In order to describe a message transfer process of
It should be understood that the process 203 of determining a suggested word result and the process 207 of determining a prefetched search result by the server system 220 are not limited to being performed in the sequence shown in
The technical solution described above is only for illustration, and does not limit the present disclosure. It should be understood that the client 210 and the server system 220 may also be arranged in other manners and connection relationships. In order to explain the principle of the foregoing solution more clearly, the information search process will be described in more detail below with reference to
At 302, the server system 220 may receive a request message from the client 210. It should be understood that, the request message includes query information. Here, the request message is not a “search request message” in a conventional technical solution, because the request message is not triggered by a search action of the user, but may be triggered by an action of entering the query information by the user. It should further be understood that the query information may be at least part of a query item entered by the user. As an example, when the user wants to search for information about “bei jing tian qi,” if the user first enters “bei jing” in a search box, “bei jing” is the query information. When the user subsequently enters “tian,” the query item “bei jing tian” is the query information. The client 210 is configured to present a suggested word result such as “bei jing tian qi” and “bei jing ti yu” (which means Beijing sports) to the user based on the query information entered by the user in real time. In addition, the client 210 is further configured to acquire a prefetched search result from the server system 220 based on the query information entered by the user in real time, so that when the user triggers a search instruction or the user selects one suggested word result from a plurality of presented suggested word results for a search, the client 210 may present the prefetched search result to the user.
At 304, the server system 220 may determine, based on the request message, a suggested word result and a prefetched search result corresponding to the query information.
In some embodiments, to determine the suggested word result and the prefetched search result, the server system 220 may generate, based on the request message, a suggested word request message and a prefetch service request message associated with the query information. It should be understood that the server system 220 may include a plurality of function entities. As an example,
Then, the transfer function entity 421 respectively sends the suggested word request message and the prefetch service request message to the suggested word service function entity 422 and the prefetch service function entity 423 in the server system 420. As an example, at 402, the transfer function entity 421 sends the suggested word request message to the suggested word service function entity 422. After this or at the same time, at 403, the transfer function entity 421 sends the prefetch service request message to the prefetch service function entity 423.
In addition, the transfer function entity 421 is further configured to receive a suggested word response message from the suggested word service function entity 422 and a prefetch service response message from the prefetch service function entity 423. As an example, at 404, the suggested word service function entity 422 determines a suggested word result based on the suggested word request message, and at 405, the suggested word service function entity 422 transfers the suggested word result to the transfer function entity 421 as the suggested word response message. After the process 404 or at the same time, at 407, the prefetch service function entity 423 determines a prefetched search result based on the prefetch service request message, and at 408, the prefetch service function entity 423 transfers the prefetched search result to the transfer function entity 421 as the prefetch service response message. In this way, by arranging the transfer function entity 421 in the server system 420, in the present disclosure, the client can receive the two results determined by the server system 420 after sending a request message once, thereby reducing the bandwidth overheads on the client side.
It should be understood that the suggested word response message includes the suggested word result corresponding to the query information, and the prefetch service response message includes the prefetched search result corresponding to the query information. It should also be understood that the foregoing processes are not limited to being performed in the sequence shown in
In addition, in some embodiments, the request message may include a suggested word request message, and therefore, the suggested word service function entity may partially take the place of the foregoing transfer function entity. As an example,
In addition, a prefetch service request message may be further generated based on the suggested word request message, and a prefetch service response message is generated based on the prefetch service request message, wherein the prefetch service response message includes a prefetched search result corresponding to the query information. As an example, at 504, the suggested word service function entity 521 sends a prefetch service request message to the prefetch service function entity 522, and at 505, the prefetch service function entity 522 determines a prefetched search result, and then at 506, returns the prefetched search result to the suggested word service function entity 521 as a prefetch service response message. In this way, by setting the suggested word service function entity in the server system 520 as a transfer function entity, in the present disclosure, the client can receive the two results determined by the server system 520 after sending a request message once, thereby reducing the bandwidth overheads on the client side.
At 306, the server system 220 may return the suggested word result as a first response message for the request message to the client 210. As an example, as shown in
At 308, the server system 220 may return the prefetched search result as a second response message for the request message to the client 210. As an example, as shown in
In some example embodiments, the first response message and the second response message for the request message are transferred sequentially based on chunked transfer encoding of HyperText Transfer Protocol. In other words, there may be one response message for the request message, the first response message includes start information of the response message for the request message, and the second response message includes end information of the response message. Therefore, the client 210 can acquire the suggested word result and prefetched search result by receiving one response message, thereby saving bandwidth resources on the client side.
At 602, the client 210 may send a request message to a server system based on query information entered by a user. It should be understood that, the request message includes query information. Here, the request message is not a “search request message” in a conventional technical solution, because the request message is not triggered by a search action of the user, but may be triggered by an action of entering the query information by the user. As an example, when the user wants to search for information about “bei jing tian qi,” if the user first enters “bei jing” in a search box, “bei jing” is the query information. When the user subsequently enters “tian,” the query item “bei jing tian” is the query information.
At 604, the client 210 may receive, from at least one service function entity in the server system 220, a first response message and a second response message for the request message. As an example, the first response message may be used to indicate a suggested word result corresponding to the query information and to be presented to the user, and the second response message may be used to indicate a prefetched search result corresponding to the query information and to be presented to the user. As an example, the client 210 may present a suggested word result such as “bei jing tian qi” and “bei jing ti yu” to the user based on the query information entered by the user in real time. In addition, the client 210 is further configured to acquire a prefetched search result from the server system 220 based on the query information entered by the user in real time, so that when the user triggers a search instruction or the user selects one suggested word result from a plurality of presented suggested word results for a search, the client 210 may present the prefetched search result to the user.
In some embodiments, the at least one service function entity may be a suggested word service function entity or a prefetch service function entity for providing a suggested word service function or a prefetch service function. Alternatively or additionally, the at least one service function entity may alternatively be a transfer service function entity for providing a forwarding service function. In some embodiments, the first response message and the second response message for the request message are transferred sequentially based on chunked transfer encoding of HyperText Transfer Protocol.
It should be understood that the request message may include addressing information for addressing the at least one service function entity in the server system 220. For example, the request message may include address information destined to the suggested word service function entity, so that when receiving the request message, the transfer function entity may directly forward the request message to the suggested word service function entity based on the address information. For another example, the request message may include address information destined to the prefetch service function entity, so that when receiving the request message, the transfer function entity may directly forward the request message to the prefetch service function entity based on the address information. In this way, a working mechanism of the transfer function entity can be defined on the client side, so that when the server system 220 includes function entities other than the suggested word service function entity and the prefetch service function entity, the client 210 can determine by itself a destination function entity to which the request message is sent. In this way, the scalability of a server-side function entity is improved.
In some embodiments, when the client 210 receives a search instruction entered by the user, for example, the user touches the “search” instruction, or the user selects one of suggested word results, the client 210 needs to compare the prefetched search result with the query information. The prefetched search result is presented to the user if the prefetched search result matches the query information. If the prefetched search result does not match the query information, the client 210 directly re-initiates a search request based on the query information. In this way, the accuracy of the search result and the user experience can be improved.
Through the above embodiments, the present disclosure provides an improved flow of message communication between the client and the server system in the information search process. Through the execution of the improved flow of the present disclosure, the number of times a client sends a request can be reduced, thereby greatly reducing system and bandwidth overheads of the client in a process of entering query information by a user. In addition, the present disclosure uses the chunked transfer encoding of hypertext transfer protocol (HTTP) to transfer, in one response message, the two results determined on the server system side, thereby reducing the number of times the client receives a response and further reducing the system and bandwidth overheads of the client.
In addition, the present disclosure further provides a corresponding computer-readable storage medium, which stores computer instructions that are used to cause a computer to perform at least one process of the foregoing embodiments. The present disclosure further provides a corresponding computer program product, which includes a computer program that can implement at least one process of the foregoing embodiments.
In some embodiments, the result determination module 704 may be further configured to: generate, based on the request message, a suggested word request message and a prefetch service request message associated with the query information; respectively send the suggested word request message and the prefetch service request message to a suggested word service function entity and a prefetch service function entity in a server system; and receive a suggested word response message from the suggested word service function entity and a prefetch service response message from the prefetch service function entity, wherein the suggested word response message includes the suggested word result corresponding to the query information, and the prefetch service response message includes the prefetched search result corresponding to the query information.
In some embodiments, the request message may include a suggested word request message, and the result determination module may be further configured to: generate a suggested word response message based on the suggested word request message, wherein the suggested word response message includes the suggested word result corresponding to the query information; generate a prefetch service request message based on the suggested word request message; and generate a prefetch service response message based on the prefetch service request message, wherein the prefetch service response message includes the prefetched search result corresponding to the query information.
In some embodiments, the first response message and the second response message for the request message may be transferred sequentially based on chunked transfer encoding of HyperText Transfer Protocol.
In some embodiments, the at least one service function entity may be configured to provide a suggested word service function or a prefetch service function.
In some embodiments, the at least one service function entity may be configured to provide a forwarding service function.
In some embodiments, the request message may include addressing information for addressing the at least one service function entity in the server system.
In some embodiments, the first response message and the second response message for the request message are transferred sequentially based on chunked transfer encoding of HyperText Transfer Protocol.
In some embodiments, the apparatus may further include: a comparison module configured to compare the prefetched search result with the query information in response to receiving a search instruction entered by the user; and a search result presentation module configured to present the prefetched search result to the user in response to the prefetched search result matching the query information.
A plurality of components in the device 900 are connected to the I/O interface 905, including: an input unit 906, such as a keyboard or a mouse; an output unit 907, such as various types of displays or speakers; a storage unit 908, such as a magnetic disk or an optical disc; and a communication unit 909, such as a network interface card, a modem, or a wireless communication transceiver. The communication unit 909 allows the device 900 to exchange information/data with other devices via a computer network such as the Internet and/or various telecommunications networks.
The processing unit 901 performs the various methods and processing described above, such as the processes 300 and 600. For example, in some embodiments, the processes 300 and 600 may be implemented as computer software programs, which are tangibly included in a machine-readable medium, such as the storage unit 908. In some embodiments, a part or all of the computer program may be loaded and/or installed onto the device 900 via the ROM 902 and/or the communication unit 909. When the computer program is loaded into the RAM 903 and executed by the CPU 901, one or more steps of the processes 300 and 600 described above may be performed. Alternatively, in other embodiments, the CPU 901 may be configured to perform the processes 300 and 600 in any other appropriate manner (for example, by means of firmware).
The functions described herein above may be performed at least partially by one or more hardware logic components. For example, without limitation, example types of hardware logic components that can be used include: a field programmable gate array (FPGA), an application-specific integrated circuit (ASIC), an application-specific standard product (ASSP), a system-on-chip system (SOC), a complex programmable logic device (CPLD), etc.
Program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. The program code may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing devices, such that when the program code is executed by the processor or controller, the functions/operations specified in the flowcharts and/or block diagrams are implemented. The program code may be completely executed on a machine, or partially executed on a machine, or may be, as an independent software package, partially executed on a machine and partially executed on a remote machine, or completely executed on a remote machine or server.
In the context of the present disclosure, the machine-readable medium may be a tangible medium, which may contain or store a program for use by an instruction execution system, apparatus, or device, or for use in combination with the instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of the machine-readable medium may include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
In addition, although the various operations are depicted in a specific order, it should be understood as requiring such operations to be performed in the specific order shown or in a sequential order, or requiring all illustrated operations to be performed to achieve desired results. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Some features that are described in the context of separate embodiments can also be implemented in combination in a single implementation. Conversely, various features that are described in the context of a single implementation can also be implemented in a plurality of implementations individually or in any suitable sub-combination.
Although the subject matter has been described in a language specific to structural features and/or logical actions of the method, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. In contrast, the specific features and actions described above are merely example forms of implementing the claims.
The various embodiments described above can be combined to provide further embodiments. All of the U.S. patents, U.S. patent application publications, U.S. patent applications, foreign patents, foreign patent applications and non-patent publications referred to in this specification and/or listed in the Application Data Sheet are incorporated herein by reference, in their entirety. Aspects of the embodiments can be modified, if necessary to employ concepts of the various patents, applications and publications to provide yet further embodiments.
These and other changes can be made to the embodiments in light of the above-detailed description. In general, in the following claims, the terms used should not be construed to limit the claims to the specific embodiments disclosed in the specification and the claims, but should be construed to include all possible embodiments along with the full scope of equivalents to which such claims are entitled. Accordingly, the claims are not limited by the disclosure.
Number | Date | Country | Kind |
---|---|---|---|
202011480940.7 | Dec 2020 | CN | national |