CN106649640B - Instant search method and device - Google Patents

Instant search method and device Download PDF

Info

Publication number
CN106649640B
CN106649640B CN201611123458.1A CN201611123458A CN106649640B CN 106649640 B CN106649640 B CN 106649640B CN 201611123458 A CN201611123458 A CN 201611123458A CN 106649640 B CN106649640 B CN 106649640B
Authority
CN
China
Prior art keywords
search
input
keyword text
changed
request
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
CN201611123458.1A
Other languages
Chinese (zh)
Other versions
CN106649640A (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.)
Wuhan Douyu Network Technology Co Ltd
Original Assignee
Wuhan Douyu Network Technology 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 Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201611123458.1A priority Critical patent/CN106649640B/en
Publication of CN106649640A publication Critical patent/CN106649640A/en
Application granted granted Critical
Publication of CN106649640B publication Critical patent/CN106649640B/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/957Browsing optimisation, e.g. caching or content distillation
    • 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/951Indexing; Web crawling techniques

Abstract

The invention discloses an instant search method and a device, which are applied to a mobile terminal, wherein the method comprises the following steps: receiving keyword text input by a user in a search input box; monitoring whether the keyword text in the search input box is not input and changed within a first preset time interval; and if the keyword text in the search input box is monitored not to be input and changed within the first preset time interval, sending a first search request for requesting search results according to the keyword text currently existing in the search input box to the server. The invention well balances searching timeliness and resource consumption, and is more suitable for searching in the mobile terminal.

Description

