CN112052361A - Searching method, searching device, terminal and storage medium - Google Patents

Searching method, searching device, terminal and storage medium Download PDF

Info

Publication number
CN112052361A
CN112052361A CN201910493017.8A CN201910493017A CN112052361A CN 112052361 A CN112052361 A CN 112052361A CN 201910493017 A CN201910493017 A CN 201910493017A CN 112052361 A CN112052361 A CN 112052361A
Authority
CN
China
Prior art keywords
character
characters
data
index
retrieval index
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.)
Pending
Application number
CN201910493017.8A
Other languages
Chinese (zh)
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 CN201910493017.8A priority Critical patent/CN112052361A/en
Publication of CN112052361A publication Critical patent/CN112052361A/en
Pending legal-status Critical Current

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/903Querying
    • G06F16/90335Query processing
    • G06F16/90344Query processing by using string matching techniques
    • 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/901Indexing; Data structures therefor; Storage structures

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a searching method, a searching device, a terminal and a storage medium. The method comprises the following steps: a terminal acquires a keyword; searching a retrieval index taking the acquired key words as indexes in a local database; the local database comprises at least one retrieval index corresponding to the data; the retrieval index of the data is created by performing character-dividing processing on the characteristic characters of corresponding data in a single-character-dividing mode and utilizing a character sequence obtained by the character-dividing processing based on a full text retrieval (FTS) technology; taking data corresponding to the searched retrieval index in the local database as a search result; and outputting the search result.

Description

