DATA ACCESS

Abstract: A data access system is provided, including proxy servers (100) for caching "local" copies of selected data sets stored on data servers (115) to which users request access. Each proxy server (100) is adapted to generate (135) a subscription request message in respect of each identified cached data set for submission to a conventional "publish & subscribe" data distribution system (110). The data distribution system (110) is arranged with access to "published" updates to data sets, made available from respective data servers (115). Upon receipt of a published updated data set having an identifier matching that in an earlier-received subscription request, the data distribution system (110) forwards the data set to the subscribing proxy server (100) to enable update to the respective cached copy. Thus, a proxy server (100), having decided to cache a particular data set, need only issue a subscription request message in order to receive all subsequent updates, as they become available, until choosing to remove the data set from the cache.

Description: DATA ACCESS This invention relates to data access and in particular to maintaining integrity of cached copies of data. The use of proxy servers to cache frequently accessed data sets is well known. Proxy servers may be provided to service a "local" community of users, storing (caching) local copies of frequently requested data sets that would otherwise need to be retrieved from their respective originating data sources every time a user requested access to them. Once a proxy server has stored a local copy of a particular data set, a subsequent request for access by a user to that data set is intercepted by the proxy server and access provided rapidly to the locally cached copy rather than to the originating source specified in the request. A proxy server may include features to monitor user access requests and to select data sets for caching according to a predetermined selection algorithm. For example, a data set may be selected for caching if access to it was requested from three or more different users over a predetermined time period. A cached data set may be deleted from the cache if the time period between consecutive access requests exceeds a predetermined threshold. A proxy server must ensure that any cached data sets remain up-to-date with respect to changes to the "original" data set held at the originating data source. To achieve this, known proxy servers use one or more of the following techniques: (1 ) Periodic checking - once a data set has been cached, the proxy server submits periodic requests for access to the original source of the data set to determine whether amendments have been made. However, if the proxy server is to keep up to date with many cached data sets, a great deal of proxy server processing time and communications bandwidth is consumed if the period between requests is to be kept sufficiently short in order to avoid serving out-of-date data sets to users. (2) Patterns associated with data being updated - the proxy server looks for patterns in the update of a data set and attempt to predict when it will next be amended. For example, if a data set has consistently been updated each morning at 6am (e.g. a newspaper), then the proxy server may download a new copy of the data set from the corresponding source at say 6.01 every morning. However, it is not possible to be 100% accurate in predicting when a data set will be updated. (3) Specified expiry time - a data set provider tags the data set with a 'will be valid until ' message. The proxy server will not seek to refresh the cached copy until after that time. However, timely refresh of the cached copy depends upon the clocks between the proxy and data source being reasonably well aligned and upon the data set not expiring early. In practice short expiry periods are used, e.g. 1 hour. (4) Update queries triggered by user access requests - every time a proxy server receives a request for access to a cached data set, the proxy server sends a message to the corresponding source of that data set asking "Has this data set been updated since xxxx", where xxxx is a time or date. If it has, then a copy of the new data set is downloaded to the cache. While this is one of the most common modes of operation of proxy servers, it may add considerable time delay to the servicing of a request for access, and consumption of communications bandwidth in submitting an update query every time. This dramatically decreases the Quality of Service available to broadband users who expect far more rapid access to requested data sets. Aspects of the present invention are as set out in the claims, individually or in combinations thereof. Embodiments of the present invention can be used to provide, to a group of user interfaces, access to files which are cached locally but which are each automatically updated as soon as an update becomes available at a source file server. This is facilitated by using a publish and subscribe system to update the cached files. The publish and subscribe system in turn can be fed updates to the individual files by a source file server which is adapted to detect file updates and then use "push technology" to send the updates to the publish and subscribe system. In at least a first aspect of the present invention, it is not necessary for a proxy (or caching) server to actively validate then update cached data sets once a decision has been made to cache a particular data set. Instead, the proxy server generates a subscription request message for sending to a predetermined node of a known "publish & subscribe" data distribution system, requesting receipt of any new "published" version of the particular identified data set. The data distribution system is arranged with access to published updates to data sets from corresponding data sources. If the data distribution system receives a data set having the same identifier as one subscribed to, the data set will be propagated through the data distribution system and delivered to the subscribing proxy server. On receipt, the proxy server overwrites the existing cached copy of the data set with the newly delivered version. If a proxy server deletes a data set from its cache, the proxy server is arranged to generate an "unsubscribe" message for sending to the data distribution system to ensure that further updates to the data set are no longer delivered. Preferably, data sources may be arranged to "publish" to the data distribution system a copy of each data set that is changed at that source. If the data distribution system has received a subscription request from a proxy server in respect of a changed data set received from a source, then the data distribution system delivers the changed data set to the subscribing proxy server. Preferably, a change monitoring process may be implemented at data sources to monitor changes to files and to "push" a copy of each changed file to a predetermined point of entry to the data distribution system. Any changed file that is not the subject of a subscription by a proxy server will not be propagated further by the data distribution system. A "data set" or a "file", in the context of the present invention, might in practice be any of several different types of electronically transmittable entities such as those accessible over the Internet, including for instance text, graphics, spreadsheets, computer programmes, audio, video, multimedia, or data. It should also be noted that a "user" may in practice be non-human, such as a machine or a piece of software. There now follows, by way of example only, a description of a specific embodiment of the present invention. This description is to be read in conjunction with the accompanying drawing, in which: Figure 1 shows a block diagram of a data access system according to a preferred embodiment of the present invention; and Figure 2 shows a block diagram of a caching server for use in the data access system of Figure 1 . Referring to Figure 1 , a diagram is provided showing in schematic form a data access system according to a preferred embodiment of the present invention. Two proxy servers 100 are shown arranged with access to forwarding computers 105 of a "publish & subscribe" data distribution system 1 10 comprising, in this example, a simple hierarchy of forwarding computers 105 (FC-1 to FC-6). Servers 1 1 5 representing sources of data sets are also shown arranged with access to forwarding computers 105 of the data distribution system 1 10. Referring to Figure 2, a proxy (or caching) server 100 includes: a user access request monitor 1 20 for intercepting and monitoring messages sent by client devices 200 containing requests for access to data sets stored on data servers 1 15; a cache (store) 1 25; and a data set selector 130 for selecting data sets for storage in the cache 1 25 according to a predetermined selection algorithm. A proxy server 100 also includes a subscription message generator 1 35 for generating and sending messages to the data distribution system 1 10 to subscribe on behalf of the proxy server to receive updates to specified data sets. The subscription message generator 135 is arranged to generate subscription messages n a format acceptable to the data distribution system 1 10. A subscription message includes an address for the subscribing proxy server 100, an indication of whether the message is a "subscribe" or "unsubscribe" request message and a unique identifier for the data set for which updates are/were sought. Preferably, the data set selector 130 may be adapted to signal to the subscription message generator 1 35 the unique data set identifier of a data set for which a decision has been made to store a copy in the cache 125 and an indication that a "subscription" request message is to be generated. Similarly, upon deciding to remove a data set from the cache 1 25, the data set selector 130 may signal to the subscription message generator 135 to generate an "unsubscribe" message in respect of that data set. In operation, proxy server 100, by means of the user access request monitor 1 20, intercepts a user's message requesting access to a data set stored on a specified data server 1 15. If the requested data set is stored in the cache 125, then the proxy server 100 services the access request by providing access to the cached copy of the requested data set, trapping the user's access request message. If the requested data set is not stored in the cache 125, then the user's access request message is forwarded to the specified data server 1 1 5 over a conventional communications network (not shown in Figure 1 ). The user's access request is also copied to the data set selector 130 to determine whether or not a copy of the requested data set should be stored in the cache 1 25. Such a storage decision may be made for example for the benefit of providing faster subsequent user access to that data set. A conventional selection algorithm may be implemented by the data set selector 130, for example implementing selection criteria listed above in the introductory part of the present patent application. If the data set selector 130 chooses to store the requested data set in the cache 1 25, proxy server 100 may be arranged to intercept a response from the specified data server 1 1 5 to the corresponding user's access request message and to copy the data set supplied in the response to the cache 1 25, thereafter forwarding the response to the client device for the requesting user. On selecting the data set for storage in the cache 1 25, the data set selector 1 30 is arranged to trigger the subscription message generator 1 35 to generate a subscription request message, supplying to the subscription message generator 1 35 a unique identifier for the selected data set for inclusion in the subscription request message, and to send the generated message to the "publish & subscribe" data distribution system 1 10, preferably to a predetermined forwarding computer 105 of that system. On receipt of a subscription request message, the data distribution system 1 10 registers the request in a conventional way to ensure that a subsequently received data set having the identifier specified in the subscription request will be forwarded and delivered by forwarding computers 105 of the system to one or more subscribing proxy servers 100. In order for updates to data sets stored on data servers 1 1 5 to be made available to the data distribution system 1 10 for delivery to subscribing proxy servers 100, a simple update monitoring module 140 may be installed on each data server 1 1 5 to detect changes to data sets stored in a store 145 and to "publish" each changed data set by forwarding a copy of the data set to a predetermined forwarding computer 105 in the data distribution system 1 10. An update monitoring module 140 may be implemented in the form of a computer program for installation on a conventional data server. An example of a listing for such a computer program is attached to the present patent application as Annex A. A computer program such as that in Annex A would be suitable for installation and integration into a conventional data server for monitoring directories of files in the data server store 145 and for sending a copy of each file in which a change is detected to a predetermined destination. On receipt of an updated copy of a cached data set, proxy server 100 is arranged to store the updated copy in the cache 1 25, overwriting the previously stored copy. Of course, updates to data sets stored on data servers 1 15 may be made available by third party sources and "published" to the data distribution system 1 10 for delivery to subscribing proxy servers 100. The preferred embodiment of the present invention as described above may be implemented to operate in the context of the Internet and World- ide Web. A conventional web proxy server, such as the 'Squid' server (or 'Cuttlefish' derivative), may be adapted to receive and install a subscription message generation module 135 and to enable updates to cached data sets to be written to the cache 125 upon receipt. A skilled person would be readily able to implement proxy server features of the present invention on a conventional proxy server. The present invention may also be applied to Wireless Application Protocol (WAP) proxy servers. WAP proxy servers operate in a similar way to web servers employing the Hypertext Transfer Protocol (HTTP) to access data sets. ANNEX A From Win32 declarations module 'Windows 32API function call definitions & Constant Declarations Option Explicit 'Constant Declarations Public Const INFINITE = &HFFFF Public Const WAIT_OBJECT = &H0 Public Const WAIT_ABANDONED = &H80 Public Const WAIT TIMEOUT = &H102 ile Change Notification Flag in this instance set just to monitor changes to last file write 'time Public Const FILE_NOTIFY_CHANGE_LAST_WRITE As Long = &H10 'API Interface Declarations Public Declare Function FindFirstChangeNotification Lib "kernel32" _ Alias "FindFirstChangeNotificationA" _ (ByVal lpPathName As String, _ ByVal bWatchSubtree As Long, _ ByVal d NotifyFilter As Long) As Long Public Declare Function FindCloseChangeNotification Lib "kernel32" _ (ByVal hChangeHandle As Long) As Long Public Declare Function FindNextChangeNotification Lib "kernel32" _ (ByVal hChangeHandle As Long) As Long Public Declare Function WaitForMultipleObjects Lib "kernel32" _ (ByVal nCount As Long, _ lpHandles As Long, _ ByVal bWaitAll As Long, _ ByVal dwMilliseconds As Long) As Long From main module 'Set option explicit so all variables used must be pre-declared Option Explicit 'Declare Global Variables Dim hChangeHandle As Long Dim hWatchedO As Long Dim Ter inateFlag As Long Private Sub Form_Load() Dim fso, FilesCollection, RootFolder, File, newdate, changedfile Dim clniReturn, TerminateFlag As Boolean Dim i As Integer Dim atchStatus As Long Dim WatchPath As String Dim clniData As String Dim FolderArray () As String 'CDS CIni is a class module for parsing ini files Dim clni As New CDS_CIni WatchPath = "C:\InetPub\wwwroot\" 'Root path of watched directory tree TerminateFlag = False ind all directories under the WatchPath and write to folder array FolderArray = FindDirectories (WatchPath) 'Add root watch path to end of watched directory array ReDim Preserve FolderArray (UBound(FolderArray) + 1) FolderArray (UBound(FolderArray) ) = WatchPath ReDim hWatched (UBound (FolderArray) ) 'Create a watched directory tree & show list of watched folders Set fso = CreateObject ("Scripting. FileSystemObject") 'Set reference ini file name clni .FileName = App.Pat & "\data.ini" For i = 0 To UBound (FolderArray) hWatched (i) =WatchCreate (FolderArray (i) , FILE_NOTIFY_CHANGE_LAST _WRITE) Set RootFolder = f so . GetFolder (FolderArray (i) ) Set FilesCollection = RootFolder . Files 'write last modified time & file path to ini file under file path key for each file 'syntax is clniWriteValuef ini file key name, field name, value) 'where key name is the ini file key for rapid relocation of record in file 'field is the field name for that key and value is the value to write to the file For Each File In FilesCollection clni . WriteValue FolderArray (i) & "\ " & File . Name, "Lastwrite " , File . DateLastModif ied clni .WriteValue FolderArray (i) & "\ " & File . Name , "FilePath" , FolderArray (i) & "\ " & _File .Name Next Next 'Setup wait state ready for change WatchStatus = WatchDirectory (UBound (hWatched) + 1 , hWatched, 100) '(perform actions) for first detected change Set RootFolder = f so . GetFolder (FolderArray (WatchStatus) ) Set FilesCollection = RootFolder . iles For Each File In FilesCollection 'check current file last modified date against stored date to find changed file clniReturn = clni . ReadValue (FolderArray (WatchStatus) & "\ " & File . Name , _ "Lastwrite " , clniData) If clniData <> File . DateLastModif ied Then newdate = clniData 'Modified File has been found store path & open socket clniReturn = clni . ReadValue (FolderArray (WatchStatus) & "\ " & File . ame, _ "FilePath" , clniData) changedfile = clniData sckConnect . Connect 'code will then jump to connect event and send data of changed file to beacon sckConnect . Close End If Next 'now go into a second loop, this time calling the FindNextChangeNotification API, 'exiting if WatchStatus indicates the terminate flag was set - for this demo code 'this is an infinite loop for processing changes but final code will have an event to 'set terminate flag when a request to cease monitoring is received Do While TerminateFlag = False 'write new modified date of changed file to ini file clni . WriteValue changedfile , "Lastwrite " , newdate 'reset handle with previously signalled change & resume watch wait state WatchStatus = WatchResume (WatchStatus , hWatched, 100 ) '(perform actions) for detected change Set RootFolder = f so . GetFolder (FolderArray (WatchStatus ) ) Set FilesCollection = RootFolder . Files For Each File In FilesCollection 'check current file last modified date against stored date to find changed file clniReturn = clni . ReadValue (FolderArray (WatchStatus) & " \ " & File . Name , _ "Lastwrite " , clniData) If clniData <> File . DateLastModif ied Then newdate = clniData 'Modified File has been found store path & open socket clniReturn = clni . ReadValue (FolderArray (WatchStatus) & " \ " & File . Name , _ " FilePath" , clniData) changedfile = clniData 'sckConnect is a winsock control object sckConnect . Connect 'code will then jump to connect event and send data of changed file to beacon sckConnect . Close End If Loop End Sub Private Function WatchCreate (lpPathName As String, flags As Long) As Long 'Calls FindFirstChangeNotification to return a change monitoring handle 'on the specified directory path specified for the change event set by the 'FILE NOTIFY FLAG Dim WatchSubTree As Long WatchSubTree = 0 FindFirstChangeNotification members: IpPathName: folder to watch WatchSubTree: True (1) = watch specified folder and its sub folders False (0) = watch the specified folder only flags: FfLE_NOT/FY_ flag to apply WatchCreate = FindFirstChangeNotification (IpPathName , WatchSubTree , flags ) End Function Private Function WatchDirectory (Arra Len As Long, HandleArra O As Long, interval As Long) As Long 'Sets up wait state on handle array using WaitForMultipleObjects (returns array index of 'handle signaling change) 'ArrayLen - Length of Handle Array 'HandleArray (0) actually passes pointer to entire HandleArray into WaitForMultipleObjects alse - means wait state should not wait for all handles to signal a change so it will return 'on 1 change interval - wait state interval, would be set to infinite in a multi threaded 'implementation Dim r As Long r = WAIT_TIMEOUT Do While r = WAIT IIMEOUT And TerminateFlag = False r = WaitForMultipleObjects (ArrayLen, HandleArray (0) , False, interval) DoEvents Loop WatchDirectory = r End Function Private Function WatchResume (Index As Long, HandleArrayO As Long, interval) As Long 'Resets triggered directory handle using FindNextChangeNotification 'and then calls waitForMultipleObjectst to wait for next event trigger Call FindNextChangeNotification (HandleArray (Index) ) Dim r As Long r = WAIT TIMEOUT Do While r = WAITJTIMEOUT And TerminateFlag = False r = WaitForMultipleObjects (UBound (HandleArray) + 1, HandleArray (0) , False, interval) DoEvents Loop WatchResume = r End Function Function FindDirectories (fPath As String) As String () 'This procedure runs through all of the directories 'in the watched path using a recursive call to build 'an array of all the watched directories Dim fso, RootFolder, Folder, FolderCollection, i Dim FolderArray () As String Dim TempFolderArray () As String ReDim FolderArray (0) Set fso = CreateObject ("Scripting. FileSystemObject"; Set RootFolder = fso. GetFolder (fPath) Set FolderCollection = RootFolder . SubFolders For Each Folder In FolderCollection FolderArray (UBound (FolderArray) ) = Folder. Path ReDim Preserve FolderArray (UBound (FolderArray) + 1) TempFolderArray = FindDirectories (Folder. Path) If Not TempFolderArray (0) = "" Then For i = 0 To UBound (TempFolderArray) FolderArray (UBound (FolderArray) ) = TempFolderArray (i) ReDim Preserve FolderArray (UBound (FolderArray) + 1) Next End If Next If UBound (FolderArray) > 0 Then ReDim Preserve FolderArray (UBound (FolderArray) - 1) End If FindDirectories = FolderArray End Function Private Sub sc Connect_Connect () 'Sends data down cache socket to update cache server sckConnect . SendData 'data to send to cache server goes here e.g. http push of file 'file path must be passed in End Sub

