CN110502699B - Method and device for acquiring information - Google Patents

Method and device for acquiring information Download PDF

Info

Publication number
CN110502699B
CN110502699B CN201910794750.3A CN201910794750A CN110502699B CN 110502699 B CN110502699 B CN 110502699B CN 201910794750 A CN201910794750 A CN 201910794750A CN 110502699 B CN110502699 B CN 110502699B
Authority
CN
China
Prior art keywords
search
result corresponding
complete
search word
search result
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910794750.3A
Other languages
Chinese (zh)
Other versions
CN110502699A (en
Inventor
曹建楠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Baidu Online Network Technology Beijing Co Ltd
Original Assignee
Baidu Online Network Technology Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Baidu Online Network Technology Beijing Co Ltd filed Critical Baidu Online Network Technology Beijing Co Ltd
Priority to CN201910794750.3A priority Critical patent/CN110502699B/en
Publication of CN110502699A publication Critical patent/CN110502699A/en
Application granted granted Critical
Publication of CN110502699B publication Critical patent/CN110502699B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9532Query formulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation

Abstract

The embodiment of the application discloses a method and a device for acquiring information. One embodiment of the method comprises: detecting that a user performs input operation in a search box of an application program; the following storage steps are performed: acquiring a current search word in a search box; sending a pre-fetching request to a server based on the current search word, and receiving a search result corresponding to the current search word returned by the server; storing a search result corresponding to the current search word; in response to determining that the user input is finished, acquiring a complete search word in the search box; and responding to the search result corresponding to the complete search word determined to be stored, and acquiring the search result corresponding to the stored complete search word. The embodiment improves the acquisition speed of the search result.

Description

Method and device for acquiring information
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a method and a device for acquiring information.
Background
With the rapid development of the internet, more and more users actively search on the internet to acquire information required by the users.
Currently, the conventional information obtaining manner is to first pre-fetch the search results based on JavaScript, and then search the pre-fetched search results for the corresponding search results. The search result prefetching based on JavaScript comprises the following steps: firstly, a JavaScript code is loaded into WebView in advance at the starting stage of an application program, then the application program transmits the behavior of a user to the JavaScript in the WebView, and the JavaScript initiates the prefetching of a search result.
Disclosure of Invention
The embodiment of the application provides a method and a device for acquiring information.
In a first aspect, an embodiment of the present application provides a method for acquiring information, which is applied to an application installed on a terminal device, and includes: detecting that a user performs input operation in a search box of an application program; the following storage steps are performed: acquiring a current search word in a search box; sending a pre-fetching request to a server based on the current search word, and receiving a search result corresponding to the current search word returned by the server; storing a search result corresponding to the current search word; in response to determining that the user input is complete, acquiring a complete search term in the search box; and responding to the search result corresponding to the complete search word determined to be stored, and acquiring the search result corresponding to the stored complete search word.
In some embodiments, the method further comprises: and detecting that the user continues to perform input operation in the search box, and continuing to execute the storage step.
In some embodiments, the method further comprises: and responding to the search result corresponding to the complete search word which is not determined to be stored, and acquiring the search result corresponding to the complete search word from the server.
In some embodiments, after obtaining the complete search term in the search box, the method further includes: and sending an acquisition request to the page display control based on the complete search word so that the page display control intercepts the acquisition request.
In some embodiments, obtaining the search result corresponding to the complete search term from the server includes: and sending a release instruction to the page display control so that the page display control releases the acquisition request to the server and receives a search result corresponding to the complete search word returned by the server.
In some embodiments, each time an input operation performed by a user in a search box is detected, a new thread is created for executing a task of sending a prefetch request corresponding to a currently input search word and receiving a search result corresponding to the currently input search word.
In a second aspect, an embodiment of the present application provides an apparatus for acquiring information, where the apparatus is installed in an application installed on a terminal device, and the apparatus includes: a detection unit configured to detect that a user performs an input operation in a search box of an application; a storage unit configured to perform the following storage steps: acquiring a current search word in a search box; sending a pre-fetching request to a server based on the current search word, and receiving a search result corresponding to the current search word returned by the server; storing a search result corresponding to the current search word; a first obtaining unit configured to obtain a complete search word in the search box in response to determining that the user input is completed; and the second acquisition unit is configured to respond to the search result corresponding to the stored complete search word and acquire the search result corresponding to the stored complete search word.
In some embodiments, the apparatus further comprises: and the execution unit is configured to detect that the user continues to perform input operation in the search frame and continue to perform the storing step.
In some embodiments, the apparatus further comprises: and a third obtaining unit configured to obtain a search result corresponding to the complete search word from the server in response to determining that the search result corresponding to the complete search word is not stored.
In some embodiments, the apparatus further comprises: and the sending unit is configured to send the acquisition request to the page display control based on the complete search word so that the page display control intercepts the acquisition request.
In some embodiments, the third obtaining unit is further configured to: and sending a releasing instruction to the page display control so that the page display control releases the acquisition request to the server and receives a search result corresponding to the complete search word returned by the server.
In some embodiments, each time an input operation performed by a user in a search box is detected, a new thread is created for executing a task of sending a prefetch request corresponding to a currently input search word and receiving a search result corresponding to the currently input search word.
In a third aspect, an embodiment of the present application provides an electronic device, including: one or more processors; a storage device having one or more programs stored thereon; when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method as described in any implementation of the first aspect.
In a fourth aspect, the present application provides a computer-readable medium, on which a computer program is stored, which, when executed by a processor, implements the method as described in any implementation manner of the first aspect.
According to the method and the device for acquiring information, under the condition that the user is detected to perform input operation in the search box of the application program, the current search word in the search box is acquired; sending a pre-fetching request to a server based on the current search word, and receiving a search result corresponding to the current search word returned by the server; storing a search result corresponding to the current search word; under the condition that the user input is determined to be finished, acquiring a complete search word in a search box; and under the condition that the search result corresponding to the stored complete search word is determined to be stored, obtaining the search result corresponding to the stored complete search word. And predicting possible search results for the user according to the input process of the search terms of the user in the application program, and acquiring the search results from the server side to the application program in advance. After the user inputs the complete search word, whether a search result corresponding to the complete search word is stored in the application program or not is preferably inquired. Under the condition that the search results corresponding to the complete search words are stored, the stored corresponding search results are directly obtained, the obtaining time of the search results is shortened, and therefore the obtaining speed of the search results is improved. In addition, the search result is directly prefetched from the server side in the application program in a local mode, compared with the traditional search result prefetching mode based on JavaScript, the method does not need to load JavaScript codes in the page display control in advance, shortens the prefetching time of the search result, and therefore improves the prefetching speed of the search result.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture to which the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a method for obtaining information according to the present application;
FIG. 3 is a flow diagram of yet another embodiment of a method for obtaining information according to the present application;
FIG. 4 is a schematic block diagram illustrating one embodiment of an apparatus for obtaining information according to the present application;
FIG. 5 is a schematic block diagram of a computer system suitable for use in implementing an electronic device according to embodiments of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 shows an exemplary system architecture 100 to which embodiments of the method for obtaining information or the apparatus for obtaining information of the present application may be applied.
As shown in fig. 1, a system architecture 100 may include a terminal device 101, a network 102, and a server 103. Network 102 is the medium used to provide communication links between terminal devices 101 and server 103. Network 102 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may use terminal device 101 to interact with server 103 over network 102 to receive or send messages and the like. The terminal apparatus 101 may be installed with various communication client applications, such as a search application or an application with a search function.
The terminal apparatus 101 may be hardware or software. When the terminal apparatus 101 is hardware, it may be various electronic apparatuses supporting web browsing. Including but not limited to smart phones, tablet computers, e-book readers, laptop portable computers, desktop computers, and the like. When the terminal apparatus 101 is software, it can be installed in the above-described electronic apparatus. It may be implemented as multiple pieces of software or software modules, or as a single piece of software or software module. And is not particularly limited herein.
The server 103 may be hardware or software. When the server 103 is hardware, it may be implemented as a distributed server cluster composed of a plurality of servers, or may be implemented as a single server. When the server 103 is software, it may be implemented as multiple pieces of software or software modules (e.g., to provide distributed services), or as a single piece of software or software module. And is not particularly limited herein.
In practice, the application installed on the terminal device 101 detects that the user performs an input operation in a search box of the application; acquiring a current search word in a search box; sending a pre-fetching request to the server 103 based on the current search word, and receiving a search result corresponding to the current search word returned by the server 103; storing a search result corresponding to the current search word; in response to determining that the user input is complete, acquiring a complete search term in the search box; and responding to the search result corresponding to the complete search word determined to be stored, and acquiring the search result corresponding to the stored complete search word.
It should be noted that the method for acquiring information provided in the embodiment of the present application is generally executed by an application installed on the terminal device 101, and accordingly, the apparatus for acquiring information is generally disposed in the application installed on the terminal device 101.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of a method for obtaining information in accordance with the present application is shown. The method for acquiring information comprises the following steps:
step 201, detecting that a user performs an input operation in a search box of an application program.
In this embodiment, an application installed on a terminal device (for example, the terminal device 101 shown in fig. 1) may detect whether a user performs an input operation in a search box of the application. In a case where it is detected that the user performs an input operation in the search box of the application program, step 202 is performed.
In practice, an application may be installed on the terminal device. Here, the application may be a search-type application or a search-function-attached application, and a search box and a search button are generally provided on a homepage thereof. Specifically, after the user clicks an application icon on the terminal device, a home page of the application may be presented on the terminal device. After the user clicks on the search box, information can be entered in the search box. When the user inputs a search word in the search box, an input operation is performed. At this time, the application detects that the user performs an input operation in the search box of the application.
Step 202, obtaining the current search term in the search box.
In this embodiment, the application may obtain the current search term in the search box. Wherein the current search term may be a search term currently presented in the search box. In general, the current search term may be at least part of the complete search term that the user wants to enter. That is, the current search word is a search word that has been input into the search box before a certain time in the process of the user inputting the complete keyword.
Step 203, sending a pre-fetching request to the server based on the current search word, and receiving a search result corresponding to the current search word returned by the server.
In this embodiment, the application may send a prefetch request to a server (e.g., server 103 shown in FIG. 1) based on the current search terms. That is, the application may send the prefetch request directly to the server in a Native manner. The prefetch request may include the current search term, among other things. Subsequently, the server may perform a search based on the current search term to obtain a search result corresponding to the current search term, and send the search result corresponding to the current search term to an application installed on the terminal device.
And step 204, storing the search result corresponding to the current search word.
In this embodiment, the application program may store the search result corresponding to the current search term. Typically, the applications installed on the terminal device may include a Cache (Cache). Therefore, the application program can store the search result corresponding to the current search word in the cache of the application program.
Step 205, in response to determining that the user input is complete, obtaining a complete search term in the search box.
In this embodiment, the application may determine whether the user has finished inputting. Upon determining that the user input is complete, the application may retrieve the complete search terms in the search box.
In practice, after the user inputs the complete search word, the search button is clicked to perform the search, and therefore, when the user clicks the search button, it can be determined that the user input is completed. At this time, the search word presented in the search box is the complete search word.
Step 206, in response to determining to store the search result corresponding to the complete search term, obtaining the search result corresponding to the stored complete search term.
In this embodiment, the application program may perform a search based on the complete search term to determine whether a search result corresponding to the complete search term is stored. Under the condition that the search result corresponding to the complete search word is determined to be stored, the application program can directly obtain the search result corresponding to the stored complete search word.
Generally, an application may perform a lookup in a cache based on a complete search term to determine whether a search result corresponding to the complete search term is stored in the cache. Under the condition that the search result corresponding to the complete search word is determined to be stored in the cache, the application program can directly obtain the search result corresponding to the complete search word from the cache and send the search result to the page display control for displaying. Wherein, the page showing control can be WebView. WebView is a very important control in android (android) and is used for showing a web page.
Specifically, the application program may match the complete search word with each search result stored in the cache one by one, and if a preset number of search results with matching degrees greater than a preset matching degree exist, it is determined that the search result corresponding to the complete search word is stored in the cache, and the search result with matching degree greater than the preset matching degree is the search result corresponding to the complete search word.
According to the method for acquiring the information, under the condition that the input operation of a user in a search box of an application program is detected, the current search word in the search box is acquired; sending a pre-fetching request to a server based on the current search word, and receiving a search result corresponding to the current search word returned by the server; storing a search result corresponding to the current search word; under the condition that the user input is determined to be finished, acquiring a complete search word in a search box; and under the condition of determining to store the search result corresponding to the complete search word, acquiring the search result corresponding to the stored complete search word. And predicting possible search results for the user according to the input process of the search terms of the user in the application program, and acquiring the search results from the server side to the application program in advance. After the user inputs the complete search word, whether a search result corresponding to the complete search word is stored in the application program or not is preferably inquired. Under the condition that the search results corresponding to the complete search words are stored, the stored corresponding search results are directly obtained, the obtaining time of the search results is shortened, and therefore the obtaining speed of the search results is improved. In addition, the search result is directly prefetched from the server side in the application program in a local mode, compared with the traditional search result prefetching mode based on JavaScript, the method does not need to load JavaScript codes in the page display control in advance, shortens the prefetching time of the search result, and therefore improves the prefetching speed of the search result.
With further reference to FIG. 3, a flow 300 of yet another embodiment of a method for obtaining information in accordance with the present application is illustrated. The method for acquiring information comprises the following steps:
step 301, detecting that a user performs an input operation in a search box of an application program.
Step 302, obtaining the current search term in the search box.
Step 303, sending a prefetch request to the server based on the current search word, and receiving a search result corresponding to the current search word returned by the server.
And step 304, storing the search result corresponding to the current search word.
Step 305, in response to determining that the user input is complete, the complete search terms in the search box are obtained.
In the present embodiment, the specific operations of step 301-.
And step 306, sending an acquisition request to the page display control based on the complete search word so that the page display control intercepts the acquisition request.
In this embodiment, the application may send an acquisition request to the page presentation control based on the complete search term. The acquisition request may include the complete search term. After receiving the fetch request, the page show control may intercept the fetch request. Thus, the acquisition request cannot be sent to a server (e.g., the server 103 shown in fig. 1) through the page display control, so that the stored search results are preferentially queried.
Step 307, determining whether to store the search result corresponding to the complete search term.
In this embodiment, the application program may perform a search based on the complete search term to determine whether a search result corresponding to the complete search term is stored. If the search result corresponding to the complete search word is determined to be stored, executing step 308; in the event that a determination is made that a search result corresponding to the complete search term is not stored, step 309 is performed.
Generally, an application may perform a lookup in a cache based on a complete search term to determine whether a search result corresponding to the complete search term is stored in the cache.
Step 308, obtaining the stored search result corresponding to the complete search term.
In this embodiment, the specific operation of step 308 has been described in detail in step 206 in the embodiment shown in fig. 2, and is not described herein again.
Step 309, sending a release instruction to the page display control, so that the page display control releases the acquisition request to the server, and receives a search result corresponding to the complete search term returned by the server.
In this embodiment, in a case that it is determined that a search result corresponding to the complete search term is not stored, the application program may send a release instruction to the page presentation control. In this way, the page show control can pass the get request to the server. Subsequently, the server can perform searching based on the complete search term to obtain a search result corresponding to the complete search term, and send the search result to the application installed on the terminal device. And finally, the application program can send the search result corresponding to the complete search word to the page display control for display.
Step 310, detecting that the user continues to perform the input operation in the search box.
In this embodiment, during the process of executing step 302 and step 304, the application program may continuously detect whether the user continues to perform the input operation in the search box. And returning to continue executing the step 302 until the user input is finished under the condition that the user is detected to continue to perform the input operation in the search box.
Generally, the application program may obtain the keyword displayed in the search box at this time, compare the keyword with the keyword displayed in the search box at the previous time, and determine that the user continues to perform the input operation if the keyword displayed in the search box at this time is different from the keyword displayed in the search box at the previous time. At this time, the terminal device detects that the user continues to perform the input operation in the search box.
In some optional implementation manners of this embodiment, each time the application detects that the user performs an input operation in the search box, a new thread is created for executing a task of sending a prefetch request corresponding to the currently input search word and receiving a search result corresponding to the currently input search word. For example, a user wants to input ABC for searching, and when the user inputs a, a thread is created for performing tasks of sending a prefetch request corresponding to a and receiving a search result corresponding to a; when the user inputs B, a new thread is created for executing the tasks of sending the pre-fetching request corresponding to the AB and receiving the searching result corresponding to the AB. That is, whenever the user has new input, a new thread is created to perform the corresponding task. The parallel execution of the pre-fetching task is realized through a multi-thread mode, and compared with the traditional single-thread search result pre-fetching mode based on JavaScript, the pre-fetching speed is improved.
As can be seen from fig. 3, compared with the embodiment corresponding to fig. 2, the flow 300 of the method for obtaining information in the present embodiment adds a step of prefetching search results in parallel, and a step of obtaining request interception and obtaining request passing. Therefore, according to the scheme described in the embodiment, the search results are prefetched in parallel in the process of inputting the keywords by the user, and the prefetching speed is improved. In addition, after the user finishes inputting, the acquisition request is intercepted through the page display control, and the search result stored by priority query is realized. Under the condition that the search result corresponding to the complete search word is not stored, the page display control releases the acquisition request to the server, so that the search result corresponding to the complete search word is acquired from the server, and the search result corresponding to the complete search word can be acquired in time.
With further reference to fig. 4, as an implementation of the methods shown in the above-mentioned figures, the present application provides an embodiment of an apparatus for acquiring information, which corresponds to the method embodiment shown in fig. 2, and which is particularly applicable to various electronic devices.
As shown in fig. 4, the apparatus 400 for acquiring information of the present embodiment may include: a detection unit 401, a storage unit 402, a first acquisition unit 403, and a second acquisition unit 404. The detection unit 401 is configured to detect that a user performs an input operation in a search box of an application program; a storage unit 402 configured to perform the following storage steps: acquiring a current search word in a search box; sending a pre-fetching request to a server based on the current search word, and receiving a search result corresponding to the current search word returned by the server; storing a search result corresponding to the current search word; a first obtaining unit 403 configured to obtain a complete search word in the search box in response to determining that the user input is completed; a second obtaining unit 404 configured to obtain a search result corresponding to the stored complete search term in response to determining to store a search result corresponding to the complete search term.
In the present embodiment, in the apparatus for acquiring information 400: the detailed processing of the detecting unit 401, the storing unit 402, the first obtaining unit 403 and the second obtaining unit 404 and the technical effects thereof can refer to the related descriptions of step 201 and step 206 in the corresponding embodiment of fig. 2, which are not described herein again.
In some optional implementations of the present embodiment, the apparatus 400 for acquiring information further includes: and an execution unit (not shown in the figure) configured to detect that the user continues to perform the input operation in the search box, and to continue to perform the storing step.
In some optional implementations of the present embodiment, the apparatus 400 for acquiring information further includes: and a third obtaining unit (not shown in the figure) configured to obtain the search result corresponding to the complete search word from the server in response to determining that the search result corresponding to the complete search word is not stored.
In some optional implementations of the present embodiment, the apparatus 400 for acquiring information further includes: and a sending unit (not shown in the figure) configured to send the obtaining request to the page display control based on the complete search term, so that the page display control intercepts the obtaining request.
In some optional implementations of this embodiment, the third obtaining unit is further configured to: and sending a releasing instruction to the page display control so that the page display control releases the acquisition request to the server and receives a search result corresponding to the complete search word returned by the server.
In some optional implementation manners of this embodiment, each time it is detected that the user performs an input operation in the search box, a new thread is created for executing a task of sending a prefetch request corresponding to the currently input search word and receiving a search result corresponding to the currently input search word.
Referring now to FIG. 5, a block diagram of a computer system 500 suitable for use in implementing an electronic device (e.g., terminal device 101 shown in FIG. 1) of an embodiment of the present application is shown. The electronic device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU)501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the system 500 are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The computer program performs the above-described functions defined in the method of the present application when executed by the Central Processing Unit (CPU) 501.
It should be noted that the computer readable medium described herein can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or electronic device. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a detection unit, a storage unit, a first acquisition unit, and a second acquisition unit. Here, the names of these units do not constitute a limitation of the unit itself in this case, and for example, the detection unit may also be described as a "unit that detects an input operation by a user in a search box of an application".
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: detecting that a user performs input operation in a search box of an application program; the following storage steps are performed: acquiring a current search word in a search box; sending a pre-fetching request to a server based on the current search word, and receiving a search result corresponding to the current search word returned by the server; storing a search result corresponding to the current search word; in response to determining that the user input is complete, acquiring a complete search term in the search box; and responding to the search result corresponding to the complete search word determined to be stored, and acquiring the search result corresponding to the stored complete search word.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (12)

