Predictive networking

A method and system for predicting server database requests by a client. A database contains a plurality of command sets likely to be sent by a client to a server. The server compares statements received from the client with command sets stored in the database. If the server recognizes a pattern with a command set stored in the database, the server predicts that the client will send this command set and executes the statements contained therein.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention generally relates to distributed computer networks and more specifically to a method and system for improving data transfer between a client and server computer.

2. Description of the Related Art

Due to the prevalence of distributed computer networks and development of mass storage and low priced disk devices, database systems of the server-client form have recently increased. Generally, a distributed computer system comprises a collection of loosely coupled machines (mainframe, workstations or personal computers) interconnected by a communication network.

Through a distributed computer system, a user or client may access various servers to store information, print documents, access databases, acquire client/server computing or gain access to the Internet. These services often require software applications running on the user's desktop to interact with other applications that might reside on one or more remote machines. Thus, in a client/server computing environment, one or more clients and one or more servers, along with the operating system and various inter-process communication (IPC) methods or mechanisms, form a composite that permits distributed computation, analysis and presentation.

In a typical distributed computer network, many clients are simultaneously coupled to the server. Server database requests by the many clients may occur concurrently thereby slowing the transmission of data to each of the clients. Conventionally, when a client issues a database request to the server, the server must wait until it receives all of the statements in the database request before it can start processing the request. This results in wasted processing time and creates unnecessary overhead in the network.

Therefore, there is a need for a method and system that allows a server to service client requests more efficiently and reduce the overhead time associated with servicing requests.

SUMMARY OF THE INVENTION

The embodiments generally relate to the transfer of information over computer networks and in particular to the transfer of information between a client and server computer. Still more particularly, the embodiments relate to a method of optimizing the transfer of information between a client and server by predictively completing a task not yet explicitly requested by the client.

In one embodiment a method and system is provided for predicting server requests from a client. The server comprises a database of commands likely to be sent by the client. The server receives a portion of a command from the client and determines whether a matching command exists in the database of commands. If a match is found, the server executes the matched command. The server then receives the remaining portion of the client command and determines if the matched command matches the client command. If so, the server sends the results to the client.

In another embodiment, the server and client comprise an identical database of commands likely to be sent by the client. The server receives a portion of a command from the client and determines whether a matching command exists in the database of commands. The server and the client determine if a matching command exists in the database of commands. If so, the server executes the matched command and sends the results to the client.

In still another embodiment, the server builds a database of commands likely to be sent by a client. The database of commands are commands recognized by the server as likely to repeat by a particular client user or client application. The server receives a command from the client and determines if the command had been previously sent. If so, the server stores the command in the database.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT

The embodiments provide a method and system to predict requests of a server, by a client, in a computer network environment. In many cases, server requests are predictable because they must follow strict construction rules set forth by the application program interface (API) used by the client and server. Anticipating a client request significantly improves overall network speed. In one embodiment, a client sends a database request to the server by sequentially sending each statement in the request. The sever collects the statements sent by the client and determines if it can recognize a pattern in the database request. If the server is able to predict the remaining statements in the database request, the server executes the predicted database request.

In another embodiment, the server predicts the behavior of the client while the client, using the same prediction method as the server, generates the same prediction as the server. As an illustration, the client prepares a database request and sequentially sends the database request statements to the server. When the server recognizes a pattern of statements sent by the client, the server executes a predicted command set and sends the results to the client. Because the client executes the same predictive method in tandem with the server, the client can determine whether and when the server has correctly predicted subsequent statements. Since the client knows how the server will predict its behavior, the client waits for the results from the server without sending the remaining statements in the database request.

In still another embodiment, the server keeps track of requests made upon it by a client application so that it can predict future behavior based on past usage. As an illustration, each application executed by a client develops unique repetitive patterns of requests made upon a server. The server stores these patterns for use in predicting the future behavior of the client's applications. When the server recognizes a predicted pattern, the server executes the predicted request and sends the results to the client.

One embodiment is described in the general context of computer-executable instructions, such as program modules, being executed by a computer, such as a personal computer, for example. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types.

The program modules that define the functions of the present embodiments may then be placed on a signal-bearing medium to provide a signal-bearing medium. The signal bearing media, include, but are not limited to, (i) information permanently stored on non-writable storage media, (e.g., read-only memory devices within a computer such as CD-ROM disks readable by a CD-ROM drive); (ii) alterable information stored on writable storage media (e.g., floppy disks within a diskette drive or hard-disk drive); and (iii) information conveyed to a computer by a communications medium, such as through a computer or telephone network, including wireless communications. The latter embodiment specifically includes information downloaded from the Internet and other networks. Such signal-bearing media, when carrying computer-readable instructions that direct the functions of the present invention, represent embodiments of the present invention.

