Abstract:
An apparatus for maintaining a limit value of a resource for use in a concurrent limit checking system comprising: a resource having an associated limit value; a plurality of request handlers having access to a plurality of sub-limit values, wherein the sub-limit values when summed equal the limit value and wherein each request handler is operable to check a request value of a request for consuming the resource against its associated sub-limit value, in order to determine whether the request can be satisfied. The apparatus comprises a coordinator, responsive to the first request handler determining that the first request cannot be satisfied, for generating a coordination request comprising a coordination request value required to satisfy the first request, a receiver for receiving a coordination response from the second request handler; and an updater for updating the sub-limit values in accordance with the coordination request value.

Description:
FIELD OF THE INVENTION 
       [0001]    The present invention provides an apparatus for maintaining a limit value of a resource for use in a concurrent limit checking system. 
       BACKGROUND OF THE INVENTION 
       [0002]    A request for consumption of a resource is typically checked against a limit associated with the resource in order to ensure that the resource is not consumed beyond the limit. 
         [0003]    In an example, with reference to  FIG. 1 , when a user at a client computer ( 105 ) submits a request to buy shares from a request processing system ( 120 ), an associated limit comprising a value ( 115 ) (residing on a limit value checking system ( 110 )) is typically set (e.g. by the client computer ( 105 ), the limit value checking system ( 110 ) or the request processing system ( 120 )). 
         [0004]    The limit value is associated with the user&#39;s account and specifies a limit beyond which an associated resource (i.e. account funds) cannot be consumed. That is, an amount of funds associated with any request(s) for shares will not be permitted to exceed the limit value. 
         [0005]    The limit value checking system ( 110 ) processes a request by checking a value of the request against the limit value ( 115 ) in order to determine whether the value exceeds the limit value. If the limit value is exceeded, the request is rejected or a notification is sent to the client computer ( 105 ). 
         [0006]    If the limit value is not exceeded, the limit value checking system ( 110 ) passes the request to the request processing system ( 120 ) which processes the request. 
         [0007]    The limit value checking system ( 110 ) can process plural requests received from a single account concurrently. However, there are risks associated with concurrent processing. 
         [0008]    For example, an account has a limit value of £1000 and two concurrent requests to buy shares, each with a value of £501, are received. In response, two concurrent processes (each unaware of the other) make checks against the limit value and each process determines that a request to buy shares of a value of £501 will not exceed the limit value of £1000. Thus, both requests are authorised, however, the total value of both requests is £1002 (i.e. £2 over the limit value). 
         [0009]    Thus, the authorisation of both requests causes risk, as the client computer ( 105 ) can request to buy shares having an aggregate value that exceeds the limit value placed on the user account. That is, the associated resource (e.g. account funds) can be consumed beyond the limit. 
         [0010]    In order to prevent this risk, requests are checked serially. Thus, using the example above, a first request with a value of £501 is checked and passed to the request processing system ( 120 ) as the limit value will not be exceeded. A second request with a value of £501 will be rejected as the value of the second request causes the limit value to be exceeded. 
         [0011]    However, a drawback of serial processing is that the time taken to serially check requests against a limit value causes a reduction in throughput of the overall request handling process. Thus, as request volumes for a single account increase (e.g. due to automated requestor computer programs), the reduction in throughput affects the ability of systems to meet the needs of users. 
       SUMMARY OF THE INVENTION 
       [0012]    According to a first aspect there is provided an apparatus for maintaining a limit value of a resource for use in a concurrent limit checking system comprising: a resource having an associated limit value; a first request handler having access to a first sub-limit value; and a second request handler having access to a second sub-limit value; wherein the first sub-limit value and the second sub-limit value when summed equal the limit value and wherein each request handler is operable to check a request value of a request for consuming the resource against the associated sub-limit value, in order to determine whether the request can be satisfied; the apparatus comprising: a coordinator, responsive to the first request handler determining that the first request cannot be satisfied, for generating a coordination request comprising a coordination request value required to satisfy the first request; a transmitter for transmitting the coordination request to the second request handler; a receiver for receiving a coordination response comprising the coordination request value; and an updater for updating the first sub-limit value and the second sub-limit value in accordance with the coordination request value. 
         [0013]    According to a second aspect there is provided a method for maintaining a limit value of a resource for use in a concurrent limit checking system comprising: a resource having an associated limit value; a first request handler having access to a first sub-limit value; and a second request handler having access to a second sub-limit value; wherein the first sub-limit value and the second sub-limit value when summed equal the limit value and wherein each request handler is operable to check a request value of a request for consuming the resource against the associated sub-limit value, in order to determine whether the request can be satisfied; the method comprising the steps of: generating, in response to the first request handler determining that the first request cannot be satisfied, a coordination request comprising a coordination request value required to satisfy the first request; transmitting the coordination request to the second request handler; receiving a coordination response comprising the coordination request value; and updating the first sub-limit value and the second sub-limit value in accordance with the coordination request value. 
         [0014]    According to a third aspect there is provided a computer program comprising program code means adapted to perform all the steps of the method above when said program is run on a computer. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS  
         [0015]    The present invention will now be described, by way of example only, with reference to preferred embodiments thereof, as illustrated in the following drawings: 
           [0016]      FIG. 1  is a block diagram of a prior art system for handling a request for a resource; 
           [0017]      FIG. 2  is a block diagram of a system for handling a request for a resource according to the preferred embodiment; 
           [0018]      FIG. 3  is a block diagram showing in more detail a request handler of the system of  FIG. 2 ; and 
           [0019]      FIG. 4  is a flow chart showing the operational steps involved in a process according to the preferred embodiment. 
       
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT 
       [0020]    The preferred embodiment will now be described with reference to the figures. 
         [0021]    With reference to  FIG. 2 , there is shown a system ( 200 ) in which the preferred embodiment may be implemented. There is shown a client computer ( 205 ), a limit value checking system ( 210 ) and a request processing system ( 290 ). 
         [0022]    The request processing system ( 290 ) comprises identifiers associated with account funds (the resource, in this case). 
         [0023]    The limit value checking system ( 210 ) comprises a request receiver ( 215 ) operable to communicate with the client computer ( 205 ) concurrently, a request distributor ( 220 ) operable to communicate with the request receiver ( 215 ); a first request handler ( 225 ) and a second request handler ( 230 )— 225  &amp;  230  handle requests for a user account (in the examples described herein, a single user account is handled)—each of which is operable to communicate with the request distributor ( 220 ); and a request transmitter ( 235 ) operable to communicate with the first request handler ( 225 ), the second request handler ( 230 ) and the request processing system ( 290 ). 
         [0024]    The first request handler ( 225 ) and the second request handler ( 230 ) are shown in greater detail in  FIG. 3 . Each request handler comprises a storage component ( 240 ,  265 ) for storing a value associated with limit beyond which an associated resource (e.g. account funds) cannot be consumed—in the examples described herein, each limit is assigned randomly and a receiver ( 245 ,  270 ) operable to communicate with the request distributor ( 220 ). 
         [0025]    Each request handler also comprises a checker ( 250 ,  275 ) operable to communicate with the receiver ( 245 ,  270  respectively) and the storage component ( 240 ,  265  respectively). 
         [0026]    Each request handler also comprises an updater ( 255 ,  280 ) operable to communicate with the checker ( 250 ,  275  respectively), the storage component ( 240 ,  265  respectively) and the response transmitter ( 235 ). 
         [0027]    Each request handler also comprises a coordinator ( 260 ,  285 ) operable to communicate with the updater ( 255 ,  280  respectively), the storage component ( 240 ,  265  respectively) and the coordinator of another request handler. 
         [0028]    A first example will now be described with reference to the figures. In the first example, limit values (stored in storage components  240  and  265  respectively) associated with the first request handler ( 225 ) and the second request handler ( 230 ) are shown below: 
         [0029]    First request handler ( 225 ): 
         [0030]    First limit value=£600 
         [0031]    Second request handler ( 230 ): 
         [0032]    Second limit value=£400 
         [0033]    In the first example, at step  400 , the request receiver ( 215 ) receives a first request and a second request to buy shares from the client computer ( 205 ). The values of the first request and the second request are shown below: 
         [0034]    First request: 
         [0035]    Value=£450 
         [0036]    Second request: 
         [0037]    Value=£300 
         [0038]    The request receiver ( 215 ) passes the requests to the request distributor ( 220 ), which uses a distribution policy to distribute the requests. 
         [0039]    In the first example, the distribution policy governs that the requests be distributed randomly, wherein one request is distributed to one request handler. 
         [0040]    At step  405 , in accordance with the distribution policy, the request distributor ( 220 ), distributes the first request to the first request handler ( 225 ) and the second request to the second request handler ( 230 ). 
         [0041]    Receiver  1  ( 245 ) receives the first request and Receiver  2  ( 270 ) receives the second request. 
         [0042]    At step  410 , Checker  1  ( 250 ) checks the value of the first request against the first limit value stored in the storage component ( 240 ) in order to determine whether the value of the first request (£450) exceeds the first limit value (£600). 
         [0043]    If the value of the first request exceeds the first limit value, step  425  is executed as will be described with reference to the second example. 
         [0044]    In the first example, Checker  1  ( 250 ) determines that the value of the first request does not exceed the first limit value. 
         [0045]    At step  415 , Updater  1  ( 255 ) updates the first limit value i.e. the first limit value is decreased to £150. 
         [0046]    In response to the update, as the first limit value would not be exceeded, at step  420 , Updater  1  ( 255 ) passes the first request to the request transmitter ( 235 ) which passes the first request to the request processing system ( 290 ). 
         [0047]    The request processing system ( 290 ) processes (step  425 ) the first request. Preferably, the request processing system ( 290 ) sends a notification to the client computer ( 205 ), acknowledging that the first request has been processed. 
         [0048]    Likewise, at step  410 , Checker  2  ( 275 ) (concurrently) checks the value of the second request against the second limit value stored in the storage component ( 265 ) in order to determine whether the value of the second request (£300) exceeds the second limit value (£400). If the value of the second request exceeds the second limit value, step  425  is executed as will be described with reference to the second example. 
         [0049]    In the first example, Checker  2  ( 275 ) determines that the value of the second request does not exceed the second limit value. 
         [0050]    At step  415 , Updater  2  ( 280 ) updates the second limit value i.e. the limit value is decreased to £100. 
         [0051]    In response to the update, as the second limit value would not be exceeded, at step  420 , Updater  2  ( 280 ) passes the second request to the request transmitter ( 235 ) which passes the second request to the request processing system ( 290 ). 
         [0052]    The request processing system ( 290 ) processes (step  425 ) the second request. Preferably, the request processing system ( 290 ) sends a notification to the client computer ( 205 ), acknowledging that the second request has been processed. 
         [0053]    A second example will now be described with reference to the figures. In the first example, limit values (stored in storage components  240  and  265  respectively) associated with the first request handler ( 225 ) and the second request handler ( 230 ) are shown below: 
         [0054]    First request handler ( 225 ): 
         [0055]    Third limit value=£300 
         [0056]    Second request handler ( 230 ): 
         [0057]    Fourth limit value=£400 
         [0058]    In the second example, at step  400 , the request receiver ( 215 ) receives a third request and a fourth request to buy shares from the client computer ( 205 ). The values of the third request and the fourth request are shown below: 
         [0059]    Third request: 
         [0060]    Value=£350 
         [0061]    Fourth request: 
         [0062]    Value=£300 
         [0063]    The request receiver ( 215 ) passes the requests to the request distributor ( 220 ), which uses a distribution policy to distribute the requests. 
         [0064]    In the second example, the distribution policy governs that the requests be distributed randomly, wherein one request is distributed to one request handler. 
         [0065]    At step  405 , in accordance with the distribution policy, the request distributor ( 220 ), distributes the third request to the first request handler ( 225 ) and the fourth request to the second request handler ( 230 ). 
         [0066]    Receiver  1  ( 245 ) receives the third request and Receiver  2  ( 270 ) receives the fourth request. 
         [0067]    At step  410 , Checker  1  ( 250 ) checks the value of the third request against the third limit value stored in the storage component ( 240 ) in order to determine whether the value of the third request (£350) exceeds the third limit value (£300). 
         [0068]    In the second example, the value of the third request exceeds the third limit value and step  430  is executed. That is, Coordinator  1  ( 260 ) sends a coordination request to Coordinator  2  ( 285 ). 
         [0069]    In the second example, the coordination request comprises a coordination request value which when summed with the third limit value generates a new limit value. The value of the third request can not exceed the new limit value. In the second example, the coordination request value is £50. 
         [0070]    In the second example, Coordinator  2  ( 285 ) receives the coordination request before Coordinator  2  ( 285 ) executes step  410 . 
         [0071]    At step  435 , in response to receiving the coordination request, Coordinator  2  ( 285 ) determines whether the coordination request can be met. That is, Coordinator  2  ( 285 ) checks whether the coordination request value (£50) can be provided from the fourth limit value (£400). 
         [0072]    If the coordination request cannot be met, preferably, an action is executed (step  440 ) (e.g. a notification is sent to the client computer). 
         [0073]    In the second example, Coordinator  2  ( 285 ) determines that the coordination request value (£50) can be provided from the fourth limit value (£300). Preferably, Coordinator  2  ( 285 ) sends a coordination response comprising the coordination request value (£50) and updates the fourth limit value (i.e. the fourth limit value is decreased to £350). 
         [0074]    In response to receiving the coordination response, Coordinator  1  ( 260 ) sums the coordination request value (£50) the third limit value (£300) to generate a new limit value (£350). 
         [0075]    At step  415 , Updater  1  ( 255 ) updates the new limit value i.e. the new limit value is decreased to £0. 
         [0076]    In response to the update, as the new limit value would not be exceeded, at step  420 , Updater  1  ( 255 ) passes the third request to the request transmitter ( 235 ) which passes the third request to the request processing system ( 290 ). 
         [0077]    The request processing system ( 290 ) processes (step  425 ) the third request. Preferably, the request processing system ( 290 ) sends a notification to the client computer ( 205 ), acknowledging that the third request has been processed. 
         [0078]    At step  410 , Checker  2  ( 275 ) checks the value of the fourth request against the fourth limit value stored in the storage component ( 265 ) in order to determine whether the value of the fourth request (£300) exceeds the fourth limit value (£350). That is, requests are handled concurrently across request handlers and requests are handled serially by an individual request handler. 
         [0079]    If the value of the fourth request exceeds the fourth limit value, step  425  is executed as described above. 
         [0080]    In the second example, Checker  2  ( 275 ) determines that the value of the fourth request does not exceed the fourth limit value. 
         [0081]    At step  415 , Updater  2  ( 280 ) updates the fourth limit value i.e. the limit value is decreased to £50. 
         [0082]    In response to the update, as the fourth limit value would not be exceeded, at step  420 , Updater  2  ( 280 ) passes the fourth request to the request transmitter ( 235 ) which passes the fourth request to the request processing system ( 290 ). 
         [0083]    The request processing system ( 290 ) processes (step  425 ) the fourth request. Preferably, the request processing system ( 290 ) sends a notification to the client computer ( 205 ), acknowledging that the fourth request has been processed. 
         [0084]    Advantageously, values of requests can be concurrently checked against limit values, thereby increasing throughput of the overall request handling process. 
         [0085]    Furthermore, the risk associated with concurrent processing is eliminated by providing a coordination feature, such that a resource cannot be consumed beyond a limit. 
         [0086]    There are a number of optimisation mechanisms that are provided by the present invention to balance the concurrent processing of requests and the invocation of the coordination feature. 
         [0087]    In a first optimisation mechanism, distribution of limit values over request handlers is selectively assigned by an assignor. 
         [0088]    In a first example, a larger limit value is associated with a first request handler and a relatively smaller limit value is associated with a second request handler. Preferably, the request distributor distributes requests in accordance with the first optimisation mechanism. For example, the request distributor uses a distribution policy that governs that a first request having a relatively larger value than a second request is sent to the first request handler and the second request is sent to the second request handler. 
         [0089]    In a second example, distribution of limit values is governed in accordance with statistical data e.g. data associated with an average value of requests that have been handled by a request handler. 
         [0090]    Thus, the first optimisation mechanism provides an environment wherein a request is likely to be met by a request handler without the need for coordination. That is, if most of a limit value is held by a single request handler, other request handlers may require coordination in order to be able to fulfil requests. Alternatively, if limit values are distributed evenly across all request handlers, a single request handler will be unable to fulfil a request having a relatively large value compared with the limit value without the need for co-ordination. 
         [0091]    In a second optimisation mechanism, a number of request handlers are selectively invoked/deselected by an invoker. 
         [0092]    For example, a number of request handlers are invoked in accordance with statistical data associated with previous request handling. 
         [0093]    In a first example, if a threshold associated with a number of requests is exceeded, further request handlers are invoked. In a second example, if a time period threshold has expired, one or more request handlers are invoked or deselected. In a third example, request handlers are invoked/deselected in accordance with a rate at which requests need to be handled. 
         [0094]    In the examples described herein, each request handler comprises a coordinator. Alternatively, a coordinator function is provided by a central coordinator. 
         [0095]    In one example, a request handler sends a coordination request to all other request handlers. In another example, a request handler sends a coordination request to a subset of the other request handlers. 
         [0096]    In the examples described herein, a single user account is handled. In another example, multiple user accounts are handled and preferably, an identifier associated with a user account is associated with a request sent by a client computer. 
         [0097]    In the second example, the coordination request value, when summed with a limit value, generates a new limit value. The value of a request equals the new limit value. In another example, the coordination request has a coordination request value such that the value of a request is less than the new limit value. In yet another example, the coordination request has a coordination request value with an associated range; e.g. “no less than £50 and up to £1000”. 
         [0098]    It should be understood that if a coordination request cannot be met, preferably it is re-sent after a time threshold has expired. Preferably, a coordination request is re-sent a (configurable) number of times before a request is eventually rejected. Alternatively, a coordination request is re-sent a number of times within a (configurable) time period before a request is eventually rejected. 
         [0099]    In the second example described herein, a single coordination request comprising a coordination request value is sent. It should be understood that alternatively, multiple coordination requests comprising sub-coordination request values can be sent to a plurality of request handlers. 
         [0100]    In the examples described herein, a limit value is strictly enforced, such that a request value cannot exceed a limit value. However, in another example, a limit value may not be strictly enforced in that a flexible limit value above (or below) the limit value can also be set. For example, a limit value is £500, a flexible limit value is +£100—thus, a request for £600 (which exceeds the limit value but not the limit value summed with the flexible limit value) is still met. 
         [0101]    It will be clear to one of ordinary skill in the art that all or part of the method of the preferred embodiments of the present invention may suitably and usefully be embodied in a logic apparatus, or a plurality of logic apparatus, comprising logic elements arranged to perform the steps of the method and that such logic elements may comprise hardware components, firmware components or a combination thereof. 
         [0102]    It will be equally clear to one of skill in the art that all or part of a logic arrangement according to the preferred embodiments of the present invention may suitably be embodied in a logic apparatus comprising logic elements to perform the steps of the method, and that such logic elements may comprise components such as logic gates in, for example a programmable logic array or application-specific integrated circuit. Such a logic arrangement may further be embodied in enabling elements for temporarily or permanently establishing logic structures in such an array or circuit using, for example, a virtual hardware descriptor language, which may be stored and transmitted using fixed or transmittable carrier media. 
         [0103]    It will be appreciated that the method and arrangement described above may also suitably be carried out fully or partially in software running on one or more processors (not shown in the figures), and that the software may be provided in the form of one or more computer program elements carried on any suitable data-carrier (also not shown in the figures) such as a magnetic or optical disk or the like. Channels for the transmission of data may likewise comprise storage media of all descriptions as well as signal-carrying media, such as wired or wireless signal-carrying media. 
         [0104]    The present invention may further suitably be embodied as a computer program product for use with a computer system. Such an implementation may comprise a series of computer-readable instructions either fixed on a tangible medium, such as a computer readable medium, for example, diskette, CD-ROM, ROM, or hard disk, or transmittable to a computer system, via a modem or other interface device, over either a tangible medium, including but not limited to optical or analogue communications lines, or intangibly using wireless techniques, including but not limited to microwave, infrared or other transmission techniques. The series of computer readable instructions embodies all or part of the functionality previously described herein. 
         [0105]    Those skilled in the art will appreciate that such computer readable instructions can be written in a number of programming languages for use with many computer architectures or operating systems. Further, such instructions may be stored using any memory technology, present or future, including but not limited to, semiconductor, magnetic, or optical, or transmitted using any communications technology, present or future, including but not limited to optical, infrared, or microwave. It is contemplated that such a computer program product may be distributed as a removable medium with accompanying printed or electronic documentation, for example, shrink-wrapped software, pre-loaded with a computer system, for example, on a system ROM or fixed disk, or distributed from a server or electronic bulletin board over a network, for example, the Internet or World Wide Web. 
         [0106]    In an alternative, the preferred embodiment of the present invention may be realized in the form of computer implemented method of deploying a service comprising steps of deploying computer program code operable to, when deployed into a computer infrastructure and executed thereon, cause said computer system to perform all the steps of the described method. 
         [0107]    It will be clear to one skilled in the art that many improvements and modifications can be made to the foregoing exemplary embodiment without departing from the scope of the present invention.