Instant search method and device
Technical Field
The invention relates to the field of internet, in particular to an instant search method and an instant search device.
Background
In the development of the mobile terminal, searching has become one of indispensable functions, but since the mobile terminals are all connected to the internet through traffic or wifi, the network environment is slightly worse than that of a computer, and the performance of the mobile terminal is limited, so that searching in app applications of the mobile terminal is performed according to the starting searching operation of the user after the user input is finished, which may cause the searching timeliness at the mobile terminal to be poor.
Disclosure of Invention
In view of the above problems, embodiments of the present invention provide an instant search method and apparatus, which improve search timeliness and resource consumption in a balanced manner.
In a first aspect, an embodiment of the present invention provides an instant search method, which is applied to a mobile terminal, and the instant search method includes:
receiving keyword text input by a user in a search input box;
monitoring whether the keyword text in the search input box has no input change within a first preset time interval;
and if the condition that the keyword text in the search input box is not changed in input within the first preset time interval is monitored, sending a first search request for requesting search results for the keyword text currently existing in the search input box to a server.
Preferably, after the sending of the first search request for the keyword text request search result currently existing in the search input box to the server, the method further comprises:
monitoring whether the keyword text in the search input box is input and changed or not in the process of sending the first search request;
if the keyword text in the search input box is monitored to be changed in input, monitoring whether the changed keyword text is not changed in input within a second preset time interval, and otherwise, receiving a search result corresponding to the first search request for displaying;
and if the changed keyword text has no input change within the second preset time interval, canceling the first search request, and sending a second search request for the changed keyword text request search result to the server, otherwise, receiving the search result corresponding to the first search request and displaying the search result.
Preferably, after the sending of the second search request for the changed keyword text request search result to the server, the method further includes:
receiving a search result corresponding to the second search request;
and displaying the search result corresponding to the second search request.
Preferably, the monitoring whether the keyword text in the search input box has not been input changed within a first preset time interval includes:
and monitoring whether the keyword text in the search input box has no input change within the first preset time interval through a binding component.
Preferably, the monitoring, by the binding component, whether the keyword text in the search input box has not been input changed within the first preset time interval includes:
step a, receiving the first preset time interval as a parameter through a debounce operator;
b, calling the debounce operator to judge whether the keyword text in the search input box is input and changed within the first preset time interval;
step c, if the input of the keyword text in the search input box is changed within the first preset time interval, refreshing the timing in the debounce operator and returning to the step b, otherwise, returning the keyword text currently existing in the search input box through the debounce operator, so that the binding component monitors that the input of the keyword text in the search input box is not changed within the first preset time interval.
Preferably, the sending a first search request for a keyword text request search result in the search input box to a server includes:
a first search request for a keyword text request search result within the search input box is sent to the server asynchronously.
Preferably, the sending the second search request for the changed keyword text request search result to the server includes:
sending a second search request for the changed edit text request search result to the server by invoking a conversion operator.
In a second aspect, an embodiment of the present invention provides an instant search apparatus, which is applied to a mobile terminal, where the instant search apparatus includes:
a text receiving unit for receiving a keyword text input by a user in the search input box;
the first monitoring unit is used for monitoring whether the keyword text in the search input box has no input change within a first preset time interval;
and the first search request unit is used for sending a first search request for requesting search results for the keyword texts currently existing in the search input box to a server if the condition that the keyword texts in the search input box are not input and changed within the first preset time interval is monitored.
Preferably, the apparatus further comprises:
the second monitoring unit is used for monitoring whether the keyword text in the search input box is input and changed or not in the process of sending the first search request;
a third monitoring unit, configured to monitor whether the changed keyword text has no input change within a second preset time interval if it is monitored that the keyword text in the search input box has an input change, and otherwise, receive a search result corresponding to the first search request and display the search result;
and the request processing unit is used for canceling the first search request and sending a second search request for requesting search results for the changed keyword text to the server if the changed keyword text is not changed in input within the second preset time interval, or receiving the search results corresponding to the first search request for displaying.
Preferably, the apparatus further comprises:
a search result receiving unit, configured to receive a search result corresponding to the second search request;
and the display unit is used for displaying the search result corresponding to the second search request.
Preferably, the first listening unit includes:
and the binding monitoring subunit monitors whether the keyword text in the search input box is not input and changed within the first preset time interval or not through a binding component.
Preferably, the binding listening subunit is specifically configured to:
step a, receiving the first preset time interval as a parameter through a debounce operator;
b, calling the debounce operator to judge whether the keyword text in the search input box is input and changed within the first preset time interval;
step c, if the input of the keyword text in the search input box is changed within the first preset time interval, refreshing the timing in the debounce operator and returning to the step b, otherwise, returning the keyword text currently existing in the search input box through the debounce operator, so that the binding component monitors that the input of the keyword text in the search input box is not changed within the first preset time interval.
Preferably, the first search request unit is specifically configured to:
a first search request for a keyword text request search result within the search input box is sent to the server asynchronously.
Preferably, the third monitoring unit is specifically configured to:
sending a second search request for the changed edit text request search result to the server by invoking a conversion operator.
One or more technical solutions provided by the embodiments of the present invention at least achieve the following technical effects or advantages:
monitoring whether the keyword text input by a user in the search input box is not changed within a first preset time interval; and if the keyword text in the search input box is monitored not to be input and changed within a first preset time interval, sending a first search request for requesting search results according to the keyword text currently existing in the search input box to the server. Therefore, the search request generated immediately can be sent to the server to obtain the search result, and the search timeliness is improved. On the other hand, the method can avoid generating search requests in the process of continuously inputting the search requests by the user, thereby reasonably controlling the time for generating the search requests, preventing some useless search requests from occurring, and reducing the consumption of the system resources under the condition of using flow cost and a large number of concurrent requests. The searching timeliness and the resource consumption are well balanced, and the method is more suitable for searching in the mobile terminal.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flow chart of an instant search method according to an embodiment of the present invention;
FIG. 2 is a flow chart of a preferred embodiment of S102 of FIG. 1;
FIG. 3 is a flow chart of an instant search method according to another embodiment of the present invention;
fig. 4 is a functional block diagram of an instant search apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention provides an instant searching method which is applied to a mobile terminal. The mobile terminal is a smart phone or a tablet computer (pad) based on an Android operating system.
Referring to fig. 1, an instant search method provided by an embodiment of the present invention includes the following steps:
s101, receiving a keyword text input in a search input box by a user.
S102, monitoring whether the keyword text in the search input box is not input and changed within a first preset time interval;
s103, if it is monitored that the keyword text in the search input box has not changed in input within a first preset time interval, sending a first search request for requesting a search result according to the keyword text currently existing in the search input box to the server.
In the embodiment of the invention, a data layer and a View (View) layer are bound through a binding component (Rxbinding), and whether the input of the keyword text input in a search input box is changed or not is monitored through the Rxbinding. Specifically, Rxbinding asynchronously obtains the keyword text input by the user in the search input box. Rxbinding is performed by receiving a keyword text in a search input box as a parameter, wherein the keyword text in the search input box is of a CharSequence type, and therefore, a target for monitoring whether the keyword text has no input change within a first preset time interval is returned: observer < CharSequence >, listening for input changes to the keyword text within the search input box.
An embodiment of the instant search method provided by the embodiment of the present invention is described below with reference to fig. 1:
first, S101 is executed, and a keyword text input by the user in the search input box is received.
Specifically, the search input box is an input box of the app application. For example, a query content input box of a browser application, a goods search input box of a shopping application, and an address search input box of a map application.
Specifically, the search input box corresponds to an EditText control for receiving a keyword text input by a user.
In the process of executing S101, S102 is executed, and it is monitored whether the keyword text has not been input changed within a first preset time interval.
Specifically, as shown in fig. 2, the monitoring whether the keyword text in the search input box has not been input changed within a first preset time interval includes:
step S1021, receiving a first preset time interval as a parameter through a debounce operator (debounce);
step S1022, calling the debounce operator to judge whether the keyword text has input change within a first preset time interval;
if the keyword text has an input change within a first preset time interval, execute step S1023: and returning to the step S1022 after refreshing the timing in the debounce operator, and otherwise, executing S1024.
S1024: the method includes returning keyword text currently existing in a search input box through a debounce operator, so that a binding component monitors that the keyword text has not been input changed within a first preset time interval.
Specifically, in one embodiment: the method is realized by matching Rxjava (Reactive Extensions Java) with a debounce operator:
the debounce operator filters input changes occurring within a first preset time interval, and submits keyword text currently existing in the search input box to a subscriber operator (subscriber) if no input change occurs within the first preset time interval. Thus, when the keyword text in the search input box is input and changed, the subscriber operator can receive the keyword text currently existing in the search input box, so that the processing in S103 is performed by the subscriber operator.
Rxjava incorporates observable collections of asynchronous calls and event-based programming. Is a java class library of responsive programming in which various operator terms in responsive programming are provided. Among RxJava are an observer operator, and a subscriber operator, where the object operator is responsible for sending messages and the subscriber operator is responsible for consuming messages. From the event point of view, the basic structure of the event driver is composed of an event collector, an event sender and an event processor. In RxJava, the Observer corresponds to an event collector, and the process of event sending corresponds to the process of subscription by a subscriber operator.
Specifically, the first preset time interval is set to a time length value between 100 and 350 milliseconds, so that searching is avoided when a user inputs a single character every time due to too short time interval, and user experience is reduced due to too long time interval after input and too long waiting event.
Taking the first preset time interval as 100 milliseconds as an example, calling the debounce operator to filter the input change of the keyword text within 100 milliseconds, and if the input change of the keyword text does not occur within 100 milliseconds, returning the keyword text currently existing in the search input box to a subscription operator (subscriber). If the keyword text has an input change within 100 milliseconds, it is refreshed for 100 milliseconds. Looping through in turn until a 100 millisecond pause does not return the keyword text currently present within the search input box to the subscribe operator (subscriber).
Then, the step S103 is executed: and if the keyword text in the search input box is monitored not to be input and changed within a first preset time interval, sending a first search request for requesting search results according to the keyword text currently existing in the search input box to the server.
Specifically, the implementation of sending the first search request to the server is performed by a subscriber operator: the subscriber operator receives the keyword text currently existing in the search input box, and sends a first search request to the server, wherein the first search request comprises the keyword text currently existing in the search input box.
Since the first network request is an input/output (IO) operation that is time consuming, in an embodiment of the present invention, the first search request is sent to the server asynchronously.
Through the embodiment, the search request is prevented from being directly sent as soon as the keyword text in the search input box is input and changed, so that most of meaningless search requests are avoided, the waste of flow resources is reduced, the throttling purpose is achieved, and the search timeliness and the waste of the flow of the search request are well balanced.
Referring to fig. 3, the present invention further provides another embodiment of an instant search method, which includes the following steps:
s101, receiving a keyword text input in a search input box by a user.
S102, monitoring whether the keyword text in the search input box is not input and changed within a first preset time interval;
s103, if the condition that the keyword text is not input and changed within a first preset time interval is monitored, sending a first search request for requesting a search result according to the keyword text currently existing in a search input box to a server;
s104, monitoring whether the keyword text in the search input box is input and changed or not in the process of sending the first search request;
s105, if the keyword text in the search input box is monitored to be input and changed, monitoring whether the changed keyword text is not input and changed within a second preset time interval;
and S106, if the changed keyword text is not changed in input within a second preset time interval, canceling the first search request, and sending a second search request for the changed keyword text request search result to the server, otherwise, receiving the search result corresponding to the first search request and displaying the search result.
In this embodiment, the specific implementation of steps S101 to S103 refers to the previous embodiment, and for brevity of the description, the description is omitted here.
In S104, whether an input change occurs to the keyword text in the search input box is monitored through Rxbinding. Specifically, Rxbinding asynchronously obtains the keyword text input by the user in the search input box. Rxbinding returns a target for monitoring whether the input of the keyword text changes or not by receiving the keyword text in the search input box as a parameter: observer < CharSequence > to listen whether the keyword text in the search input box has changed after a first preset time interval.
The embodiment of monitoring whether the changed keyword text has not changed in the second preset time interval in S105 is the same as or similar to the embodiment of monitoring whether the keyword text has not changed in the first preset time interval in S102, and those skilled in the art can know the embodiment of S105 according to the description of S102, and for the sake of brevity of the description, details are not repeated herein.
After sending the second search request for the changed keyword text request search result to the server, the method further comprises: receiving a search result corresponding to the second search request; and displaying the search result corresponding to the second search request.
Specifically, in S106, a second search request for the changed keyword text request search result is sent to the server by calling the conversion operator.
When a second search request for the changed keyword text request search results is sent to the server by using a conversion operator (switchMap), if the sending of the first search request is not completed, the first search request is cancelled and the listening to the search results generated by the first search request is stopped.
Through the embodiment, when the search request is sent again, the search result of the prior search request is considered to be unnecessary, so that the situation that the prior search result returns earlier than the later search result due to short pause in the process of inputting the keyword by the user can be avoided, the search request is more reasonably controlled, and unnecessary intermediate search results are reduced and presented in a filtering manner.
In the following, a code implementation for the present embodiment is given:
“RxTextView.textChanges(editText)
debounce(100,MILLISECONDS)
switchMap(Api::search)
subscribe(::update);”
wherein rxtextview. textchanges (editText) represents listening to an input change of a keyword text within a search input box, debounce (100, milli systems) represents a first preset time interval, an enemy preset time interval is 100 msec, switchMap (Api:: searchItems) represents sending a search request, and an old search request is automatically cancelled first upon sending a new search request through a switchMap operator, wherein the first search request is cancelled upon sending a second search request through the switchMap operator, the second search request is cancelled upon sending a third search request through the switchMap operator, Api:: search represents a call of the search request, and substribe (this:: update) is a keyword text currently present within the search input box returned to a subscription operator.
In the following, taking the first preset time interval as 100 ms and the user inputting the english keyword "red flower" for searching as an example, an interactive embodiment of the present invention is provided:
the method comprises the steps that a user inputs 'r', 'e' and'd' in sequence, if the pause time between the input of 'r', 'e' and'd' is less than 100 milliseconds, then a first search request is not triggered to be sent, if the input of 'red' is finished, the user pauses for at least 100 milliseconds and does not input, the first search request is triggered, when the first search request is sent, the user continues to input 'flower', if the pause time between the input of 'r', 'e' and'd' is less than 100 milliseconds, then a second search request is not triggered to be sent, after the input of 'flower' is finished, the second search request is triggered, the first search request and the search result aiming at the first search request are cancelled, and the search result aiming at the second search request is received.
In the following, taking the first preset time interval as 350 ms and the user inputting the Chinese keyword "continental action movie" to search as an example, the interactive embodiment of the present invention is provided:
the method comprises the steps that a user inputs 'big' and 'land' in sequence, if pause time between the input of the 'big' and the 'land' is less than 350 milliseconds, then a first search request is not triggered to be sent, if the input of the 'big' and the 'land' is finished, the user can trigger a first search request if the user pauses for at least 350 milliseconds, when the first search request is sent, the user continues to input 'action', if pause time between the input of the 'action' and the 'action' is less than 350 milliseconds, then a second search request is not triggered, after the input of the 'action' is finished, the second search request can be triggered, the first search request and a search result aiming at the first search request are cancelled, after the search result of the second search request is received, then the 'movie' is continuously input, if pause time between the input of the 'electricity' and the 'movie' is less than 350 milliseconds, then a third search request is not triggered, and after the input of the, search results of the third search request are received.
An embodiment of the present invention provides an instant search device, which is applied to a mobile terminal, and as shown in fig. 4, the instant search device includes:
a text receiving unit 201 for receiving a keyword text input by a user in a search input box;
a first monitoring unit 202, configured to monitor whether the keyword text in the search input box has not been input and changed within a first preset time interval;
a first search request unit 203, configured to send, to a server, a first search request for requesting a search result for a keyword text currently existing in the search input box if it is monitored that the keyword text in the search input box has not been input and changed within the first preset time interval.
Preferably, the apparatus further comprises:
the second monitoring unit is used for monitoring whether the keyword text in the search input box is input and changed or not in the process of sending the first search request;
a third monitoring unit, configured to monitor whether the changed keyword text has no input change within a second preset time interval if it is monitored that the keyword text in the search input box has an input change, and otherwise, receive a search result corresponding to the first search request and display the search result;
and the request processing unit is used for canceling the first search request and sending a second search request for requesting search results for the changed keyword text to the server if the changed keyword text is not changed in input within the second preset time interval, or receiving the search results corresponding to the first search request for displaying.
Preferably, the apparatus further comprises:
a search result receiving unit, configured to receive a search result corresponding to the second search request;
and the display unit is used for displaying the search result corresponding to the second search request.
Preferably, the first listening unit includes:
and the binding monitoring subunit monitors whether the keyword text in the search input box is not input and changed within the first preset time interval or not through a binding component.
Preferably, the binding listening subunit is specifically configured to:
step a, receiving the first preset time interval as a parameter through a debounce operator;
b, calling the debounce operator to judge whether the keyword text in the search input box is input and changed within the first preset time interval;
step c, if the input of the keyword text in the search input box is changed within the first preset time interval, refreshing the timing in the debounce operator and returning to the step b, otherwise, returning the keyword text currently existing in the search input box through the debounce operator, so that the binding component monitors that the input of the keyword text in the search input box is not changed within the first preset time interval.
Preferably, the first search requesting unit 203 is specifically configured to:
a first search request for a keyword text request search result within the search input box is sent to the server asynchronously.
Preferably, the third monitoring unit is specifically configured to:
sending a second search request for the changed edit text request search result to the server by invoking a conversion operator.
Since the apparatus described in the embodiment of the present invention is adopted for implementing the embodiment of the instant search method of the present invention, based on the instant search method described in the foregoing embodiment, a person skilled in the art can understand the specific structure and the deformation of the device, and thus the detailed description is omitted here. All the devices adopted for implementing the method of the embodiment of the instant search method of the invention belong to the protection scope of the invention.
One or more technical solutions provided in the embodiments of the present invention have at least the following technical effects or advantages:
the algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functionality of some or all of the components of a gateway, proxy server, system according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.

