Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
A mobile terminal implementing various embodiments of the present invention will now be described with reference to the accompanying drawings. In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no specific meaning in themselves. Thus, "module" and "component" may be used in a mixture.
Fig. 1 is a schematic diagram of a hardware structure of a server implementing various embodiments of the present invention.
Theserver 100 may include, but is not limited to, thememory 20, thecontroller 30, thewireless communication unit 40, thedisplay unit 50, theinput unit 60, thegyroscope 70, theinterface unit 80, and thepower supply unit 90. FIG. 1 shows aserver 100 having various components, but it is to be understood that not all of the illustrated components are required to be implemented. More or fewer components may alternatively be implemented. The elements of theserver 100 will be described in detail below.
Thewireless communication unit 40 typically includes one or more components that allow wireless point communication between theserver 100 and a wireless communication system or network. For example, the wireless communication unit may include at least one of a broadcast receiving module, a mobile communication module, a wireless internet module, a short-range communication module, and a location information module.
The broadcast receiving module receives a broadcast signal and/or broadcast associated information from an external broadcast management server via a broadcast channel. The broadcast channel may include a satellite channel and/or a terrestrial channel. The broadcast management server may be a server that generates and transmits a broadcast signal and/or broadcast associated information or a server that receives a previously generated broadcast signal and/or broadcast associated information and transmits it to a terminal. The broadcast signal may include a TV broadcast signal, a radio broadcast signalBroadcast-related information may also be provided via a mobile communication network, and in this case, the broadcast-related information may be received by a mobile communication module@) A digital broadcasting system of a terrestrial digital broadcasting integrated service (ISDB-T), etc. receives digital broadcasting. The broadcast receiving module may be constructed to be suitable for various broadcasting systems providing broadcast signals as well as the above-mentioned digital broadcasting system. The broadcast signal and/or broadcast associated information received via the broadcast receiving module may be stored in the memory 20 (or other type of storage medium).
The mobile communication module transmits and/or receives radio signals to and/or from at least one of a base station (e.g., access point, node B, etc.), an external terminal, and a server. Such radio signals may include voice call signals, video call signals, or various types of data transmitted and/or received according to text and/or multimedia messages.
The wireless internet access technology to which the module refers may include W L AN (wireless L AN) (Wi-Fi), Wibro (wireless broadband), Wimax (worldwide interoperability for microwave Access), HSDPA (high speed Downlink packet Access), and the like.
The short-range communication module is a module for supporting short-range communication. Some examples of short-range communication technologies include bluetoothTMRadio Frequency Identification (RFID), infrared data association (IrDA), Ultra Wideband (UWB), zigbeeTMAnd so on.
The location information module is a module for checking or acquiring location information of the server. A typical example of the location information module is a GPS (global positioning system). According to the current technology, the GPS module calculates distance information and accurate time information from three or more satellites and applies triangulation to the calculated information, thereby accurately calculating three-dimensional current location information according to longitude, latitude, and altitude. Currently, a method for calculating position and time information uses three satellites and corrects an error of the calculated position and time information by using another satellite. In addition, the GPS module can calculate speed information by continuously calculating current position information in real time.
Theoutput unit 50 is configured to provide output signals (e.g., audio signals, video signals, alarm signals, vibration signals, etc.) in a visual, audio, and/or tactile manner. Theoutput unit 50 may include adisplay unit 51, anaudio output module 52, analarm unit 53, and the like.
Thedisplay unit 51 may display information processed in theserver 100. For example, when theserver 100 is in a phone call mode, thedisplay unit 51 may display a User Interface (UI) or a Graphical User Interface (GUI) related to a call or other communication (e.g., text messaging, multimedia file downloading, etc.). When theserver 100 is in a video call mode or an image capturing mode, thedisplay unit 51 may display a captured image and/or a received image, a UI or GUI showing a video or an image and related functions, and the like.
Meanwhile, when thedisplay unit 51 and the touch pad are stacked on each other in the form of a layer TO form a touch screen, thedisplay unit 51 may be used as an input device and an output device, thedisplay unit 51 may include at least one of a liquid crystal display (L CD), a thin film transistor L CD (TFT-L CD), an organic light emitting diode (O L ED) display, a flexible display, a three-dimensional (3D) display, and the like, some of these displays may be configured TO be transparent TO allow a user TO view from the outside, which may be referred TO as a transparent display, a typical transparent display may be, for example, a TO L ED (transparent organic light emitting diode) display, and the like, theserver 100 may include two or more display units (or other display devices), for example, an external display unit (not shown) and an internal display unit (not shown), and the touch screen may be used TO detect a touch input pressure and a touch input position and a touch input area, according TO a particularly intended embodiment.
Theaudio output module 52 may convert audio data received by thewireless communication unit 40 or stored in thememory 20 into an audio signal and output as sound when the server is in a call signal reception mode, a call mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Also, theaudio output module 52 may provide audio output related to a specific function performed by the server 100 (e.g., a call signal reception sound, a message reception sound, etc.). Theaudio output module 52 may include a speaker, a buzzer, and the like.
Thealarm unit 53 may provide an output to notify theserver 100 of the occurrence of the event. Typical events may include call reception, message reception, key signal input, touch input, and the like. In addition to audio or visual output, thealarm unit 53 may provide output in different ways to notify the occurrence of an event. For example, thealarm unit 53 may provide an output in the form of vibration, and when a call, a message, or some other incoming communication (communicating communication) is received, thealarm unit 53 may provide a tactile output (i.e., vibration) to notify the user thereof. By providing such a tactile output, the user can recognize the occurrence of various events even when the user's mobile phone is in the user's pocket. Thealarm unit 53 may also provide an output notifying the occurrence of an event via thedisplay unit 51 or theaudio output module 52.
Theinput unit 60 may generate key input data according to a command input by a user to control various operations of the server. Theinput unit 60 allows a user to input various types of information, and may include a keyboard, dome sheet, touch pad (e.g., a touch-sensitive member that detects changes in resistance, pressure, capacitance, and the like due to being touched), scroll wheel, joystick, and the like. In particular, when the touch pad is superimposed on thedisplay unit 50 in the form of a layer, a touch screen may be formed. Thegyroscope 70 is used to detect a yaw angle, a rotation angle, and the like of theserver 100.
Theinterface unit 80 serves as an interface through which at least one external device is connected to theserver 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The identification module may store various information for authenticating a user using theserver 100 and may include a User Identity Module (UIM), a Subscriber Identity Module (SIM), a Universal Subscriber Identity Module (USIM), and the like. In addition, a device having an identification module (hereinafter, referred to as "identification device") may take the form of a smart card, and thus, the identification device may be connected with theserver 100 via a port or other connection means. Theinterface unit 80 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within theserver 100 or may be used to transmit data between the server and the external device.
In addition, when theserver 100 is connected with an external cradle, theinterface unit 80 may serve as a path through which power is supplied from the cradle to theserver 100 or may serve as a path through which various command signals input from the cradle are transmitted to the server. Various command signals or power input from the cradle may be used as signals for identifying whether the server is accurately mounted on the cradle.
Thememory 20 may store software programs or the like for processing and controlling operations performed by thecontroller 30, or may temporarily store data (e.g., a phonebook, messages, still images, videos, and the like) that has been or is to be output. Also, thememory 20 may store data regarding various ways of vibration and audio signals output when a touch is applied to the touch screen.
Thememory 20 may include at least one type of storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. Also, theserver 100 may cooperate with a network storage device that performs a storage function of thestorage 20 through a network connection.
Thecontroller 30 generally controls the overall operation of the server. For example, thecontroller 30 performs control and processing related to voice calls, data communications, video calls, and the like. In addition, thecontroller 30 may include a multimedia module for reproducing (or playing back) multimedia data, and the multimedia module may be constructed within thecontroller 30 or may be constructed separately from thecontroller 30. Thecontroller 30 may perform a pattern recognition process to recognize a handwriting input or a picture drawing input performed on the touch screen as a character or an image.
Thepower supply unit 90 receives external power or internal power and provides appropriate power required to operate the respective elements and components under the control of thecontroller 30.
For a hardware implementation, the embodiments described herein may be implemented using at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a programmable logic device (P L D), a Field Programmable Gate Array (FPGA), a processor, a controller, a microcontroller, a microprocessor, an electronic unit designed to perform the functions described herein, such an implementation may be implemented in the controller 180 in some cases.
Thus far, servers have been described in terms of their functionality. Hereinafter, for the sake of brevity, a slide type server among various types of servers such as a folder type, a bar type, a swing type, a slide type server, and the like will be described as an example. Therefore, the present invention can be applied to any type of server, and is not limited to a slide type server.
Theserver 100 as shown in fig. 1 may be configured to operate with communication systems such as wired and wireless communication systems and satellite-based communication systems that transmit data via frames or packets.
A communication system in which a server according to the present invention is operable will now be described with reference to fig. 2. The server can implement intercommunication with themobile terminal 200 through a communication system as shown in fig. 2.
For example, the air interfaces used by communication systems include, for example, Frequency Division Multiple Access (FDMA), Time Division Multiple Access (TDMA), Code Division Multiple Access (CDMA), and Universal Mobile Telecommunications System (UMTS) (particularly Long term evolution (L TE)), Global System for Mobile communications (GSM), and so forth.
Referring to fig. 2, a CDMA wireless communication system may include a plurality ofmobile terminals 200, a plurality of Base Stations (BSs) 270, Base Station Controllers (BSCs) 275, and Mobile Switching Centers (MSCs) 280, theMSCs 280 are structured to interface with Public Switched Telephone Networks (PSTNs) 290, theMSCs 280 are also structured to interface with theBSCs 275, which may be coupled to thebase stations 270 via backhaul lines, which may be structured according to any of several known interfaces including, for example, E1/T1, ATM, IP, PPP, frame relay, HDS L, ADS L, or xDS L, it will be appreciated that a system as shown in fig. 2 may include a plurality of BSCs 2750.
Each BS270 may serve one or more sectors (or regions), each sector covered by a multi-directional antenna or an antenna pointing in a particular direction being radially distant from theBS 270. Alternatively, each partition may be covered by two or more antennas for diversity reception. Each BS270 may be configured to support multiple frequency allocations, with each frequency allocation having a particular frequency spectrum (e.g., 1.25MHz,5MHz, etc.).
The intersection of partitions with frequency allocations may be referred to as a CDMA channel. The BS270 may also be referred to as a Base Transceiver Subsystem (BTS) or other equivalent terminology. In such a case, the term "base station" may be used to generically refer to a single BSC275 and at least oneBS 270. The base stations may also be referred to as "cells". Alternatively, each sector of a particular BS270 may be referred to as a plurality of cell sites.
As shown in fig. 2, a Broadcast Transmitter (BT)295 transmits a broadcast signal to amobile terminal 200 operating within the system. A broadcast receiving module 111 as shown in fig. 1 is provided at theserver 100 to receive a broadcast signal transmitted by theBT 295. In fig. 2, several Global Positioning System (GPS)satellites 300 are shown. Thesatellite 300 assists in locating at least one of the plurality ofmobile terminals 200.
In fig. 2, a plurality ofsatellites 300 are depicted, but it is understood that useful positioning information may be obtained with any number of satellites. The GPS module 115 as shown in fig. 1 is generally configured to cooperate withsatellites 300 to obtain desired positioning information. Other techniques that can track the location of themobile terminal 200 may be used instead of or in addition to GPS tracking techniques. In addition, at least oneGPS satellite 300 may selectively or additionally process satellite DMB transmission.
As a typical operation of a wireless communication system, the BS270 receives reverse link signals from variousmobile terminals 200. Each reverse link signal received by aparticular base station 270 is processed within theparticular BS 270. The obtained data is forwarded to the associatedBSC 275. The BSC provides call resource allocation and mobility management functions including coordination of soft handoff procedures betweenBSs 270. TheBSCs 275 also route the received data to the MSC280, which provides additional routing services for interfacing with thePSTN 290. Similarly, the PSTN290 interfaces with the MSC280, the MSC interfaces with theBSCs 275, and theBSCs 275 accordingly control the BS270 to transmit forward link signals to themobile terminal 200.
Based on the above server hardware structure and application environment, the present invention provides various embodiments of the method.
First embodiment
Referring to fig. 3, fig. 3 is a flowchart illustrating steps of a retrieval method according to an embodiment of the present invention, where the retrieval method is applied to a server, and the server may be a search server, such as an ElasticSearch, where an interface called by the ElasticSearch is ESApiService. As shown in fig. 3, the method includes:
step 301, receiving a keyword input by a user, and determining a target initial according to the keyword.
In the step, the method receives a keyword input by a user, and determines a target initial according to the keyword. The keywords input by the user can be realized by one or more of pictures, voice and words. In the embodiment of the invention, the server can directly provide a user interface for the user to input the keywords, and also can receive the keywords sent by the mobile terminal. The user can input the keyword to be searched on the mobile terminal, the mobile terminal obtains the keyword input by the user, then the keyword input by the user is sent to the server, and the server determines the target initial according to the keyword sent by the mobile terminal. For example, the method may provide an API (Application Programming Interface) on the mobile terminal for the user to input keywords, such as the search Interface shown in fig. 4, and the user may input the keywords in the input field shown in fig. 4. The mobile terminal may send the keyword to the server through an http (hypertext transfer protocol) request after receiving the keyword input by the user, for example, the user may click a search button after inputting the keyword, and the mobile terminal may send the keyword to the server through an http request after receiving an operation of clicking the search button by the user.
The key words can be Chinese or Pinyin. When the keyword is a chinese character, the method may determine the target first letter according to the keyword by dividing the keyword into one or more keywords by a word divider and then determining the first letter of each keyword as the target first letter. When the keyword is pinyin, the method may determine the target first letter according to the keyword by dividing the keyword into one or more pinyins (i.e., pinyins corresponding to one or more keywords) by a word divider, and then determining the first letter of each pinyin as the target first letter. It can be understood that, when the information input by the user is voice information, the mobile terminal or the server receiving the voice information may convert the voice information into a chinese character or a pinyin through voice recognition, and then determine the target first letter according to the converted chinese character or pinyin. In some embodiments of the present invention, the method uses the Chinese character pinyin conversion tool pinyin4j to convert the Chinese input by the user into pinyin, and divides the pinyin input by the user into one or more pinyins through the pinyin word separation service Chinese4 PService.
Step 302, retrieving a sentence with an initial index including all letters or part of letters in the target initial from a pre-stored word bank according to the target initial as a target retrieval result.
In the step, the method searches sentences with initial indexes including all letters or partial letters in the target initial from a pre-stored word stock according to the target initial as target search results. In this embodiment, the server stores a pre-stored word bank, where the pre-stored word bank may be established by a user, that is, the user inputs one or more sentences, and the server receives the one or more sentences input by the user and adds the one or more sentences to the pre-stored word bank. The method also establishes an initial index for each statement in the pre-stored word stock according to the pre-stored word stock, and is used for facilitating retrieval in the pre-stored word stock according to the initial of the keyword input by the user. In the embodiment of the present invention, the method may store the pre-stored word stock in an HDFS (Hadoop Distributed File System).
The method can search all sentences with first letter indexes including the target first letter from the pre-stored word stock according to the target first letter as target search results. The method may determine all sentences of which the retrieved first letter indexes include all letters in the target first letter as target retrieval results, and may also determine partial sentences of which the first letter indexes include all letters in the target first letter as target retrieval results. In this embodiment, the method may search only sentences whose first letter indexes include all letters in the target first letter, and then use all the searched sentences as the target search result, or may determine some of the searched sentences as the target search result, for example, determine a sentence whose matching degree with the keyword is ranked by N, where N is an integer greater than or equal to 1, as the target search result.
The method can also search sentences with first letter indexes including partial letters in the target first letter from the pre-stored word stock according to the target first letter as target search results. The method may determine all sentences of which the first letter indexes include a part of letters in the target first letter as the target retrieval result, and may also determine a part of sentences of which the first letter indexes include a part of letters in the target first letter as the target retrieval result. In this embodiment, the method may search only sentences of which the first letter index includes a part of letters in the target first letter, and then use all the searched sentences as the target search result, or may determine a part of the searched sentences as the target search result, for example, determine a sentence with a top N number of matches with the keyword as the target search result, where N is an integer greater than or equal to 1.
The method can also search the sentences of which the first letter indexes comprise all letters in the target first letter, and then determine whether to search the sentences of which the first letter indexes comprise partial letters in the target first letter or not according to the searching condition. For example, assuming that a preset rule requires that a result fed back to a user is N sentences, where N is an integer greater than or equal to 1, the method first searches sentences whose first letter indexes include all letters in the target first letter to obtain a first search result, then determines whether the number of sentences included in the first search result is less than N, and if the number of sentences included in the first search result is not less than N, the method directly determines N sentences from the first search result as target search results without further searching sentences whose first letter indexes include some letters in the target first letter. On the contrary, if the number of sentences included in the first search result is less than N, the method may further search sentences whose initial index includes a part of letters in the target initial, and then determine the target search result according to the searched sentences whose initial index includes the part of letters in the target initial.
In the first embodiment, the method receives a keyword input by a user, and determines a target initial according to the keyword; and retrieving a sentence with an initial index including all letters or partial letters in the target initial from a pre-stored word bank according to the target initial as a target retrieval result. Therefore, the retrieval method provided by the invention can carry out initial matching fuzzy retrieval according to the keywords input by the user, has a wider retrieval result range, and can effectively avoid missing information required to be retrieved by the user.
Second embodiment
Referring to fig. 5, fig. 5 is a flowchart of another searching method provided in the embodiment of the present invention, and as shown in fig. 5, the method includes:
step 501, receiving a keyword input by a user, and determining a target initial according to the keyword.
In the step, the method receives a keyword input by a user, and determines a target initial according to the keyword. The keywords input by the user can be realized by one or more of pictures, voice and words. In the embodiment of the invention, the server can directly provide a user interface for the user to input the keywords, and also can receive the keywords sent by the mobile terminal. The user can input the keyword to be searched on the mobile terminal, the mobile terminal obtains the keyword input by the user, then the keyword input by the user is sent to the server, and the server determines the target initial according to the keyword sent by the mobile terminal. For example, the method may provide an API on the mobile terminal for the user to input keywords, and the mobile terminal may send the keywords to the server through an http request after receiving the keywords input by the user.
The key words can be Chinese or Pinyin. When the keyword is a chinese character, the method may determine the target first letter according to the keyword by dividing the keyword into one or more keywords by a word divider and then determining the first letter of each keyword as the target first letter. When the keyword is pinyin, the method may determine the target first letter according to the keyword by dividing the keyword into one or more pinyins (i.e., pinyins corresponding to one or more keywords) by a word divider, and then determining the first letter of each pinyin as the target first letter. It can be understood that, when the information input by the user is voice information, the mobile terminal or the server receiving the voice information may convert the voice information into a chinese character or a pinyin through voice recognition, and then determine the target first letter according to the converted chinese character or pinyin. In some embodiments of the present invention, the method uses the Chinese character pinyin conversion tool pinyin4j to convert the Chinese input by the user into pinyin, and divides the pinyin input by the user into one or more pinyins through the pinyin word separation service Chinese4 PService.
For example, assuming the user needs to retrieve "display," the user may enter the keyword "display," as shown in FIG. 6. Of course, the user may also input the pinyin keyword "xianshiqi", and the method determines that the target initial is "xsq" according to the keyword input by the user.
Step 502, retrieving a sentence with an initial index including all letters in the target initial from the pre-stored word stock as a first retrieval result.
In this embodiment, the method first retrieves, from the pre-stored word bank, a sentence whose first letter index includes all letters in the target first letter as a first retrieval result. For example, when the target initial is "xsq", the method retrieves, from the pre-stored thesaurus, a sentence including "xsq" in all initial indexes, for example, a sentence including the words "display", "muffler", "new application", "story", "new period", and the like, as a first retrieval result.
Step 503, determining whether the number of statements included in the first search result is less than N, where N is an integer greater than or equal to 1.
In this embodiment, it is assumed that N search results need to be provided for the user, so the method determines whether the number of statements included in the first search result is less than N after the first search result is obtained, and if the number of statements included in the first search result is not less than N, executestep 505; conversely, if the number of statements included in the first search result is less than N,step 505 is executed.
And 505, determining the sentences ranked with the top N matching degrees with the keywords from the first retrieval result as the target retrieval result.
In this step, when the number of sentences included in the first search result is not less than N, the method determines N sentences from the first search result as the target search result. The way in which the method determines N sentences from the first search result as target search results may be determined according to the matching degree of the sentences in the first search result with the keywords, that is, the method determines the sentences ranked N top with the matching degree of the keywords as the target search results. It should be noted that the matching degree in the embodiment of the present invention may be ranked according to the percentage of the same word in the keyword to the word number in the keyword, the percentage of the same word in the keyword to the word number in the sentence, and the like.
And 505, retrieving a statement with an initial index including a part of letters in the target initial from the pre-stored word stock as a second retrieval result.
In this step, if the number of sentences included in the first search result is less than N, the method further searches a sentence whose initial index includes a part of letters in the target initial from the pre-stored word stock as a second search result. That is, when the number of sentences whose first letter indexes include all the letters in the target first letter in the pre-stored word stock does not satisfy a preset number, the method retrieves the sentences whose first letter indexes include a part of the letters in the target first letter from the pre-stored word stock according to the target first letter as a second retrieval result.
The method may sequentially retrieve from the pre-stored thesaurus with different letter combinations in the target initial, for example, when the target initial is "xsq", the method may retrieve a sentence whose initial index includes "xs" or "x" from the pre-stored thesaurus using "xs" or "x" as the second retrieval result. It is to be understood that the second search result includes the first search result.
Step 506, determining whether the number of statements included in the second search result is less than N.
In this step, the method determines whether the number of statements included in the second search result is less than N after the second search result is obtained, and if the number of statements in the second search result is not less than N, executesstep 507; conversely, if the number of statements in the second search result is less than N, go to step 508.
And 507, determining a sentence with the top N matched degrees with the keywords from the second retrieval result as the target retrieval result.
In this step, when the number of sentences included in the second search result is not less than N, the method determines, as the target search result, a sentence ranked N top names with the keyword matching degree from the second search result.
And step 508, determining the second retrieval result as the target retrieval result.
In this step, when the number of statements included in the second search result is less than N, the method directly determines that the second search result is the target search result. That is, when the first letter index retrieved by the method from the preset thesaurus includes a part of letters in the target first letter, the method directly determines all sentences of which the first letter index includes the part of letters in the target first letter, and the number of the sentences is less than N as the target retrieval result.
In some embodiments of the present invention, when the number of sentences included in the first search result is less than N, the method may search the pre-stored word stock sequentially with different letter combinations in the first letter of the target (for example, sequentially decreasing the last letter for searching) until the searched result is not less than N or until all the different letter combinations in the first letter of the target are searched. For example, assuming that N is 5, the method retrieves 2 sentences whose initial indexes include "xsq" from the pre-stored thesaurus according to the target initial "xsq", that is, 2 sentences included in the first retrieval result, the method further retrieves a sentence whose initial index includes "xs" from the pre-stored thesaurus, and if the number of sentences whose initial indexes include "xs" included in the pre-stored thesaurus is not less than 5, the method determines that the retrieved sentence whose initial index includes "xs" is used as the second retrieval result. If the number of the sentences of which the initial indexes comprise 'xs' in the pre-stored word stock is less than 5, the method further retrieves the sentences of which the initial indexes comprise 'x' from the pre-stored word stock, and then determines the sentences of which the initial indexes comprise 'x' as the second retrieval result. For example, as shown in fig. 7, when the user inputs the keyword "display", the server retrieves that the number of sentences corresponding to the keyword initial "xsq" is 3 and less than 5 (for the case of N ═ 5), at this time the method continues with the first two initials "xs" to perform the retrieval, then determines two words with higher association with the keyword "display" and 3 retrieval results corresponding to the initial "xsq" as the last retrieval results in the retrieval results, and displays the last retrieval results on the user interface for the user to view.
In a second embodiment of the invention, the method receives a keyword input by a user, and determines a target initial according to the keyword; retrieving sentences with first letter indexes including all letters in the target first letter from the pre-stored word stock as a first retrieval result; if the number of sentences included in the first retrieval result is not less than N, determining the sentences ranked at the top N with the matching degree of the keywords from the first retrieval result as the target retrieval result, wherein N is an integer greater than or equal to 1; if the number of the sentences included in the first retrieval result is less than N, retrieving sentences of which the initial indexes include part of letters in the target initial from the pre-stored word stock as second retrieval results, wherein the second retrieval results include the first retrieval results; if the number of sentences included in the second retrieval result is not less than N, determining the sentences ranked at the top N with the matching degree of the keywords from the second retrieval result as the target retrieval result; and if the number of the sentences in the second retrieval result is less than N, determining that the second retrieval result is the target retrieval result. Therefore, the retrieval method provided by the invention enlarges the retrieval result by reducing the retrieval words in sequence, and can effectively avoid missing the information required to be retrieved by the user.
Third embodiment
Referring to fig. 8, fig. 8 is a flowchart of another retrieval method provided in the embodiment of the present invention, and as shown in fig. 8, the method includes:
step 801, receiving a sentence input by a user, adding the sentence input by the user to a pre-stored word bank, and updating the pre-stored word bank.
In this embodiment, the method receives a sentence input by a user, and adds the sentence input by the user to a pre-stored word stock. For example, the method may create a folder (e.g., folder "zhouls. dic" with suffix name ". dic") under the configuration file (config/custom), and the user may add sentences in the file, each separated by a predetermined symbol (e.g., carriage return symbol).
Step 802, establishing an initial index for each statement in the pre-stored word stock.
In this step, the method establishes an initial index for each sentence in the pre-stored lexicon. For example, the method may determine that the first letter corresponding to all words included in a sentence is the first letter index of the sentence, and may determine that the first letter index of "display model" is "xsqxh", for example.
Step 803, receiving a keyword input by a user, and determining a target initial according to the keyword.
In the step, the method receives a keyword input by a user, and determines a target initial according to the keyword. The keywords input by the user can be realized by one or more of pictures, voice and words. In the embodiment of the invention, the server can directly provide a user interface for the user to input the keywords, and also can receive the keywords sent by the mobile terminal. The user can input the keyword to be searched on the mobile terminal, the mobile terminal obtains the keyword input by the user, then the keyword input by the user is sent to the server, and the server determines the target initial according to the keyword sent by the mobile terminal. For example, the method may provide an API (Application Programming Interface) on the mobile terminal for the user to input a keyword, and the mobile terminal may send the keyword to the server by an http (hypertext transfer protocol) request after receiving the keyword input by the user.
The key words can be Chinese or Pinyin. When the keyword is a chinese character, the method may determine the target first letter according to the keyword by dividing the keyword into one or more keywords by a word divider and then determining the first letter of each keyword as the target first letter. When the keyword is pinyin, the method may determine the target first letter according to the keyword by dividing the keyword into one or more pinyins (i.e., pinyins corresponding to one or more keywords) by a word divider, and then determining the first letter of each pinyin as the target first letter. It can be understood that, when the information input by the user is voice information, the mobile terminal or the server receiving the voice information may convert the voice information into a chinese character or a pinyin through voice recognition, and then determine the target first letter according to the converted chinese character or pinyin. In some embodiments of the present invention, the method uses the Chinese character pinyin conversion tool pinyin4j to convert the Chinese input by the user into pinyin, and divides the pinyin input by the user into one or more pinyins through the pinyin word separation service Chinese4 PService.
Step 804, retrieving a sentence with an initial index including all letters or partial letters in the target initial from a pre-stored word stock according to the target initial as a target retrieval result.
Step 804 is the same asstep 302 in the first embodiment of the present invention, and is not described herein again.
Optionally, the keyword is chinese or pinyin, and determining a target first letter according to the keyword includes:
if the keyword is Chinese, determining the pinyin first letter of each keyword in the keyword as the target first letter;
and if the keyword is pinyin, determining the first letter of each pinyin in the keyword as the target first letter.
In the third embodiment of the invention, the method receives the sentences input by the user, adds the sentences input by the user to a pre-stored word bank and updates the pre-stored word bank; establishing an initial index for each statement in the pre-stored word stock; receiving a keyword input by a user, and determining a target initial according to the keyword; and retrieving a sentence with an initial index including all letters or partial letters in the target initial from a pre-stored word bank according to the target initial as a target retrieval result. Therefore, the method provided by the invention establishes the initial index for each sentence in the pre-stored word stock, facilitates subsequent retrieval according to the initial of the keyword input by the user, simultaneously obtains a wider retrieval result by retrieval according to the initial, and can effectively avoid missing information required to be retrieved by the user.
Fourth embodiment
Referring to fig. 9, fig. 9 is a schematic structural diagram of a server according to an embodiment of the present invention, and as shown in fig. 9, theserver 900 includes:
a determiningmodule 901, configured to receive a keyword input by a user, and determine a target initial according to the keyword;
a retrievingmodule 902, configured to retrieve, from a pre-stored word library, a sentence with an initial index including all or part of the letters in the target initial as a target retrieval result according to the target initial.
Optionally, referring to fig. 10, fig. 10 is a schematic structural diagram of another server provided in the embodiment of the present invention, and as shown in fig. 10, the retrievingmodule 902 includes:
afirst retrieval unit 9021, configured to retrieve, from the pre-stored word library, a sentence whose first letter index includes all letters in the target first letter, as a first retrieval result;
a first determiningunit 9022, configured to determine, from the first search result, a statement that is ranked N times before the keyword matching degree as the target search result if the number of statements included in the first search result is not less than N, where N is an integer greater than or equal to 1.
Optionally, referring to fig. 11, fig. 11 is a schematic structural diagram of another server provided in the embodiment of the present invention, and as shown in fig. 11, the retrievingmodule 902 further includes:
a second retrievingunit 9023, configured to retrieve, from the pre-stored word library, a statement whose initial index includes a part of letters in the target initial as a second retrieval result if the number of statements included in the first retrieval result is less than N, where the second retrieval result includes the first retrieval result;
a second determiningunit 9024, configured to determine, from the second search result, a statement that is ranked N times before the keyword matching degree as the target search result if the number of statements included in the second search result is not less than N;
a third determiningunit 9025, configured to determine that the second search result is the target search result if the number of statements included in the second search result is less than N.
Optionally, referring to fig. 12, fig. 12 is a schematic structural diagram of another server provided in the embodiment of the present invention, and as shown in fig. 12, theserver 900 further includes:
areceiving module 903, configured to receive a statement input by a user, add the statement input by the user to a pre-stored word stock, and update the pre-stored word stock;
an establishingmodule 904, configured to establish an initial index for each sentence in the pre-stored word bank.
Optionally, the keyword is chinese or pinyin, referring to fig. 13, where fig. 13 is a schematic structural diagram of another server provided in the embodiment of the present invention, and as shown in fig. 13, the determiningmodule 901 includes:
a fourth determiningunit 9011, configured to determine, if the keyword is a chinese word, that the pinyin first letter of each keyword in the keyword is the target first letter;
a fifth determiningunit 9012, configured to determine, if the keyword is a pinyin, that the first letter of each pinyin in the keyword is the target first letter.
Theserver 900 can implement the processes implemented by the server in the above embodiments, and in order to avoid repetition, the description is omitted here.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.