Method and device for inputting data in multimedia service database on embedded device
View Patent ↗The present invention discloses a method and a device for inputting data in a multimedia service database on an embedded device. The method includes: when multimedia file scanning is performed, storing generated directory information of a multimedia file in a random access memory database (RAM-DB), and performing a RAM-DB to backup database (BAK-DB) data backup operation in a scanning process; and if an interruption occurs in the scanning process, and when the scanning continues after the scanning interruption ends, copying data in the BAK-DB to the RAM-DB, and continuing to scan, according to existing data in the RAM-DB, a multimedia file that is not scanned. In the present invention, two database files RAM-DB and BAK-DB are configured in a multimedia service system.
1. A method for inputting data in a multimedia service database on an embedded device comprising:
storing generated directory information of a multimedia file in a random access memory database (RAM-DB) when a multimedia file scanning process is performed;
performing a RAM-DB to backup database (BAK-DB) data backup operation in the multimedia file scanning process;
copying data in the BAK-DB to the RAM-DB based at least in part upon an occurrence of an interruption in the multimedia file scanning process;
continuing to scan, according to existing data in the RAM-DB, a multimedia file that is not scanned after the interruption ends;
detecting whether the directory information of the multimedia file exists in the BAK-DB when scanning the multimedia file;
copying the directory information of the multimedia file in the BAK-DB to the RAM-DB when the directory information of the multimedia file is detected in the BAK-DB;
scanning the multimedia file and writing generated directory information of the multimedia file into the RAM-DB when the directory information of the multimedia file is not detected in the BAK-DB;
detecting whether the directory information of the multimedia file exists in the RAM-DB when scanning the multimedia file;
skipping a scanning operation performed on the multimedia file when the directory information of the multimedia file is detected in the RAM-DB; and
scanning the multimedia file and writing the generated directory information of the multimedia file into the RAM-DB when the directory information of the multimedia file is not detected in the RAM-DB.
2. A device for inputting data in a multimedia service database on an embedded device comprising:
a scanning module configured to, when multimedia file scanning is performed, store generated directory information of a multimedia file in a random access memory database (RAM-DB);
a backup module configured to, in a scanning process, perform a RAM-DB to backup database (BAK-DB) data backup operation; and
an interruption processing module configured to copy data in the BAK-DB to the RAM-DB based at least in part upon an occurrence of an interruption in the scanning process and continue to scan, according to existing data in the RAM-DB, a multimedia file that is not scanned,
wherein the scanning module is further configured to:
detect whether directory information of the multimedia file exists in the BAK-DB when scanning the multimedia file;
copy the directory information of the multimedia file in the BAK-DB to the RAM-DB when the directory information of the multimedia file is detected in the BAK-DB;
scan the multimedia file and write generated directory information of the multimedia file into the RAM-DB when the directory information of the multimedia file is not detected in the BAK-DB;
detect whether directory information of the multimedia file exists in the RAM-DB when scanning the multimedia file;
skip a scanning operation performed on the multimedia file when the directory information of the multimedia file is detected in the RAM-DB; and
scan the multimedia file and write generated directory information of the multimedia file into the RAM-DB when the directory information of the multimedia file is not detected in the RAM-DB.