Claims (9)

1. An instant search method is applied to a mobile terminal, and is characterized in that the instant search method comprises the following steps:
receiving keyword text input by a user in a search input box;
monitoring whether the keyword text in the search input box is not input and changed within a first preset time interval, specifically comprising: receiving a first preset time interval as a parameter through a debounce operator (debounce); a debounce operator is called to judge whether the input of the keyword text is changed within a first preset time interval; if the input of the keyword text is changed within the first preset time interval, refreshing the timing in the debounce operator, returning to the step of calling the debounce operator to judge whether the input of the keyword text is changed within the first preset time interval, otherwise returning to the keyword text currently existing in the search input box through the debounce operator, and enabling the binding component to monitor that the input of the keyword text is not changed within the first preset time interval;
and if the condition that the keyword text in the search input box is not changed in input within the first preset time interval is monitored, sending a first search request for a search result of the keyword text request currently existing in the search input box to a server, wherein the first search request comprises the keyword text currently existing in the search input box.
2. The instant search method of claim 1, wherein after said sending a first search request to a server requesting search results for keyword text currently present within the search input box, the method further comprises:
monitoring whether the keyword text in the search input box is input and changed or not in the process of sending the first search request;
if the keyword text in the search input box is monitored to be changed in input, monitoring whether the changed keyword text is not changed in input within a second preset time interval, and otherwise, receiving a search result corresponding to the first search request for displaying;
and if the changed keyword text has no input change within the second preset time interval, canceling the first search request, and sending a second search request for the changed keyword text request search result to the server, otherwise, receiving the search result corresponding to the first search request and displaying the search result.
3. The instant search method of claim 2, wherein after said sending a second search request to the server for the changed keyword text request search results, the method further comprises:
receiving a search result corresponding to the second search request;
and displaying the search result corresponding to the second search request.
4. The instant search method of claim 1, wherein said listening whether the keyword text in the search input box has not been changed in input within a first preset time interval comprises:
and monitoring whether the keyword text in the search input box has no input change within the first preset time interval through a binding component.
5. The instant search method of claim 1, wherein said sending a first search request to a server requesting search results for keyword text within the search input box comprises:
a first search request for a keyword text request search result within the search input box is sent to the server asynchronously.
6. The instant search method of claim 2, wherein said sending a second search request to the server for the changed keyword text request search result comprises:
sending a second search request for the changed edit text request search result to the server by invoking a conversion operator.
7. An instant search device applied to a mobile terminal, the instant search device comprising:
a text receiving unit for receiving a keyword text input by a user in the search input box;
the first monitoring unit is configured to monitor whether the keyword text in the search input box has not been input and changed within a first preset time interval, and specifically includes: receiving a first preset time interval as a parameter by a debounce operator (debounce); a debounce operator is called to judge whether the input of the keyword text is changed within a first preset time interval; if the input of the keyword text is changed within the first preset time interval, refreshing the timing in the debounce operator, returning to the step of calling the debounce operator to judge whether the input of the keyword text is changed within the first preset time interval, otherwise returning to the keyword text currently existing in the search input box through the debounce operator, and enabling the binding component to monitor that the input of the keyword text is not changed within the first preset time interval;
and the first search request unit is used for sending a first search request for a search result of a keyword text request currently existing in the search input box to a server if the condition that the keyword text in the search input box has no input change within the first preset time interval is monitored, wherein the first search request comprises the keyword text currently existing in the search input box.
8. The instant search apparatus of claim 7, wherein said apparatus further comprises:
the second monitoring unit is used for monitoring whether the keyword text in the search input box is input and changed or not in the process of sending the first search request;
a third monitoring unit, configured to monitor whether the changed keyword text has no input change within a second preset time interval if it is monitored that the keyword text in the search input box has an input change, and otherwise, receive a search result corresponding to the first search request and display the search result;
and the request processing unit is used for canceling the first search request and sending a second search request for requesting search results for the changed keyword text to the server if the changed keyword text is not changed in input within the second preset time interval, or receiving the search results corresponding to the first search request for displaying.
9. The instant search apparatus of claim 8, wherein said apparatus further comprises:
a search result receiving unit, configured to receive a search result corresponding to the second search request;
and the display unit is used for displaying the search result corresponding to the second search request.
CN201611123458.1A 2016-12-08 2016-12-08 Instant search method and device Active CN106649640B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611123458.1A CN106649640B (en) 2016-12-08 2016-12-08 Instant search method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611123458.1A CN106649640B (en) 2016-12-08 2016-12-08 Instant search method and device

