CN102375857A - Search method and device - Google Patents

Search method and device Download PDF

Info

Publication number
CN102375857A
CN102375857A CN2010102639312A CN201010263931A CN102375857A CN 102375857 A CN102375857 A CN 102375857A CN 2010102639312 A CN2010102639312 A CN 2010102639312A CN 201010263931 A CN201010263931 A CN 201010263931A CN 102375857 A CN102375857 A CN 102375857A
Authority
CN
China
Prior art keywords
result
search
page searching
page
uin
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.)
Granted
Application number
CN2010102639312A
Other languages
Chinese (zh)
Other versions
CN102375857B (en
Inventor
库宇
张丽
刘红杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201010263931.2A priority Critical patent/CN102375857B/en
Publication of CN102375857A publication Critical patent/CN102375857A/en
Application granted granted Critical
Publication of CN102375857B publication Critical patent/CN102375857B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a search method, which comprises the following steps: A. when any type of search command is received, beginning to time; B. determining whether a command for switching search types is received or not before the timing moment is reached, if so, restarting to time, and repeatedly performing the step B, and otherwise performing a step C when the timing moment is reached,; and C. asking for search result data from a server, and displaying. The invention also discloses a search device. According to the method and the device disclosed by the invention, the charge capacity of the serve can be lowered.

Description

A kind of searching method and device
Technical field
The present invention relates to computer technology, particularly a kind of searching method and device.
Background technology
At present,, received liking of users deeply, not only in amusement and recreation at ordinary times, and also obtained widespread use in routine duties though the microblogging series products also is in the infancy.
The user can search for own users interest and topic etc. through self client on microblogging, search for the reciprocal process that all will trigger between client and the server each time.Specifically; Said reciprocal process comprises: user end to server sends request; Wherein carry key (Key) value (being search key); Server is searched for according to the key value that receives, and returns search result data to client, and client is shown to the user with the search result data that receives.
But can there be certain problem in aforesaid way in practical application, such as: suppose that user A need carry out user search; Client can trigger once and the reciprocal process between the server so, if user A has not switched search-type before receiving the search result data that server returns, as has switched to the topic search; Client then needs to trigger once and the reciprocal process between the server again so; Like this, reciprocal process before just has been wasted, and that is to say; The operation of being carried out before the server is idle work, has increased the charge capacity of server in vain.
Summary of the invention
In view of this, fundamental purpose of the present invention is to provide a kind of searching method, can reduce the charge capacity of server.
Another object of the present invention is to provide a kind of searcher, can reduce the charge capacity of server.
For achieving the above object, technical scheme of the present invention is achieved in that
A kind of searching method, this method comprises:
A, when the search instruction that receives to arbitrary type, pick up counting;
B, confirm before arriving regularly constantly, whether to have received the instruction of switching search-type, if, then restart timing, and repeated execution of steps B, otherwise, when arriving regularly constantly, execution in step C;
C, to the server requests search result data, and show.
A kind of searcher comprises: first processing unit and second processing unit;
Said first processing unit is used for when receiving the search instruction that is directed against arbitrary type, picking up counting; And confirmed before arriving regularly the moment; Whether received the instruction of switching search-type, if then restart timing; And confirmed once more before arriving regularly the moment; Whether received the instruction of switching search-type, and the like, otherwise; When arriving regularly the moment, notify said second processing unit to carry out self function;
Said second processing unit is used for after the notice that receives said first processing unit, to the server requests search result data, and showing.
It is thus clear that; Adopting technical scheme of the present invention, when needs carry out the search of arbitrary type, is not immediately to the server requests search result data; But wait for a period of time; And then to the server requests search result data, thereby avoided the problem of waste reciprocal process of problem in the prior art to a certain extent, and then reduced the charge capacity of server.
Description of drawings
Fig. 1 be scheme according to the invention based on the system architecture synoptic diagram.
Fig. 2 is the process flow diagram of the inventive method embodiment.
Fig. 3 is the composition structural representation of apparatus of the present invention embodiment.
Fig. 4 is the composition structural representation of second processing unit 32 shown in Figure 3.
Embodiment
To the problem that exists in the prior art, a kind of brand-new search plan is proposed among the present invention, can reduce the charge capacity of server.Realize with regard to concrete; Scheme according to the invention can adopt the design philosophy of hierarchical model; Relevant logic function is encapsulated in the level, expresses through abstract as far as possible data structure such as interface and pure virtual function between layer and the layer, so that the reusability of code is better.Fig. 1 be scheme according to the invention based on the system architecture synoptic diagram.As shown in Figure 1, mainly comprise presentation layer, Business Logic and data Layer; Wherein, presentation layer is mainly used in the mutual of encapsulation and user, and Business Logic mainly is responsible for functional logical process and state storage, and data Layer mainly is responsible for Data Acquisition and tissue.
Based on the said system framework, Fig. 2 is the process flow diagram of the inventive method embodiment.As shown in Figure 2, may further comprise the steps:
Step 21: when receiving the search instruction that is directed against arbitrary type, pick up counting.
The search of said arbitrary type can be meant search subscriber or search topic etc.Imported a certain key (Key) value such as the user; And the button of having clicked the search subscriber correspondence (in practical application, can be shown to key value input window of user, corresponding two search-type selector buttons; One is " user search "; One is " topic search "), can confirm that so then the user need be according to this key value search subscriber, and pick up counting.
Step 22: confirm before arriving regularly the moment, whether to have received the instruction of switching search-type, if then execution in step 23, otherwise, execution in step 24.
Step 23: restart timing, and repeated execution of steps 22.
Step 24: when arriving regularly the moment, to the server requests search result data, and show, then process ends.
The executive agent of above-mentioned each step is the client at user place.
In the present embodiment, when receiving to behind the search instruction of arbitrary type, be not trigger immediately and server between reciprocal process; Promptly to the server requests search result data etc., but wait for scheduled duration, switch the search-type instruction if in this scheduled duration, receive; Then trigger and server between reciprocal process; If in this scheduled duration, received the instruction of switching search-type, then restart timing, and the like.The concrete value of said scheduled duration can be decided according to the actual requirements, such as can be 300 milliseconds.
If in the scheduled duration intra search-type; So according to existing processing mode; Need to trigger twice and server between reciprocal process, promptly trigger once and trigger once, and after adopting scheme according to the invention according to the search-type after switching according to the search-type before switching; Only need trigger once and get final product (suppose the user has been switched within 300 milliseconds after the search-type do not switch search-type once more), thereby reduce the charge capacity of server.
Preferably, after having switched search-type, can give tacit consent to, repeat to import identical key value thereby need not the user based on switching the key value that receives before the search-type to the server requests search result data.
How switching search-type is prior art, such as: switch to the search topic from search subscriber, at first according to key value to the server requests search result data; And, refresh the page with the removing of the search subscriber item control in the current container, show to load (Loading) animation; Then after receiving the search result data that server returns; Utilize it that search topic item control is carried out initialization, and the search topic item control after the initialization is inserted in the current container, refresh the page afterwards once more; Remove the Loading animation, the display of search results page.
If client to server requests search result data; Consider that server itself needs the regular hour to carry out relevant treatment; And server is sent to client with search result data and also needs the regular hour; So client need just can receive the search result data that server returns after after a while, if during this period of time switched search-type, the search result data of being asked before the switching search-type that receives so subsequently obviously is exactly no longer to need; Server can carry corresponding call back function in the search result data of returning; Client can determine whether the search result data that receives is required data according to this call back function, if not, can directly abandon.
Preferably, in the step 24, can show the required search result data of first result of page searching to server requests earlier, and first result of page searching is shown; Then, when receiving page-turning instruction, show the search result data that next result of page searching is required, next result of page searching is shown to server requests, and the like.That is to say; Can be once to all search result data of server requests; But ask according to user's demand, like this, if the user promptly withdraws from search procedure or has switched search-type after only having checked first result of page searching; Then need not to ask to show the required search result data of follow-up each result of page searching, thereby reduced the volume of transmitted data between client and the server.
Perhaps; Consider that the user maybe rapid Continuous repeatedly ask page turning (in practical application, promptly show as rapid Continuous and repeatedly click " following one page " button), such as having asked continuously 4 times, the user finally can see so just is directed against the result of page searching that the 4th request is shown; If can be according to aforesaid way; Need obviously, 3 times all be wasted to 4 search result data of server requests.For this reason, in the step 24, can show the required search result data of first result of page searching to server requests earlier, and first result of page searching is shown; Then, when receiving page-turning instruction, pick up counting; And the number of the page-turning instruction that receives in the statistics scheduled duration, use the number that counts to add the number of pages of the current result of page searching that shows, obtain M as a result; Show M the search result data that result of page searching is required to server requests, M result of page searching shown, then when receiving page-turning instruction once more; Restart timing, and repeat the process of above-mentioned statistics, request and demonstration.The concrete value of said scheduled duration can be decided according to the actual requirements, such as can be 200 milliseconds.
Preferably; But client is the required search result data of each result of page searching of demonstration that arrives of cache request also; Like this, when receiving the instruction of returning a certain result of page searching of checking before checking, can directly from buffer memory, obtain the required search result data of this result of page searching of demonstration; After receiving new key value or switching search-type, can empty buffer memory.
In the prior art; When carrying out page turning, all be to adopt the mode of directly hiding original result of page searching and showing new result of page searching usually, in the scheme according to the invention; Can original result of page searching be removed gradually; New result of page searching is moved into gradually, promptly show a kind of level and smooth effect that moves, thereby promote user experience.In practical application; The said level and smooth effect that moves can realize in the following manner: two container controls are set, and one is used to carry original result of page searching, and another is used to carry new result of page searching; When the needs page turning; The search result data initialization that gets access to is filled in second container control, and first container control is removed original result of page searching gradually then, and second container control moves into new result of page searching gradually.
Have again; In the scheme according to the invention; The user end to server request shows that the process of the search result data that each result of page searching is required includes following two steps: at first, ask the corresponding uin tabulation of this result of page searching in batches to server, and this uin tabulation of buffer memory; Then, ask the corresponding details of each uin in the uin tabulation in batches, after server returns the corresponding details of each uin, can utilize its initialization control and show to server; But in actual applications; The sequencing of the details that each uin that server returns is corresponding maybe be inconsistent with the sequencing of each uin in the uin tabulation; And the sequencing of each uin is to confirm according to certain principle in the uin tabulation; The meeting comparison operators share the demand at family; User such as popularity is high comes the front; So; Need the corresponding details of each uin that receive be sorted according to the sequencing of each uin in the uin tabulation, and show the details that each uin is corresponding according to the order after the ordering.
So far, promptly accomplished introduction about the inventive method embodiment.
Based on above-mentioned introduction, Fig. 3 is the composition structural representation of apparatus of the present invention embodiment.As shown in Figure 3, comprising: first processing unit 31 and second processing unit 32.
First processing unit 31 is used for when receiving the search instruction that is directed against arbitrary type, picking up counting; And confirmed before arriving regularly the moment; Whether received the instruction of switching search-type, if then restart timing; And confirmed once more before arriving regularly the moment; Whether received the instruction of switching search-type, and the like, otherwise; When arriving regularly the moment, notify second processing unit 32 to carry out self function;
Second processing unit 32 is used for after the notice that receives first processing unit 31, to the server requests search result data, and showing.
Wherein, second processing unit 32 can be further used for, if switched search-type, gives tacit consent to according to the key value that receives before the switching search-type to the server requests search result data.
Fig. 4 is the composition structural representation of second processing unit 32 shown in Figure 3.As shown in Figure 4, comprising: request subelement 321 and demonstration subelement 322;
Request subelement 321; Be used for after the notice that receives first processing unit 31; Show the required search result data of first result of page searching to server requests; And first result of page searching shown by showing subelement 322; When receiving page-turning instruction; Show the search result data that next result of page searching is required to server requests, and next result of page searching is shown by demonstration subelement 322; Perhaps; Show the required search result data of first result of page searching to server requests; And first result of page searching shown by showing subelement 322; When receiving page-turning instruction; Pick up counting; And the number of the page-turning instruction that receives in the statistics scheduled duration; Add the number of pages of the current result of page searching that shows with the number that counts; Obtain M as a result; Show M the search result data that result of page searching is required to server requests, M result of page searching shown by demonstration subelement 322, then when receiving page-turning instruction; Restart timing, and repeat above-mentioned statistics; Request and the process that shows;
Wherein, show that to server requests the required search result data of each result of page searching comprises: ask the corresponding uin tabulation of result of page searching in batches to server, and this uin tabulation of buffer memory; Ask the corresponding details of each uin in the uin tabulation in batches to server; Sequencing according to each uin in the uin tabulation sorts to the corresponding details of each uin that receive, and shows the details that each uin is corresponding according to the order after the ordering;
Show subelement 322, be used to show each result of page searching, wherein, to each result of page searching after first search result interfaces, according to original result of page searching is removed gradually, the mode that new result of page searching is moved into gradually shows.
Above-mentioned request subelement 321 also can be further used for; The search result data that each result of page searching of the demonstration that cache request arrives is required; When receiving the instruction of returning arbitrary result of page searching of checking before checking, from buffer memory, obtain and show the required search result data of this result of page searching.
The concrete workflow of Fig. 3 and 4 shown device embodiment repeats no more please with reference to the respective description among the method embodiment shown in Figure 2 here.
The above is merely preferred embodiment of the present invention, and is in order to restriction the present invention, not all within spirit of the present invention and principle, any modification of being made, is equal to replacement, improvement etc., all should be included within the scope that the present invention protects.

Claims (11)

1. a searching method is characterized in that, this method comprises:
A, when the search instruction that receives to arbitrary type, pick up counting;
B, confirm before arriving regularly constantly, whether to have received the instruction of switching search-type, if, then restart timing, and repeated execution of steps B, otherwise, when arriving regularly constantly, execution in step C;
C, to the server requests search result data, and show.
2. method according to claim 1 is characterized in that, said step C comprises:
C1, show the required search result data of first result of page searching, and first result of page searching is shown to server requests;
C2, when receiving page-turning instruction, show the search result data that next result of page searching is required to server requests, and next result of page searching shown, then repeated execution of steps C2;
Perhaps,
C1, show the required search result data of first result of page searching, and first result of page searching is shown to server requests;
C2, when receiving page-turning instruction; Pick up counting, and the number of the page-turning instruction that receives in the statistics scheduled duration, use the number that counts to add the number of pages of the current result of page searching that shows; Obtain M as a result; Show M the search result data that result of page searching is required to server requests, and M result of page searching shown, then repeated execution of steps C2.
3. method according to claim 2 is characterized in that, when showing new result of page searching, original result of page searching is removed gradually, and new result of page searching is moved into gradually.
4. method according to claim 2 is characterized in that, this method further comprises:
The search result data that each result of page searching of the demonstration that cache request arrives is required;
When receiving the instruction of returning arbitrary result of page searching of checking before checking, from buffer memory, obtain and show the required search result data of this result of page searching, and this result of page searching is shown.
5. method according to claim 2 is characterized in that, saidly shows that to server requests the required search result data of each result of page searching comprises:
Ask the corresponding uin tabulation of result of page searching in batches to server, the said uin tabulation of buffer memory;
Ask the corresponding details of each uin in the said uin tabulation in batches to server;
Sequencing according to each uin in the said uin tabulation sorts to the corresponding details of each uin that receive, and shows the corresponding details of said each uin according to the order after the ordering.
6. method according to claim 1 is characterized in that, saidly comprises to the server requests search result data: if switched search-type, then give tacit consent to according to switching the key value that receives before the search-type to the server requests search result data.
7. method according to claim 1; It is characterized in that; This method further comprises: if after the server requests search result data; Receive before the search result data that server returns, received the instruction of switching search-type, then abandon the search result data of being asked before the switching search-type that receives subsequently.
8. a searcher is characterized in that, comprising: first processing unit and second processing unit;
Said first processing unit is used for when receiving the search instruction that is directed against arbitrary type, picking up counting; And confirmed before arriving regularly the moment; Whether received the instruction of switching search-type, if then restart timing; And confirmed once more before arriving regularly the moment; Whether received the instruction of switching search-type, and the like, otherwise; When arriving regularly the moment, notify said second processing unit to carry out self function;
Said second processing unit is used for after the notice that receives said first processing unit, to the server requests search result data, and showing.
9. device according to claim 8 is characterized in that, said second processing unit is further used for, if switched search-type, then gives tacit consent to according to the key value that receives before the switching search-type to the server requests search result data.
10. device according to claim 8 is characterized in that, said second processing unit comprises: request subelement and demonstration subelement;
The described request subelement; Be used for after the notice that receives said first processing unit; Show the required search result data of first result of page searching to server requests; And first result of page searching shown by said demonstration subelement; When receiving page-turning instruction; Show the search result data that next result of page searching is required to server requests, and next result of page searching is shown by said demonstration subelement; Perhaps; Show the required search result data of first result of page searching to server requests; And first result of page searching shown by said demonstration subelement; When receiving page-turning instruction; Pick up counting; The number of the page-turning instruction that receives in the statistics scheduled duration; Add the number of pages of the current result of page searching that shows with the number that counts; Obtain M as a result; Show M the search result data that result of page searching is required to server requests, M result of page searching shown by said demonstration subelement, then when receiving page-turning instruction; Restart timing, and repeat above-mentioned statistics; Request and the process that shows;
Wherein, show that to server requests the required search result data of each result of page searching comprises: ask the corresponding uin tabulation of result of page searching in batches to server, the said uin tabulation of buffer memory; Ask the corresponding details of each uin in the said uin tabulation in batches to server; Sequencing according to each uin in the said uin tabulation sorts to the corresponding details of each uin that receive, and shows the corresponding details of said each uin according to the order after the ordering;
Said demonstration subelement is used to show each result of page searching, and wherein, to each result of page searching after first search result interfaces, according to original result of page searching is removed gradually, the mode that new result of page searching is moved into gradually shows.
11. device according to claim 10; It is characterized in that; The described request subelement is further used for; The search result data that each result of page searching of the demonstration that cache request arrives is required when receiving the instruction of returning arbitrary result of page searching of checking before checking, is obtained from buffer memory and is shown the required search result data of this result of page searching.
CN201010263931.2A 2010-08-24 2010-08-24 Search method and device Active CN102375857B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201010263931.2A CN102375857B (en) 2010-08-24 2010-08-24 Search method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201010263931.2A CN102375857B (en) 2010-08-24 2010-08-24 Search method and device

Publications (2)

Publication Number Publication Date
CN102375857A true CN102375857A (en) 2012-03-14
CN102375857B CN102375857B (en) 2014-08-13

Family

ID=45794479

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201010263931.2A Active CN102375857B (en) 2010-08-24 2010-08-24 Search method and device

Country Status (1)

Country Link
CN (1) CN102375857B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104424199A (en) * 2013-08-21 2015-03-18 阿里巴巴集团控股有限公司 Search method and device
CN105138246A (en) * 2015-07-29 2015-12-09 百度在线网络技术(北京)有限公司 Method and apparatus for switching search type
CN107340886A (en) * 2017-08-04 2017-11-10 腾讯科技(深圳)有限公司 A kind of soft keyboard state determines method, apparatus, medium and terminal
CN112163144A (en) * 2020-09-29 2021-01-01 四川虹魔方网络科技有限公司 Web front-end search optimization method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050278313A1 (en) * 2004-06-10 2005-12-15 International Business Machines Corporation Search scheduling and delivery
CN101094135A (en) * 2006-06-23 2007-12-26 腾讯科技(深圳)有限公司 Method and system for extracting information of content in Internet
CN101543070A (en) * 2007-04-10 2009-09-23 电子部品研究院 Method for asynchronous multimedia retrieval
CN101788991A (en) * 2009-06-23 2010-07-28 北京搜狗科技发展有限公司 Updating reminding method and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050278313A1 (en) * 2004-06-10 2005-12-15 International Business Machines Corporation Search scheduling and delivery
CN101094135A (en) * 2006-06-23 2007-12-26 腾讯科技(深圳)有限公司 Method and system for extracting information of content in Internet
CN101543070A (en) * 2007-04-10 2009-09-23 电子部品研究院 Method for asynchronous multimedia retrieval
CN101788991A (en) * 2009-06-23 2010-07-28 北京搜狗科技发展有限公司 Updating reminding method and system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104424199A (en) * 2013-08-21 2015-03-18 阿里巴巴集团控股有限公司 Search method and device
CN104424199B (en) * 2013-08-21 2018-07-24 阿里巴巴集团控股有限公司 searching method and device
CN105138246A (en) * 2015-07-29 2015-12-09 百度在线网络技术(北京)有限公司 Method and apparatus for switching search type
CN107340886A (en) * 2017-08-04 2017-11-10 腾讯科技(深圳)有限公司 A kind of soft keyboard state determines method, apparatus, medium and terminal
CN112163144A (en) * 2020-09-29 2021-01-01 四川虹魔方网络科技有限公司 Web front-end search optimization method

Also Published As

Publication number Publication date
CN102375857B (en) 2014-08-13

Similar Documents

Publication Publication Date Title
US10853099B2 (en) System, method, and apparatus for rendering interface elements
CN110300328B (en) Video playing control method and device and readable storage medium
CN101493751B (en) Multi-window manager of embedded graph system
CN102449602A (en) System and method for reducing startup cost of a software application
JP2013542522A (en) Method and device for displaying messages
CN104850296B (en) Method and device for displaying page content
CN110636366A (en) Video playing processing method and device, electronic equipment and medium
CN102143156A (en) Desktop sharing method and device
CN107003907A (en) A kind of data processing method and data processing equipment
CN112702261B (en) Information display method and device and electronic equipment
CN102298491B (en) Embedded graphical interface system and image generation method thereof
CN105912610A (en) Method and device for guiding share based on character information
CN109309712A (en) Data transmission method, server and the storage medium called based on interface asynchronous
CN102375857A (en) Search method and device
CN106201224A (en) The method and device that a kind of batch data processes
CN105335036A (en) Input interaction method and input method system
CN110020300A (en) A kind of browser page synthetic method and terminal
CN110008027A (en) Operation method, device, terminal and the storage medium of process
CN110347459A (en) A kind of window minimizes method, apparatus, storage medium and interactive intelligent tablet computer
CN102207888A (en) Method and device for managing timer
CN109725788A (en) Processing method, device, processor and the terminal of user interface interaction
CN105872767A (en) Method and apparatus for guiding sharing based on user behaviors
CN101655989A (en) 3D special-efficacy graphic user interface system and method of mobile phone
CN112866092B (en) Group chat creation method and group chat creation device
CN103648047A (en) Resource searching method and system of intelligent television

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant