CN107590248B - Search method, search device, search terminal and computer-readable storage medium - Google Patents

Search method, search device, search terminal and computer-readable storage medium Download PDF

Info

Publication number
CN107590248B
CN107590248B CN201710838305.3A CN201710838305A CN107590248B CN 107590248 B CN107590248 B CN 107590248B CN 201710838305 A CN201710838305 A CN 201710838305A CN 107590248 B CN107590248 B CN 107590248B
Authority
CN
China
Prior art keywords
search
keyword
memory stack
stack
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
CN201710838305.3A
Other languages
Chinese (zh)
Other versions
CN107590248A (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201710838305.3A priority Critical patent/CN107590248B/en
Publication of CN107590248A publication Critical patent/CN107590248A/en
Application granted granted Critical
Publication of CN107590248B publication Critical patent/CN107590248B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention belongs to the technical field of search, and particularly relates to a search method, a search device, a search terminal and a computer-readable storage medium, wherein the method comprises the following steps: acquiring a search keyword, and searching a search result matched with the search keyword from a memory stack of the terminal; if the search result matched with the search keyword is not found from the memory stack, sending a search request to a database; receiving a search result matched with the search keyword and fed back by the database; and pushing the search keyword and the search result matched with the search keyword into the memory stack. When information searching is carried out, the search result matched with the search keyword can be searched from the memory stack, a search request does not need to be sent to a database for many times, and the search result matched with the search keyword is obtained from the database, so that the search time is saved, and the search efficiency is improved.

Description

Search method, search device, search terminal and computer-readable storage medium
Technical Field
The present invention belongs to the field of search technologies, and in particular, to a search method, an apparatus, a terminal, and a computer-readable storage medium.
Background
At present, mobile terminals are widely used in daily life and study of people, and people often need to search information by using the mobile terminals.
When people search network data or local data through a browser installed on a mobile terminal or a search unit on other application software, even if a search result of a keyword input by a user is contained in a search result of the keyword input by the user last time, the mobile terminal still needs to initiate a search request to a database and obtain the search result from the database; the time consumption for obtaining the search result each time is basically the same, and the search efficiency is low.
Disclosure of Invention
The embodiment of the invention provides a searching method, a searching device, a terminal and a computer readable storage medium, which can improve the searching efficiency.
A first aspect of an embodiment of the present invention provides a search method, applied to a terminal, including:
acquiring a search keyword, and searching a search result matched with the search keyword from a memory stack of the terminal;
if the search result matched with the search keyword is not found from the memory stack, sending a search request to a database; receiving a search result matched with the search keyword and fed back by the database;
and pushing the search keyword and the search result matched with the search keyword into the memory stack.
A second aspect of an embodiment of the present invention provides a search apparatus, including:
the searching module is used for acquiring a searching keyword and searching a searching result matched with the searching keyword from a memory stack of the terminal;
the sending and receiving module is used for sending a search request to a database when a search result matched with the search keyword is not found in the stack; receiving a search result matched with the search keyword and fed back by the database;
and the stack pushing module is used for pushing the search keyword and the search result matched with the search keyword into the memory stack.
A third aspect of the embodiments of the present invention provides a terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method when executing the computer program.
A fourth aspect of the embodiments of the present invention provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the steps of the above method.
In the embodiment of the invention, the search result matched with the search keyword is searched from the memory stack, so that the search request does not need to be sent to the database for many times during information search, and the search result matched with the search keyword is obtained from the database, thereby saving the search time and improving the search efficiency.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments or the prior art will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and that for a person skilled in the art, other relevant drawings can be obtained from these drawings without inventive effort.
Fig. 1 is a flowchart of an implementation of a search method according to an embodiment of the present invention;
fig. 2 is a flowchart of a specific implementation of the search method S101 according to an embodiment of the present invention;
FIGS. 3a to 3c are schematic diagrams illustrating a first structure of a memory stack according to an embodiment of the present invention;
fig. 4a to 4c are schematic diagrams illustrating a second structure of a memory stack according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of a search apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
In some embodiments of the invention, according to the monitored search keyword input by the user, the search result matched with the search keyword is obtained from the memory stack, so that when information search is carried out, a search request does not need to be sent to a database for many times, the search time is saved, and the search efficiency is improved.
Fig. 1 shows a flowchart of an implementation of a search method provided in an embodiment of the present invention, where the method is applied to a terminal and includes steps S101 to S103.
In S101, a search keyword is obtained, and a search result matching the search keyword is searched from the memory stack of the terminal.
The memory stack refers to a dynamic memory area stored in a Random Access Memory (RAM), and an application program can press data into the memory stack and delete the data from the top of the stack; the stack belongs to a special linear table where push and delete operations can be performed at the same end. One end allowing the push and delete operation is called the top of the stack (top), and the other end is the bottom of the stack (bottom); the stack bottom is fixed, and the stack top floats; the number of elements in the stack is zero and is called an empty stack. Pushes are generally referred to as PUSH, PUSH or PUSH (PUSH), and deletes are referred to as POP or POP. The stack is also called a last-in-first-out table.
Pressing a new element into a stack means that the new element is placed on the top element of the stack to become a new top element of the stack; deleting an element from a stack, also known as popping or popping, deletes the top-of-stack element, making its neighbors a new top-of-stack element.
In some embodiments of the present invention, when performing information search, a memory stack is first created, where the memory stack is used to store search keywords and search results matching the search keywords.
Optionally, the search keyword includes a search keyword for searching information input by a user in a search input box or a search unit on a browser, or a search keyword for searching information input in a search unit on other application software, for example, a search keyword input in a search unit on application software such as a music player or an e-book reader.
In some embodiments of the present invention, when the search keyword input in the search input box or the search unit is monitored, the search result matching the search keyword is searched from the memory stack according to the input search keyword.
In some embodiments of the present invention, as shown in fig. 2, the searching for the search result matching the search keyword from the memory stack of the terminal includes steps S201 to S205.
In S201, a top keyword in the memory stack is acquired.
For example, as shown in fig. 3a, a schematic structural diagram of a stack is shown, where a top keyword in the memory stack is "picture", and a search result corresponding to the top keyword "picture" is "search result 1".
In S202, it is determined whether the top-of-stack keyword is a subset of the search keyword.
In some embodiments of the present invention, the determining whether the top-of-stack keyword is a subset of the search keyword comprises: if the characters of the top keyword correspond to the nth character to the mth character of the search keyword one to one, judging that the top keyword is a subset of the search keyword; otherwise, judging that the top keyword is not the subset of the search keyword; wherein m is larger than n, and the number of the characters of the keyword at the top of the stack is m-n + 1.
For example, when the keyword at the top of the stack is "picture", and the search keyword is "animal picture", since the keyword at the top of the stack is "picture" and the 3 rd character to the 4 th character of the search keyword "animal picture" are in one-to-one correspondence, it can be determined that the keyword at the top of the stack "picture" is a subset of the search keyword "animal picture", and is similar to a concept of a set in a mathematical sense.
For another example, the top-of-stack keyword is "a", the search keyword is "ABC", and since characters of the top-of-stack keyword "a" correspond to the 1 st to 1 st characters of the search keyword "ABC", it can be determined that the top-of-stack keyword "a" is a subset of the search keyword "ABC"; for another example, if the top keyword is "AB" and the search keyword is "a", since the characters of the top keyword "AB" cannot correspond to the characters of the search keyword "a" one to one, the top keyword "AB" is not a subset of the search keyword.
In S203, if the top keyword is a subset of the search keyword, searching for a search result matching the search keyword from among search results matching the top keyword.
For example, when the search keyword input by the user at the first search is "picture", the search keyword "picture" and the search result "search result 1" associated with the search keyword "picture" have been pushed into the memory stack, and the memory stack as described in fig. 3a is formed. When the user inputs the character "animal" again on the basis of the original search keyword "picture", it means that the search keyword input by the user for the second time in the search input box or search unit is "animal picture", and at this time, because the top keyword "picture" is a subset of the search keyword "animal picture", the search result of the search keyword "animal picture" input by the user for the second time is included in the search result of the search keyword "picture" input by the user for the first time. That is, the search result of the search keyword "animal picture" may be searched from the search result "search result 1" matching with the top keyword "picture", and the search result "search result 2" matching with the search keyword "animal picture" is obtained; and step S103 is executed to press the search keyword "animal picture" and the search result "search result 2" matching with the search keyword "animal picture" into a memory stack, so as to form the memory stack shown in fig. 3 b.
It should be noted that, as the user inputs the character "animal" and changes the search keyword into "animal picture", that is, the top keyword becomes a subset of the search keyword, the mobile terminal may search the search result matching the search keyword from the search result matching the top keyword, that is, may search the search result matching the search keyword from the internal storage stack without sending a search request to the database, so as to obtain the search result matching the search keyword, save the time of information search, and improve the efficiency of search.
In S204, if the top keyword is not the subset of the search keyword, deleting the top keyword and the search result matching the top keyword, and searching for the search result matching the search keyword from the memory stack after deleting the top keyword.
For example, on the basis of the above, if the user inputs "animal picture", then "animal" is deleted, and "plant" is input, so that the search keyword input by the user for the third time is "plant picture", at this time, because the top keyword "animal picture" is not a subset of the search keyword "plant picture". Therefore, the stack top keyword and the search result matching the stack top keyword need to be deleted, and then the search result matching the search keyword is searched from the memory stack after the stack top keyword is deleted. If so, deleting the stack top keyword "animal picture" and the search result "search result 2" matched with the stack top keyword "animal picture", so that the stack with the stack top keyword deleted becomes the memory stack shown in fig. 3 a; and searching a search result matched with the search keyword from the memory stack after the top keyword is deleted.
Since the new top keyword is "picture" in the memory stack from which the top keyword is deleted, and the top keyword "picture" is a subset of the search keyword "plant picture", a search result "search result 3" matching the search keyword "plant picture" can be searched from the memory stack from which the top keyword is deleted, and then step S103 is executed to press the search keyword "plant picture" and the search result "search result 3" matching the search keyword "plant picture" into the memory stack, thereby forming the memory stack shown in fig. 3 c.
It should be noted that, if the user deletes the "animal" after inputting the "animal picture" and does not input other characters, it means that the user only performs the operation of deleting the characters in the search keyword, so that the search keyword input by the user for the third time is the "picture", and at this time, the "animal picture" as the top keyword is not the subset of the "picture" as the search keyword is not input by the user. Similarly, the stack top keyword "animal picture" and the search result "search result 2" matching with the stack top keyword "animal picture" still need to be deleted first, so that the memory stack in which the stack top keyword is deleted becomes the memory stack shown in fig. 3 a; and searching a search result matched with the search keyword from the memory stack after the top keyword is deleted.
Since the new top keyword is a "picture" in the memory stack after the top keyword is deleted, and the top keyword "picture" is the same as the search keyword "picture", at this time, the search result "search result 1" matching the top keyword "picture" is directly searched from the memory stack, and the search result 1 "is displayed without performing the stack pushing operation in step S103.
As shown in fig. 2, in step S204, the searching for the search result matching the search keyword from the memory stack after the top-of-stack keyword is deleted includes: judging whether the memory stack after deleting the top keywords is an empty stack, if so, executing the step S205; if not, the process goes to step S101.
In S205, if the stack memory after the top keyword is deleted is an empty stack, a feedback message that the search result matching the search keyword is not found in the memory stack is sent.
For example, the first input search keyword is "a", the obtained search result is "search result a", and the search keyword "a" and the search result "search result a" matching with the search keyword "a" are pressed into the memory stack to form the structural diagram of the memory stack as shown in fig. 4 a; inputting the character "B" on the basis of the character "a" for the second time, so that the search keyword input for the second time becomes "AB", at this time, since the top keyword "a" is a subset of the search keyword "AB", the search result "search result AB" matching the search keyword "AB" can be searched from the search result "search result a" matching the top keyword, and the search keyword "AB" and the search result "search result AB" matching the search keyword "AB" are pushed into the memory stack, forming the structure diagram of the memory stack shown in fig. 4B.
When the character "a" in the keyword "AB" is deleted and the character "C" is input, the search keyword "BC" input for the third time is formed, and at this time, the top keyword "AB" is not a subset of the search keyword "BC", and therefore, the top keyword "AB" and the search result "search result AB" matching the top keyword need to be deleted. At this time, whether the memory stack after deleting the stack top keyword "AB" and the search result "search result AB" matched with the stack top keyword is an empty stack is judged.
Since the memory stack after deleting the stack top keyword "AB" and the search result "search result AB" matching the stack top keyword is the memory stack shown in fig. 4a, it is not an empty stack. Therefore, jumping to step S101, acquiring a top keyword in the stack; and judging whether the top-of-stack keyword is a subset of the search keyword again. Since the top keyword "a" is not a subset of the search keyword "BC", step S204 is executed to delete the top keyword and the search result matching the top keyword, that is, delete the top keyword "a" and the search result "search result a" matching the top keyword "a"; judging whether the memory stack after deleting the top keywords is an empty stack or not; at this time, the memory stack after the top keyword is deleted is an empty stack as shown in fig. 4c, and therefore, a feedback message that a search result matching the search keyword is not found in the memory stack is sent.
In some embodiments of the present invention, the method further includes monitoring an input search keyword, and if the input search keyword is null, clearing the memory stack.
For example, as shown in fig. 4b, the memory stack already stores the search keyword "a" and the search result "search result a" matching the search keyword "a", and also stores the search keyword "AB" and the search result "search result AB" matching the search keyword "AB". If the user performs clearing of the search keyword, namely, deletes the character "a" and the character "B" so that the search keyword input on the search input box or the search unit is empty, then correspondingly performing the step of clearing the memory stack; when the user re-inputs the search keyword, the search request can be directly sent to the database under the condition that the memory stack is empty, so that the time for searching the search result matched with the search keyword from the memory stack is saved, and the search efficiency is improved.
For another example, when the user deletes the character "a" and the character "B", the search keyword "C" is input again, and since the search keyword "C" is a new search keyword, and a search result matching the search keyword "C" does not exist in the established memory stack, the embodiment of the present invention improves the efficiency of searching for a search result matching the search keyword from the memory stack by monitoring the input search keyword and clearing the memory stack when the input search keyword is empty.
It should be noted that, when the user inputs the search keyword "a" for the first time, the stack is empty, and therefore, similarly, a feedback message that a search result matching the search keyword is not found in the memory stack needs to be sent. So that step S102 may be performed when receiving the feedback message that the search result matching the search keyword is not found from the memory stack.
In S102, if a search result matching the search keyword is not queried from the memory stack, sending a search request to a database; and receiving a search result matched with the search keyword fed back by the database.
In some embodiments of the present invention, the database includes a local database and a remote database, where the local database refers to data stored in a memory of the terminal or a server database in a local area network, and the remote database refers to a database in a cloud server, and the remote database may further include a database in a search server, a database in a video push server, a database in a download push server, a database in a news push server, a database in a novel push server, and a database in a commodity push server.
In some embodiments of the present invention, first, according to a search keyword input by a user, a search result matching the search keyword is searched from the memory stack; if the search result matched with the search keyword is not found from the memory stack, sending a search request to the database; so as to search the database for a search result matching the search keyword according to the search keyword; and receiving a search result matched with the search keyword fed back by the database, and executing step S103.
In S103, pushing the search keyword and the search result matching the search keyword to the memory stack; when the next input search keyword is a subset of the stack top keywords in the memory stack, searching a search result matched with the search keyword from the memory stack; the search efficiency is improved.
In some embodiments of the present invention, after the pushing the search keyword and the search result matching the search keyword into the memory stack, further includes displaying the search result matching the search keyword.
Wherein the displaying search results matching the search keyword comprises displaying search results matching the search keyword looked up from the memory stack; and displaying the search result matched with the search keyword fed back by the database. So that the user can view the search result matched with the search keyword after inputting the search keyword.
As shown in fig. 5, an embodiment of the present invention provides a search apparatus 500, including:
a searching module 501, configured to obtain a search keyword, and search a search result matching the search keyword from a memory stack of the terminal;
a sending and receiving module 502, configured to send a search request to a database when a search result matching the search keyword is not found in the stack; receiving a search result matched with the search keyword and fed back by the database;
a push module 503, configured to push the search keyword and the search result matching the search keyword into the memory stack.
It should be noted that, for convenience and brevity of description, the specific working process of the searching apparatus 500 described above may refer to the corresponding process of the method described in fig. 1 and fig. 2, and will not be described in detail herein.
Fig. 6 is a schematic diagram of a terminal according to an embodiment of the present invention. As shown in fig. 6, the terminal of this embodiment may include: a processor 601, a memory 602, an input device 603, and an output device 604, the processor 601, the memory 602, the input device 603, and the output device 604 being connected by a bus 605. The input devices 603 may include a keyboard, touchpad, fingerprint sensor, microphone, etc., and the output devices 604 may include a display, speaker, etc.
The terminal further comprises a computer program, such as a search program, stored in the memory 602 and executable on the processor 601. The processor 601, when executing the computer program, implements the steps in the above-described embodiments of the search method, such as steps 101 to 103 shown in fig. 1 and steps 201 to 205 shown in fig. 2. Alternatively, the processor 601, when executing the computer program, implements the functions of each module/unit in the above device embodiments, for example, the functions of the modules 501 to 503 shown in fig. 5.
Illustratively, the computer program may be partitioned into one or more modules/units that are stored in the memory 602 and executed by the processor 601 to implement the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program in the terminal. For example, the computer program may be divided into an instruction searching module, a sending and receiving module, a push module, and a display module, where the specific functions of the modules are as follows: the searching module is used for acquiring a searching keyword and searching a searching result matched with the searching keyword from a memory stack of the terminal; the sending and receiving module is used for sending a search request to a database when a search result matched with the search keyword is not found in the stack; receiving a search result matched with the search keyword and fed back by the database; and the stack pushing module is used for pushing the search keyword and the search result matched with the search keyword into the memory stack.
The terminal can be a mobile terminal such as a smart phone or a computing device such as a desktop computer, a notebook, a palm computer and a cloud server. The terminal may include, but is not limited to, a processor 601, a memory 602. Those skilled in the art will appreciate that fig. 6 is only an example of a terminal and is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or different components, e.g., the terminal may also include input-output devices, network access devices, buses, etc.
The Processor 601 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 602 may be an internal storage unit of the terminal, such as a hard disk or a memory of the terminal. The memory 602 may also be an external storage device of the terminal, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal. Further, the memory 602 may also include both an internal storage unit and an external storage device of the terminal. The memory 602 is used for storing the computer programs and other programs and data required by the terminal. The memory 602 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus/terminal and method may be implemented in other ways. For example, the above-described apparatus/terminal embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (7)

1. A searching method is applied to a terminal, and is characterized by comprising the following steps:
acquiring a search keyword, and searching a search result matched with the search keyword from a memory stack of the terminal;
if the search result matched with the search keyword is not found from the memory stack, sending a search request to a database; receiving a search result matched with the search keyword and fed back by the database;
pushing the search keyword and a search result matched with the search keyword into the memory stack;
the searching for the search result matched with the search keyword from the memory stack comprises:
acquiring a stack top keyword in the memory stack;
judging whether the top keyword is a subset of the search keyword;
if the top keyword is not the subset of the search keyword, deleting the top keyword and the search result matched with the top keyword, and searching the search result matched with the search keyword from the memory stack after the top keyword is deleted;
if the top keyword is the subset of the search keyword, searching the search result matched with the search keyword from the search results matched with the top keyword;
monitoring an input search keyword, searching a search result matched with the search keyword from a memory stack, and if the input search keyword is empty, emptying the memory stack.
2. The method of claim 1, wherein before the obtaining a search key and finding a search result matching the search key from a memory stack of the terminal, further comprising:
and creating a memory stack in a memory of the terminal, wherein the memory stack is used for storing search keywords and search results matched with the search keywords.
3. The method of claim 2, wherein said finding search results matching the search key from the memory stack after deleting the top-of-stack key comprises:
judging whether the memory stack after the top keyword is deleted is an empty stack, if so, sending a feedback message of a search result which is not matched with the search keyword and is not found from the memory stack; if not, searching a search result matched with the search keyword from the memory stack after deleting the top keyword.
4. The method of claim 1, wherein after said pushing the search key and the search results that match the search key to the memory stack, further comprising: and displaying the search result matched with the search keyword.
5. A search apparatus, provided in a terminal, comprising:
the searching module is used for acquiring a searching keyword and searching a searching result matched with the searching keyword from a memory stack of the terminal;
the sending and receiving module is used for sending a search request to a database when a search result matched with the search keyword is not found in the stack; receiving a search result matched with the search keyword and fed back by the database;
the stack pushing module is used for pushing the search keyword and a search result matched with the search keyword into the memory stack;
the searching module is further configured to obtain a stack top keyword in the memory stack;
judging whether the top keyword is a subset of the search keyword;
if the top keyword is not the subset of the search keyword, deleting the top keyword and the search result matched with the top keyword, and searching the search result matched with the search keyword from the memory stack after the top keyword is deleted;
if the top keyword is the subset of the search keyword, searching the search result matched with the search keyword from the search results matched with the top keyword;
and the monitoring module monitors the input search keywords, searches a search result matched with the search keywords from the memory stack, and if the input search keywords are empty, the memory stack is emptied.
6. A terminal comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1-4 when executing the computer program.
7. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 4.
CN201710838305.3A 2017-09-14 2017-09-14 Search method, search device, search terminal and computer-readable storage medium Active CN107590248B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710838305.3A CN107590248B (en) 2017-09-14 2017-09-14 Search method, search device, search terminal and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710838305.3A CN107590248B (en) 2017-09-14 2017-09-14 Search method, search device, search terminal and computer-readable storage medium

Publications (2)

Publication Number Publication Date
CN107590248A CN107590248A (en) 2018-01-16
CN107590248B true CN107590248B (en) 2020-02-14

Family

ID=61047080

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710838305.3A Active CN107590248B (en) 2017-09-14 2017-09-14 Search method, search device, search terminal and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN107590248B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109271578A (en) * 2018-10-26 2019-01-25 努比亚技术有限公司 Application program searching method, mobile terminal and computer storage medium
CN109739887A (en) * 2018-12-21 2019-05-10 平安科技(深圳)有限公司 Synchronous task searching method, system, device and readable storage medium storing program for executing
CN109857760A (en) * 2018-12-22 2019-06-07 中国平安人寿保险股份有限公司 Quick response search method and device, computer installation and storage medium
CN110209932A (en) * 2019-05-17 2019-09-06 上海新储集成电路有限公司 A method of improving search efficiency

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103336849A (en) * 2013-07-24 2013-10-02 昆明理工大学 Method and device for increasing retrieval speed in database retrieval system
CN107133300A (en) * 2017-04-27 2017-09-05 福建中金在线信息科技有限公司 A kind of data query method and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103336849A (en) * 2013-07-24 2013-10-02 昆明理工大学 Method and device for increasing retrieval speed in database retrieval system
CN107133300A (en) * 2017-04-27 2017-09-05 福建中金在线信息科技有限公司 A kind of data query method and device

Also Published As

Publication number Publication date
CN107590248A (en) 2018-01-16

Similar Documents

Publication Publication Date Title
CN111079022B (en) Personalized recommendation method, device, equipment and medium based on federal learning
CN107590248B (en) Search method, search device, search terminal and computer-readable storage medium
CN107967135B (en) Calculation engine implementation method, electronic device and storage medium
CN112868004B (en) Resource recommendation method and device, electronic equipment and storage medium
CN107179930B (en) Application uninstalling recommendation method and device
CN107918658B (en) Business opportunity generation method and system
CN107908662B (en) Method and device for realizing search system
CN113704243A (en) Data analysis method, data analysis device, computer device, and storage medium
CN109471893B (en) Network data query method, equipment and computer readable storage medium
CN109840120B (en) Decoupling micro-service release method, electronic device and computer readable storage medium
CN111367870A (en) Method, device and system for sharing picture book
CN113704307A (en) Data query method, device, server and computer readable storage medium
CN111368697A (en) Information identification method and device
CN109299173B (en) Data transmission method, device and storage medium
CN106599082B (en) Retrieval method, related device and electronic equipment
CN108985805B (en) Method and device for selectively executing push task
CN112749258A (en) Data searching method and device, electronic equipment and storage medium
CN110505289B (en) File downloading method and device, computer readable medium and wireless communication equipment
CN109740130B (en) Method and device for generating file
CN110751510A (en) Method and device for determining promotion list
CN111143461A (en) Mapping relation processing system and method and electronic equipment
CN107885774B (en) Data processing method and system
CN111611056A (en) Data processing method and device, computer equipment and storage medium
CN110647623B (en) Method and device for updating information
CN107368597B (en) Information output method and device

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant after: OPPO Guangdong Mobile Communications Co., Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant before: Guangdong Opel Mobile Communications Co., Ltd.

GR01 Patent grant
GR01 Patent grant