FIG. 1illustrates a block diagram of a networked computer system100. The system100comprises a client computer108and a server computer104. In one embodiment, client computer system108connects to a network110by means of a connecting device106. Also connected to the network110are one or more server computers104connected by means of their own connecting device102. Those skilled in the art will appreciate that these connecting devices may take various forms, including modems, token-ring hubs, Ethernet hubs and other network enabling devices. The server104includes an area of system memory and/or disk storage space dedicated to storing and maintaining a predicted command database112. The server memory also includes an input buffer114and an output buffer116. Although only one client computer108is shown, any number of client computers may be connected to the network110.

FIG. 2shows an illustrative embodiment of the client computer system108. In one embodiment, the client computer system108includes a central processing unit (CPU)206, a memory controller212, system memory208, disk storage202, and a disk storage controller204. Illustratively, the system108includes a display214,a keypad216and an interface port218. Illustratively, the interface port218may be a serial or parallel communications port that allows the client108to be connected to a network connecting device102. A portion of the system memory208is set aside for a command set database210. The command set database210stores sets of commands commonly used by the client when making requests of a server database.

FIG. 3shows an illustrative embodiment of the server computer system104. In one embodiment, the server computer system104includes a central processing unit (CPU)306, a memory controller312, system memory308, disk storage302, a disk storage controller304, and an interface port318. Illustratively, the interface port318may be a serial or parallel communications port that allows the server104to be connected to a network connecting device102. A portion of the system memory308is set aside for the command set database112, the input buffer114and the output buffer116. The command set database112stores sets of commands commonly used by a client when making requests of a server database. The input buffer114is a memory area used to store commands received from the client. The output buffer116is a memory area used to store the results of an executed command set received from the client108.

One embodiment illustrating a method of predicting a client request of a server is shown as a method400inFIG. 4. In one embodiment, the method400may be understood as illustrative of the operation of the system100. Therefore, reference is occasionally made toFIG. 1,FIG. 2andFIG. 3. The method400is entered at step402where the server104receives one of a plurality of statements in a command set. The statements are stored in the input buffer114. After each statement is received, the method400proceeds to step404.

At step404, the method400compares the sequence of statements contained in the input buffer114with command sets stored in the command set database112and queries if a match is found. The command set database112contains sets of statements representing routine service requests. The sequence of statements received in the input buffer114are matched against statements in the command set database112. If there is not a match with a command set, the method proceeds back to step402to receive further statements from the client. If there is a match, the method400proceeds to step408.

At step408, the server executes the statements in the command set that were matched in step404. The results of the executed command set are stored in the output buffer116. The method then proceeds to step410.

At step410, the server104receives the remaining statements from the client. The statements are stored in the input buffer114and are combined with the statements previously received to form a complete service request. The input buffer114now contains all of the statements in the command set sent by the client. The method then proceeds to step412.

At step412, the server compares the command set sent by the client, stored in the input buffer114, with the command set executed in step408. If the command sets are identical, the server has successfully predicted the behavior of the client by preparing the results of the client request prior to receiving the complete set of command statements from the client. In this case, the method400proceeds to step414. If the command sets are not identical, the sever has not successfully predicted the behavior of the client and the method400proceeds to step416.

At step416, the server clears its output buffer and undoes any changes made to its database as a result of executing the command set in step404. This occurs because the server has not correctly predicted the behavior of the client and must restore its database to a state prior to executing the command set performed in step408. The method400proceeds to step418.

At step418, the server executes the service request command set sent by the client stored in the input buffer. The results of executing the client service request are stored in the output buffer116. The method400proceeds to step414.At step414the server sends the results stored in the output buffer to the client. The method then proceeds back to step402to receive new commands from the client.

To illustrate the process of method400, assume that the client is preparing to send the following structured query language (SQL) command set to the server:

At line001, the client instructs the server to prepare to perform an SQL that includes three parameters (C1, C2, C3) for the returned information. The client will supply the values for the three parameters. The first two parameters (C1, C2) are set in the setString statements in lines002–003and are sent to the server. The client then sends line004, the final parameter (C3) to be set, to the server. Given this illustration, the server can make a prediction, after line004is received in the input buffer114, that the execute statement in line005is going to be sent next by the client.

This is because in the structure of an SQL request command set, the preparation statement in line001defined that the statements in lines002–004would necessarily have to be sent to the server before an execution instruction. It also follows that the execute statement at line005would have to be sent by the client so that server may process the previous command set. The ability of the server to predict subsequent statements before receiving them is made possible by storing an appropriate command set in the command set database112. In the present example, the command set data base112stores a command set reflecting the command set structure shown in lines001–005. Thus, after each received statement or series of statements, the server can take predictive steps to anticipate the next statements(s).

