A kind of method that keyword in website is retrieved immediately
Technical field
The present invention relates to a kind of keyword search method, relate in particular to a kind of method that keyword in website is retrieved immediately.
Background technology
In current information society, obtaining and organizing of information is one important topic.How to obtain up-to-date relevant information easily and more and more important meaning is arranged for information user.
Current, obtain the important means that information has become people's acquired information by online, all there is every day bulk information to pass through the user that this kind mode arrives needs this information.The surf the Net a kind of main means of Query Information of user are by opening the information that this webpage of interested web page browsing provides.Sometimes, when the user browses certain webpage, can relatively be concerned about, need further this key word of retrieval, obtain the detailed content relevant with this key word to certain word in the webpage or speech (being called key word).For example, for English webpage, the user often needs the English word in the webpage is translated.For news web page, the user is interested in certain specific personage or incident in such webpage usually, wants to understand the information relevant with this personage or incident.
At the demand, there is following scheme that the relevant information of key word in the webpage can be provided to the user in the prior art.
Scheme one: use the client retrieves application software.
This key search mode is that the software of retrieve application is installed on user's computer, use the screen word-selecting function to choose keyword in website, by the search function that application software provides user-selected key word is retrieved, and shown relevant information to the user.Kingsoft Powerword software for example, after computing machine is installed and is moved this software, when the screen word-selecting function is opened, above mouse moves on to some words, the explanation that a floating frame shows word will appear, the content of this explanation can come from the database of subscriber computer this locality, also can be to obtain to special server lookup by network.
Scheme two: in webpage, key word is added link.
In webpage, the special key words in the webpage is added hyperlink, this key word is linked with the webpage of relevant customizing messages.The user can enter this webpage by this hyperlink and obtain relevant information.
Scheme three: use search website, key word is retrieved.
Though above-mentioned prior art can satisfy client's demand preferably, still has some defectives.
The mode of scheme one is mainly used in the foreign language translation application software, in this mode, the key word that is obtained when getting speech, normally by application software according to speech habits, the setting that some words or regular collocation are carried out in advance.Under this mode, it is dumb to get speech, can't meet consumers' demand.And the user must start a mounted application software when opening webpage, and therefore the system resource that takies is many.More crucial problem is because the information that obtains under this mode is the general information at normal conditions, therefore can't provide the customizing messages relevant with webpage at certain or some particular Web page.
The mode of scheme two is that the deviser by webpage determines keyword in website.Because the deviser does not understand user's information retrieval demand, therefore, its key word of determining often can not satisfy the user.And the webpage that obtains by this key word neither provide at this webpage, therefore, can't provide customizing messages at this webpage for the user equally.
The mode of scheme three needs user's manual unlocking search website to carry out the retrieval of key word, and the user operates very inconvenient.And the result for retrieval of search website generally is all information relevant with key word, and the customizing messages at webpage can't be provided.
In addition, Chinese invention patent instructions (CN1402155A) discloses a kind of method of utilizing network to carry out aided education: teaching this paper that user's end presents with form web page by network loading one, to this user's end, wherein this selection mechanism is used for choosing of key word to one selection mechanism with this page download; This user chooses key word or text unit in this webpage, this selection mechanism then obtains the identification data of this key word word string or text unit; Transmitting this key word word string inquires about to the web station system end; The web station system end utilizes inquiry mechanism to accept this key word word string and inquire about relevant note in this paper annotation database; The web station system end is presented on user by the network transmission with the form of webpage with the note content that is checked in and holds.This method can be the user customizing messages at this webpage is provided, but also has defective: can not real time monitoring and receive keyboard or key word to be checked is obtained in the operation of mouse; Convenient inadequately to the control that the mode of operation and the relevant state of the open and close of key search function, the mouse that starts key search or keyboard are selected.
Summary of the invention
Defective at above-mentioned prior art exists the invention provides a kind of method that keyword in website is retrieved immediately.The mode of operation and the relevant state of key search function of the open and close of key search function, the mouse that starts key search or keyboard can be set, and the operation of supervision keyboard or mouse, with content key word is set, and specially provides information specific at the particular requirement of this webpage at particular webpage.
A kind of method that keyword in website is retrieved immediately provided by the invention comprises:
11) in the client Web page loading, load the shell script that web page contents is carried out key search, and according to this program start key search process; Described key search process comprises, monitoring module is used to monitor the operation of the mouse or the keyboard of client, and according to this operation trigger corresponding operation; The keyword query module is used to obtain the key word that the user selects, and the key search server is delivered in this key word; Display module is used to generate display message, and this display message comprises the retrieving information relevant with key word that information and inquiry obtain; Control module is used to be provided with the mode of operation of the open and close of key search function, the mouse that the startup key search is set or keyboard and the state relevant with described key search function and selects;
12) real time monitoring and receive mouse or the operation of keyboard;
13) obtain key word to be checked according to described operation; Described key word is selected voluntarily in the displaying contents of webpage by mouse or keyboard operation by the user, when using mouse, adopts dragging of mouse to carry out described key word with double click operation and selects;
14) send described key word immediately and carry out information retrieval to the key search server; The retrieving information that obtains is sent to client; Described key search server is the private server that the content that aims at specific certain or some webpage provides key search information; When not having related content in the described key search server, provide result for retrieval according to immediate key word; Described key search server at first is converted into the form of the suitable current web page of retrieving before client sends result for retrieval; The form of described suitable current web page is judged according to the form of the described key word that client sends;
15) the described result for retrieval of client instant playback; Client shows that described result for retrieval is to realize by generating floating frame; The display position of described floating frame is a benchmark with the position of key word, and can drag to the optional position.
Preferably, after the described step 12), also comprise before the step 13):
31) judge whether described key search function opens, if then carry out next step; If not, then do not carry out any operation.
Preferably, described step 31) afterwards, also comprise before the step 13):
41) judge whether described operation is the key search operation; If then enter step 13); If not, then enter step 12).
Preferably, if the webpage of described loading is closed, then when closing this webpage, finish described key search process.
Preferably, when carrying out described step 14), promptly generate described floating frame, this floating frame display reminding information.
Compared with prior art, method provided by the invention is in the client Web page loading, the shell script of key search is carried out in loading to web page contents, and according to its startup key search process, thereby provide key search information targetedly at certain or some webpages, can be used for occasion such as application-specific such as the Web-based instructions.The mode of operation of the open and close of key search function, the mouse that starts key search or keyboard, the state that the key search function is relevant also can be set, and the operation of real time monitoring keyboard or mouse, retrieve to obtain required key word.Particularly, has following advantage.
1, method provided by the invention has better targeted choosing of key word.
In the technical program, at the content of webpage and the function of this webpage, the more and pointed key word of quantity is set in the key search server, carry out information retrieval for the user.Because the key word setting shoots the arrow at the target, thereby, can provide more rationally for the user, key terms accurately.The user can select any word content in the webpage so that icon carries out information retrieval when browsing page.Because the key word setting that the key search server can enrich at the content and the function of webpage, therefore, the user is interested and to need further information inquiring generally be effective key word.Under the situation that is not effective key word, retrieval server also can be with the key word of selecting as the user with the immediate key word of this information.
In addition, owing to be to set up special retrieval server at certain or certain class webpage, therefore, being provided with of key word can upgrade in time according to user's demand, fully satisfies the demand that the user constantly changes.
2, method provided by the invention can according at particular webpage and function thereof more timely abundant and key search information with strong points is provided.
The scheme of prior art does not all provide directly related keyword message at particular webpage, therefore, the information that user search obtains often is not oneself to wish to obtain, or when obtaining the own information that needs the information of acquisition bulk redundancy, need carry out a large amount of information sifting work.
Compare with above-mentioned prior art, in the method provided by the invention, because the content of keyword retrieval server designs for particular webpage, can be according to the content and the function thereof of particular Web page, provide keyword retrieval information targetedly, make the user obtain information needed quickly and accurately.In addition, this method also is convenient to the server admin personnel and as required the information of key word is managed timely owing to use special-purpose keyword retrieval server that information retrieval service is provided, and for example upgrades, deletion, change etc.
3, method provided by the invention need not any software of user's manual installation, can realize the retrieval to key word in the webpage.
Because this method loads the shell script of key search when opening webpage, therefore, this method need not any special procedure of the special installation of user just can realize search function.
4, method provided by the invention can the real-time response user to the demand of key search, return result for retrieval immediately.
Among the present invention, be to start along with opening of webpage to the search function of key word in the webpage, and by the operation of real-time response mouse-keyboard, obtain the key word that the user chooses, immediate feedback is to retrieval server, and result for retrieval fed back to client and shows.
5, the demonstration of result for retrieval does not influence the demonstration of user to the webpage original text.
Result for retrieval uses floating frame to show that described floating frame is a benchmark with the position of the user-selected key word of getting, and described floating frame can arbitrarily drag to any position, is user-friendly to.And the operation that provides the user to close window.
6, keyword search method provided by the invention need not any software of user's manual installation, thereby avoids taking multi-system resource.
Method provided by the invention only need provide a less shell script to client when opening webpage, by the operation of this shell script monitoring user, and carry out operations such as content corresponding extraction, demonstration.Described shell script discharges along with closing of webpage.Thereby reduce the resource occupation of client, also user-friendly.
Description of drawings
Fig. 1 is the process flow diagram of first embodiment of the invention;
Fig. 2 is an application example of first embodiment of the invention.
Embodiment
Please referring to Fig. 1, this figure is the process flow diagram of first embodiment of the invention.Please be simultaneously referring to Fig. 2, this figure is a running example of first embodiment of the invention.
Step S101, beginning.
Step S102 according to client-requested, to the client Web page loading, and loads the shell script that web page contents is carried out key search simultaneously, and according to this program start key search process.
Described client-requested is the operation that the user opens particular webpage.After the user sent this request, server end was to the client Web page loading.Simultaneously, also load a shell script to client.This shell script is set up a process in client during client is opened described webpage, this process is used to client that the service that the key word of described webpage is retrieved is provided.
Described key search process comprises monitoring module, keyword query module, display module and control module.
Described monitoring module is used to monitor the operation of the mouse or the keyboard of client, and triggers corresponding retrieving according to this operation.
Described keyword query module is used to obtain the key word that the user selects, and the key search server delivered in this key word.
Described display module is used to produce a display window, the relevant information of selecting with the user of key word that this display window is used for display reminding information and shows that inquiry obtains.
Described control module is used to be provided with the open and close state of key search function, and the state relevant with described key search function selection, as: the concrete mode of mouse or keyboard startup key search operation etc. is set.The concrete operations mode that is provided with in the present embodiment is: mouse drag and mouse are double-clicked two incidents.
The multiple client script language that above-mentioned shell script can adopt prior art to provide is realized.For example, present widely used Javascript language.
Step S103 monitors the operation of mouse or keyboard.
Real time monitoring mouse or keyboard and other operation of input equipment are so that carry out relevant treatment at any time
Step S104 receives the input operation of mouse or keyboard.
Receive the operation information of mouse or keyboard, so that judge and handle.
Step S105 judges whether to open the key search function.If then enter step S106; If not, then enter step S111.
Step S106 judges whether the operation of described mouse or keyboard is the operation of key search.If then enter step S107; If not, then enter step S111.
Described input operation might be and the relevant operation of ongoing other processes of client, also may be the operation of relevant this key search process place webpage, and this type of information is meaningless for this process.
Described input operation also may be the setting operation relevant with this process, should carry out corresponding setting.
When input operation is operated for starting key search, then start the process of associated keyword retrieval.
The determination methods of above-mentioned information determines according to the mode of the startup key search operation that sets in advance.Be input as example with mouse,, during click simultaneously, judge that then this is operating as control operation, forward step S111 to, carry out control and treatment when the instructs cursor of mouse is arranged on some and this process of this process place webpage relevant control knob or Control-Menu.If the instructs cursor of mouse is positioned on certain literal of information content part of webpage and carries out mouse when double-clicking (perhaps using cursor of mouse to drag and select passage), then description operation information is key search.
Step S107 obtains key word, and this key word is sent to the key search server; Simultaneously, generate display message in client, this information can be information or other any information of user waiting prompt result for retrieval.
Described key search module reads the key word that the user selectes, and after reading this key word, this key word is sent to the key search server by network.
When reading the key word that the user selectes, described display module generates display message, informs that the user retrieves.
Described selected key word has multiple implementation under prior art.A kind of preferred mode is to adopt cursor of mouse to select the key word that needs in the webpage.For example the mouse instructs cursor is moved on the key word that needs inquiry, carry out double click operation, perhaps drag the mouse instructs cursor and select a phrase or one section word as key word.Certainly, described selected key word also can adopt other multiple modes such as cursor key of keyboard to carry out.
Described key word is a literal arbitrarily in the content of current web page, comprises individual character, word, phrase, sentence.Whether can obtain Query Result and depend on whether store relevant content in the key search server, but user side can be selected key word arbitrarily in web page contents.If there is not related content in the retrieval server, then retrieval server can provide result for retrieval according to immediate key word.
Described display module generates the method for display message, has multiple mode to realize under prior art.A kind of preferred scheme is to adopt the mode that generates floating frame to show relevant information.This kind mode can avoid influencing the information that the user reads former webpage.This floating frame itself has the action button relevant with this floating frame, so that this floating frame is controlled, for example this floating frame is carried out convergent-divergent, and drags this floating frame or close this floating frame etc.Can also have in this floating frame and the more relevant buttons of retrieval, be used to start the operation relevant, for example store result for retrieval into assigned address etc. with retrieval.The display position of described floating frame is a benchmark with the key word position, and described floating frame can drag to the optional position.
Described key search server is the private server that key search information is provided for the content of certain webpage or certain class webpage.The content of this server can according at the content and the function of webpage be provided with specially, and be convenient to upgrade at any time according to user's retrieval situation.
Step S108 retrieves at the key search server according to described key word.
After described key search server obtains described key word, in the searching database of this server, retrieve, obtain the relevant information corresponding with this key word.
Step S109 is converted to suitable form with obtaining result for retrieval, is sent to client.
Described key search server is converted into suitable form with this result for retrieval after obtaining result for retrieval, outputs to client.
The purpose of described format conversion is that result for retrieval correctly is presented in the webpage with the coding of current web page.In order to know the coded system of current web page, before display result was turned back to client, server end was judged the coding of the described key word of reception, obtains the coding that current web page uses.For example, Chang Yong web page coding has utf-8, forms such as gb2312.
Step S110, client receives described result for retrieval, and shows in display window.
Described result for retrieval is read by the display module of client, and according to this result for retrieval corresponding information is shown in the floating frame.
So far, described retrieving finishes.
Step S111 judges whether user's operation is the control operation of relevant this retrieval process.If then enter step S112; If not, then return step S103.
Step S112 carries out described control operation, returns step S103 after finishing.
If input operation is that the key search process is carried out control operation, the control operation that then described control module is correlated with according to command content.Described operation comprises the various associative operations with key search.For example, open or close the key search function, enter key search help etc.The mode of operation of choosing key word is preset in the control module, but also can carry out corresponding setting, changes the key word mode of operation that presets.
If this operation is not the operation relevant with this retrieval process, then this process is not done any processing to it.
Generation of this process and operation all are based on the webpage at its place, when this webpage is closed, then will finish simultaneously with the produced simultaneously retrieval process of this webpage, and shared system resource will be released.
Please referring to Fig. 2, this figure is an application example of the present invention, and this example is that method provided by the invention is applied to word enquiring.Background is one piece of webpage that the content of opening is an english article among this figure, when the user double-clicks the about key word in the webpage, the instant playback floating frame, floating frame is display reminding information at first, this information prompting is being retrieved or other content, after obtaining result for retrieval, then show result for retrieval, i.e. the contents such as explanation of relevant this English word that inquiry obtains.Also have some buttons relevant in this floating frame with the window operation of this window.Use this method to realize word enquiring, can replenish special query contents at any time, be particularly suitable for carrying out the occasion of english teaching on the net.
The above only is a preferred implementation of the present invention; should be pointed out that for those skilled in the art, under the prerequisite that does not break away from the principle of the invention; can also make some improvements and modifications, these improvements and modifications also should be considered as protection scope of the present invention.