1. Technical Field
The present disclosure relates to control systems and methods for data storage, and particularly to a control system connected to a storage device and a control method for data storage utilizing the control system.
2. Description of Related Art
Common digital electronic devices, such as video recorders, are widely used. An existing video recorder can store image/video data, sound data or other kinds of data in a storage device, such as a server which is connected to the video recorder via a network connector. However, if the connection/communication between the device and the server is disconnected while data is being transferred to the server, the data saving process will be suddenly interrupted, and as a result, lead to data loss.
Referring to
The electronic device 7 includes a processor 8 and a storage system 10. The processor 8 is connected to the storage system 10 that stores a number of modules each of which contains one or more computerized instructions to be executed by the processor 8. The number of modules includes a data storage module 102, a backup device control module 104, and a detecting module 106.
The data storage module 102 stores data, such as image or sound data, generated by the electronic device 7 to the server 40 and the SD card 20.
The backup device control module 104 detects whether the SD card 20 in the electronic device 7 is a new device. If the SD card 20 in the electronic device 7 is a new device, the backup device control module 104 formats the SD card 20 and partitions the SD card 20 into a data area 202 and an exclusive area 204 that stores a connection/communication status between the electronic device 7 and the server 40, such as connected/disconnected or up/down, and stores a connected status in the exclusive area 204 by default. If the SD card 20 in the electronic device 7 is not a new device, the SD card 20 is not formatted. In one embodiment, the backup device control module 104 searches for the exclusive area 204 in the SD card 20 to determine whether the SD card 20 is a new device. If the exclusive area 204 is found in the SD card 20, the SD card 20 is not a new device. If the exclusive area 204 is not found in the SD card 20, the SD card 20 is determined to be a new device.
The detecting module 106 periodically detects the connection/communication between the electronic device 7 and the server 40. If the connection is disconnected, the detecting module 106 stores a disconnected status in the exclusive area 204, and only stores data in the SD card 20. Otherwise, data is stored in the server 40 and the SD card 20. In one embodiment, the detecting module 106 detects the connection by pinging the server 40. The detecting module 106 further detects whether the connection between the electronic device 7 and the server 40 is reconnected. If the connection between the electronic device 7 and the server 40 is reconnected, the detecting module 106 stores a connected status in the exclusive area 204, and transfers data stored in the SD card 20 during the disconnected status to the server 40 to prevent data loss, and data is stored in the server 40 and the SD card 20 after finishing transferring data from the SD card 20 to the server 40. If the connection between the electronic device 7 and the server 40 is not reconnected, data keeps being stored in the SD card 20. In other embodiments, the detecting module 106 can also obtain the connection status between the electronic device 7 and the server 40 by searching for the exclusive area 204.
In step S100, the backup device control module 104 detects whether the SD card 20 in the electronic device 7 is a new device. If the SD card 20 in the electronic device 7 is a new device, the procedure goes to step S102. If the SD card 20 in the electronic device 7 is not a new device, the procedure goes to step S104.
In step S102, the backup device control module 104 formats the SD card 20, partitions the SD card 20 into a data area 202 and an exclusive area 204, and stores a connected status in the exclusive area 204.
In step S104, the detecting module 106 detects the connection between the electronic device 7 and the server 40. If the connection is disconnected, the procedure goes to step S106. Otherwise, the procedure goes to step S114.
In step S106, the detecting module 106 stores a disconnected status in the exclusive area 204.
In step S108, the detecting module 106 stores data in the SD card 20.
In step S110, the detecting module 106 determines whether the connection between the electronic device 7 and the server 40 is reconnected. If the connection between the electronic device 7 and the server 40 is reconnected, the procedure goes to step S112. If the connection between the electronic device 7 and the server 40 is not reconnected, the procedure returns to step S108.
In step S112, the detecting module 106 stores a connected status in the exclusive area 204, and transfers data stored in the SD card 20 during the disconnected status to the server 40 to prevent data loss.
In step S114, the data storage module 102 stores data generated by the electronic device 7 in the server 40 and the SD card 20, and the procedure goes to step S104.
It is to be understood, however, that even though numerous characteristics and advantages of the embodiments have been set forth in the foregoing description, together with details of the structure and function of the embodiments, the disclosure is illustrative only, and changes may be made in details, especially in matters of shape, size, and arrangement of parts within the principles of the embodiments to the full extent indicated by the broad general meaning of the terms in which the appended claims are expressed.
Number | Date | Country | Kind |
---|---|---|---|
200910305012.4 | Jul 2009 | CN | national |