1. A method for acquiring information, which is applied to an application program installed on a terminal device, comprises the following steps:
detecting that a user performs input operation in a search box of the application program;
the following storage steps are performed: acquiring a current search word in the search box; sending a pre-fetching request to a server based on a current search word, and receiving a search result corresponding to the current search word returned by the server; storing a search result corresponding to the current search word;
in response to determining that the user input is complete, acquiring a complete search term in the search box;
and responding to the search result corresponding to the complete search word, and acquiring the stored search result corresponding to the complete search word, wherein when the user is detected to perform input operation once in the search box, a new thread is created for executing the tasks of sending the pre-fetching request corresponding to the input current search word and receiving the search result corresponding to the input current search word.
2. The method of claim 1, wherein the method further comprises:
and detecting that the user continues to perform input operation in the search box, and continuing to execute the storage step.
3. The method according to claim 1 or 2, wherein the method further comprises:
and responding to the fact that the search result corresponding to the complete search word is not stored, and obtaining the search result corresponding to the complete search word from the server.
4. The method of claim 3, wherein after said obtaining the complete search term in the search box, further comprising:
and sending an acquisition request to a page display control based on the complete search word so that the page display control intercepts the acquisition request.
5. The method of claim 4, wherein the obtaining, from the server, the search result corresponding to the complete search term comprises:
and sending a release instruction to the page display control so that the page display control releases the acquisition request to the server and receives a search result corresponding to the complete search term returned by the server.
6. An apparatus for acquiring information provided to an application installed on a terminal device, comprising:
a detection unit configured to detect that a user performs an input operation in a search box of the application program;
a storage unit configured to perform the following storage steps: acquiring a current search word in the search box; sending a pre-fetching request to a server based on a current search word, and receiving a search result corresponding to the current search word returned by the server; storing a search result corresponding to the current search word;
a first obtaining unit configured to obtain a complete search word in the search box in response to determining that the user input is completed;
and the second obtaining unit is configured to respond to the search result corresponding to the complete search word determined to be stored, and obtain the stored search result corresponding to the complete search word, wherein a new thread is created for executing tasks of sending a pre-fetching request corresponding to the current search word input this time and receiving the search result corresponding to the current search word input this time when the user is detected to perform an input operation in the search box once.
7. The apparatus of claim 6, wherein the apparatus further comprises:
an execution unit configured to detect that the user continues to perform an input operation in the search box, and to continue to execute the storing step.
8. The apparatus of claim 6 or 7, wherein the apparatus further comprises:
a third obtaining unit configured to obtain, from the server, a search result corresponding to the complete search word in response to determining that the search result corresponding to the complete search word is not stored.
9. The apparatus of claim 8, wherein the apparatus further comprises:
and the sending unit is configured to send an acquisition request to a page display control based on the complete search term so that the page display control intercepts the acquisition request.
10. The apparatus of claim 9, wherein the third obtaining unit is further configured to:
and sending a release instruction to the page display control so that the page display control releases the acquisition request to the server and receives a search result corresponding to the complete search term returned by the server.
11. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-5.
12. A computer-readable medium, on which a computer program is stored, wherein the computer program, when being executed by a processor, carries out the method according to any one of claims 1-5.
CN201910794750.3A 2019-08-27 2019-08-27 Method and device for acquiring information Active CN110502699B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910794750.3A CN110502699B (en) 2019-08-27 2019-08-27 Method and device for acquiring information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910794750.3A CN110502699B (en) 2019-08-27 2019-08-27 Method and device for acquiring information

