Abstract:
Browsers which are required to display a large amount of constantly changing real-time information tend to make excessive demands on available computational resources, since the browser needs to update the screen every time a piece of information in its document object model changes and this process is inherently inefficient. By queuing real-time data updates and emptying the queue at periodic intervals, all updates received within those intervals are simultaneously written to the browser&#39;s document object model, so reducing the burden of updating the screen. In addition, earlier updates held in the queue can be overwritten by subsequent updates, so that out-of-date information is never provided to the browser.

Description:
FIELD OF THE INVENTION  
         [0001]    This invention relates to the field of streaming real-time data to a browser.  
         BACKGROUND  
         [0002]    The World Wide Web is based on hypertext, which can be thought of as text which is not constrained to be sequential. The Web can handle much more than just text, so the more general term hypermedia is used to cover all types of content, including but not limited to pictures, graphics, sound and video. While the primary language for representing hypermedia content on the Web is HTML, other markup languages are constantly developing, including, for example, XML.  
           [0003]    HTML defines the structure and layout of a Web document by reference to a number of pre-defined tags with associated attributes. The tags and attributes are interpreted and the web page is accordingly displayed by a client application running on a computer, commonly referred to as a browser.  
           [0004]    Although the use of HTML on its own produces essentially static Web pages, it is well known to use scripting languages such as Javascript™ to enhance HTML functionality; the combination is often referred to as Dynamic HTML. The current generation of browsers use a document object model (DOM) to represent web pages internally. This is an application programming interface for valid HTML and well-formed XML documents. It defines the logical structure of a document and the way in which the document can be accessed and manipulated. In particular, it makes all of the content on a page available to scripting code and enables programs and scripts to dynamically access and update the content, structure and style of documents.  
           [0005]    For example, share prices displayed on a browser screen in the form of a table are each represented in the browser&#39;s document object model as a text object. The browser can be arranged to display real-time updates of each share price by continuously overwriting each text object in the document object model with data items streamed from a real-time data source.  
           [0006]    However, in commercial systems for use, for example, in financial trading environments, the browser screen is required to display a substantial amount of real-time data. In this case, it has been found that the provision of a large amount of constantly changing information to a browser can place an intolerably high load on the system processor, causing the display of updates to be delayed and in extreme cases, cause the browser to stop responding, resulting in the need to close and restart the browser or even reboot the entire system. In environments where the continuous provision of real-information is crucial to obtain a commercial advantage, such behaviour is unacceptable.  
           [0007]    The present invention aims to address the above problem.  
         SUMMARY OF THE INVENTION  
         [0008]    According to the present invention, there is provided a method of sending real-time data to a browser for display by the browser, wherein the browser is operative to update its display on receipt of a data item for display, the method comprising the steps of receiving a plurality of data items from a real-time data source, storing the plurality of data items as a batch and sending the batch of data items to the browser at a predetermined time.  
           [0009]    Advantageously, sending the data items to the browser as a batch allows the browser to perform a single updating procedure to update the screen, rather than having to repeatedly update the screen every time a single data item arrives.  
           [0010]    The batch of data items may be stored at the server to which the browser connects to obtain the real-time data, before being sent to the browser, or data items can be individually streamed from the server and stored as a batch at the client computer on which the browser runs.  
           [0011]    The batch storage method can comprise queuing the data items.  
           [0012]    The batch of data items can be sent to the browser from the server or from the client computer at predetermined intervals, for example around 4 times per second. The interval chosen should allow sufficient updates to be gathered to improve browser operation, without prejudicing the real-time nature of the data.  
           [0013]    In a browser which is configured to represent the data items as objects in a document object model, the step of sending the batch of data items to the browser can include writing all of the data items in the batch to the document object model concurrently.  
           [0014]    The method can further include replacing a data item in the batch with an updated data item from the real-time source. By replacing a data item which has not yet been sent to the browser with a later update, the earlier data item is never sent to the browser, resulting in a more efficient updating procedure.  
           [0015]    According to the invention, there is further provided a server for providing real-time data to a browser comprising means for receiving a plurality of data items from a real-time data source, means for storing the plurality of data items as a batch and means for streaming the batch of data items to the browser at a predetermined time.  
           [0016]    According to the invention, there is additionally provided a program for providing real-time data to a browser comprising means for receiving a plurality of data items from a real-time data source, means for storing the plurality of data items as a batch and means for streaming the batch of data items to the browser at a predetermined time. 
       
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
       [0017]    Embodiments of the invention will now be described by way of example with reference to the accompanying drawings, in which:  
         [0018]    [0018]FIG. 1 is a schematic diagram of an Internet based system for accessing real-time streaming data;  
         [0019]    [0019]FIG. 2 is a schematic diagram of the architecture of a typical computer;  
         [0020]    [0020]FIG. 3 illustrates a document object model corresponding to a first code extract;  
         [0021]    [0021]FIG. 4 is a screen-shot corresponding to the first code extract;  
         [0022]    [0022]FIG. 5 is a flow chart explaining the streaming of real-time financial data to a web browser in accordance with a first aspect of the invention;  
         [0023]    [0023]FIG. 6 is a flow chart illustrating an improvement to the method of FIG. 5;  
         [0024]    [0024]FIG. 7 is a flow chart explaining the streaming of real-time financial data to a web browser in accordance with a second aspect of the invention; and  
         [0025]    [0025]FIG. 8 is a flow chart illustrating an improvement to the method of FIG. 7. 
     
    
     DETAILED DESCRIPTION  
       [0026]    [0026]FIG. 1 is a schematic diagram of an Internet based system in which a client computer  1  connects to a server computer  2  via the Internet  3 . The client computer  1  is capable of running browser software  4 , for example, Internet Explorer™ or Netscape Navigator™ for viewing web pages provided by web server software  5  at the server computer  2 . A further server computer  6  provides a source of real-time data and its functionality will be described in detail below.  
         [0027]    The client computer  1  and server computers  2 ,  6  are conventional computers, an example architecture for which is shown in FIG. 2. Each computer  1 ,  2 ,  6  comprises a central processing unit (CPU)  7  for executing computer programs and managing and controlling the operation of the computer. The CPU  7  is connected to a number of devices via a bus  8 , the devices including a read/write device  9 , for example a floppy disk drive for reading and writing data and computer programs to and from a removable storage medium such as a floppy disk  10 , a storage device  11 , for example a hard disk drive for storing system and application software, a CD-ROM drive  12  and memory devices including ROM  13  and RAM  14 . The computer further includes a network card  15  for interfacing to a network  3  and user input/output devices, such as a mouse  16 , keyboard  17  and display  18 . It will be understood by the skilled person that the above described architecture is not limiting, but is merely an example of a typical computer architecture. It will be further understood that the described computer has all the necessary operating system and application software to enable it to fulfil its purpose.  
         [0028]    As mentioned above, the current generation of web browsers represent the content and format of web pages as a document object model (DOM). The DOM is an application programming interface (API) for documents which defines the logical structure of documents and the way a document is accessed or manipulated. The DOM specification is under constant development by the World Wide Web Consortium (W3C), but it is currently implemented differently depending on the browser software being used, so that access to and manipulation of the elements on a web page is browser type and browser version specific. Document object models are implemented by, for example, Internet Explorer version 4 and above and Netscape Navigator version 6.  
         [0029]    For example, the HTML extract shown as Code Extract  1  below is represented by the document object model shown in FIG. 3.  
                                                   &lt;table&gt;           &lt;tbody&gt;           &lt;tr&gt;           &lt;td&gt;British Energy&lt;/td&gt;           &lt;td&gt;£15.12&lt;/td&gt;           &lt;/tr&gt;           &lt;tr&gt;           &lt;td&gt;British Power&lt;/td&gt;           &lt;td&gt;£3.24&lt;/td&gt;           &lt;/tr&gt;           &lt;/tbody&gt;           &lt;/table&gt;                      
 
         [0030]    Code Extract  1   
         [0031]    Code Extract  1  also corresponds to the browser display shown at FIG. 4. A data item is embedded at a particular position in a web page by placing it into an HTML element at that position. An HTML element is defined by a pair of tags between which text can be placed, such as &lt;td&gt;. . . &lt;/td&gt;, &lt;div&gt;. . . &lt;/div&gt; or &lt;p&gt;. . . &lt;/p&gt;tags.  
         [0032]    The efficient streaming of real-time data to a browser is described below with reference to FIG. 5.  
         [0033]    Referring to FIG. 5, the client computer  1  connects to the server machine  2  to obtain a financial information service (step s 1 ). The web server  5  at the server  2  provides a web page which includes code for implementing the invention, referred to herein as a script (step s 2 ). For example, the HTML code for the web page includes a SCRIPT tag in the general form:  
         &lt;script language=javascript src=url&gt;&lt;/script&gt; 
         [0034]    The ‘stc’ attribute points to the url of the directory containing the program, written for example in Javascript, which provides the functionality according to the invention.  
         [0035]    The script performs browser detection (step s 3 ) in a manner well-known per se to determine whether the browser is at least Internet Explorer version 4, Netscape Navigator version 6 or some other browser which implements a DOM and therefore to determine which DOM should be used.  
         [0036]    The script then sets up the screen display by writing supplied or default attribute values to the document object model specifying how the data retrieved from the data source is to be presented (step s 4 ). For example, in relation to share price data, these attributes define what constitutes ‘up’ and what constitutes ‘down’ for the purpose of determining temporary background colour change (flashing) when a value updates. An attribute may specify that a value greater than the previous value is interpreted as ‘up’ and a value less than the previous value interpreted as ‘down’. Alternatively, a positive value is interpreted as ‘up’ and a negative value as ‘down’. Other attributes define the colour to be used for the background flash for down, up and no change updates respectively. The colour may be any valid HTML colour.  
         [0037]    Similarly, other attributes define the corresponding up/down definitions and colour changes for the foreground (text) colour change when a value updates. A ‘flashtime’ attribute is the length of time in milliseconds for which the background to each element remains highlighted, i.e. flashes, when the value of that element is updated. For example, flashtime=500 causes the colour of each element to change when the value updates and to revert to the original colour half a second later.  
         [0038]    The script is then arranged to identify the data items which are required to be updated (step s 5 ), so that the corresponding real-time information can be extracted from the relevant real-time data source. For example, each item is identified by symbol and field identifier (fid) attributes, which reference information from an external data source. For example, Caplin Systems Ltd., London, UK, have developed a web protocol known as Real Time Text Protocol (RTTP), which implements real-time streaming for almost all types of information, including logical records, news and free-format pages. RTTP data sources for providing information which is capable of being referenced by the symbol and fid attributes are available by subscription over the Internet. The identification of a data item can be performed, for example, by extracting identification information for that item included in the web page, in accordance with the procedure set out in our co-pending application no. 00309703.7, the disclosure of which is incorporated herein by reference.  
         [0039]    The ‘symbol’ attribute specifies the financial instrument which is being referenced. The symbol used to identify a particular instrument depends on the symbology being used by the data source. For example, symbol=“IBM.N” represents the Reuters symbology for the real-time price of IBM ordinary shares traded on the New York Stock Exchange.  
         [0040]    The ‘fid’ attribute specifies a piece of data relating to the financial instrument selected by the ‘symbol’ attribute. For example, typical values for a particular stock are “Bid”, “Ask”, “Mid”, “Chng” and “Cls”, representing the bid price, asking price, mid price, change on the day and previous day&#39;s closing price respectively. The range of ‘fids’ available for a particular financial instrument depends on the symbology being used by the data source. For example, fid=“Ask” displays the most recent price at which the instrument specified by the ‘symbol’ attribute was offered for sale in the market.  
         [0041]    The specified attributes are used to retrieve the data from the real-time data source as described in detail below.  
         [0042]    For example, a Java applet is used to implement a connection between the script and the data server  6  shown in FIG. 1. A request is sent via the applet to the data server  6  specifying the required data (step s 6 ). The script then waits to receive data from the server (step s 7 ). The data server  6  notes the data request (step s 8 ) and sends the latest available value of the updated data to the script (step s 9 ). The data server  6  then waits for further updates (step s 10 ). Every time the value of the requested data is updated, the updated value is sent to the script by the data server (step s 9 ). Each data item sent comprises a value, together with a symbol and a field identifier to enable identification of the item.  
         [0043]    Over a given time interval, for example 0.25 seconds, all the updated values received from the data server  6  are temporarily stored, for example by placing them into a queue as each is received (step s 11 ). The queue is emptied at predetermined intervals, for example, four times a second, by writing all the data items in the queue to the document object model concurrently (step s 12 ). The browser then updates the screen display (step s 13 ), taking account of all the changes made, rather than needing to recalculate the screen display based on each change as it arrives.  
         [0044]    While data is held in a queue, a data update which supersedes an existing data item may arrive. In a further improvement of the above method illustrated in FIG. 6, the script tests for this condition (step s 14 ), and if it determines that a later data item supersedes an earlier one, the earlier data item is replaced in the queue by the more recent data item (step s 15 ), so that the earlier data item is never written to the document object model. If there is no existing item in the queue corresponding to the latest update, the update is queued as before (step s 11 ). All queued data is then written to the DOM and the browser screen updated as described in relation to FIG. 5 (steps s 12  and s 13 ).  
         [0045]    In a second aspect of the invention shown in FIG. 7, the queuing is performed at the server rather than the browser. The initial steps s 1  to s 8  proceed as described in relation to the first aspect above. However, when the data server  6  receives an updated value it queues the value together with all previously updated values within a given interval, for example 0.25 seconds (step s 16 ). The server then determines whether the queue should be emptied (step s 17 ), which is done, for example, 4 times a second. If the queue is to be emptied, all of the items in the queue are streamed to the browser (step s 18 ) where they are written to the document object model concurrently (step s 19 ). The browser then updates the screen display (step s 20 ), taking account of all the changes made, rather than needing to recalculate the screen display based on each change as it arrives.  
         [0046]    In the event that the queue is not to be emptied, the server waits for updates (step s 21 ), queues them (step s 16 ) and then repeats the queue checking/emptying process.  
         [0047]    While the item updating embodiment of FIG. 6 has been described in relation to the first aspect of the invention illustrated in FIG. 5, it can also be used in conjunction with the second aspect of the invention described above with reference to FIG. 7, as shown in FIG. 8. The overwriting mechanism in this example is operative after each update is received (step s 21 ).  
         [0048]    While the above methods have been described in relation to a data server which provides a source of streaming data, it will be understood that the invention is not limited to this, but can be implemented with any data source, including a source from which data can be periodically requested, or by any method by which numerical or other information is updated or computed.  
         [0049]    Although the Web server machine  2  and data server  6  have been shown as separate computers, it will be understood that the web server  5  and data server  6  can be server processes running on the same physical machine.