1. Technical Field
Embodiments of the present disclosure relate to document synchronization technology, and particularly to an electronic device and method for storing distributed electronic documents using the electronic device.
2. Description of Related Art
Globalized economic development creates multinational companies. Numerous multinational companies comprise a variety of departments distributed all over the world. Typically, a variety of information must be shared between multiple departments in a company. Data management and information sharing are pivotal for the efficient running of a multinational company. Departments need to access data and cooperate with each other over vast distances. Distributed database management systems are employed to enhance the efficiency of data access and to reduce error.
Many distributed database management systems have data stored in a variety of distributed physical locations, under a universal logic system. Users can access data stored in a remote storage as easily as data stored locally. However, each physical location has only one file transfer protocol (FTP) server for storing data in a current distributed database management system.
When the FTP server in one physical location is damaged, the documents stored in the FTP server will be lost if backups of the documents are not stored in other physical locations. In addition, a new FTP server with larger and more expensive storage capacity is needed when the storage space of an original FTP server is not enough, if storage is to be kept in a single new FTP server. Therefore, a more efficient method for storing distributed documents is desired.
All of the processes described below may be embodied in, and fully automated via, functional code modules executed by one or more general purpose electronic devices or processors. The code modules may be stored in any type of non-transitory computer-readable medium or other storage device. Some or all of the methods may alternatively be embodied in specialized hardware. Depending on the embodiment, the non-transitory computer-readable medium may be a hard disk drive, a compact disc, a digital video disc, a tape drive or other storage medium.
The network 140 may be an intranet, the Internet or other suitable communication network, such as general packet radio service (GPRS), Wi-Fi/Wireless local area network (Wi-Fi/WLAN), third generation/Wideband code division multiple access (3G/WCDMA), or 3.5G/High-Speed downlink packet access (3.5G/HSDPA). The branch-node 120 is described below to exemplify the apparatus and function of each of the branch-nodes.
The client computer 121 of the branch-node 120 includes a client proxy 201. The client proxy 201 separates executions for users from executions for the system (e.g., the operating system of the client computer 121), to simplify executions for users. The client proxy 201 includes a client processing module 202, a database processing module 203, and a file processing module 205. The application server system 122 of the branch-node 120 includes a file transfer protocol (FTP) server system 207 and an application server 209. The FTP server system 207 includes a plurality of slave FTP servers 213, 215, and one master FTP server 211. The master FTP server 211 provides both document upload and document download functions, and the slave FTP servers 213, 215 provide the document download function.
The client processing module 202 provides a graphical user interface (GUI) for users to input data. The client processing module 202 is connected to the database processing module 203 and the file processing module 205. The client processing module 202 sends commands to the file processing module 205 and the database processing module 203 for implementation, and displays the process results on the GUI.
The file processing module 205 is connected to the FTP server system 207, and sends file processing commands to the FTP server system 207. These file processing commands include read, edit, copy, save, update, and/or delete file, and the like. The file processing module 205 receives data from the database processing module 203.
The database processing module 203 is connected to the database server 123 via the application server 209. The database processing module 203 generates commands for searching, updating and deleting data stored in the database server 123, and sends results of implementation of the commands to the file processing module 205.
In one embodiment, the database server 123 stores a configuration table 300 (refer to
The area ID 301 records an ID of an area address of the branch-node 120, each branch-node has a unique area ID, for example, the area ID of the branch-node 120 is “001”. The server name 303 records a name (or a brief description) of a FTP server (e.g., the master FTP server or the slave FTP server). The server address 305 records an Internet protocol (IP) address of a FTP server, such as 10.153.24.199. The CPU load 307 records a current usage ratio of the CPU in each FTP server.
The tag 309 determines whether an FTP server is the master FTP server or the slave FTP server. For example, a first value “1” is used to indicate the master FTP server, and a second value “0” is used to indicate the slave FTP server. Each branch-node has one master FTP server and one or more slave FTP servers in the FTP server system. The master FTP server uploads and downloads documents, and the slave FTP server downloads documents. That is, the client computer 121 uploads the documents to the master FTP server 211.
The tag 309 of each FTP server is updated according to a change in status of the master FTP server 211. For example, the master FTP server may be the FTP server having the lowest CPU load. If the CPU load of a original master FTP server is greater than a preset value (e.g., 95%), one slave FTP server having the lowest CPU load currently is selected to be an updated master FTP server, and the tags of the original master FTP server and the selected slave FTP server (i.e., the updated master FTP server) are updated in the configuration table 300.
For example, the tag of the original master FTP server is changed from “1” to “0”, and the tag of the selected slave FTP server (i.e., the updated master FTP server) is changed from “0” to “1”. Thus, the original master FTP server is changed to the slave FTP server, and does not receive documents uploaded from the client computer 121. In one embodiment, the configuration table 300 in the database server 123 is synchronized in accordance with other configuration tables in other branch-nodes (e.g., 113, 133) periodically, for example, once every thirty minutes.
The FTP server system 207 stores documents. For example, the documents may be unstructured documents in various formats such as images, words, sounds and other media. The FTP server system 207 connects with other FTP server system in other branch-nodes 110, 130 via the network 140, and can exchange documents with other branch-nodes 110, 130.
The application server 209 connects to the client computer 121 and the database server 123. The application server 209 sends database processing commands received from the database processing module 203 to the database server 123, and returns the processing results to the database processing module 203.
The database server 123 includes a summary table 400 (refer to
The document ID 401 is one of a designated set of numbers for various documents stored in the information system. Each of the documents has a unique document ID. The document title 403 records a description of each document. The document location 405 records the IP address or a media access control (MAC) address of an FTP server showing where a document is located, for example, 10.153.24.199. The document directory 407 records a directory of documents in a corresponding FTP server. The update time 409 records a time of the most recent editing of a document.
In other embodiments, the database server 123 may be combined with the application server 209, for example, the functions of the database server 123 may be executed by the application server 209, and thus the database server 123 is removed. The application server 209 may be replaced by other suitable electronic devices, such as a smart phone, or a personal digital assistant (PDA).
The display device 220 may be a liquid crystal display (LCD) device, and the input device 221 may be a mouse or a keyboard used to input computer readable data. The storage device 223 may be a non-volatile computer storage chip that can be electrically erased and reprogrammed, such as a hard disk or a flash memory card.
The distributed document storing system 224 uploads a document to a master FTP server in a first branch-node according to the configuration table 300 in the first branch-node, sends a backup of the uploaded document to the master FTP server in other branch-nodes, and updates a tag of the master FTP server in the configuration table 300 according to a status change of the master FTP server. In one embodiment, the distributed document storing system 224 may include computerized instructions in the form of one or more programs that are executed by the at least one processor 225 and stored in the storage device 223 (or memory). A description of the distributed document storing system 224 is given in the following paragraphs.
In step S10, a client computer of a first branch-node sends a document upload command to an application server. For example, the first branch-node may be the branch-node 120.
In step S11, the document uploading module 231 receives the document upload command, and determines a master FTP server 211 “S1” in the FTP server system 207 of the first branch-node according to the tag of each FTP server recorded in the configuration table 300 of the first branch-node.
In step S12, the document uploading module 231 uploads a document corresponding to the document upload command to the master FTP server “S1”.
In step S13, the summary recording module 232 adds summary information of the document (i.e., the upload document) in the summary table 400 of the first branch-node. For example, the summary information may include a document ID, a document title, a storage location of the document in the first branch-node, a document directory, and update time (e.g., upload time) of the document.
In step S14, the document synchronizing module 233 synchronizes the document by sending a copy of the document to the master FTP servers in other branch-nodes as backup. A description of the synchronization step S14 is shown in
In another embodiment, the document synchronizing module 233 may send a backup of the configuration table 300 and of the summary table 400 of the first branch-node to other branch-nodes (e.g., 110, 130) at preset intervals (e.g., ten minutes).
In step S15, the data updating module 234 updates the tags of specified FTP servers in the configuration table 300 of the first branch-node when a preset condition is triggered. In another embodiment, step S15 may be executed before step S14.
For example, if the CPU load (or other parameters, such as memory usage ratio) of an original master FTP server is greater than a preset value (e.g., 95%) and the preset condition is triggered, then the data updating module 234 selects a slave FTP server having lowest CPU load from the first branch-node, the selected slave FTP server is determined and treated as an updated master FTP server. In other embodiments, the updated master FTP server may be selected randomly from the slave FTP servers in the first branch-node. The data updating module 234 changes the tag of the updated master FTP sever to a first value, and changes the tag of the original master FTP server to a second value so that the original master FTP server becomes a slave FTP server. For example, the first value is “1”, and the second value is “0”.
In other embodiments, the method further includes the step of obtaining a storage location of a specified document from the summary table 400 by the document downloading module 235 when a document download command is received from the client computer 121 in the first branch-node. The document downloading module 235 downloads the specified document from a corresponding FTP server of the first branch-node according to the storage location of the specified document.
In other embodiments, the method further includes the step of obtaining all storage locations of a specified document from the summary table 400 by the document deleting module 236 when a document delete command is received from the client computer 121 in the first branch-node. The document deleting module 236 deletes the specified document from a corresponding FTP server of each branch-node according to each obtained storage location of the specified document.
In step S141, the document synchronizing module 233 obtains a storage location of the document from the summary table 400 of the first branch-node according to a document ID of the document.
In step S142, the document synchronizing module 233 downloads the document from a specified FTP server of the FTP server system in the first branch-node according to the storage location of the document. The original master FTP server 211 may be changed at that time. However, the IP address (or the MAC address) of the original master FTP 211 is not changed, thus the storage location of the document is not changed even though the original status of the master FTP server is changed in the first branch-node.
In step S143, the document synchronizing module 233 determines a master FTP server “S2” in a FTP server system of a second branch-node (e.g. branch-node 130) according to a summary table of the second branch-node.
In step S144, the document synchronizing module 233 uploads the document to the master FTP server “S2” in the FTP server system of the second branch-node 130.
In step S145, the document synchronizing module 233 adds summary information of the document in the summary table 400 of the second branch-node 130. For example, the summary information may include the document ID, the document title, the storage location of the document in the second branch-node, the document directory, and the update time (e.g., upload time) of the document.
In the embodiments, the documents are stored in a plurality of FTP servers, the FTP servers include a master FTP server and one or more slave FTP servers, where the master FTP server is used to upload and download documents, the slave FTP server is used to download documents, and the upload operation and the download operation of the documents may be executed on different FTP servers at the same time, to improve access speed of the documents of the FTP servers. In addition, when one FTP server is damaged, the documents stored are not lost, to improve data security. If the storage space of the original master FTP server is not enough, a slave FTP server may be selected as an updated master FTP server from the FTP server system by changing the tag of the selected slave FTP server in the configuration table 300. There is no need to buy a larger storage capacity and more expensive server.
It should be emphasized that the above-described embodiments of the present disclosure, particularly, any embodiments, are merely possible examples of implementations, merely set forth for a clear understanding of the principles of the disclosure. Many variations and modifications may be made to the above-described embodiment(s) of the disclosure without departing substantially from the spirit and principles of the disclosure. All such modifications and variations are intended to be included herein within the scope of this disclosure and the present disclosure and protected by the following claims.
Number | Date | Country | Kind |
---|---|---|---|
201210181414X | Jun 2012 | CN | national |