Recherche Images Maps Play YouTube Actualités Gmail Drive Plus »
Recherche avancée dans les brevets | Images de page | Historique Web | Connexion

Brevets

  
[merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][graphic][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small]
[blocks in formation]

COMPUTER PROGRAM PRODUCT TO
ENABLE MULTIPLE COMPUTER SYSTEMS
TO SHARE SINGLE SEQUENTIAL LOG

This application is a division of U.S. application Ser. No. 5 08/394,582 filed Feb. 27 1995, (status: pending).

TECHNICAL FIELD

The present invention relates generally to sequential logs, and more particularly to a system and method for enabling 10 multiple computer systems to share a sequential log.

BACKGROUND ART

As is well known, a sequential log (also herein called "sequential log file," "sequential file log," or simply "log") 15 is a database wherein each new data record is stored in the next available (i.e., free) physical memory location of the log. In other words, in a sequential log, new data records are stored in sequential physical memory locations of the log.

For example, suppose that a computer system generates 20 the following data records (in the indicated order): record-A, record-B, and record-C. If the computer system writes these data records to a sequential log in the order in which the data records are created, then record-A would be stored in physical location N of the log, record-B would be stored in 25 physical location N+l of the log, and record-C would be stored in physical location N+2 of the log (where physical location N is the first available memory location in the log).

Consider FIG. 1, which illustrates an example computer system 102 and an example sequential log 106. The sequential log 106 includes a plurality of physical memory blocks 108A-108E, where each memory block 108 is of a size to store three data records. For example, memory block 108A stores data records A, B, and C. (The letter designations of data records indicate their sequence of creation. Thus, data record A was created first, data record B was created second, data record C was created third, etc.)

The computer system 102 includes a buffer 104 (implemented using random access memory, RAM, or a 4Q combination of registers, for example). The buffer 104 is of a size to store three data records.

The computer system 102 stores data records in the buffer 104 as such data records are created. In the example of FIG. 1, the buffer 104 has stored therein data records G and H. 45 When data record I is created, it shall be stored in the remaining slot of the buffer 104, at which time the buffer 104 shall be full.

When the buffer 104 becomes full, its contents are stored in the next available (free) block in the sequential log 106. 50 In the example shown in FIG. 1, the next available block in the sequential log 106 is block 108C. Thus, when the buffer 104 becomes full, its contents are stored in physical memory block 108C, as indicated by line 110.

As should be clear from the above discussion, data 55 records are stored in a sequential log in the order in which such data records are created. In the example of FIG. 1, data record A was the first to be created, and is thus stored in the first memory location of the log 106. Data record B was created immediately after data record A, and is thus stored 60 in the next memory location of the log 106.

This characteristic of sequential logs makes them well suited for use with applications where data records must be stored in the order in which they are created. Such applications include financial institutions (such as banks and loan 65 companies), insurance companies, package delivery services, food delivery services, etc.

30

35

Traditionally, a sequential log is dedicated to a single computer system, for the exclusive use by that computer system. This is the scenario presented in FIG. 1. With the advent of distributed and parallel processing, however, it has become advantageous to allow multiple computer systems (connected over a computer network, for example) to have access to a single sequential log.

Consider, for example, a banking scenario where a bank has a first branch and a second branch, the first and second branches being located in different cities. Suppose that a customer makes a withdraw at the first branch, and then later in the day makes a deposit at the second branch, and then still later in the day makes a withdraw at the first branch. It is preferable that the two computer systems (corresponding to the first and second branches) share the same sequential log. Otherwise, the first branch will have no knowledge of the deposit made at the second branch, such that the second withdraw at the first branch may be denied due to insufficient funds.

There are problems associated with allowing multiple computer systems to have access to a single sequential log. This is illustrated in FIG. 2, where a first computer system 202 and a second computer system 206 share a sequential log 210. The first system 202 temporarily stores data records in its internal buffer 204. Similarly, the second system 206 temporarily stores data records in its internal buffer 208. Note that the first system 202 has generated and stored data record A in its buffer 204. The second system 206 has then generated and stored data records B and C in its buffer 208. The first system 202 has then generated and stored data record D in its buffer 204.

