The present invention relates generally to managing large query result sets corresponding with a search.
When a user initiates a search, as for example, when using a web search engine, a set of results corresponding with a user query may be returned. Increasingly, online web searching tends to return large query result sets consisting of numerous results. A user navigating large query result sets may, in some examples, increase demands on network resources. Managing large query result sets, therefore, becomes increasingly important in order to provide more effective network services deployment.
The following presents a simplified summary of some embodiments of the invention in order to provide a basic understanding of the invention. This summary is not an extensive overview of the invention. It is not intended to identify key/critical elements of the invention or to delineate the scope of the invention. Its sole purpose is to present some embodiments of the invention in a simplified form as a prelude to the more detailed description that is presented below.
Methods and computer program products are presented for managing a query result set in response to a search, including: generating a user request corresponding with a portion of the query result set, responsive to the portion of the query result set being resident on a client cache, returning the portion of the query result set corresponding with the user request to a client table, responsive to the user request not having been sent to an application server, adding the user request to an inflight queue, sending the user request to the application server, returning the portion of the query result set corresponding with the user request to the client cache, and returning the portion of the query result set corresponding with the user request to the client table, and responsive to the user request having been sent to the application server, adding the user request to a blocked cache queue.
In other embodiments, systems for managing a query result set are presented including: a client configured to send user requests and to receive query result sets corresponding with the user requests, the client including, a client table for displaying a portion of the query result set, and a client cache for storing the query result set, where the client cache includes, a first queue for tracking inflight user requests, the inflight user requests representing a first number of user requests corresponding with a first portion of the query result set, a second queue for tracking blocked user requests, the blocked user requests representing a second number of user requests corresponding with a second portion of the query result set, a third queue for tracking blocked cache user requests, the blocked cache user request representing a third number of user requests corresponding with a third portion of the query result set, and a request result table for storing the query result set from the first queue, the second queue, and the third queue in an ordered and contiguous fashion, the request result table configured to provide the portion of the query result set to the client table in response to the user request.
The present invention is illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings and in which like reference numerals refer to similar elements and in which:
As will be appreciated by one skilled in the art, the present invention may be embodied as a system, method or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment (including firmware, resident software, micro-code, etc.) or an embodiment combining software and hardware aspects that may all generally be referred to herein as a “circuit,” “module” or “system.” Furthermore, the present invention may take the form of a computer program product embodied in any tangible medium of expression having computer usable program code embodied in the medium. Any combination of one or more computer usable or computer readable medium(s) may be utilized. The computer-usable or computer-readable medium may be, for example but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, device, or propagation medium. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CDROM), an optical storage device, a transmission media such as those supporting the Internet or an intranet, or a magnetic storage device. Note that the computer-usable or computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via, for instance, optical scanning of the paper or other medium, then compiled, interpreted, or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory. In the context of this document, a computer-usable or computer-readable medium may be any medium that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. The computer-usable medium may include a propagated data signal with the computer-usable program code embodied therewith, either in baseband or as part of a carrier wave. The computer usable program code may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc.
Computer program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the “C” programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet Service Provider).
The present invention is described below with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable medium that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable medium produce an article of manufacture including instruction means which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks
Referring now to the Figures, the flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Web search engines such as Google and Yahoo allow a user to enter a query and return results. A limited number of results may be displayed one page at a time. Typically, if the result the user is looking for is not available on the displayed page, the user may click a link to display additional pages having additional results. With the introduction of Web 2.0 technologies such as asynchronous JavaScript and XML (AJAX) and asynchronous request management there is no need to keep the outdated paging model for Web applications. Modern JavaScript libraries such as Open Rico and DOJO have implemented rich client technologies for displaying results in a single window with a scroll bar that provides the ability to scroll through all the results without forcing the user to navigate through many pages.
Several challenges arise when implementing rich clients that enable scrolling. One challenge encountered in implementing rich clients arises because a user can freely scroll forward to any position in a result list, which may adversely affect server performance. For example, a user initiating a search may retrieve a first set of results (e.g. results 1 to 20) from a server. If the user immediately scrolls to the last set of results (e.g. results 9980 to 10000) a server may experience performance degradation a) because conventional servers may not be configured to skip forward through sets of results, and b) because conventional servers may be required to re-execute a query to accommodate the scrolling request. The problem is exacerbated if the user then skips backward to the first set of results. As above, conventional servers may not be configured to skip backward through sets of results and conventional servers may be required to re-execute a query. Moreover, the problem is further exacerbated if the user skips forward and backward to intermediate search results, which may result in multiple re-executions of queries. With each re-execution of a query, server resources are further taxed which may result in degradation of service.
Another challenge encountered in such a scheme is that communication ports may be overburdened by server traffic in response to user requests. As may be appreciated, each query that is executed requires some communication traffic. When a server executes multiple queries in response to a user scrolling haphazardly through a query result set, communication ports may be unduly burdened. This may be particularly undesirable in high traffic or low bandwidth networks.
Client 102 may be configured to send user requests to application server 120 and receive handle query result sets from application server 120. As utilized herein, a query result set corresponds with the results of a search. Further, as utilized herein, a user request corresponds with a requested portion of a query result set. Thus, a user may request a portion of a query result set through a user request such as by scrolling. The results of a user request may then be displayed on client table 104. Generally, a client table may be utilized for showing a limited view (or window) of a larger query result set. Users may change views by scrolling through displayed results without being blocked by the UI as in conventional solutions. Client 102 further includes client cache 106. In embodiments, client cache 106 may be configured to store a query result set in an ordered and contiguous fashion returned from application server 120 in request results table 108. In addition, in embodiments, request results table 108 may be configured to provide a portion of the query result set to client table 104. In order to efficiently process user requests, client cache 106 may utilize at least three queues (110, 112, and 114). In embodiments, queueinflight 110 may be configured to track inflight user requests. Inflight user requests correspond with requests made to and currently processed by an application server. Inflight user requests will be discussed in further detail below for
a) An initial condition of a request results table is WI=100 and WC=100. That is, the highest result requested from a server (i.e. WI) is 100 and the highest result received from a server (i.e. WC) is 100.
b) A user request for results 40 to 50 is made where RP=40 and RC=11.
Because the user request is resident in cache as indicated by WC, results 40 to 50 may be retrieved from cache (see a step 318).
Returning to
a) An initial condition of a request results table is WI=500 and WC=100. That is, the highest result requested from a server (i.e. WI) is 500 and the highest result received from a server and cached in client cache (i.e. WC) is 100.
b) A user request for results 50 to 250 is made where RP=50 and RC=201.
Blocked Cache Queue—In this example, since a portion of the query result set is being retrieved, but not yet fully received from server, the user request is moved to blocked cache queue to avoid multiple user requests to a server for a query result set that is already being processed. This is true even though at least some of the results may already be in client cache. As will be discussed subsequently, once inflight queue requests are processed, blocked cache queue requests may be displayed and removed from blocked cache queue.
The method continues to a step 316 to wait. Waiting, in embodiments, may include additional steps which will be discussed in further detail below for
a) An initial condition of a request results table is WI=100 and WC=100. That is, the highest result requested from a server (i.e. WI) is 100 and the highest result received from a server (i.e. WC) is 100.
b) A user request for results 500 to 600 is made where RP=500 and RC=101.
Modification—In embodiments, modification may result in RP=101 and RC=499 in accordance with the following formulas:
R
P(modified)=WI+1=101
R
C(modified)=RP+RC−WI−1=499; and
W
I(modified)=RP+RC−1=599.
As may be appreciated, the method modifies the user request to include otherwise non-contiguous results. Thus, if a user scrolls backward, a re-execution of a query may be avoided.
Returning to
As utilized herein, the terms queueinflight and inflight queue are synonymous. Further, the terms queueblocked and blocked queue are synonymous. Still further, the terms queueblocked
a) Initial conditions are as follows:
b) Conditions after utilizing methods described in
If R2 is the first inflight request response returned by the server, then the value of RP2 is compared with all other inflight RP values (i.e. 101, 600, and 700). As may be seen, RP2 is out of order with respect to RP1, so the method adds R2 to blocked queue and removes R2 from the inflight queue (see a step 406). Thus, if the method determines at a step 404 that the inflight request response is out of order, the method continues to a step 406 to add the inflight request response to blocked queue and remove the inflight request response from inflight queue whereupon the method ends.
c) Conditions after R2 is examined utilizing methods described herein:
Returning to a step 404, if the method determines that the inflight request response is not out of order, the method continues to a step 408 to return the inflight request response (or query result set) to a client cache and to return the query result set to a client table, whereupon the method continues to a step 410 to remove the inflight request response from the inflight queue. The method then determines whether the inflight queue request is empty at a step 412. If the method determines at a step 412 that the inflight queue is not empty, the method ends. In some embodiments, the method returns to a wait state. If the method determines at a step 412, that the inflight queue is empty, the method proceeds to a step 414 to process blocked queue, which step will be discussed in further detail below for
d) Conditions after RI is examined utilizing methods described herein:
e) Conditions after R3 is examined utilizing methods described herein:
Since inflight queue is empty, requests in blocked queue are handled according to
f) Conditions after RP2 is examined following the steps in
g) Conditions after RP3 is examined following the steps in
h) Conditions after RP4 is examined following the steps in
While this invention has been described in terms of several embodiments, there are alterations, permutations, and equivalents, which fall within the scope of this invention. It should also be noted that there are many alternative ways of implementing the methods and apparatuses of the present invention. Furthermore, unless explicitly stated, any method embodiments described herein are not constrained to a particular order or sequence. Further, the Abstract is provided herein for convenience and should not be employed to construe or limit the overall invention, which is expressed in the claims. It is therefore intended that the following appended claims be interpreted as including all such alterations, permutations, and equivalents as fall within the true spirit and scope of the present invention.