WO2013037257A1 - 一种防止移动终端存储卡频繁热插拔的方法及移动终端 - Google Patents

一种防止移动终端存储卡频繁热插拔的方法及移动终端 Download PDF

Info

Publication number
WO2013037257A1
WO2013037257A1 PCT/CN2012/080056 CN2012080056W WO2013037257A1 WO 2013037257 A1 WO2013037257 A1 WO 2013037257A1 CN 2012080056 W CN2012080056 W CN 2012080056W WO 2013037257 A1 WO2013037257 A1 WO 2013037257A1
Authority
WO
WIPO (PCT)
Prior art keywords
hot
memory card
time period
predetermined time
mobile terminal
Prior art date
Application number
PCT/CN2012/080056
Other languages
English (en)
French (fr)
Inventor
俞斌
杨维琴
Original Assignee
惠州Tcl移动通信有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 惠州Tcl移动通信有限公司 filed Critical 惠州Tcl移动通信有限公司
Publication of WO2013037257A1 publication Critical patent/WO2013037257A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0751Error or fault detection not based on redundancy
    • G06F11/0754Error or fault detection not based on redundancy by exceeding limits
    • G06F11/0757Error or fault detection not based on redundancy by exceeding limits by exceeding a time limit, i.e. time-out, e.g. watchdogs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/073Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in a memory management context, e.g. virtual memory or cache management