In another embodiment, the client comprises a command set database210, identical to the server command set database, to execute the prediction method400in parallel with the server. As an illustration, the server generates a predicted command set using method400based on commands received from the client and the client generates the same prediction using method400based on the commands it has sent to the server. Because the client is generating the same prediction as the server, the client does not send the remaining statements in a command set if the client determines that the prediction is correct. Since the client knows that the server has correctly anticipated the client's actions, the client is then free to process other data while waiting for the server to send the results. If the client receives an unpredicted result from the server, the client sends the complete command set request to the server along with a prediction unsuccessful flag. Upon receiving the prediction unsuccessful flag from the client, the server undoes the work performed when executing the wrongly predicted command set and executes the complete command set request sent by the client.

In still another embodiment, the server builds a database containing command sets commonly generated by a client's application. By keeping track of specific starting and ending points in what an application does, the server can predict that the pattern of server requests will hold for new requests. As an illustration, when the server receives the first statement in a command set sent to it by the client application, it compares the statement with the first statements in the built database of command sets. If a database command set has the identical first statement as the first statement sent by the client application, the server selects the database command set as the predicted behavior of the application. The server then executes the database command set.

To illustrate this embodiment, the following series of network setup calls are made by a user application before starting to send work to the server database system:

As an illustration of how the command set database is built, the server stores the first series of requests (Command1001, Command2002, and Command3003) in the input buffer114. The next set of requests (Command1004, Command2005, and Command4006) are also stored in the input buffer114. The server then compares these series of requests and notes that the sequence of receiving Command2has repeated sequentially after Command1was received. The server then blocks the sequence of Command1followed by Command2as a command set in the command set database. This command set represents a command set that is likely to repeat in future requests by the client. Thereafter, when the server receives Command1, the server will perform a lookup in the command set database and find the blocked command set beginning with Command1and ending with Command2. The server will then execute the command set consisting of Command1and Command2.

In another embodiment, the server will wait for a predetermined repetition of commands before it blocks repetitive commands in the command set database. This is useful in situations where an application behaves differently at startup than after reaching a steady state. Referring back to the network call illustrated above, the application at startup first sends Command1001, Command2002, and Command3003. The next series of commands (Command1004and Command2005) repeat the first two commands sent at startup (Command1001and Command2002) and includes a new command (Command4006). In this embodiment, the server will not immediately block Command1and Command2as a repeating command set. The server may wait for a predetermined period until a series of commands have been sent at least twice before it blocks the commands as a repeating command set. In the next series of commands, the server notes that the series of commands, Command1007, Command2008and Command4009have repeated from a previous request and will block these three commands in the command set database if the predetermined wait period has been reached. Thereafter, when the client sends Command1, the server will perform a lookup in the command set database and find the command set beginning with Command1. The server will then execute all of the commands in the command set beginning with Command1.

The present invention offers numerous advantages over conventional data transfer techniques. For example, the present invention allows a networking layer to intelligently decide when to do something on the user's behalf before the user actually requests the action and without requiring knowledge of the actual application that the end user is running. This solution fits well into the emerging world of distributed computing where the various system layers are not developed by the same company. Thus, for example, the present invention could be used in a Java Database Connectivity (“JDBC”) driver for a tier-0device (such as a personal digital assistant). These embodiments may be desirable because, even though the JDBC driver could still predict what the user is going to do given the series of events leading up to it. By acting on this prediction and being able to handle the small number of cases where the prediction is wrong, the JDBC driver could achieve significant performance gains.

Embodiments of the present invention are also desirable because they allow the server to perform processing tasks during network traversals and while other actions are going on within the client system. By increasing the parallelism of the computing processes in this way, the present invention makes a noticeable impact on performance from the end user's perspective. Those skilled in the art will appreciate that these client-side performance benefits may be particularly desirable when implemented, in whole or in part, on cellular phones, personal digital assistants, and other pervasive devices.

Although the present invention has been described in detail with reference to certain examples thereof, it may be also embodied in other specific forms without departing from the essential spirit or attributes thereof. Thus, the present invention may be used in other processes commonly performed by a client/server or distributed architecture in which the communication layer is based on a standard that follows uncommon patterns. Embodiments of the present invention may also utilize other information to help predict the client's requests, such as the end user's identity, the end user's location, and the client computer's device type, etc. In addition, embodiments may take advantage of other methods of generating the predicted client request, such as neural networks, fuzzy logic, and the like.