Publications (2)

Publication Number Publication Date
CN106649640A CN106649640A (en) 2017-05-10
CN106649640B true CN106649640B (en) 2020-05-12

Family

ID=58819788

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611123458.1A Active CN106649640B (en) 2016-12-08 2016-12-08 Instant search method and device

Country Status (1)

Country Link
CN (1) CN106649640B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20210039992A (en) * 2020-09-25 2021-04-12 바이두 인터내셔널 테크놀로지 (센젠) 코., 엘티디. Search method, search device, electronic device, storage medium and computer program

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107562819B (en) * 2017-08-16 2021-08-31 深圳市沃特沃德股份有限公司 Searching method and device based on vehicle-mounted system
CN109948042A (en) * 2017-12-08 2019-06-28 北京京东尚科信息技术有限公司 Handle the method and system of the search operation of user
CN108063823A (en) * 2017-12-21 2018-05-22 五八有限公司 Data processing method, device, equipment and storage medium
CN110069680A (en) * 2019-04-28 2019-07-30 努比亚技术有限公司 Search processing method, mobile terminal and computer readable storage medium
CN112084395A (en) * 2020-09-25 2020-12-15 百度国际科技(深圳)有限公司 Search method, search device, electronic device, and storage medium
CN112163144A (en) * 2020-09-29 2021-01-01 四川虹魔方网络科技有限公司 Web front-end search optimization method
CN112199215B (en) * 2020-10-13 2024-01-19 恒生电子股份有限公司 Message processing method, device, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100856477B1 (en) * 2007-04-24 2008-09-04 이준호 Category selection service and search portal server system which uses double-key entering method at mobile web search
CN102033911A (en) * 2010-11-25 2011-04-27 北京搜狗科技发展有限公司 Search preprocessing method and search preprocessor
CN105335415A (en) * 2014-08-04 2016-02-17 北京搜狗科技发展有限公司 Search method based on input prediction, and input method system
CN105677924A (en) * 2016-03-29 2016-06-15 努比亚技术有限公司 Data searching device and method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100856477B1 (en) * 2007-04-24 2008-09-04 이준호 Category selection service and search portal server system which uses double-key entering method at mobile web search
CN102033911A (en) * 2010-11-25 2011-04-27 北京搜狗科技发展有限公司 Search preprocessing method and search preprocessor
CN105335415A (en) * 2014-08-04 2016-02-17 北京搜狗科技发展有限公司 Search method based on input prediction, and input method system
CN105677924A (en) * 2016-03-29 2016-06-15 努比亚技术有限公司 Data searching device and method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20210039992A (en) * 2020-09-25 2021-04-12 바이두 인터내셔널 테크놀로지 (센젠) 코., 엘티디. Search method, search device, electronic device, storage medium and computer program
KR102591878B1 (en) * 2020-09-25 2023-10-24 바이두 인터내셔널 테크놀로지 (센젠) 코., 엘티디. Search method, search device, electronic device, storage medium and computer program