The sequential log 210 stores data records it receives in sequential physical memory blocks, irrespective of the source of such data records. Suppose that the second system 206 generates and stores data record E in its buffer 208, and then sends the contents of its buffer 208 to the sequential log 210. Then, the first system 202 generates and stores data record F in its buffer 204, and sends the contents of its buffer 204 to the sequential log 210. In this scenario, the contents of buffer 208 would be stored in block 212A (as indicated by line 216), and the contents of buffer 204 would be stored in block 212B (as indicated by line 214).

According to this scenario, the contents of the sequential log 210 would be as follows (starting from the top of the log 210): B, C, E, A, D, F. Note that the data records are not stored in the sequential log 210 in the order in which they were created. Thus, the use of a sequential log with multiple computer systems results in improper behavior.

FIG. 3 illustrates one conventional approach for solving this problem, where each computer system is provided with its own sequential log. In the example of FIG. 3, a first computer system 302 is provided with a first sequential log 310, and a second computer system 306 is provided with a second sequential log 314. When buffer 304 in the first computer system 302 becomes full, its contents are stored in the next available block in the first log 310. Similarly, when buffer 308 in the second computer system 306 becomes full, its contents are stored in the next available block in the second log 314. At predetermined time intervals (such as the end of the day), the contents of the first and second logs 310, 314 are merged and sorted.

The approach shown in FIG. 3 is flawed for a number of reasons. First, this approach is very expensive, since each computer system must be provided with its own sequential log. Second, this approach is very complex, because the operation of all of the logs must be coordinated (so as to read out and merge the data contained in such logs).

3 4

Third, this approach is not transparent to existing com- FIGS. 7-10 are flowcharts representing the operation of

puter systems. Existing computer systems expect to com- the present invention, municate with a single sequential log. This is not the case

with this approach, which requires each computer system to BEST MODE FOR CARRYING OUT THE

operate with its own sequential log. Thus, this approach 5 INVENTION

requires changes in existing computer systems. r,,, . . . ,. . , . . , ,

n 1 he present invention is directed to a system and method

Fourth, this approach does not support a single database. for enabling multiple computer systems to share a singie

This is the case, since the data records are distributed among sequential log. since only a single sequentiai iog is required,

all of the individual sequential logs (such as logs 310 and ±e present invention is less complex, easier to implement

314 in FIG. 3). As a result, each computer system does not 10 and ... and less expensive than other approaches for

have real-time access to all of the data records. This char- sharing a sequentiai log among multiple computer systems

acteristic has many negative implications. (such as that shown in FIQ 3A and FIQ 3B)

Consider the first computer system 302 in FIG. 3. This According to the present invention, from the perspective

first computer system 302 does not have real-time access to f me uter temS; data records are sequentially stored

the data records in the second log 314. Suppose that data ^ ±e ntial j in order of irreSpective of the

record C represents a deposit by a bank customer, and data ... of sucfa ... Eacfa uter tem can access

record D represents a withdraw by the same bank customer. ^ of ±e d^ ... ^ ±e ntial h m real.time.

Since it does not have real-time access to the data records in ...

the second log 314, the first computer system 302 has no The Prfent invention is transparent to existing computer knowledge of the deposit (data record C). Consequently, the 20 systeJms (such as those shown ln F}GS- 1 and 2\ In other first computer system 302 may deny the withdraw (data ^°rds' exlstlng computer systems do not need to be modirecord D) for lack of sufficient funds. Thus, this approach fied to °Perate wlth the sequential log of the present invenmay result in improper operation. tlon'

Thus, what is required is an improved system and method The Present invention is well suited for use with appli

for enabling multiple computer systems to share a sequential 25 catlons where data records must be stored in the order in

jog which they are created (i.e., journal-type data records). Such

applications include (but are not limited to) financial insti

DISCLOSURE OF INVENTION tutions (such as banks and loan companies), insurance

Briefly stated, the present invention is directed to an companies, package delivery services, food delivery

improved system and method for enabling multiple com- 30 services, etc. In these applications, the sequential log is

puter systems to share a sequential log. The present inven- preferably implemented as a hierarchical database, although

tion includes a database system comprising a sequential log. tms ls not required.

The database system receives data records generated by An approach for implementing the present invention that

multiple computer systems, and stores such data records in was contemplated by the inventors is shown in FIG. 4.

the sequential log. The database system periodically reor- 35 According to this approach, all computer systems (such as a

ganizes the data records in the sequential log such that the first computer system 402 and a second computer system

data records are stored in sequential physical memory loca- 406) have access to a single shared memory 404. The

tions of the sequential log by order of their creation. computer systems 402, 406 store data records in the shared

According to the present invention, the data records memory 404 as they are created. When the shared memory include date/time creation stamps indicating the respective 404 becomes full, its contents are written to the first availdates and times at which the data records were created. The able (free) physical block in the sequential log 408. database system utilizes the date/time creation stamps to In the example of FIG. 4, the first computer system 402 reorganize the data records in the sequential log. In has created data record D, and has stored it in the shared particular, the database system extracts data records from the 4J memory 404. The second computer system 406 has created sequential log, sorts the extracted data records by their data record E, and has stored it in the shared memory 404. date/time creation stamps, and stores the sorted data records Suppose that the second computer system 406 then crein an archive storage device (such as the sequential log). ates data record F, and stores it in the shared memory 404,

Further features and advantages of the present invention, such that the shared memory 404 becomes full. The contents

as well as the structure and operation of various embodi- 50 of the shared memory 404 are then stored in physical block

ments of the present invention, are described in detail below 410B (indicated by line 412), which is the first available

with reference to the accompanying drawings. In the (free) physical block in the sequential log 408.

drawings, like reference numbers indicate identical or func- This approach allows multiple computer systems to

tionally similar elements. access a single sequential log, and data records are sequen

BRIEF DESCRIPTION OF DRAWINGS 55 tiallv stored in the sequential log in order of creation,

irrespective of the source of such creation. Also, each

The present invention will be described with reference to computer system can access all of the data records in the

the accompanying drawings, wherein: sequential log in real-time.

FIGS. 1-3 illustrate conventional sequential logs; However, this approach is not ideal for a number of

FIG. 4 illustrates an environment wherein multiple com- 60 reasons. First, this approach is not entirely transparent to

puter systems share a single sequential log according to a existing computer systems, since they must be modified to

first embodiment of the present invention; st0re their data records in the shared memory 404, rather

FIG. 5 illustrates an environment wherein multiple com- than an internal buffer. Second, this approach is subject to

puter systems share a single sequential log according to a race condition problems. For example, if the first computer

second embodiment of the present invention; 65 system 402 creates a record M at the same time that the

FIG. 6 is a block diagram of a computer used in the second computer system 406 creates a record N, then record

environment of FIG. 5; and M will be stored in the shared memory 404 before record N

5

only if record M arrives at the shared memory 404 before record N. (Such race condition problems can be eliminated by adding well known handshaking/protocol mechanisms.)

The inventors have developed another approach for enabling multiple computer systems to access a single 5 sequential log. This approach, which represents the preferred embodiment of the present invention, shall now be described with reference to FIG. 5.

According to the preferred embodiment of the present invention, a plurality of computer systems (such as a first 10 computer system 502, a second computer system 506, . . . , and an Nth computer system 510) have access to a common database system 514. The computer systems 502, 506, 510 also have access to a coordinate clock 522 (described below). Each of the computer systems 502, 506, 510 has an 15 internal buffer 504, 508, 512, respectively (implemented using random access memory, RAM, or a series of registers, for example). The computer systems 502, 506, 510 may be local to one another, or may be located physically distant to one another (in different offices, buildings, cities, countries, 20 etc.).

The database system 514 includes a sequential log 518 and a controller 516 which controls access to the sequential log 518. The sequential log 518 includes a plurality of physical memory blocks (for simplicity, only six blocks 520A-520F are shown in FIG. 5). Preferably, the size of each block 520 is the same as the size of the internal buffers 504, 508, 512. In the example of FIG. 5, the blocks 520 and the internal buffers 504, 508, 512 can each store three data

A 30

records.

Each of the computer systems 502, 506, 510 is preferably implemented using a computer 602 having a block diagram as shown in FIG. 6. The computer 602 includes one or more processors 604 connected to a bus 606. The computer 602 3J also includes a main memory 608, preferably random access memory (RAM), and a secondary memory 610 that includes, for example, a disk drive 612.

The computer 602 further includes a network interface 618 that couples the computer 602 to a communication 40 network 620. Preferably, the database system 514 is connected to this communication network 620, such that the first, second, and Nth computer systems 502, 506, 510 communicate with the database system 514 via the communication network 620 (other well known means for connect- 45 ing the computer systems 502, 506, 510 to the database system 514 can alternatively be used).

A suitable form of the computer 602 is the well known RISC System/6000 family of computers produced by IBM. Alternatively, the computer 602 is the well known System/ 50 390 family of computers produced by IBM. It should be understood, however, that other computers could alternatively be used without departing from the scope and spirit of the present invention.

The database system 514 may also be implemented using 55 a computer 602 as shown in FIG. 6. In this case, the sequential log 518 is stored in the main memory 608 and/or the secondary memory 610. The controller 516 preferably represents software which (when executing) resides in main memory 608 (alternatively, the controller 516 is imple- 60 mented primarily using hardware, as a hardware state machine, for example). (The computer program representing the controller 516 may be stored in a floppy disk or some other removable storage unit 616, which is read by the disk drive or some other storage device 612 and then transferred 65 to the main memory 608.) The controller 516, when executed, enables the computer 602 to perform the features

6

of the present invention as discussed herein. Thus, the controller 516 represents a controller of the computer 602.

The operation of the present invention shall now be described.

FIG. 7 is a flowchart 702 illustrating the operation of each of the computer systems 502, 506, 510 when storing a new data record in the associated internal buffer 504, 508, 512, respectively. For illustrative purposes, flowchart 702 shall be described with reference to the first computer system 502 (although the other computer systems 506, 510 operate in the same way). Flowchart 702 begins with step 704, where control immediately passes to step 706.

In step 706, the first computer system 502 creates a new data record. The new data record may be created in response to a command from a user. For example, in a banking situation, a new data record is created each time a customer performs a transaction (such as depositing, transferring, and withdrawing funds). The structure of the data record and the information stored in the data record are implementation dependent, and will be apparent to persons skilled in the relevant art.

In step 708, the first computer system 502 obtains the current date/time stamp (i.e., the current date and time). Preferably, the first computer system 502 performs step 708 by accessing and obtaining the current date/time stamp from a clock device, such as coordinate clock 522. The coordinate clock 522 keeps track of the current date and time, and makes this information available to the computer systems 502, 506, 510 upon request (the coordinate clock 522 may be connected to the computer systems 502, 506, 510 via a network, for example). Coordinate clocks are well known devices and, thus, the structure and operation of the coordinate clock 522 will be apparent to persons skilled in the art.

Alternatively, the first computer system 502 obtains the current date/time stamp in step 708 by acquiring the current date and time from its internal clock (not shown), which is synchronized with the internal clocks (not shown) in the other computer systems 506,510. According to this alternate embodiment, the internal clocks in the computer systems 502, 506, 510 are periodically synchronized to one another using well known procedures (for example, by having the computer systems 502, 506, 510 update their internal clocks using the current date and time provided by the coordinate clock 522).

In step 710, the first computer system 502 stores the data record and the date/time stamp in the next available (i.e., free) memory location of its internal buffer 504 (the data record could be considered to include both the data and the date/time stamp). Thus, according to the present invention, a date/time stamp is associated with each data record. When its internal buffer 504 becomes full (in the example of FIG. 5, the buffer 504 becomes full after three data records have been stored in it), the first computer system 502 transfers the content of the internal buffer 504 to the database system 514. The operation of flowchart 702 is complete after step 710 is performed, as indicated by step 712.

FIG. 8 is a flowchart 802 representing the operation of the database system 514 when it receives a data block from one of the computer systems 502, 506, 510. A data block preferably represents the contents of an internal buffer 504, 508, or 512 (i.e., three data records in the example of FIG. 5). Flowchart 802 begins with step 804, where control immediately passes to step 806.

In step 806, the database system 514 receives a data block from one of the computer systems 502, 506, 510.

« PrécédentContinuer »