Claims: CLAIMS 1 . A file server for retrieving and transmitting files in response to received requests, in a communications network, the file server comprising: i) a request input for receiving file requests from client equipment; ii) request monitoring means for monitoring received file requests; iii) a subscription request output; iv) file retrieval means for retrieving a file identified in a received file request from a first location and transmitting it to the client equipment making the request; and v) a cache for storing local copies of files for which file requests have been received; wherein the request monitoring means is arranged to monitor received file requests, and, in the event of a predetermined condition being met for a file identified by at least one request, to trigger the subscription request output to output a subscription request for the identified file to a second location. 2. A file server according to claim 1 wherein the predetermined condition comprises a threshold number of requests for the identified file. 3. A file server according to claim 1 wherein the predetermined condition comprises a threshold rate of requests for the identified file. 4. A data access system for providing updated files in response to received file requests, the system comprising: i) a subscription service file server which provides a subscription service to at least one caching file server, the subscription service file server being provided with a log for logging subscription data against respective caching file servers in respect of selected files or categories of files; and ii) access to a source file server which provides updates to files to the subscription service file server; said subscription service file server being triggerable, on receipt of an update to a file, to send a copy of the update to each caching file server logged in respect of that file. 5. A system according to claim 4 wherein said log is arranged to log caching file servers against individual file identifiers. 6. A system according to claim 4 wherein said log is arranged to log caching file servers against file categories. 7. A data access system for use in providing updated files in response to received file requests, the system comprising a source file server which provides a file updating service to at least one destination file server, the source file server being provided with: i) update detection means for monitoring one or more files stored by the source file server to detect an update thereto; ii) a destination server log for logging destination information with respect to one or more destination file servers; iii) file selection means for selecting files to be monitored by the update detection means; and means triggerable by a detected update to a file to output a copy of the update to any destination file server having destination information logged in respect of it. 8. A data access system according to claims 1 , 4 and 7.

Inventors: COBLEY RICHARD JOHN, EVANS PAUL ANDREW, COBLEY, RICHARD, JOHN, EVANS, PAUL, ANDREW
Applicants: BRITISH TELECOMM, COBLEY RICHARD JOHN, EVANS PAUL ANDREW, BRITISH TELECOMMUNICATIONS PUBLIC LIMITED COMPANY, COBLEY, RICHARD, JOHN, EVANS, PAUL, ANDREW
Application year: 2001
Main classification: G06F17
IPC codes: G06F7, G06F12, G06F13, G06F17