Publications (2)

Publication Number Publication Date
CN110502699A CN110502699A (en) 2019-11-26
CN110502699B true CN110502699B (en) 2022-06-03

Family

ID=68589612

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910794750.3A Active CN110502699B (en) 2019-08-27 2019-08-27 Method and device for acquiring information

Country Status (1)

Country Link
CN (1) CN110502699B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111177539A (en) * 2019-12-16 2020-05-19 北京百度网讯科技有限公司 Search result page generation method and device, electronic equipment and storage medium
CN111159592B (en) * 2019-12-16 2021-12-24 百度在线网络技术(北京)有限公司 Search result page generation method and device, electronic equipment and storage medium
CN112084395A (en) * 2020-09-25 2020-12-15 百度国际科技(深圳)有限公司 Search method, search device, electronic device, and storage medium
CN112579897B (en) * 2020-12-16 2023-07-28 北京百度网讯科技有限公司 Information searching method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103631826A (en) * 2012-08-28 2014-03-12 深圳市世纪光速信息技术有限公司 Search method and search device
CN103810176A (en) * 2012-11-07 2014-05-21 腾讯科技(深圳)有限公司 Pre-fetching accessing method and device of webpage information
CN105068716A (en) * 2015-08-11 2015-11-18 广东欧珀移动通信有限公司 Information search method and device
CN105593852A (en) * 2013-08-05 2016-05-18 谷歌公司 Providing information in association with a search field
CN108701159A (en) * 2016-12-13 2018-10-23 谷歌有限责任公司 System and method for prefetching content item

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9881089B2 (en) * 2014-04-28 2018-01-30 Verizon New Jersey Inc. Pop-up search box

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103631826A (en) * 2012-08-28 2014-03-12 深圳市世纪光速信息技术有限公司 Search method and search device
CN103810176A (en) * 2012-11-07 2014-05-21 腾讯科技(深圳)有限公司 Pre-fetching accessing method and device of webpage information
CN105593852A (en) * 2013-08-05 2016-05-18 谷歌公司 Providing information in association with a search field
CN105068716A (en) * 2015-08-11 2015-11-18 广东欧珀移动通信有限公司 Information search method and device
CN108701159A (en) * 2016-12-13 2018-10-23 谷歌有限责任公司 System and method for prefetching content item