Definitions

  • the present invention relates to the field of mobile terminals, and in particular, to a method and a mobile terminal for preventing frequent hot swapping of a memory card of a mobile terminal.
  • Some mobile phones implement hot-swap technology on software and hardware for user convenience. In this way, the user can insert and remove the card when the phone is turned on, and the phone can correctly recognize the user's insertion and removal of the card.
  • the user frequently inserts and removes the card (plugs out immediately after insertion, and immediately inserts and pulls out immediately%), because the software operation involved in the insertion and removal of the card is very complicated, and it takes a lot of CPU time. And resources, so frequent user plugging and unplugging is easy to cause the mobile phone software to deal with it, and it will lead to crash when it is serious.
  • the technical problem to be solved by the present invention is to provide a method for preventing frequent hot swapping of a memory card of a mobile terminal and a mobile terminal, which can avoid the occurrence of a crash problem caused by frequent card insertion and removal by the user. It is guaranteed to be used normally when the user frequently inserts and removes the card, which provides convenience for the user.
  • a method for preventing frequent hot swapping of a memory card of a mobile terminal including:
  • the mobile terminal detects whether there is a hot plugging operation of the memory card. When it is detected that there is a hot plugging operation of the memory card, whether the number of hot plugging of the memory card reaches the preset number of hot plugging times in the first predetermined time period is counted.
  • the hot plugging function is automatically disabled
  • step A further includes:
  • step A further comprises: setting, by using a counter, counting the number of hot swapping of the memory card in the first predetermined time period, and initializing the counter to 0. .
  • step A specifically includes:
  • the mobile terminal detects whether there is a hot plugging operation of the memory card in real time
  • the counter When it is detected that there is a hot plugging operation of the memory card, the counter is turned on to count the number of hot swapping of the memory card in the first predetermined time period;
  • A3. Determine whether the number of hot swapping of the memory card reaches the preset upper limit of the number of hot plugging times in the first predetermined time period.
  • step A2 further comprises: when detecting a hot plugging operation of the memory card, and waiting for the number of hot plugging of the memory card in the first predetermined time period not to reach the pre When the upper limit of the number of hot plugs is set, the counter value is initialized to 0 to recount, and the process returns to step A1.
  • the method for preventing frequent hot swapping of a memory card of a mobile terminal wherein the memory card comprises an SD card, a microSD card, a miniSD card, and a TF card
  • a mobile terminal comprising:
  • a detecting module configured to detect whether there is a memory card hot plugging action
  • a judging module configured to: when the hot plugging operation of the memory card is detected, whether the number of hot plugging of the memory card reaches a preset upper limit of the number of hot plugging times in the first predetermined time period;
  • the hot plugging module is disabled, and when it is determined that the number of hot plugging of the memory card reaches the preset upper limit of the number of hot plugging times in the first predetermined time period, the hot plugging function is automatically disabled;
  • the hot plug module is restored, and the hot plug function is automatically restored after the hot plug function is disabled for a second predetermined period of time.
  • the mobile terminal wherein the method further includes:
  • a software counter that records the number of times the user has hot-swapped the memory card. When the user inserts or removes the memory card into the card slot, the value of the number of times is increased by one;
  • the hot plugging upper limit setting module is configured to set an upper limit value of the number of consecutive hot plugging of the memory card that the system can accept;
  • a first software timer configured to preset a first predetermined time period value, and set to record a first predetermined time period value by using a first software timer
  • a second software timer configured to preset a second predetermined time period value, and set a second predetermined time period value to be recorded by the second software timer.
  • the mobile terminal wherein the method further includes:
  • the re-counting module is configured to initialize the counter value when detecting that there is a hot plugging operation of the memory card and waiting for the number of hot plugging of the memory card in the first predetermined period of time does not reach the preset hot plugping number upper limit value Recount for 0.
  • the mobile terminal wherein the memory card comprises a TF card, a microSD card, an SD card, and a miniSD card.
  • the method for preventing frequent hot swapping of a memory card of a mobile terminal and the mobile terminal provided by the invention enable the mobile terminal to increase the function of preventing hot swapping of the memory card of the mobile phone, and can greatly reduce the crash caused by frequent insertion and removal of the memory card by the user. Such problems as failures provide users with convenience and extend the service life of mobile terminals.
  • FIG. 1 is a schematic structural diagram of a mobile phone according to an embodiment of the present invention.
  • FIG. 2 is a block diagram showing the functional principle of a mobile terminal according to an embodiment of the present invention.
  • FIG. 3 is a flowchart of a method for preventing frequent hot swapping of a memory card of a mobile terminal according to an embodiment of the present invention.
  • FIG. 4 is a flow chart of a method for preventing frequent hot swapping of a memory card of a mobile terminal according to a specific application embodiment of the present invention.
  • the mobile terminal of the embodiment of the present invention adds a function of preventing frequent hot swapping of the mobile phone memory card.
  • the mobile terminal in the embodiment of the present invention mainly uses a mobile phone as an example, and the required hardware condition is that storage is required on the mobile phone.
  • the card interface, and the number of the memory card interfaces may be N (N is a natural number, such as the memory card interface 1, the memory card interface 2, the memory card interface N shown in FIG. 1), and the N memory card interfaces are connected to the CPU.
  • the memory card needs to be supported for hot plugging, and the memory card includes an SD card, a microSD card, a miniSD card, a TF card, and the like.
  • a mobile terminal As shown in FIG. 2, a mobile terminal according to an embodiment of the present invention mainly sets the following functional modules:
  • the software counter 101 is used to record the number C of hot swapping of the memory card by the user. When the user inserts or removes the memory card into the card slot, the value C is incremented by one.
  • the hot swapping number upper limit setting module 102 is configured to set an upper limit value of the number of consecutive hot plugging of the memory card that can be accepted by the system; in this embodiment, the upper limit of the number of hot plugging times is defined as Cmax, the upper limit of the number of hot plugging times Cmax is used to set the number of consecutive hot plugs that the system can accept.
  • Cmax the upper limit of the number of hot plugging times
  • Cmax the number of times the user hot swaps the memory card C is greater than the number of hot swaps.
  • the system will disable the hot plug function.
  • the value of Cmax needs to be set before the function of preventing the hot swapping of the mobile phone memory card is enabled.
  • the first software timer 103 is configured to preset a first predetermined time period value, and set a first predetermined time period value to be recorded by the first software timer; the first software timer (T1) 103, in each system
  • the first software timer (T1) 103 is turned on after detecting that the memory card is inserted or removed, and if the memory card is inserted or removed before the first software timer (T1) 103 has not timed out,
  • the secondary operation will be considered as continuous, that is, the number C of hot swapping of the memory card by the user after this process is added twice, and the timeout period of T1, that is, the first predetermined time period value needs to be set in advance.
  • the second software timer 104 is configured to preset a second predetermined time period value, and set a second predetermined time period value to be recorded by the second software timer.
  • the second software timer (T2) 104 when the number C of hot-swappable memory cards is greater than Cmax, the system will disable the hot plug function, and simultaneously open the second software timer (T2) 104, when the second software timer ( After the second predetermined time period value preset by T2) 104 expires, the system will re-enable the hot plug function, and the timeout time of the second predetermined time period value preset by the second software timer (T2) 104 needs to be advanced. Settings.
  • the detecting module 105 is configured to detect whether there is a hot plugging operation of the memory card; when the user has the action of inserting and removing the memory card, detecting by the detecting module.
  • the judging module 106 is configured to: when the hot plugging operation of the memory card is detected, whether the number of hot plugging of the memory card reaches a preset upper limit of the number of hot plugging times in the first predetermined time period. For example, when the first predetermined time period is set to 1-10S, and the upper limit of the number of hot plugging times in the first time period 1-10S is set to 5 times.
  • the hot plug module 107 is configured to automatically disable the hot plug function when it is determined that the number of hot plugs of the memory card reaches a preset number of hot plug times in the first predetermined time period; for example, the hot plug function is connected As described above, when the number of hot plugs in the first predetermined time period 1-10S exceeds the upper limit of the number of hot plugs 5 times, the hot plug function of the mobile terminal is automatically disabled by prohibiting hot plugging. When the hot plug function is disabled, hot swapping the memory card on the mobile terminal of the embodiment will not work.
  • the hot plug module 108 is restored to automatically restore the hot plug function after the hot plug function is disabled for a second predetermined period of time.
  • the second predetermined time period is set to be 1-15S (seconds)
  • the hot plug of the mobile terminal is automatically prohibited.
  • the automatic hot plugging function is controlled by the recovery hot plug module 108 of the mobile terminal.
  • the mobile terminal further includes:
  • the recounting module 109 is configured to: when it is detected that there is a hot plugging operation of the memory card, and wait for the first predetermined period of time when the number of hot plugging of the memory card does not reach the preset upper limit of the number of hot plugging times, the counter value is Initialize to 0 to recount. That is, when the mobile terminal of the embodiment of the present invention detects that there is a hot plugging operation of the memory card, and the number of hot plugging of the memory card generated in the first time period, for example, 1-10S, does not exceed the upper limit of the number of hot plugging times, for example, When 5 times, the counter for recording the number of hot swapping of the memory card is automatically initialized to 0.
  • the embodiment of the present invention further provides a method for preventing frequent hot swapping of a memory card of a mobile terminal, as shown in FIG. 3 . It mainly includes the following steps:
  • Step S100 The mobile terminal detects whether there is a hot plugging operation of the memory card. When it is detected that there is a hot plugging operation of the memory card, whether the number of hot swapping of the memory card reaches a preset hot plug in the first predetermined time period Upper limit of the number of times;
  • the setting is used to count the number of hot swapping of the memory card in the first predetermined time period by a counter, and initialize the counter to zero.
  • Step S100 specifically includes:
  • the mobile terminal detects whether there is a hot plugging operation of the memory card in real time
  • the counter When it is detected that there is a hot plugging operation of the memory card, the counter is turned on to count the number of hot swapping of the memory card in the first predetermined time period;
  • A3. Determine whether the number of hot swapping of the memory card reaches the preset upper limit of the number of hot plugging times in the first predetermined time period.
  • the upper limit value of the number of hot swapping of the memory card is set to 5 times within the first predetermined time period of 1-10 seconds, it is detected in real time whether there is a hot plugging operation of the memory card, and is in the first During the time period 1-10, it is detected whether the number of hot swapping of the memory card exceeds a preset upper limit of the number of hot plugging times, for example, five times.
  • the step A2 further includes: when detecting a hot plugging operation of the memory card, and waiting for the number of hot plugging of the memory card for the first predetermined time period When the preset hot plug count upper limit value is not reached, the counter value is initialized to 0 to recount, and the process returns to step A1.
  • the mobile terminal of the embodiment of the present invention detects that there is a hot plugging operation of the memory card, and the number of hot plugging of the memory card generated in the first time period, for example, 1-10S, does not exceed the upper limit of the number of hot plugging times, for example, When 5 times, the counter for recording the number of hot swapping of the memory card is automatically initialized to 0, and the process returns to step A1.
  • Step S200 When it is determined that the number of hot plugging of the memory card reaches the preset upper limit of the number of hot plugging times in the first predetermined time period, the hot plugging function is automatically disabled.
  • the hot plug function is automatically disabled.
  • Step S300 When the hot plug function is prohibited from waiting for the second predetermined period of time, the hot plug function is automatically restored.
  • the second predetermined time period is set to be 1-15S (seconds)
  • the hot plug of the mobile terminal is automatically prohibited.
  • the automatic hot swap function is controlled by the recovery hot plug module 108 of the mobile terminal.
  • the method for preventing the hot swapping of the memory card of the mobile terminal is further performed. Before the step S100, the method further includes:
  • the memory card includes an SD card, a microSD card, a miniSD card, and a TF card.
  • the present invention further provides an application embodiment of a method for preventing frequent hot swapping of a memory card of a mobile terminal. As shown in FIG. 4, the method mainly includes the following steps:
  • step S15 When a card insertion or extraction operation is detected, the process proceeds to step S16.
  • step S16 Whether the software counter C is equal to 0. If not, the process proceeds to step S17, and if YES, the process proceeds to step S18.
  • step S17 Has the first software timer T1 timed out?
  • the process returns to step S13 (that is, when the mobile terminal in the embodiment of the present invention detects that there is a hot plugging operation of the memory card, and waits for the first time period, for example, 1-10S, the number of hot swapping of the memory card does not exceed the heat.
  • the upper limit of the number of times of insertion and removal is 5 times, the counter for recording the number of hot plugging of the memory card is automatically initialized to 0), and if not, the process proceeds to step S18;
  • step S18 the software counter C is incremented by 1, and proceeds to step S19;
  • step S19 whether the software counter C is greater than the plug-in number upper limit Cmax, if not, proceeds to step S20, and when yes, proceeds to step S21;
  • step S21 the second software timer T2 is turned on, and proceeds to step S22;
  • step S23 Is the second software timer T2 timed out? If yes, the process proceeds to step S24. If not, the process returns to step S22.
  • the method for preventing frequent hot swapping of a memory card of a mobile terminal and the mobile terminal provided by the present invention enable the mobile terminal to increase the function of preventing hot swapping of the memory card of the mobile phone, which can greatly reduce the frequent insertion and removal of the user. Problems such as crashes caused by the memory card, etc., provide convenience for the user and prolong the service life of the mobile terminal.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)

Abstract

本发明公开了一种防止移动终端存储卡频繁热插拔的方法及移动终端,所述方法包括:移动终端检测是否有存储卡热插拔动作,当检测到有存储卡热插拔动作时,在第一预定时间段内统计存储卡热插拔次数是否达到预设定的热插拔次数上限值;当判断在第一预定时间段内存储卡热插拔次数达到预设定的热插拔次数上限值,则自动禁止热插拔功能;当禁止热插拔功能等待第二预定时间段后,则自动恢复热插拔功能。其使移动终端增加了防止手机存储卡频繁热插拔的功能,能够大大降低由于用户频繁插拔存储卡造成的死机等故障等问题,为用户提供了方便,延长了移动终端的使用寿命。

Description

一种防止移动终端存储卡频繁热插拔的方法及移动终端
技术领域
本发明涉及移动终端领域,尤其涉及的是一种防止移动终端存储卡频繁热插拔的方法及移动终端。
背景技术
随着移动通信的发展和人们生活水平的不断提高,各种移动终端如手机的使用越来越普及,手机已经成为人们生活中不可缺少的通信工具。
现有技术中大部分手机都具外接存储卡的功能,各种存储卡在手机上越来越普及,特别是microSD卡,市面上几乎所有手机都提供这种卡的插槽。
有些手机为了用户使用方便在软件和硬件上实现了热插拔技术。这样,用户便可以在手机开机的情况下插入拔出卡,并且手机能正确识别用户对卡的插入和拔出。
但是,在某些情况下,用户频繁插拔卡(插入后马上拔出,又马上插入马上拔出……),由于卡的插入和拔出动作涉及的软件操作非常复杂,需要消耗大量CPU时间和资源,因此用户频繁的插拔容易导致手机软件上处理不过来,严重时会导致死机。
因此,现有技术还有待于改进和发展。
发明内容
本发明要解决的技术问题在于,针对现有技术的上述缺陷,提供一种防止移动终端存储卡频繁热插拔的方法及移动终端,其可以避免出现用户频繁插拔卡导致死机问题的产生,保证了在用户频繁热插拔卡的情况下正常使用,为用户提供了方便。
本发明解决技术问题所采用的技术方案如下:
一种防止移动终端存储卡频繁热插拔的方法,其中,包括:
A、移动终端检测是否有存储卡热插拔动作,当检测到有存储卡热插拔动作时,在第一预定时间段内统计存储卡热插拔次数是否达到预设定的热插拔次数上限值;
B、当判断在第一预定时间段内存储卡热插拔次数达到预设定的热插拔次数上限值,则自动禁止热插拔功能;
C、当禁止热插拔功能等待第二预定时间段后,则自动恢复热插拔功能。
所述防止移动终端存储卡频繁热插拔的方法,其中,所述步骤A之前还包括:
a、预先设定第一预定时间段值和第二预定时间段值,并设置通过第一软件定时器来记录第一预定时间段值、通过第二软件定时器来记录第二预定时间段值;
b、预先设定在第一预定时间段内热插拔次数上限值。
所述防止移动终端存储卡频繁热插拔的方法,其中,所述步骤A还包括:设置通过一计数器来统计在第一预定时间段内存储卡热插拔次数,并将该计数器初始化为0。
所述防止移动终端存储卡频繁热插拔的方法,其中,所述步骤A具体包括:
A1、移动终端实时检测是否有存储卡热插拔动作;
A2、当检测到有存储卡热插拔动作时,开启计数器来统计在第一预定时间段内存储卡热插拔次数;
A3、判断在第一预定时间段内统计存储卡热插拔次数是否达到预设定的热插拔次数上限值。
所述防止移动终端存储卡频繁热插拔的方法,其中,所述步骤A2还包括:当检测到有存储卡热插拔动作,并等待第一预定时间段存储卡热插拔次数没有达到预设定的热插拔次数上限值时,则将计数器值初始化为0进行重新计数,并返回步骤A1。
所述防止移动终端存储卡频繁热插拔的方法,其中,所述存储卡包括SD卡、microSD卡、miniSD卡、TF卡
一种移动终端,其中,包括:
检测模块,用于检测是否有存储卡热插拔动作;
判断模块,用于当检测到有存储卡热插拔动作时,在第一预定时间段内统计存储卡热插拔次数是否达到预设定的热插拔次数上限值;
禁止热插拔模块,用于当判断在第一预定时间段内存储卡热插拔次数达到预设定的热插拔次数上限值,则自动禁止热插拔功能;
恢复热插拔模块,用于当禁止热插拔功能等待第二预定时间段后,则自动恢复热插拔功能。
所述的移动终端,其中,其还包括:
软件计数器,用于记录用户热插拔存储卡的次数,当用户将存储卡插入或拔出卡槽时次数值都将加1;
热插拔次数上限设置模块,用于设置系统所能接受的存储卡连续热插拔次数上限值;
第一软件定时器、用于预先设定第一预定时间段值,并设置通过第一软件定时器来记录第一预定时间段值;
第二软件定时器,用于预先设定第二预定时间段值,并设置通过第二软件定时器来记录第二预定时间段值。
所述的移动终端,其中,其还包括:
重新计数模块,用于当检测到有存储卡热插拔动作,并等待第一预定时间段存储卡热插拔次数没有达到预设定的热插拔次数上限值时,则将计数器值初始化为0进行重新计数。
所述的移动终端,其中,所述存储卡包括TF卡、microSD卡、SD卡、miniSD卡。
本发明所提供的防止移动终端存储卡频繁热插拔的方法及移动终端,其使移动终端增加了防止手机存储卡频繁热插拔的功能,能够大大降低由于用户频繁插拔存储卡造成的死机等故障等问题,为用户提供了方便,延长了移动终端的使用寿命。
附图说明
图1是本发明实施例的手机的结构示意图。
图2是本发明实施例的移动终端功能原理框图。
图3是本发明一实施例的防止移动终端存储卡频繁热插拔的方法流程。
图4是本发明一具体应用实施例的防止移动终端存储卡频繁热插拔的方法流程图。
具体实施方式
本发明所提供的防止移动终端存储卡频繁热插拔的方法及移动终端,为使本发明的目的、技术方案及优点更加清楚、明确,以下参照附图并举实施例对本发明进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。
本发明实施例的移动终端增加了防止手机存储卡频繁热插拔的功能,如图1所示,本发明实施例的移动终端主要以手机为例,需要的硬件条件是在手机上需要有存储卡接口,并且存储卡接口的数目可以是N(N为自然数,如图1所示的存储卡接口1、存储卡接口2、存储卡接口N),该N个存储卡接口与CPU连接。在软件上需要支持存储卡热插拔,其中所述存储卡包括SD卡、microSD卡、miniSD卡、TF卡等。
如图2所示,本发明实施例的一种移动终端,主要设置以下功能模块:
软件计数器101,用于记录用户热插拔存储卡的次数C,当用户将存储卡插入或拔出卡槽时次数值C都将加1。
热插拔次数上限设置模块102,用于设置系统所能接受的存储卡连续热插拔次数上限值;本实施例中热插拔次数上限值定义为Cmax,热插拔次数上限值Cmax是用来设置系统所能接受的连续热插拔次数,当用户连续热插拔存储卡次数超过热插拔次数上限值Cmax,即用户热插拔存储卡的次数C大于热插拔次数上限值Cmax后,系统将禁止热插拔功能,Cmax的值需要在开启防止手机存储卡频繁热插拔的功能前设置。
第一软件定时器103、用于预先设定第一预定时间段值,并设置通过第一软件定时器来记录第一预定时间段值;第一软件定时器(T1)103,在每次系统检测到存储卡插入或拔出后都将开启第一软件定时器(T1)103,如果在第一软件定时器(T1)103未超时之前又检测到一次存储卡的插入或拔出,这两次操作将被认为是连续的,即在此过程后用户热插拔存储卡的次数C加了两次,T1的超时时间即第一预定时间段值需要提前设置。
第二软件定时器104,用于预先设定第二预定时间段值,并设置通过第二软件定时器来记录第二预定时间段值。第二软件定时器(T2)104,当热插拔存储卡的次数C大于Cmax后,系统将禁止热插拔功能,同时开启第二软件定时器(T2)104,当第二软件定时器(T2)104预设定的第二预定时间段值超时后,系统将重新使能热插拔功能,第二软件定时器(T2)104预设定的第二预定时间段值的超时时间需要提前设置。
检测模块105,用于检测是否有存储卡热插拔动作;当用户有插拔存储卡的动作时,通过该检测模块检测。
判断模块106,用于当检测到有存储卡热插拔动作时,在第一预定时间段内统计存储卡热插拔次数是否达到预设定的热插拔次数上限值。譬如,当设置第一预定时间段为1-10S,并设置在第一时间段1-10S内热插拔次数上限值为5次。
禁止热插拔模块107,用于当判断在第一预定时间段内存储卡热插拔次数达到预设定的热插拔次数上限值,则自动禁止热插拔功能;譬如,接上所述,当在第一预定时间段1-10S内热插拔次数超过热插拔次数的上限值5次时,则通过禁止热插拔自动禁止本移动终端的热插拔功能。当禁止热插拔功能后,在本实施例的移动终端上热插拔存储卡将不起作用。
恢复热插拔模块108,用于当禁止热插拔功能等待第二预定时间段后,则自动恢复热插拔功能。
譬如,设置第二预定时间段也为1-15S(秒),则接上所述,当移动终端由于在第一时间段内热插拔次超过其上限值而自动禁止本移动终端的热插拔功能后,等待第二预定时间段例如1-15S后没有发现新的存储卡热插拔动作,则通过本移动终端的恢复热插拔模块108控制自动恢复热插拔功能。
进一步的实施例的,如图2所示,所述的移动终端其还包括:
重新计数模块109,用于当检测到有存储卡热插拔动作,并等待第一预定时间段存储卡热插拔次数没有达到预设定的热插拔次数上限值时,则将计数器值初始化为0进行重新计数。即当本发明实施例的移动终端,检测到有存储卡热插拔动作时,并且在第一时间段例如1-10S内产生的存储卡热插拔次数没有超过热插拔次数上限值如5次时,则自动将用于记录存储卡热插拔次数的计数器初始化为0。
基于上述实话例的移动终端,本发明实施例还提供了一种防止移动终端存储卡频繁热插拔的方法,如图3所示。主要包括以下步骤:
步骤S100、移动终端检测是否有存储卡热插拔动作,当检测到有存储卡热插拔动作时,在第一预定时间段内统计存储卡热插拔次数是否达到预设定的热插拔次数上限值;
设置通过一计数器来统计在第一预定时间段内存储卡热插拔次数,并将该计数器初始化为0。
步骤S100具体包括:
A1、移动终端实时检测是否有存储卡热插拔动作;
A2、当检测到有存储卡热插拔动作时,开启计数器来统计在第一预定时间段内存储卡热插拔次数;
A3、判断在第一预定时间段内统计存储卡热插拔次数是否达到预设定的热插拔次数上限值。
如前面所述,当设定在第一预定时间段1-10秒内存储卡热插拔次数的上限值为5次时,则实时检测是否有存储卡热插拔动作,并在第一时间段1-10内检测存储卡热插拔次数是否超过预设定的热插拔次数上限值例如5次。
进一步地实施例,所述防止移动终端存储卡频繁热插拔的方法,所述步骤A2还包括:当检测到有存储卡热插拔动作,并等待第一预定时间段存储卡热插拔次数没有达到预设定的热插拔次数上限值时,则将计数器值初始化为0进行重新计数,并返回步骤A1。即当本发明实施例的移动终端,检测到有存储卡热插拔动作时,并且在第一时间段例如1-10S内产生的存储卡热插拔次数没有超过热插拔次数上限值如5次时,则自动将用于记录存储卡热插拔次数的计数器初始化为0,并返回步骤A1。
步骤S200、当判断在第一预定时间段内存储卡热插拔次数达到预设定的热插拔次数上限值,则自动禁止热插拔功能;
譬如如上所述,当在第一预定时间段1-10S内存储卡热插拔次数达到预设定的热插拔次数5次以上,则自动控制禁止热插拔功能。
步骤S300、当禁止热插拔功能等待第二预定时间段后,则自动恢复热插拔功能。
譬如,设置第二预定时间段也为1-15S(秒),则接上所述,当移动终端由于在第一时间段内热插拔次超过其上限值而自动禁止本移动终端的热插拔功能后,等待第二预定时间段例如1-15S后,则通过本移动终端的恢复热插拔模块108控制自动恢复热插拔功能
所述防止移动终端存储卡频繁热插拔的方法进一步地实施例,在所述步骤S100之前还包括:
a、预先设定第一预定时间段值和第二预定时间段值,并设置通过第一软件定时器来记录第一预定时间段值、通过第二软件定时器来记录第二预定时间段值;
b、预先设定在第一预定时间段内热插拔次数上限值。具体如上所述。
本发明实施例如,所述存储卡包括SD卡、microSD卡、miniSD卡、TF卡
基于上述实施例,本发明还提供了一种防止移动终端存储卡频繁热插拔的方法的应用实施例:如图4所示,主要包括以下步骤:
S10、开始。
S11、初始化开启防止热插拔过频繁功能。
S12、设置第一软件定时器T1和第二软件定时器T2,以及插拔次数上限值Cmax;譬如如上所述,设置第一软件定时器的第一预定时间段为1-10S,设置第二软件定时器的第二预定时间段为1-15S。以及设置插拔次数上限值Cmax为5次。
S13、设置软件计数器C的初始值等于0。
S14、等待存储卡的插入或拔出。即实时检测并等待存储卡的插入或拔出。
S15、当检测到一次卡插入或拔出动作时,进入步骤S16。
S16、软件计数器C是否等于0,当否时,进入步骤S17,当是时进入步骤S18。
S17、第一软件定时器T1超时了吗?当是时返回步骤S13(即当本发明实施例的移动终端,检测到有存储卡热插拔动作时,并等待第一时间段例如1-10S后产生的存储卡热插拔次数没有超过热插拔次数上限值如5次时,则自动将用于记录存储卡热插拔次数的计数器初始化为0),当否时,进入步骤S18;
S18、软件计数器C加1,并进入步骤S19;
S19、软件计数器C是否大于插拔次数上限值Cmax,当否时进入步骤S20,当是时进入步骤S21;
S20、继续开启第一软件定时器T1计时;并返回步骤S14;
S21、开启第二软件定时器T2,并进入步骤S22;
S22、控制禁止热插拔功能,进入S23;
S23、第二软件定时器T2超时了吗,当是时进入步骤S24,当否时返回步骤S22
S24、重新使用热插拔功能。
综上所述,本发明所提供的防止移动终端存储卡频繁热插拔的方法及移动终端,其使移动终端增加了防止手机存储卡频繁热插拔的功能,能够大大降低由于用户频繁插拔存储卡造成的死机等故障等问题,为用户提供了方便,延长了移动终端的使用寿命。
应当理解的是,本发明的应用不限于上述的举例,对本领域普通技术人员来说,可以根据上述说明加以改进或变换,所有这些改进和变换都应属于本发明所附权利要求的保护范围。

Claims (17)

  1. 一种防止移动终端存储卡频繁热插拔的方法,其特征在于,包括:
    A、移动终端检测是否有存储卡热插拔动作,当检测到有存储卡热插拔动作时,在第一预定时间段内统计存储卡热插拔次数是否达到预设定的热插拔次数上限值;
    A1、移动终端实时检测是否有存储卡热插拔动作;
    A2、当检测到有存储卡热插拔动作时,开启计数器来统计在第一预定时间段内存储卡热插拔次数;
    A3、判断在第一预定时间段内统计存储卡热插拔次数是否达到预设定的热插拔次数上限值;
    B、当判断在第一预定时间段内存储卡热插拔次数达到预设定的热插拔次数上限值,则自动禁止热插拔功能;
    C、当禁止热插拔功能等待第二预定时间段后,则自动恢复热插拔功能。
  2. 根据权利要求1所述防止移动终端存储卡频繁热插拔的方法,其特征在于,所述步骤A之前还包括:
    a、预先设定第一预定时间段值和第二预定时间段值,并设置通过第一软件定时器来记录第一预定时间段值、通过第二软件定时器来记录第二预定时间段值;
    b、预先设定在第一预定时间段内热插拔次数上限值。
  3. 根据权利要求1所述防止移动终端存储卡频繁热插拔的方法,其特征在于,所述步骤A还包括:设置通过一计数器来统计在第一预定时间段内存储卡热插拔次数,并将该计数器初始化为0。
  4. 根据权利要求1所述防止移动终端存储卡频繁热插拔的方法,其特征在于,所述步骤A2还包括:当检测到有存储卡热插拔动作,并等待第一预定时间段存储卡热插拔次数没有达到预设定的热插拔次数上限值时,则将计数器值初始化为0进行重新计数,并返回步骤A1。
  5. 根据权利要求1所述防止移动终端存储卡频繁热插拔的方法,其特征在于,所述存储卡包括SD卡、microSD卡、miniSD卡、TF卡。
  6. 一种防止移动终端存储卡频繁热插拔的方法,其特征在于,包括:
    A、移动终端检测是否有存储卡热插拔动作,当检测到有存储卡热插拔动作时,在第一预定时间段内统计存储卡热插拔次数是否达到预设定的热插拔次数上限值;
    B、当判断在第一预定时间段内存储卡热插拔次数达到预设定的热插拔次数上限值,则自动禁止热插拔功能;
    C、当禁止热插拔功能等待第二预定时间段后,则自动恢复热插拔功能。
  7. 根据权利要求6所述防止移动终端存储卡频繁热插拔的方法,其特征在于,所述步骤A之前还包括:
    a、预先设定第一预定时间段值和第二预定时间段值,并设置通过第一软件定时器来记录第一预定时间段值、通过第二软件定时器来记录第二预定时间段值;
    b、预先设定在第一预定时间段内热插拔次数上限值。
  8. 根据权利要求6所述防止移动终端存储卡频繁热插拔的方法,其特征在于,所述步骤A还包括:设置通过一计数器来统计在第一预定时间段内存储卡热插拔次数,并将该计数器初始化为0。
  9. 根据权利要求6所述防止移动终端存储卡频繁热插拔的方法,其特征在于,所述存储卡包括SD卡、microSD卡、miniSD卡、TF卡
  10. 一种移动终端,其特征在于,包括:
    检测模块,用于检测是否有存储卡热插拔动作;
    判断模块,用于当检测到有存储卡热插拔动作时,在第一预定时间段内统计存储卡热插拔次数是否达到预设定的热插拔次数上限值;
    禁止热插拔模块,用于当判断在第一预定时间段内存储卡热插拔次数达到预设定的热插拔次数上限值,则自动禁止热插拔功能;
    恢复热插拔模块,用于当禁止热插拔功能等待第二预定时间段后,则自动恢复热插拔功能。
  11. 根据权利要求10所述的移动终端,其特征在于,其还包括:
    软件计数器,用于记录用户热插拔存储卡的次数,当用户将存储卡插入或拔出卡槽时次数值都将加1;
    热插拔次数上限设置模块,用于设置系统所能接受的存储卡连续热插拔次数上限值;
    第一软件定时器、用于预先设定第一预定时间段值,并设置通过第一软件定时器来记录第一预定时间段值;
    第二软件定时器,用于预先设定第二预定时间段值,并设置通过第二软件定时器来记录第二预定时间段值。
  12. 根据权利要求10所述的移动终端,其特征在于,其还包括:
    重新计数模块,用于当检测到有存储卡热插拔动作,并等待第一预定时间段存储卡热插拔次数没有达到预设定的热插拔次数上限值时,则将计数器值初始化为0进行重新计数。
  13. 根据权利要求10所述的移动终端,其特征在于,所述存储卡包括TF卡、microSD卡、SD卡、miniSD卡。
  14. 一种移动终端,其特征在于,包括:
    判断模块,用于当检测到有存储卡热插拔动作时,在第一预定时间段内统计存储卡热插拔次数是否达到预设定的热插拔次数上限值;
    禁止热插拔模块,用于当判断在第一预定时间段内存储卡热插拔次数达到预设定的热插拔次数上限值,则自动禁止热插拔功能;
    恢复热插拔模块,用于当禁止热插拔功能等待第二预定时间段后,则自动恢复热插拔功能。
  15. 根据权利要求14所述的移动终端,其特征在于,包括:
    软件计数器,用于记录用户热插拔存储卡的次数,当用户将存储卡插入或拔出卡槽时次数值都将加1;
    热插拔次数上限设置模块,用于设置系统所能接受的存储卡连续热插拔次数上限值;
    第一软件定时器、用于预先设定第一预定时间段值,并设置通过第一软件定时器来记录第一预定时间段值;
    第二软件定时器,用于预先设定第二预定时间段值,并设置通过第二软件定时器来记录第二预定时间段值。
  16. 根据权利要求14所述的移动终端,其特征在于,包括:
    重新计数模块,用于当检测到有存储卡热插拔动作,并等待第一预定时间段存储卡热插拔次数没有达到预设定的热插拔次数上限值时,则将计数器值初始化为0进行重新计数。
  17. 根据权利要求14所述的移动终端,其特征在于,所述存储卡包括TF卡、microSD卡、SD卡、miniSD卡。
