CN100481040C - Method for implementing real-time hot-plug of USB memory under TV embedded Linux system - Google Patents
Method for implementing real-time hot-plug of USB memory under TV embedded Linux system Download PDFInfo
- Publication number
- CN100481040C CN100481040C CNB2006100328416A CN200610032841A CN100481040C CN 100481040 C CN100481040 C CN 100481040C CN B2006100328416 A CNB2006100328416 A CN B2006100328416A CN 200610032841 A CN200610032841 A CN 200610032841A CN 100481040 C CN100481040 C CN 100481040C
- Authority
- CN
- China
- Prior art keywords
- memory device
- usb memory
- subregion
- application layer
- situation
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims abstract description 24
- 238000012544 monitoring process Methods 0.000 claims description 6
- 230000008569 process Effects 0.000 abstract description 2
- 230000004044 response Effects 0.000 abstract description 2
- 238000005192 partition Methods 0.000 abstract 1
- 230000007246 mechanism Effects 0.000 description 2
- 230000009467 reduction Effects 0.000 description 2
- 238000002679 ablation Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The invention relates to a method for realizing hot plugging of USB storage device in the television embedded Linux system. The inventive method is characterized in that it can create a protection process between the core program and the application program to make the application program be aware of the connection status of the USB storage devices, and can perform partition automatic load or unload according to the plugging or unplugging status of the USB storage devices. The method has the advantages of being simple and having rapid response.
Description
Technical field
The present invention relates to the embedded OS field, especially relate to a kind of hot-swappable method of USB memory device of under the TV set embedded Linux system, carrying out in real time.
Background technology
Adopt the product of USB interface when it is worked, not carry out plug, particularly USB is moved storage device, may damage data wherein, just can reuse after generally having only format.In addition can not be at short notice frequent plug flash memory disk because after product was inserted USB interface, system needed certain hour, just can be reacted, and it be pulled up at once, then probably causes system mistake.
For embedded Linux system, this problem is especially outstanding.In built-in Linux, kernel and equipment support have all been deleted many; And in built-in Linux, do not have the complete hot-swappable and carry mechanism of a cover at the USB memory device.Set up such cover mechanism, can in kernel, make amendment, but it is bigger to revise technical difficulty like this, and can not guarantees kernel integrity.
Summary of the invention
The object of the present invention is to provide a kind of hot-swappable method of USB memory device of under the TV set embedded Linux system, carrying out in real time.
The objective of the invention is to be realized by following technical scheme: the USB memory device is realized hot-swappable method in real time under this TV set embedded Linux system, its improvements are to create a finger daemon between kernel program and application layer program, make the application layer program understand the connection situation of USB memory device in real time, this method comprises:
When finger daemon finds that the USB memory device inserts, check whether be memory device;
If check USB memory device subregion situation;
According to the subregion situation, adopt the method carry subregion that writes synchronously;
After carry is finished, send successfully letter to the application layer program;
When finger daemon found that the good USB memory device of carry is extracted, the information that gives a warning was given the application layer program;
Carry out the subregion unloading according to the USB memory device situation of extracting.
The USB memory device is realized hot-swappable method in real time under the above-mentioned TV set embedded Linux system, described finger daemon be independent of control terminal and periodically carry out certain task or etc. pending some event; Its monitoring point can be/ digital document under the proc/scsi/usb-storage catalogue, and concrete monitoring periods is set at a second level.
It is hot-swappable to carry out the USB memory device in real time by this method under the TV set embedded Linux system, and the situation of loss of data can not occur.This method is simple and practical, do not destroy kernel integrity, and response speed is fast.Owing to do not revise kernel, safeguard that debugging cost reduces greatly.Simultaneously, improved the real-time of Linux.
Description of drawings
Fig. 1 is a method flow diagram of the present invention.
Embodiment
Below in conjunction with accompanying drawing the present invention is described in further detail:
See also shown in Figure 1, the present invention carries out the hot-swappable method of USB memory device in real time on TV set embedded Linux be to utilize finger daemon in the built-in Linux (Daemon) to monitor the plug situation of USB memory device, and feed back to the program of application layer, control the carry and the unloading of USB memory device by the application layer program, thereby realize real-time hot-swappable method.
At first create the finger daemon (Daemon) of a Linux, allow it constantly monitor plug situation of USB device.Finger daemon (Daemon) is a kind of special processing that operates in the backstage.It is independent of control terminal and periodically carry out certain task or etc. pending some event.Can its monitoring point be/proc/scsi/usb-storage-? digital document under the catalogue, concrete monitoring periods can be looked the application complexity and decide, and is set at a second level here.
When finger daemon finds to have USB device to insert, will check whether be memory device, if, the subregion situation of checkout facility then.Simultaneously, carry out the carry subregion according to the situation of subregion.After carry is finished, send a piece of news to other the program of application layer, so that other program is handled.When carrying out the carry subregion according to the subregion situation, this method has adopted the hanging method of " writing synchronously ", makes it write cache invalidation.Do some performances of meeting reduction like this, still, because USB memory device speed is fast, and buffer memory is still effective when reading, so its performance reduction is not obvious, but can significantly promote its stability, extracts the reliability that equal energy assurance writes in power down suddenly, ablation process.
When the finger daemon good USB device of finding that carry is arranged was extracted, the information that can give a warning was immediately given the program of application layer, and deletes mount point from system.Because adopt synchronous writing mode during carry, unexpected not extracting can bring any harm to system.
Claims (2)
1, the USB memory device is realized hot-swappable method in real time under a kind of TV set embedded Linux system, it is characterized in that between kernel program and application layer program, creating a finger daemon, make the application layer program understand the connection situation of USB memory device in real time, this method comprises:
When finger daemon finds that the USB memory device inserts, check whether be memory device;
If check USB memory device subregion situation;
According to the subregion situation, adopt the method carry subregion that writes synchronously;
After carry is finished, send into function signal to the application layer program;
When finger daemon found that the good USB memory device of carry is extracted, the information that gives a warning was given the application layer program;
Carry out the subregion unloading according to the USB memory device situation of extracting.
2, the USB memory device is realized hot-swappable method in real time under a kind of TV set embedded Linux according to claim 1 system, it is characterized in that described finger daemon be independent of control terminal and periodically carry out certain task or etc. pending some event; Its monitoring point can be/ digital document under the proc/scsi/usb-storage catalogue, and concrete monitoring periods is set at a second level.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2006100328416A CN100481040C (en) | 2006-01-13 | 2006-01-13 | Method for implementing real-time hot-plug of USB memory under TV embedded Linux system |
HK07103716.0A HK1096176A1 (en) | 2006-01-13 | 2007-04-10 | A real-time plug in/out method of a usb device in an embedded linux system of a television |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2006100328416A CN100481040C (en) | 2006-01-13 | 2006-01-13 | Method for implementing real-time hot-plug of USB memory under TV embedded Linux system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN1877550A CN1877550A (en) | 2006-12-13 |
CN100481040C true CN100481040C (en) | 2009-04-22 |
Family
ID=37509991
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNB2006100328416A Expired - Fee Related CN100481040C (en) | 2006-01-13 | 2006-01-13 | Method for implementing real-time hot-plug of USB memory under TV embedded Linux system |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN100481040C (en) |
HK (1) | HK1096176A1 (en) |
Families Citing this family (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101452369B (en) | 2007-11-29 | 2012-01-25 | 国际商业机器公司 | Method and system for controlling logical unit of USB mass storage device |
CN101847101A (en) * | 2009-03-24 | 2010-09-29 | Tcl集团股份有限公司 | Method for automatically mounting USB storage device under embedded Linux |
CN102023940B (en) * | 2009-09-16 | 2013-07-10 | 研祥智能科技股份有限公司 | CPCI (compact peripheral component interconnection) hot swapping system |
CN101790052A (en) * | 2010-03-16 | 2010-07-28 | 青岛海信电器股份有限公司 | Method for realizing television USB Widget and television |
CN102455981A (en) * | 2010-10-19 | 2012-05-16 | 康佳集团股份有限公司 | Method for realizing hot plug of USB device based on QTE environment |
CN102411554B (en) * | 2011-08-09 | 2015-04-29 | Tcl集团股份有限公司 | Hot-plugging method, apparatus and terminal device for USB (universal serial bus) storage devices |
CN102866964B (en) * | 2012-09-18 | 2015-06-03 | 北京奇虎科技有限公司 | Method and device for protecting data on storage equipment |
CN104700048B (en) * | 2012-09-18 | 2018-03-16 | 北京奇虎科技有限公司 | The method and device of data in a kind of protection storage device |
CN104461489A (en) * | 2013-09-22 | 2015-03-25 | 安一恒通(北京)科技有限公司 | Method and device for quickly popping up removable device and user device |
CN103530124B (en) * | 2013-10-18 | 2017-01-25 | 中安消技术有限公司 | Method and device for sharing hot plug device in Linux system |
CN105589657A (en) * | 2014-10-23 | 2016-05-18 | 中兴通讯股份有限公司 | Method and device for realizing mounting of mobile storage |
CN104734979A (en) * | 2015-04-07 | 2015-06-24 | 北京极科极客科技有限公司 | Control method for storage device externally connected with router |
CN106598798B (en) * | 2016-12-19 | 2019-11-19 | 四川长虹电器股份有限公司 | The method of Android intelligent equipment detection USB device |
CN107831534A (en) * | 2017-12-15 | 2018-03-23 | 合肥国为电子有限公司 | Untethered memory-type seismic detector data acquisition device and method based on USB flash disk interaction |
CN118170443A (en) * | 2024-03-20 | 2024-06-11 | 苏州西默医疗科技有限公司 | U disk automatic identification and formatting method and system based on embedded system |
-
2006
- 2006-01-13 CN CNB2006100328416A patent/CN100481040C/en not_active Expired - Fee Related
-
2007
- 2007-04-10 HK HK07103716.0A patent/HK1096176A1/en not_active IP Right Cessation
Non-Patent Citations (2)
Title |
---|
基于嵌入式Linux系统的DVB-CI设备驱动的开发. 周庆喜,刘强.计算机应用,第25卷第7期. 2005 |
基于嵌入式Linux系统的DVB-CI设备驱动的开发. 周庆喜,刘强.计算机应用,第25卷第7期. 2005 * |
Also Published As
Publication number | Publication date |
---|---|
HK1096176A1 (en) | 2007-05-25 |
CN1877550A (en) | 2006-12-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN100481040C (en) | Method for implementing real-time hot-plug of USB memory under TV embedded Linux system | |
US6415387B1 (en) | Low power mode computer with simplified power supply | |
US20080140736A1 (en) | Hardware-Initiated Automated Back-Up of Data from an Internal Memory of a Hand-Portable Electronic Device | |
US9152562B2 (en) | Storage sub-system for a computer comprising write-once memory devices and write-many memory devices and related method | |
EP0886240A3 (en) | A card-type storage medium | |
CN102819442B (en) | A kind of method and system of embedded device program burn writing | |
TW201222256A (en) | Memory storage device, memory controller thereof, and method for responding instruction sent from host thereof | |
CN102830970A (en) | Hot-plug treatment method applicable to Linux embedded system | |
CN103186385A (en) | Electronic device capable of setting starting parameter and setting method | |
CN102439557A (en) | Hybrid storage device | |
CN109496292A (en) | A kind of disk management method, disk management device and electronic equipment | |
CN114579055B (en) | Disk storage method, device, equipment and medium | |
CN103617053A (en) | Method and device for upgrading software | |
CN102355568A (en) | Method and device for carrying out charged uninstallation and installation of hard disk for digital video recorder | |
CN104077250A (en) | Connection processing method and device for intelligent terminal and storage equipment | |
CN201063240Y (en) | Mobile hard disk with read-write protection switch | |
US6907506B2 (en) | Security device for a mass storage | |
US20200104061A1 (en) | Data protection method and associated storage device | |
CN102023906B (en) | Microprocessor of portable terminal as well as portable terminal and repair method thereof | |
TWI741271B (en) | Data protection method and associated storage device | |
CN210776642U (en) | Automatic disk splicing device for multiple TF cards | |
CN114968297A (en) | OTA (over the air) upgrading method, electronic equipment and chip system | |
CN100592258C (en) | Memory card supporting self start-up | |
CN104794023B (en) | An a kind of one-key backup method | |
CN115525466A (en) | Log reading method, system, device, equipment and computer readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
REG | Reference to a national code |
Ref country code: HK Ref legal event code: DE Ref document number: 1096176 Country of ref document: HK |
|
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
REG | Reference to a national code |
Ref country code: HK Ref legal event code: GR Ref document number: 1096176 Country of ref document: HK |
|
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20090422 Termination date: 20160113 |
|
CF01 | Termination of patent right due to non-payment of annual fee |