Also Published As

Publication number Publication date
CN110502699A (en) 2019-11-26

Similar Documents

Publication Publication Date Title
CN110502699B (en) Method and device for acquiring information
US10812564B1 (en) Preloading content for requesting applications
WO2018223717A1 (en) Webpage front-end testing method, device, system, apparatus and readable storage medium
CN110708346A (en) Information processing system and method
US20190278438A1 (en) Determining Variations of Single-Page Applications
US9256696B2 (en) Dynamic selection of one of many available web browsers
US10082937B2 (en) Intelligent rendering of webpages
US11930096B2 (en) Systems and methods for rendering interactive web pages
US9648078B2 (en) Identifying a browser for rendering an electronic document
WO2020199659A1 (en) Method and apparatus for determining push priority information
US11775439B2 (en) Prefetching data for application usage
CN114237651A (en) Installation method and device of cloud native application, electronic equipment and medium
TW201525740A (en) Method and device for displaying web page and computer-readable storage medium
EP3863252A1 (en) Advertisement anti-shielding method and device
US9998559B2 (en) Preemptive caching of data
CN111783005A (en) Method, apparatus and system for displaying web page, computer system and medium
EP3642727B1 (en) Resource pre-fetch using age threshold
US11055365B2 (en) Mechanism for web crawling e-commerce resource pages
CN113032702A (en) Page loading method and device
US11438403B2 (en) Page presentation method and system, computer system, and computer readable medium
CN111353296B (en) Article processing method, apparatus, electronic device and computer readable storage medium
CN110858238B (en) Data processing method and device
CN111078324B (en) Method and apparatus for prefetching page data
US20210342400A1 (en) Information search method and apparatus
CN114218330A (en) ES cluster selection method, ES cluster selection device, ES cluster selection apparatus, ES cluster selection medium, and program product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant