A kind of method for designing backup security policy for double-computer transaction fileTechnical field
The invention belongs to electronic information technical field, particularly a kind of method for designing backup security policy for double-computer transaction file, and the application of this method in automatic ticket selling system for rail traffic.
Technical background
Track traffic AFC system is rail traffic ticket automatic selling and checking system (Automatic Fare Collection, be called for short AFC), be based on computer, communication, network, automatic control technology, realizing the automated system of overall processes such as ticketing, ticket checking, charge, statistics, management, also is the important component part of the normal operation of Rail Transit System.In the AFC system the inside, transaction file transaction data such as putting down in writing passenger ticket buying, enter the station, set off and deducting fees, whole operation there is very important effect, therefore rail traffic ticket automatic selling and checking system need be gathered and files a large amount of transaction files, requires to preserve to be no less than the transaction file in 1 year.
During present track traffic ticket selling and checking system uses unit and two-shipper scheme arranged.Wherein commonly used is the two-node cluster hot backup scheme, in the two-shipper scheme, after a station server breaks down, switch to an other station server adapter job, continual service is provided, but this mode subject matter is: the transaction file that collects before switching leaves on the local disk of first station server, after breaking down, this server switches to second station server, the transaction file that collect this moment can be stored on the local disk of second station server, cause all having deposited transaction file above the two-server, but all imperfect.This situation is brought a lot of inconvenience to administering and maintaining of transaction file, such as retrieval transaction file by date; By month transaction file is backuped to External memory equipment etc.
Along with the progress of science and technology, design a kind of existing equipment that can rely on track traffic AFC system transaction file is carried out the method that full backup is filed, be that relevant departments expect, have broad application prospects.
Summary of the invention
The objective of the invention is to lack the problem of transaction file integrality backup at existing track traffic AFC system, provide a kind of high safe, high complete, support verification and compression function in the solution of one, can well guarantee AFC system transaction file integrality and validity.
In order to realize goal of the invention, the technical scheme of employing is as follows:
A kind of method for designing backup security policy for double-computer transaction file, the two-server of use Dual-Computer Hot-Standby System is with active/standby configuration mode operation.
As shown in Figure 1, two-node cluster hot backup server A and B are connected with the network of other server and work station by switch C in local area network (LAN) D the inside.Server A is that main to use state, server B be stand-by state in the dual-machine hot backup system.The server B double as is a file server, is used to back up transaction file.FTP service can be provided on server B or method such as share directory is provided, allow the server A can be the transaction file B that uploads onto the server.
Under system's normal operation, as shown in Figure 2, server A is in the master and uses state, and server B is in stand-by state.When server A is received transaction file, storage is a in this locality, simultaneously this transaction file B that uploads onto the server, after uploading successfully, to local file and the B file of having uploaded onto the server compare, if the file that comparative result unanimity then represent is uploaded is the same with local content, upload success; If the inconsistent words of comparative result need be uploaded this transaction file again, the transaction file of uploading failure is placed in the another one catalogue, so that the attendant can in time carry out manual process easily.Server A kept 1 month at the transaction file of this locality.
When a certain server broke down, as shown in Figure 3, when server A breaks down, server B switched to the main state of using.When transaction file that server B receives, directly be put into local file the inside (transaction file of uploading with server A is placed in the same catalogue).
After fault restoration, after recovering when server A, A switches to the master and uses state, and server B is switched back stand-by state.This moment, operating state returned under system's normal operation, the transaction file that server A the receives B that uploads onto the server.
System every night is professional idle the time, and according to the time point that configures, server B regularly becomes the transaction file before 30 days 1 file to file by the sky compress backup, and is saved in appointed positions, deletes former transaction file after back up successfully.The transaction file of server A regular check this locality is deleted 1 month transaction file before.
Description of drawings
Fig. 1 is a normal running environment working state schematic representation of the present invention;
Fig. 2 is a unit failure environment working state schematic representation of the present invention;
Fig. 3 is a transaction document management schematic diagram after the fault restoration of the present invention.
Embodiment
Server A and server B are dual-machine hot backup systems, and two-server is disposed identical application program in same network the inside.Server B needs extra increasing: the FTP service is installed, so that server A can be uploaded transaction file; Dispose the compress backup application program.
The enforcement environment of this patent is divided into two kinds of different scenes.
Scene 1: server A is in the master and uses state, and server B is in stand-by state.After server A collects transaction file, a transaction file earlier in this locality storage, content according to transaction file generates the CRC check sign indicating number, server A is uploaded onto the server this document on the B by FTP then, upload the CRC check sign indicating number that calculates this document after finishing, compare former and later two CRC check sign indicating numbers, if the consistent transaction file of uploading of representing is complete, otherwise need upload this transaction file again, if attempt all unsuccessful words 5 times, server A need be noted this situation in the daily record the inside, simultaneously transaction file is duplicated a to the file the inside of uploading failure, so that the attendant can handle by hand.
Scene 2: server A breaks down, and server B switches to the main state of using.After service B collects transaction file, transaction file is saved in this locality, the transaction file of uploading with server A stores together, to make things convenient for unified management.Server B as main with collecting to such an extent that transaction file information records the journal file the inside during the server, so that the attendant checks.
Wait until the relatively more idle time of system business in morning, server A and server B need automatically perform some maintenance tasks.Server A is checked transaction file, removes 30 days files before; Check simultaneously and deposit the file that FTP uploads the failure file, if documentary words, system can attempt once more the FTP B that uploads onto the server, if still failure then provide eye-catching prompting interface or the mode by email is reminded the attendant to want in time manual and be deposited server B to file.Server B is checked the file of FTP, is the transaction file before 30 days that unit is compressed into file (one day transaction file is compressed in a file the inside) with the sky, and the correctness of verification file after compression is finished, correct words are then original transaction file deletion; If the compressed file failure then records the journal file the inside, notify the attendant in time to handle by the mode of eye-catching prompting interface or emial simultaneously.
The present invention has obtained good effect through using in No. three line ISCS of Guangzhou Underground system.