PCT/CN2012/080056 2011-09-14 2012-08-13 一种防止移动终端存储卡频繁热插拔的方法及移动终端 WO2013037257A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201110272150.4A CN102300001B (zh) 2011-09-14 2011-09-14 一种防止移动终端存储卡频繁热插拔的方法及移动终端
CN201110272150.4 2011-09-14

Publications (1)

Publication Number Publication Date
WO2013037257A1 true WO2013037257A1 (zh) 2013-03-21

Family

ID=45360166

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/080056 WO2013037257A1 (zh) 2011-09-14 2012-08-13 一种防止移动终端存储卡频繁热插拔的方法及移动终端

Country Status (2)

Country Link
CN (1) CN102300001B (zh)
WO (1) WO2013037257A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108228425A (zh) * 2017-12-29 2018-06-29 成都三零嘉微电子有限公司 一种Linux系统实施获取设备热插拔信息的系统
CN110580195A (zh) * 2019-08-29 2019-12-17 上海仪电(集团)有限公司中央研究院 一种基于内存热插拔的内存分配方法和装置

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102300001B (zh) * 2011-09-14 2014-04-16 惠州Tcl移动通信有限公司 一种防止移动终端存储卡频繁热插拔的方法及移动终端
CN104899084B (zh) * 2015-05-28 2018-09-25 惠州Tcl移动通信有限公司 电子设备和防止电子设备频繁切换工作状态的方法
CN106407143B (zh) * 2015-07-29 2020-07-31 南京中兴新软件有限责任公司 控制移动终端中cpu的热插拔操作的方法和装置
CN106708677B (zh) * 2016-12-05 2020-09-22 惠州Tcl移动通信有限公司 一种移动终端与外接设备接触不良的检测处理方法及系统
CN107148041B (zh) * 2017-06-20 2020-12-18 义乌市智享通讯设备有限公司 无线接入设备异常运行的检测方法及无线接入设备
CN107565630B (zh) * 2017-09-08 2020-05-05 宁波金氏实业有限公司 一种usb充电插口的控制方法及其充电插口
CN110213085B (zh) * 2019-05-14 2022-08-30 惠州Tcl移动通信有限公司 移动终端nfc配置参数的设置方法、储存介质及终端

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1445670A (zh) * 2002-03-15 2003-10-01 联想(北京)有限公司 实时监控计算机系统热插拔设备信息的系统
CN101192053A (zh) * 2007-12-12 2008-06-04 福建星网锐捷网络有限公司 模块化设备中热插拔模块的上电方法及热插拔控制电路
CN101505378A (zh) * 2008-02-06 2009-08-12 精工爱普生株式会社 数字信号处理装置、显示装置以及程序
US7620038B1 (en) * 2003-07-16 2009-11-17 Starent Networks, Corp. Using hot swap logic in a communication system
CN102300001A (zh) * 2011-09-14 2011-12-28 惠州Tcl移动通信有限公司 一种防止移动终端存储卡频繁热插拔的方法及移动终端

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11162570A (ja) * 1997-11-26 1999-06-18 Nec Corp コネクタの寿命警告表示方法とその装置
EP1139226A1 (en) * 2000-01-14 2001-10-04 Microchip Technology Inc. Method of emulating an attachment and detachment of a USB device
US7321313B1 (en) * 2003-07-30 2008-01-22 Tellabs Operations, Inc. Electronic insertion/extraction cycle counter and logger device
CN101017451A (zh) * 2006-12-05 2007-08-15 深圳创维-Rgb电子有限公司 一种在电视机上控制usb插拔的系统及方法
CN101615152B (zh) * 2009-07-13 2013-07-03 中兴通讯股份有限公司 存储卡热插拔故障的检测方法和装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1445670A (zh) * 2002-03-15 2003-10-01 联想(北京)有限公司 实时监控计算机系统热插拔设备信息的系统
US7620038B1 (en) * 2003-07-16 2009-11-17 Starent Networks, Corp. Using hot swap logic in a communication system
CN101192053A (zh) * 2007-12-12 2008-06-04 福建星网锐捷网络有限公司 模块化设备中热插拔模块的上电方法及热插拔控制电路
CN101505378A (zh) * 2008-02-06 2009-08-12 精工爱普生株式会社 数字信号处理装置、显示装置以及程序
CN102300001A (zh) * 2011-09-14 2011-12-28 惠州Tcl移动通信有限公司 一种防止移动终端存储卡频繁热插拔的方法及移动终端

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108228425A (zh) * 2017-12-29 2018-06-29 成都三零嘉微电子有限公司 一种Linux系统实施获取设备热插拔信息的系统
CN110580195A (zh) * 2019-08-29 2019-12-17 上海仪电(集团)有限公司中央研究院 一种基于内存热插拔的内存分配方法和装置
CN110580195B (zh) * 2019-08-29 2023-11-07 上海仪电(集团)有限公司中央研究院 一种基于内存热插拔的内存分配方法和装置