Searching method, searching device, terminal and storage medium
Technical Field
The present invention relates to the field of data processing, and in particular, to a search method, apparatus, terminal, and storage medium.
Background
Smart devices have evolved with increasing use. It has become a common phenomenon that users can query themselves for information of interest through smart devices.
However, in the related art, the query result generated according to the query information of the user often has problems of slow query, inaccurate query result, and the like.
Disclosure of Invention
In order to solve the existing technical problem, embodiments of the present invention provide a search method, an apparatus, a terminal, and a storage medium.
The technical scheme of the embodiment of the invention is realized as follows:
the embodiment of the invention provides a searching method, which is applied to a terminal and comprises the following steps:
acquiring a keyword;
searching a retrieval index taking the acquired key words as indexes in a local database; the local database comprises at least one retrieval index corresponding to the data; the retrieval index of the data is created by performing character-dividing processing on the characteristic characters of corresponding data in a single-character-dividing mode and using a character sequence obtained by the character-dividing processing based on a Full-text search (FTS) technology;
taking data corresponding to the searched retrieval index in the local database as a search result;
and outputting the search result.
In the above scheme, the method further comprises:
for first data applied locally, determining characteristic characters of the first data by using the first data;
carrying out character-dividing processing on the extracted characteristic characters by utilizing a single character-dividing character mode to obtain a character sequence;
creating a retrieval index for the first data based on FTS technology by using the obtained character sequence;
and storing the created retrieval index to a local database.
In the above scheme, the performing character-by-character processing on the extracted feature characters by using a single character-by-character manner includes:
aiming at a plurality of characters of the same type in the extracted characteristic characters, dividing the characters according to a single character; and performing character division in such a manner that a single character is combined with other characters except for the corresponding character among the plurality of characters on a single character basis.
In the foregoing solution, the dividing the characters according to the way that the single character and the other characters except the corresponding character in the plurality of characters are combined based on the single character includes:
aiming at a first character in a plurality of characters of the same type, adding a second character in the plurality of characters behind the first character to obtain a first character sequence; adding a third character in the plurality of characters after the first character sequence to obtain a second character sequence; repeating the steps until the last character in the plurality of characters is added after the character sequence to obtain a character sequence;
aiming at a second character in a plurality of characters of the same type, adding a third character in the plurality of characters to the second character to obtain a third character sequence; adding a fourth character in the plurality of characters after the third character sequence to obtain a fourth character sequence; repeating the steps until the last character in the plurality of characters is added after the character sequence to obtain the character sequence;
aiming at other characters except the first character and the second character in a plurality of characters of the same type, repeating the steps until the last character in the characters of the same type;
all the characters obtained by the character dividing processing form a character sequence.
In the foregoing solution, the creating a search index for the first data based on a full-text search technique using the obtained plurality of character sequences includes:
and creating a retrieval index for the first data based on FTS5 technology by using the obtained plurality of character sequences.
In the above scheme, when the first data is locally acquired, a retrieval index is created for the first data.
In the above scheme, after the first data is applied to the terminal, when it is determined that no search index is created for the first data, a search index is created for the first data.
In the foregoing solution, determining that a search index is not created for the first data includes:
and when the retrieval index of the first data is not stored in the local database, determining that the retrieval index is not created for the first data.
In the above scheme, the searched data is a locally installed application program (APP).
The embodiment of the present invention further provides a search device, which is arranged on a terminal, and includes:
an acquisition unit configured to acquire a keyword;
the search unit is used for searching a retrieval index taking the acquired key words as indexes in a local database; the local database comprises at least one retrieval index corresponding to the data; the retrieval index of the data is created by performing character-dividing processing on the characteristic characters of corresponding data in a single-character-dividing mode and using a character sequence obtained by the character-dividing processing based on FTS technology;
the processing unit is used for taking the data corresponding to the searched retrieval index in the local database as a search result; and outputs the search result.
An embodiment of the present invention further provides a terminal, including: a processor and a memory for storing a computer program capable of running on the processor,
wherein the processor is configured to perform the steps of any of the above methods when running the computer program.
An embodiment of the present invention further provides a storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of any one of the above methods.
The searching method, the searching device, the searching terminal and the storage medium provided by the embodiment of the invention are used for acquiring keywords; searching a retrieval index taking the acquired key words as indexes in a local database; the local database comprises at least one retrieval index corresponding to the data; the retrieval index of the data is created by performing character-dividing processing on the characteristic characters of corresponding data in a single-character-dividing mode and using a character sequence obtained by the character-dividing processing based on FTS technology; taking data corresponding to the searched retrieval index in the local database as a search result; the search result is output, because of the single character-to-character mode and the FTS technology is used for creating the retrieval index for the data, because the granularity of the participle is a single character, the query result is accurate; meanwhile, FTS technology is adopted when the retrieval index is created, so that the retrieval time is short.
Drawings
FIG. 1 is a schematic flow chart of a retrieval method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram illustrating the process of creating a search index and searching according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating a search result according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a retrieving device according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and specific embodiments.
It should be noted that: in the present examples, "first", "second", etc. are used for distinguishing similar objects and are not necessarily used for describing a particular order or sequence.
In addition, the technical solutions described in the embodiments of the present invention may be arbitrarily combined without conflict.
In the present examples, a plurality means at least two, e.g., two, three, etc., unless specifically limited otherwise.
As described above, in the query result generated according to the query information of the user, the problems of slow query, inaccurate query result, etc. often occur, for example, when the user wants to query a certain installed APP locally (which may be understood as recalling a certain installed APP), in the related art, the installed APP may be recalled in the following manner:
the first way, using the query grammar of the SQLite engine, using fuzzy query techniques, such as like query grammar, to obtain an APP recalling an installation;
in the second mode, an installed APP is recalled through the traditional word segmentation technology and FTS technology capabilities.
In the first method, because a fuzzy query technology is used, the query efficiency is low, that is, the query time is long, and a stuck phenomenon may occur in the query process.
For the second mode, because the granularity of the word segmentation in the conventional word segmentation technology is not suitable, the corresponding APP (that is, required by the user) cannot be recalled as much as possible, that is, the result of the corresponding APP name cannot be recalled, and the query result is inaccurate.
In summary, the recall schemes in the related art all have certain drawbacks.
Based on the above, in various embodiments of the present invention, the index is constructed by dividing the character sequence obtained after dividing the character by the single character and by using the characteristics of the FTS.
According to the scheme of the embodiment of the invention, the retrieval index is established for the data by a single character-to-character mode and an FTS technology, and the query result is accurate because the granularity of word segmentation is a single character; meanwhile, FTS technology is adopted when the retrieval index is created, so that the retrieval time is short.
An embodiment of the present invention provides a search method, which is applied to a terminal, and as shown in fig. 1, the method includes:
step 101: acquiring a keyword;
step 102: searching a retrieval index taking the acquired key words as indexes in a local database;
here, the local database includes at least one retrieval index corresponding to the data; the retrieval index of the data is created based on FTS technology by using a character sequence obtained by character division processing and carrying out character division processing on the characteristic characters of the corresponding data in a single character-to-character mode.
Step 103: taking data corresponding to the searched retrieval index in the local database as a search result;
step 104: and outputting the search result.
In practical application, the terminal may be a mobile terminal, such as a mobile phone, a tablet computer (pad), and the like.
In step 101, the obtaining of the keyword means: and acquiring the keywords input by the user. In actual application, a user can input keywords through a search interface displayed on a display screen of the terminal. The keywords input by the user are used for inquiring data (searched data) required by the user, such as locally installed APPs, contact information in a local address book or local short messages.
In practical applications, the keywords may be characters of various languages, such as words, pinyin, symbols, or numbers.
In step 102, in other words, the keywords entered by the user directly serve as the index for retrieval. Because the retrieval index in the database is created by performing character-dividing processing on the characteristic characters of corresponding data in a single-character-dividing mode and using the character sequence obtained by the character-dividing processing based on the FTS technology, the keyword input by the user is definitely contained in the database, so that the terminal only needs to search the retrieval index taking the acquired keyword as the index in the local database, and does not need to perform any processing before searching.
In actual application, a corresponding retrieval index needs to be established for local data.
Based on this, in an embodiment, the method may further include:
for first data applied locally, determining characteristic characters of the first data by using the first data;
carrying out character-dividing processing on the extracted characteristic characters by utilizing a single character-dividing character mode to obtain a character sequence;
creating a retrieval index for the first data based on FTS technology by using the obtained character sequence;
and storing the created retrieval index to a local database.
The data applied locally refers to: data applied to the terminal, such as an APP installed on the terminal, contact information in the terminal address book, or a short message received by the terminal.
In practical applications, the characteristic characters determined by different data are different, for example, for locally installed APPs, the determined characteristic characters may include at least one of names of the APPs, synonyms of APP uses, pinyins of the APPs, first letters of each word in the pinyins of the APPs, and the like. For the contact information in the address book, the determined characteristic characters may include: the contact name, the pinyin of the contact name, the first letter of the pinyin of each word in the contact name and the like. The embodiment of the invention does not limit the specific process of determining the characteristic characters.
In an embodiment, the performing character-by-character processing on the extracted feature characters by using a single-character-by-character manner includes:
aiming at a plurality of characters of the same type in the extracted characteristic characters, dividing the characters according to a single character; and performing character division in such a manner that a single character is combined with other characters except for the corresponding character among the plurality of characters on a single character basis.
In an embodiment, the dividing the characters according to the way that the single character and the other characters except the corresponding character in the plurality of characters are combined based on the single character comprises:
aiming at a first character in a plurality of characters of the same type, adding a second character in the plurality of characters behind the first character to obtain a first character sequence; adding a third character in the plurality of characters after the first character sequence to obtain a second character sequence; repeating the steps until the last character in the plurality of characters is added after the character sequence to obtain a character sequence;
aiming at a second character in a plurality of characters of the same type, adding a third character in the plurality of characters to the second character to obtain a third character sequence; adding a fourth character in the plurality of characters after the third character sequence to obtain a fourth character sequence; repeating the steps until the last character in the plurality of characters is added after the character sequence to obtain the character sequence;
for other characters except the first character and the second character in the plurality of characters of the same type, the same example is used for pushing the characters until the last character in the characters of the same type;
all the characters obtained by the character dividing processing form a character sequence.
Here, the plurality of characters of the same type may be a plurality of characters of chinese characters, a plurality of characters of numerals, a plurality of characters of letters, or the like in practical use.
In actual application, the obtained characteristic characters are arranged in sequence, and each character of the same type in the characteristic characters is subjected to character division processing according to the mode.
For the above process, for example, assuming that for an APP, the determined characteristic characters are the use skills, there are:
the first character is the letter, and after being divided into characters, the following characters are obtained: use, skill and skill;
the second character is used, and the following characters are obtained after character division: use, skill and skill;
the third character is a skill, and is obtained after dividing the characters: skills and skills;
the fourth character is a skilful character which is obtained after dividing the characters: and (6) skilful.
The character sequence then contains: use, use skill, skilful.
In an embodiment, the creating a search index for the first data based on a full-text search technique by using the obtained plurality of character sequences includes:
and creating a retrieval index for the first data based on FTS5 technology by using the obtained plurality of character sequences.
In actual application, a retrieval index may be created for the first data as soon as the terminal acquires the first data.
Based on this, in an embodiment, when the first data is locally acquired, the characteristic character of the first data is determined by using the first data and the characteristic character of the first data is determined by using the first data.
For example, when the first data is a locally installed APP, after the terminal acquires an APP installation data packet from the network side, a search index is created for the APP when the APP is installed (during installation), and the search index is stored in a local database.
For another example, when the first data is contact information in an address book, the terminal, upon acquiring the contact information, creates a search index for the contact information, and stores the search index in a local database (for example, a time interval between a start time of an operation of creating the search index and a time of acquiring the contact information is less than a preset time, for example, 5 ms).
For another example, when the first data is a short message, the terminal creates a search index for the short message as soon as receiving the short message, and stores the search index in a local database (for example, a time interval between a start time of an operation of creating the search index and a time of receiving the short message is less than a preset time, for example, 3 ms).
Here, it should be noted that: as mentioned previously, the process of creating a search index operation includes: determining characteristic characters, processing character division, utilizing the character sequence obtained by the character division processing, and creating a retrieval index based on FTS. The specific process of creating the search index is described in detail above, and is not described in detail here.
In practical application, after the terminal applies the first data, and when the terminal is idle (for example, a load of a processor is less than a preset load amount), a search index may be created for the first data.
Based on this, in an embodiment, after the first data is applied to the terminal, when it is determined that no search index is created for the first data, a search index is created for the first data.
For example, when the first data is a locally installed APP, after the terminal installs the APP, a retrieval index is created for the APP when the terminal is idle and network connection is normal, and the retrieval index is stored in a local database.
For another example, when the first data is contact information in an address book, after the terminal acquires the contact information, a retrieval index is created for the contact information when the terminal is idle, and the retrieval index is stored in a local database.
For another example, when the first data is a short message, the terminal creates a retrieval index for the short message when the terminal is idle after receiving the short message, and stores the retrieval index in a local database.
Here, it should be noted that: as mentioned previously, the process of creating a search index operation includes: determining characteristic characters, processing character division, utilizing the character sequence obtained by the character division processing, and creating a retrieval index based on FTS. The specific process of creating the search index is described in detail above, and is not described in detail here.
In practical application, the terminal searches for a retrieval index of the first data in the local database, and determines that no retrieval index is created for the first data when the retrieval index of the first data is not found (which may be understood as not stored) in the local database.
In step 104, the search result is presented on the terminal during actual application, and more specifically, the search result is displayed on the display screen of the terminal.
According to the scheme provided by the embodiment of the invention, keywords are obtained; searching a retrieval index taking the acquired key words as indexes in a local database; the local database comprises at least one retrieval index corresponding to the data; the retrieval index of the data is created by performing character-dividing processing on the characteristic characters of corresponding data in a single-character-dividing mode and using a character sequence obtained by the character-dividing processing based on FTS technology; taking data corresponding to the searched retrieval index in the local database as a search result; the search result is output, because of the single character-to-character mode and the FTS technology is used for creating the retrieval index for the data, because the granularity of the participle is a single character, the query result is accurate; meanwhile, FTS technology is adopted when the retrieval index is created, so that the retrieval time is short.
The present invention will be described in further detail with reference to the following application examples.
In the embodiment of the application, the installed APP is searched locally, namely the installed APP is recalled.
In the embodiment of the application, when the APP is installed, a retrieval index is created for the APP.
As shown in fig. 2, when an APP needs to be installed, an installation module of a terminal obtains an installation instruction of a user, obtains data of the APP to be installed from an application store (server), a global search process subscribes to messages of the APP, and a real-time word sequence word segmentation module of the terminal obtains relevant information of the APP from a Database (DB) of the server, so as to determine a characteristic character, such as a name of the APP, and performs word segmentation processing on the characteristic character by using a word sequence word segmentation method (which may be understood as word segmentation processing, which refers to chinese word segmentation, which is a process of segmenting a chinese character sequence into individual words, i.e., continuous word sequences are rearranged according to a certain specification and combined into word sequences), and assuming that the name of the APP is "use skill", the result after word segmentation processing is as follows:
use, skill and skill;
use, skill and skill;
skills and skills;
and (6) skilful.
The 10 words form a word sequence, and then an FTS indexing module of the terminal fills the word sequence into an FTS engine to construct a corresponding retrieval index.
During actual application, the word sequence single word segmentation full-quantity construction module of the terminal judges whether a retrieval index is created for the APP at preset time, and when the retrieval index is not created for the APP, the relevant information of the APP is obtained from the DB of the server, so that the characteristic characters of the APP are obtained by the mode, and then the FTS index module utilizes the word sequence to fill the FTS engine to construct the corresponding retrieval index.
When the terminal is installed, the related information of the APP cannot be obtained in time (for example, the related information of the APP cannot be obtained in time due to a network), the related information of the APP can be obtained by a word sequence word segmentation full construction module of the terminal, and the characteristic character of the APP is obtained by using the above method. For example, the word sequence single word segmentation total construction module traverses local data every day, when finding that the APP does not construct a search index, obtains relevant information of the APP when the terminal is idle and the network connection is normal, and obtains the characteristic character of the APP by using the above method.
As shown in fig. 2, when the user wants to retrieve the APP, the global search may invoke a local retrieval service for inputting a keyword, such as skill, through the global search interface, the retriever receives the keyword input by the user and sends the keyword to the FTS indexing module, the FTS indexing module searches for a retrieval index indexed by skill in the local database, and then the APP of skill is displayed on the display screen, as shown in fig. 3.
Since the name length naming of APP is not particularly long (generally, the number of Chinese characters is less than 8), for the technology of word sequence single-character word segmentation (single-character segmentation mode), a large number of word sequences can not appear in the result of character segmentation.
When employing correlation techniques, the query syntax of the SQLite engine may be utilized to obtain an APP recalling an installation using fuzzy query techniques, such as like query syntax. For query (recall) speed, in the same device environment, for the SQLite database containing 517430 records, the database query created using FTS takes 0.03 seconds, and the database retrieved in full text is not used, i.e., the query using the like query statement takes 22.5 seconds, which is 1000 times as long in performance.
From the above description, it can be seen that, by adopting the scheme of the embodiment of the present invention, the retrieval speed (recall speed) and the retrieval accuracy (recall accuracy) are greatly improved, and the user experience is greatly improved.
In order to implement the method according to the embodiment of the present invention, an embodiment of the present invention further provides a search apparatus, which is disposed on a terminal, and as shown in fig. 4, the apparatus includes:
an acquisition unit 41 for acquiring a keyword;
a search unit 42, configured to search a local database for a search index using the obtained keyword as an index; the local database comprises at least one retrieval index corresponding to the data; the retrieval index of the data is created by performing character-dividing processing on the characteristic characters of corresponding data in a single-character-dividing mode and using a character sequence obtained by the character-dividing processing based on FTS technology;
a processing unit 43, configured to use data corresponding to the searched retrieval index in the local database as a search result; and outputs the search result.
In an embodiment, the apparatus may further include:
the word segmentation unit is used for determining characteristic characters of first data aiming at the first data applied to the local by utilizing the first data; carrying out character-dividing processing on the extracted characteristic characters by utilizing a single character-dividing character mode to obtain a character sequence;
the index establishing unit is used for establishing a retrieval index for the first data based on FTS technology by using the obtained character sequence; and stores the created retrieval index to a local database.
In an embodiment, the word segmentation unit is specifically configured to:
aiming at a plurality of characters of the same type in the extracted characteristic characters, dividing the characters according to a single character; and performing character division in such a manner that a single character is combined with other characters except for the corresponding character among the plurality of characters on a single character basis.
The dividing of characters according to the way that the single character and other characters except the corresponding character in the plurality of characters are combined based on the single character comprises the following steps:
the word segmentation unit is used for adding a second character in the plurality of characters behind a first character to obtain a first character sequence aiming at the first character in the plurality of characters of the same type; adding a third character in the plurality of characters after the first character sequence to obtain a second character sequence; repeating the steps until the last character in the plurality of characters is added after the character sequence to obtain a character sequence;
the word segmentation unit adds a third character in the plurality of characters to the second character aiming at the second character in the plurality of characters of the same type to obtain a third character sequence; adding a fourth character in the plurality of characters after the third character sequence to obtain a fourth character sequence; repeating the steps until the last character in the plurality of characters is added after the character sequence to obtain the character sequence;
the word segmentation unit aims at other characters except the first character and the second character in a plurality of characters of the same type, and the like until the last character in the characters of the same type;
all the characters obtained by the character dividing processing form a character sequence.
In an embodiment, the index creating unit is specifically configured to:
and creating a retrieval index for the first data based on FTS5 technology by using the obtained plurality of character sequences.
In actual application, a retrieval index may be created for the first data as soon as the first data is obtained.
Based on this, in an embodiment, the word segmentation unit is specifically configured to:
when the first data is locally obtained, determining characteristic characters of the first data by using the first data; carrying out character-dividing processing on the extracted characteristic characters by utilizing a single character-dividing character mode to obtain a character sequence;
correspondingly, the index establishing unit is used for establishing a retrieval index for the first data by using the obtained character sequence based on FTS technology; and stores the created retrieval index to a local database.
In practical application, after the terminal applies the first data, and when the terminal is idle (for example, a load of a processor is less than a preset load amount), a search index may be created for the first data.
Based on this, in an embodiment, the word segmentation unit is specifically configured to:
after the first data is applied to the terminal, when it is determined that a retrieval index is not created for the first data, determining characteristic characters of the first data by using the first data; carrying out character-dividing processing on the extracted characteristic characters by utilizing a single character-dividing character mode to obtain a character sequence;
correspondingly, the index establishing unit is used for establishing a retrieval index for the first data by using the obtained character sequence based on FTS technology; and stores the created retrieval index to a local database.
Wherein, in an embodiment, determining that a retrieval index is not created for the first data comprises:
when the local database does not store the retrieval index of the first data, the word segmentation unit determines that the retrieval index is not created for the first data.
In practical applications, the obtaining unit 41, the searching unit 42, the processing unit 43, the word segmentation unit and the index establishing unit may be implemented by a processor in a searching apparatus. Of course, the processor needs to run the program stored in the memory to realize the functions of the above-described program modules.
It should be noted that: in the searching apparatus provided in the above embodiment, only the division of the program modules is exemplified when performing the search, and in practical applications, the processing distribution may be completed by different program modules according to needs, that is, the internal structure of the apparatus may be divided into different program modules to complete all or part of the processing described above. In addition, the search apparatus and the search method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments in detail and are not described herein again.
Based on the hardware implementation of the program module, and in order to implement the method of the embodiment of the present invention, the embodiment of the present invention further provides a terminal. Fig. 5 is a schematic diagram of a hardware composition structure of a terminal according to an embodiment of the present invention, and as shown in fig. 5, a terminal 50 includes:
a communication interface 51 capable of information interaction with other devices such as network devices and the like;
and the first processor 52 is connected with the communication interface 51 to implement information interaction with other devices, and is used for executing the method provided by one or more technical solutions of the terminal side when running a computer program. And the computer program is stored on the memory 53.
Of course, in practice, the various components in the terminal 50 are coupled together by a bus system 54. It will be appreciated that the bus system 54 is used to enable communications among the components. The bus system 54 includes a power bus, a control bus, and a status signal bus in addition to the data bus. For clarity of illustration, however, the various buses are labeled as bus system 54 in fig. 5.
The memory 53 in the embodiment of the present invention is used to store various types of data to support the operation of the terminal 50. Examples of such data include: any computer program for operating on the terminal 50.
It will be appreciated that the memory 53 can be either volatile memory or nonvolatile memory, and can include both volatile and nonvolatile memory. Among them, the nonvolatile Memory may be a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a magnetic random access Memory (FRAM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical disk, or a Compact Disc Read-Only Memory (CD-ROM); the magnetic surface storage may be disk storage or tape storage. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of illustration and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Enhanced Synchronous Dynamic Random Access Memory (Enhanced DRAM), Synchronous Dynamic Random Access Memory (SLDRAM), Direct Memory (DRmb Access), and Random Access Memory (DRAM). The memory 52 described in connection with the embodiments of the invention is intended to comprise, without being limited to, these and any other suitable types of memory.
The method disclosed in the above embodiments of the present invention may be applied to the processor 52, or implemented by the processor 52. Processor 52 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 52. The processor 52 described above may be a general purpose processor, a DSP, or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. Processor 52 may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the present invention. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed by the embodiment of the invention can be directly implemented by a hardware decoding processor, or can be implemented by combining hardware and software modules in the decoding processor. The software modules may be located in a storage medium located in the memory 53, and the processor 52 reads the program in the memory 53 and performs the steps of the aforementioned method in conjunction with its hardware.
Optionally, when the processor 52 executes the program, the corresponding process implemented by the terminal in each method according to the embodiment of the present invention is implemented, and for brevity, no further description is given here.
In an exemplary embodiment, the present invention further provides a storage medium, i.e. a computer storage medium, in particular a computer readable storage medium, for example comprising a first memory 53 storing a computer program, which is executable by a processor 52 of a terminal to perform the steps of the aforementioned method. The computer readable storage medium may be Memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface Memory, optical disk, or CD-ROM.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus, terminal and method may be implemented in other manners. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
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, that is, 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, all the functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately regarded as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic or optical disk, or various other media that can store program code.
Alternatively, the integrated unit of the present invention may be stored in a computer-readable storage medium if it is implemented in the form of a software functional module and sold or used as a separate product. Based on such understanding, the technical solutions of the embodiments of the present invention may be essentially implemented or a part contributing to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic or optical disk, or various other media that can store program code.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (12)

1. A searching method is applied to a terminal and comprises the following steps:
acquiring a keyword;
searching a retrieval index taking the acquired key words as indexes in a local database; the local database comprises at least one retrieval index corresponding to the data; the retrieval index of the data is created by performing character-dividing processing on the characteristic characters of corresponding data in a single-character-dividing mode and using a character sequence obtained by the character-dividing processing based on a full-text retrieval FTS technology;
taking data corresponding to the searched retrieval index in the local database as a search result;
and outputting the search result.
2. The method of claim 1, further comprising:
for first data applied locally, determining characteristic characters of the first data by using the first data;
carrying out character-dividing processing on the extracted characteristic characters by utilizing a single character-dividing character mode to obtain a character sequence;
creating a retrieval index for the first data based on FTS technology by using the obtained character sequence;
and storing the created retrieval index to a local database.
3. The method of claim 2, wherein the character-dividing processing the extracted characteristic characters by means of character-dividing of single characters comprises:
aiming at a plurality of characters of the same type in the extracted characteristic characters, dividing the characters according to a single character; and performing character division in such a manner that a single character is combined with other characters except for the corresponding character among the plurality of characters on a single character basis.
4. The method of claim 3, wherein said dividing characters on a single character basis with other characters of the plurality of characters except the corresponding character comprises:
aiming at a first character in a plurality of characters of the same type, adding a second character in the plurality of characters behind the first character to obtain a first character sequence; adding a third character in the plurality of characters after the first character sequence to obtain a second character sequence; repeating the steps until the last character in the plurality of characters is added after the character sequence to obtain a character sequence;
aiming at a second character in a plurality of characters of the same type, adding a third character in the plurality of characters to the second character to obtain a third character sequence; adding a fourth character in the plurality of characters after the third character sequence to obtain a fourth character sequence; repeating the steps until the last character in the plurality of characters is added after the character sequence to obtain the character sequence;
aiming at other characters except the first character and the second character in a plurality of characters of the same type, repeating the steps until the last character in the characters of the same type;
all the characters obtained by the character dividing processing form a character sequence.
5. The method of claim 2, wherein the creating a search index for the first data based on a full text search technique using the obtained plurality of character sequences comprises:
and creating a retrieval index for the first data based on FTS5 technology by using the obtained plurality of character sequences.
6. The method of claim 2, wherein the first data is obtained locally while a search index is created for the first data.
7. The method of claim 2,
and after the first data is applied to the terminal, when the first data is determined not to be subjected to the establishment of the retrieval index, establishing the retrieval index for the first data.
8. The method of claim 7, wherein the determining that a search index has not been created for the first data comprises:
and when the retrieval index of the first data is not stored in the local database, determining that the retrieval index is not created for the first data.
9. Method according to any of claims 1 to 8, characterized in that the searched data is a locally installed application program APP.
10. A search apparatus, provided on a terminal, comprising:
an acquisition unit configured to acquire a keyword;
the search unit is used for searching a retrieval index taking the acquired key words as indexes in a local database; the local database comprises at least one retrieval index corresponding to the data; the retrieval index of the data is created by performing character-dividing processing on the characteristic characters of corresponding data in a single-character-dividing mode and using a character sequence obtained by the character-dividing processing based on FTS technology;
the processing unit is used for taking the data corresponding to the searched retrieval index in the local database as a search result; and outputs the search result.
11. A terminal, comprising: a processor and a memory for storing a computer program capable of running on the processor,
wherein the processor is adapted to perform the steps of the method of any one of claims 1 to 9 when running the computer program.
12. A storage medium having a computer program stored thereon, the computer program, when being executed by a processor, realizing the steps of the method according to any of the claims 1 to 9.
CN201910493017.8A 2019-06-06 2019-06-06 Searching method, searching device, terminal and storage medium Pending CN112052361A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910493017.8A CN112052361A (en) 2019-06-06 2019-06-06 Searching method, searching device, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910493017.8A CN112052361A (en) 2019-06-06 2019-06-06 Searching method, searching device, terminal and storage medium

Publications (1)

Publication Number Publication Date
CN112052361A true CN112052361A (en) 2020-12-08

Family

ID=73609782

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910493017.8A Pending CN112052361A (en) 2019-06-06 2019-06-06 Searching method, searching device, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN112052361A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117130981A (en) * 2023-01-04 2023-11-28 荣耀终端有限公司 Application content searching method and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102339294A (en) * 2010-07-27 2012-02-01 卓望数码技术(深圳)有限公司 Searching method and system for preprocessing keywords
CN107861753A (en) * 2017-06-26 2018-03-30 平安普惠企业管理有限公司 APP generations index, search method and system and readable storage medium storing program for executing
CN108241713A (en) * 2016-12-27 2018-07-03 南京烽火软件科技有限公司 A kind of inverted index search method based on polynary cutting

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102339294A (en) * 2010-07-27 2012-02-01 卓望数码技术(深圳)有限公司 Searching method and system for preprocessing keywords
CN108241713A (en) * 2016-12-27 2018-07-03 南京烽火软件科技有限公司 A kind of inverted index search method based on polynary cutting
CN107861753A (en) * 2017-06-26 2018-03-30 平安普惠企业管理有限公司 APP generations index, search method and system and readable storage medium storing program for executing

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117130981A (en) * 2023-01-04 2023-11-28 荣耀终端有限公司 Application content searching method and electronic equipment

Similar Documents

Publication Publication Date Title
CN108255958B (en) Data query method, device and storage medium
CN110399568B (en) Information searching method, device, terminal and storage medium
US10230668B2 (en) Information replying method and apparatus
CN104899220B (en) Application program recommendation method and system
CN105988996B (en) Index file generation method and device
US9767183B2 (en) Method and system for enhanced query term suggestion
CN106407360B (en) Data processing method and device
US9633059B2 (en) Data table performance optimization
CN110245357B (en) Main entity identification method and device
CN110019644B (en) Search method, apparatus and computer-readable storage medium in dialog implementation
US11789940B2 (en) Natural language interface to databases
CN112052361A (en) Searching method, searching device, terminal and storage medium
US8112070B2 (en) Electronic device and method for searching a merchandise location
CN103646034A (en) Web search engine system and search method based content credibility
CN112115228A (en) Searching method, searching device, terminal and storage medium
CN114611039B (en) Analysis method and device of asynchronous loading rule, storage medium and electronic equipment
CN113254819B (en) Page rendering method, system, equipment and storage medium
CN114463068A (en) Data processing method and device
CN113918796A (en) Information searching method, device, server and storage medium
US9558167B2 (en) Method, system and web server for adding related microblogs on webpage
JP6079207B2 (en) Keyword presentation program, keyword presentation method, and keyword presentation apparatus
US11734281B1 (en) Database management systems using query-compliant hashing techniques
US20230289350A1 (en) Database management systems using query-compliant hashing techniques
US9323753B2 (en) Method and device for representing digital documents for search applications
CN110347818B (en) Word segmentation statistical method and device, electronic equipment and computer 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