Also Published As

Publication number Publication date
CN106649640A (en) 2017-05-10

Similar Documents

Publication Publication Date Title
CN106649640B (en) Instant search method and device
CN107168960B (en) Service execution method and device
CN106528210B (en) A kind of operation method and device of application program
CN107463563B (en) Information service processing method and device of browser
CN103997452A (en) Information sharing method and apparatus among multiple platforms
CN109002249B (en) Method, storage medium, device and system for realizing continuous shooting of gifts through long-press gesture
CN110933075B (en) Service calling method and device, electronic equipment and storage medium
CN104516885A (en) Implementation method and device of browse program double-kernel assembly
US20180027355A1 (en) Data download method and apparatus
CN105447092A (en) Caching method and apparatus
CN106790501B (en) Service processing method and device based on interface skip
CN103607454A (en) Method for setting private proxy server for Android system browser
CN106789832B (en) Data processing method, device and system in call process
CN109857963A (en) Local resource access method, device and electronic equipment
CN108509228B (en) Page loading method, terminal equipment and computer readable storage medium
CN111475230B (en) Application function configuration method and device and electronic equipment
CN115550354A (en) Data processing method and device and computer readable storage medium
CN111294377A (en) Network request sending method of dependency relationship, terminal device and storage medium
CN113127335A (en) System testing method and device
CN105843752A (en) Method and device for distributing memory of mobile terminal for caching image data
CN113448607B (en) Method and device for firmware upgrading and intelligent household appliance
CN115599669A (en) Debugging method and device of microservice, electronic equipment and readable storage medium
KR102304185B1 (en) Method for providing Automatic Responsive Service displayed on the screen through automatic answering of voice calls as an automatic pop-up, and a server therefor
CN111090515B (en) Access control method, device, terminal equipment and storage medium
CN114327710A (en) Function management method, management device, terminal equipment and readable storage medium

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