Also Published As

Publication number Publication date
CN102300001A (zh) 2011-12-28
CN102300001B (zh) 2014-04-16

Similar Documents

Publication Publication Date Title
WO2013037257A1 (zh) 一种防止移动终端存储卡频繁热插拔的方法及移动终端
WO2012000417A1 (zh) Usb设备识别主机操作系统的方法
WO2015135443A1 (en) Method and apparatus for simulating sound in virtual scenario, and terminal
WO2017067286A1 (zh) 一种指纹模板更新方法、装置及终端
WO2018082142A1 (zh) 一种录屏方法以及装置
WO2017088664A1 (zh) 集群文件系统的数据处理方法和装置
WO2018076844A1 (zh) 数据备份的方法、装置、存储介质及电子设备
WO2017036204A1 (zh) 应用程序切换时的焦点定位方法及装置
WO2017201897A1 (zh) 智能电视故障信息收集方法及装置
WO2017206875A1 (zh) 一种基于数据包的处理方法、装置、存储介质及电子设备
WO2012126246A1 (zh) 一种多卡移动终端及其sim卡数据转存方法
WO2018161580A1 (zh) 广播的控制方法、装置、存储介质及电子设备
WO2017118170A1 (zh) 一种移动终端的桌面启动器的定制方法及系统
WO2016065619A1 (zh) 一种数据流量管理方法及装置
WO2018161588A1 (zh) 广播接收者队列调整方法、装置、存储介质及电子设备
WO2018034491A1 (en) A primary device, an accessory device, and methods for processing operations on the primary device and the accessory device
WO2017215233A1 (zh) 一种终端电源键控制方法及系统
WO2017197752A1 (zh) 一种系统切换方法、系统切换装置及终端
WO2018010507A1 (zh) 终端系统的唤醒监控方法、存储介质、终端及电子设备
WO2020251192A1 (en) Electronic device and method of utilizing storage space thereof
WO2018161581A1 (zh) 控制广播发送的方法、装置、存储介质及电子设备
WO2017092267A1 (zh) 频道处理方法及装置
WO2019205272A1 (zh) 虚拟机服务提供方法、装置、设备及计算机可读存储介质
WO2017133054A1 (zh) 即时通信服务调用方法及企业服务总线服务器
WO2017219636A1 (zh) 数据交互方法、云端服务器以及智能终端

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12832368

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12832368

Country of ref document: EP

Kind code of ref document: A1