CN104077193B - A kind of control method and a kind of electronic equipment - Google Patents
A kind of control method and a kind of electronic equipment Download PDFInfo
- Publication number
- CN104077193B CN104077193B CN201310097734.1A CN201310097734A CN104077193B CN 104077193 B CN104077193 B CN 104077193B CN 201310097734 A CN201310097734 A CN 201310097734A CN 104077193 B CN104077193 B CN 104077193B
- Authority
- CN
- China
- Prior art keywords
- storage device
- electronic equipment
- interface
- unit
- detection
- 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.)
- Active
Links
Abstract
The invention discloses a kind of control method and a kind of electronic equipment, this method is applied in the electronic equipment with first interface and the first detection device being connect with the first interface, and this method includes:The first operation for first storage device is detected whether by first detection device;When there is first operation, judge whether first operation meets a preset condition;When first operation meets the preset condition, first control instruction corresponding with first operation is generated;First control instruction is executed, is operated with executing the first control corresponding with first control instruction to first storage device.
Description
Technical field
The present invention relates to electronic technology field more particularly to a kind of control methods and a kind of electronic equipment.
Background technology
With the continuous development of science and technology, electronic equipment has also obtained development at full speed, and the type of electronic product is also got over
Come more, people have also enjoyed the various facilities that scientific development is brought, and present people can be set by various types of electronics
It is standby, enjoy the comfortable life brought with development in science and technology.For example, existing storage device all supports hot plug, that is to say, that use
Family need not repeat to shut down, the interface of external equipment is connect and is switched on again on an electronic device when using external storage device
External equipment and the electronic equipment are attached by such repetitive operation to realize, and can be directly in electronic equipment
Open state, so that it may be used on the electronic equipment with connecing the interface of external equipment.It is grasped when completing the read-write to external equipment
, can be by confirming that the external equipment has been completed to read writing task after work, detection has the prompt message that can be extracted safely
When, so that it may the external storage equipment safely to be extracted from the electronic equipment.
But the present inventor has found that above-mentioned technology is at least deposited during inventive technique scheme in realizing the embodiment of the present invention
In following technical problem:
It, could be from electronics when 1, due to needing to wait for the read-write task of the file of external storage equipment to complete in the prior art
The connection with external storage equipment is disconnected in equipment, and if when external storage equipment is in no read-write operation for completing file
When, just directly external storage equipment and electronic equipment are disconnected by user, easily cause the damage to external world's storage device
The technical issues of.
It 2, just directly will be external by user due to existing when extraneous storage device is in no read-write operation for completing file
When storage device is disconnected with electronic equipment, the technical issues of being damaged to external storage equipment so that be stored in this
The technical issues of file data in extraneous storage device is lost.
3, due to needing, when disconnecting external storage equipment and electronic equipment, to be confirmed in the prior art
The operation that can be popped up causes pop-up to fail due to often there is system mistake, so, exist and confirms that the operation of pop-up can not be into
Capable technical problem.
Invention content
The embodiment of the present application solves in the prior art by a kind of control method of offer and a kind of electronic equipment external
When storage device does not complete the read-write operation of file, just directly external storage equipment and electronic equipment are disconnected, are easy
Cause the technical issues of damage to external world's storage device.
On the one hand, the embodiment of the present application provides a kind of control method, is applied to first interface and with described first
In the electronic equipment of first detection device of interface connection, the method includes:It is detected whether by first detection device
For the first operation of the first storage device;When there is first operation, it is default to judge whether first operation meets one
Condition;When first operation meets the preset condition, generates first control corresponding with first operation and refer to
It enables;First control instruction is executed, to execute corresponding with first control instruction the to first storage device
One control operation.
Further, first operation detected whether by first detection device for the first storage device, tool
Body is:Extract first storage device from the first interface is detected whether by first detection device
One extracts operation;Or it detects whether first storage device being inserted into the first interface by first detection device
The first insertion operation.
Further, described to have been detected whether first storage device from described first by first detection device
First extracted in interface extracts operation, specially:At the first moment, deposited by first detection device detection described first
It is first position that equipment, which is stored up, in the current location of the first interface;At the second moment after first moment, pass through institute
It is the second position to state the first detection device and detect the current location;Judge the position between the first position and the second position
Set relationship, the first judging result of acquisition;Based on first judging result, detected whether by first storage device from
First extracted in the first interface extracts operation.
Further, described when there is first operation, judge whether first operation meets a preset condition, specifically
Including:Second distance and the first position of the second position apart from the outer end of the first interface are obtained apart from institute
State the first distance of outer end;The second distance be less than described first apart from when, show to have described first to extract operation, and sentence
Whether disconnected first operation meets a preset condition.
Further, described to judge whether first operation meets a preset condition, specially:Judge the second distance
Whether the first predetermined threshold value is more than, wherein first predetermined threshold value is specially to be used for whether characterizing first storage device
Have and has disconnected the possible distance value being electrically connected with the electronic equipment.
Further, described when first operation meets the preset condition, it is opposite with first operation to generate one
The first control instruction answered, specially:Show there is described first to extract operation described, and when the second distance is less than described
When the first predetermined threshold value, stopping data transfer instruction corresponding with the first extraction operation and/or instruction data storage are generated.
Further, described to execute first control instruction, it is controlled with described first with being executed to first storage device
The corresponding first control operation of system instruction, specially:The stopping data transfer instruction being executed, to stop the electronic equipment
With the data transmission between first storage device;And/or the instruction data storage is executed, it is set with preserving first storage
Data in standby.
Further, described to have detected whether first storage device being inserted into described the by first detection device
First insertion operation of one interface, specially:At the first moment, first storage is detected by first detection device and is set
The standby current location in the first interface is the third place;The second moment after first moment, by described
It is the 4th position that first detection device, which detects the current location,;Judge the position between the third place and the 4th position
Relationship obtains the second judging result;Based on second judging result, detect whether first storage device being inserted into institute
State the first insertion operation of first interface.
Further, described when there is first operation, judge whether first operation meets a preset condition, specifically
Including:The 4th distance and the third place of the outer end of first interface described in the 4th positional distance are obtained apart from institute
State the third distance of outer end;It is described 4th distance be more than the third apart from when, show there is first insertion operation, and sentence
Whether disconnected first operation meets a preset condition.
Further, described to judge whether first operation meets a preset condition, specially:Judge the 4th distance
Whether the second predetermined threshold value is less than, wherein second predetermined threshold value is specially to be used for whether characterizing first storage device
Have and has been connect with the electronic equipment, the potential range not powered on but.
Further, when the judgement first operation meets the preset condition, one and the first operation phase are generated
Corresponding first control instruction, specially:Show there is first insertion operation described, and when the 4th distance is more than institute
When stating the second predetermined threshold value, generates remind corresponding with first insertion operation and be inserted into prompting instruction not in place.
Further, described to execute first control instruction, it is controlled with described first with being executed to first storage device
The corresponding first control operation of system instruction, specially:The prompting instruction is executed, to remind first described in the electronic equipment
Storage device is inserted into not in place.
Further, described to pass through first detection device when first storage device is USB interface storage device
Detect whether the first operation for first storage device, specially:By setting with the USB interface storage device
Pressure sensor in corresponding USB interface detect whether there are two shrapnel from two holes of the USB interface storage device
First extracted extracts operation;Or by the way that the pressure sensing in USB interface corresponding with the USB interface storage device is arranged
Device detects whether the first insertion operation being inserted into there are two shrapnel in two holes of the USB interface storage device.
Further, described by the way that the pressure sensor in USB interface corresponding with the USB interface storage device is arranged
Detect whether that extracted from two holes of the USB interface storage device there are two shrapnel first extracts operation, specially:
First moment detected the first pressure value on described two shrapnels by the pressure sensor;After first moment
The second moment, the second pressure value on described two shrapnels is detected by the pressure sensor;Judge the first pressure
The magnitude relationship of value and the second pressure value obtains third judging result;Based on the third judging result, detect whether
The first extraction operation that the shrapnel is extracted from described two holes.
Further, described when there is first operation, judge whether first operation meets a preset condition, specifically
Including:When the second pressure value is more than the first pressure value, show to have described first to extract operation, and judges described the
Whether one operation meets a preset condition.
Further, described to judge whether first operation meets a preset condition, specially:Judge the second pressure
Whether value is more than third predetermined threshold value, wherein the third predetermined threshold value is specifically used for whether characterizing first storage device
There is the possible pressure value with electronic equipment power-off connection.
Further, described when first operation meets the preset condition, it is opposite with first operation to generate one
The first control instruction answered, specially:It is described show to have described first extract operation when, and when the second pressure value is more than
When the third predetermined threshold value, generates stopping data transfer instruction corresponding with the first extraction operation and/or data store
Instruction.
Further, described to execute first control instruction, it is controlled with described first with being executed to first storage device
The corresponding first control operation of system instruction, specially:The stopping data transfer instruction being executed, to stop the electronic equipment
With the data transmission between first storage device;And/or the instruction data storage is executed, it is set with preserving first storage
Data in standby.
Further, described by the way that the pressure sensor in USB interface corresponding with the USB interface storage device is arranged
Detect whether the first insertion operation being inserted into there are two shrapnel in two holes of the USB interface storage device, specially:
One moment detected the third pressure value on two shrapnels on the USB interface by the pressure sensor;Described first
The second moment after moment, then detect the on two shrapnels on the USB interface the 4th by the pressure sensor and press
Force value;Judge the magnitude relationship of the third pressure value and the 4th pressure value, obtains third judging result;Based on described
Four judging results detect whether the first operation being inserted into the shrapnel in described two holes.
Further, described when there is first operation, judge whether first operation meets a preset condition, specifically
Including:When the 4th pressure value is less than the third pressure value, show to have described first to extract operation, and judges described the
Whether one operation meets a preset condition.
Further, described to judge whether first operation meets a preset condition, specially:Judge the 4th pressure
Whether value is less than the 4th predetermined threshold value, wherein the 4th predetermined threshold value is specially to be used for characterizing first storage device being
It is no to have had the possible pressure value for connecting with the electronic equipment, not powering on but.
Further, when the judgement first operation meets the preset condition, one and the first operation phase are generated
Corresponding first control instruction, specially:Show there is first insertion operation described, and when the 4th pressure value is less than
When four predetermined threshold value, generates remind corresponding with first insertion operation and be inserted into prompting instruction not in place.
Further, described to execute first control instruction, it is controlled with described first with being executed to first storage device
The corresponding first control operation of system instruction, specially:The prompting instruction is executed, to remind first described in the electronic equipment
Storage device is inserted into not in place.
On the other hand, the embodiment of the present application by provide a kind of electronic equipment, including:First interface;First detection device,
It is connect with the first interface;Wherein, it detects whether to be directed to by first detection device and be connected on the first interface
The first storage device first operation;When there is first operation, judge whether first operation meets a default item
Part;When first operation meets the preset condition, first control instruction corresponding with first operation is generated;
First control instruction is executed, to execute the first control corresponding with first control instruction to first storage device
System operation.
Further, first detection device specifically includes:First detection sub-unit, for detecting whether having described
The first extraction operation that one storage device is extracted from the first interface;Second detection sub-unit, for detecting whether have by
First storage device is inserted into the first insertion operation of the first interface.
Further, first detection sub-unit specifically includes:First position detection unit, at the first moment, leading to
It is first position to cross first detection sub-unit and detect first storage device in the current location of the first interface;The
Two position detection units detect institute for the second moment after first moment by first detection sub-unit
It is the second position to state current location;First judging unit, for judging the position between the first position and the second position
Relationship, the first judging result of acquisition;First extracts detection unit, for being based on first judging result, has detected whether
The first extraction operation that first storage device is extracted from the first interface.
Further, the first extraction detection unit specifically includes:First acquisition unit, for obtaining the second position
The first distance of second distance and the first position apart from the outer end apart from the outer end of the first interface;First
Judgment sub-unit, for the second distance be less than described first apart from when, show to have described first to extract operation, and judge
Whether first operation meets a preset condition.
Further, first judgment sub-unit is specifically used for judging whether the second distance is more than the first default threshold
Value, wherein whether first predetermined threshold value is specially to be used for characterizing first storage device having had setting with the electronics
The standby possible distance value for disconnecting electrical connection.
Further, first judgment sub-unit specifically includes:First generation unit shows there is described first for described
Operation is extracted, and when the second distance is more than first predetermined threshold value, generated corresponding with the first extraction operation
Stop data transfer instruction and/or instruction data storage.
Further, first judgment sub-unit further includes specifically:First execution unit, for executing the stopping data
Transmission instruction, to stop the data transmission between the electronic equipment and first storage device;And/or it executes the data and deposits
Storage instruction, to preserve the data in first storage device.
Further, second detection sub-unit specifically includes:The third place detection unit, at the first moment, leading to
It is the third place to cross first detection device and detect current location of first storage device in the first interface;The
Four position detection units, for the second moment after first moment, described in first detection device detection
Current location is the 4th position;Second judgment unit, for judging that the position between the third place and the 4th position is closed
System obtains the second judging result;First is inserted into detection unit, for being based on second judging result, has detected whether institute
State the first insertion operation that the first storage device is inserted into the first interface.
Further, the first insertion detection unit specifically includes:Second acquisition unit, for obtaining the 4th position
Third distance apart from the 4th distance of the outer end of the first interface and the third place apart from the outer end;Second
Judgment sub-unit, for it is described 4th distance be more than the third apart from when, show there is first insertion operation, and judge
Whether first operation meets a preset condition.
Further, second judgment sub-unit is specifically used for judging whether the 4th distance is less than the second default threshold
Value, wherein whether second predetermined threshold value is specially to be used for characterizing first storage device having had setting with the electronics
Standby connection, the potential range not powered on but.
Further, second judgment sub-unit specifically includes:Second generation unit, for showing there is described described
One insertion operation, and when the 4th distance is less than second predetermined threshold value, generate corresponding with first insertion operation
Prompting be inserted into prompting instruction not in place.
Further, second judgment sub-unit further includes specifically:Second execution unit refers to for executing the prompting
It enables, it is not in place to remind the first storage device described in the electronic equipment to be inserted into.
Further, when first storage device is specially USB interface storage device, and the first interface connects for USB
When mouth, first detection device specifically includes:Third detection sub-unit, for being stored with the USB interface by setting
Pressure sensor in the corresponding USB interface of equipment detects whether two from the USB interface storage device there are two shrapnel
First extracted in hole extracts operation;4th detection sub-unit, for by being arranged corresponding with the USB interface storage device
USB interface in pressure sensor detect whether to be inserted into two holes of the USB interface storage device there are two shrapnel
First insertion operation.
Further, the third detection sub-unit specifically includes:First pressure detection unit, at the first moment, leading to
It crosses the pressure sensor and detects first pressure value on described two shrapnels;Second pressure detection unit, for described the
The second moment after one moment detects the second pressure value on described two shrapnels by the pressure sensor;Third is sentenced
Disconnected unit, the magnitude relationship for judging the first pressure value and the second pressure value obtain third judging result;Second
Detection unit is extracted, for being based on the third judging result, detects whether what the shrapnel was extracted from described two holes
First extracts operation.
Further, the second extraction detection unit specifically includes:Third judgment sub-unit, in the second pressure
When value is more than the first pressure value, show there is described first to extract operation, and it is pre- to judge whether first operation meets one
If condition.
Further, the third judgment sub-unit is specifically used for judging whether the second pressure value is more than third and presets threshold
Value, wherein the third predetermined threshold value is specifically used for characterizing whether first storage device has had and the electronic equipment
Power off the possible pressure value of connection.
Further, the third judgment sub-unit specifically includes:Third generation unit, for showing there is described described
When one extraction operation, and when the second pressure value is less than the third predetermined threshold value, generates and operated with first extraction
Corresponding stopping data transfer instruction and/or instruction data storage.
Further, the third judgment sub-unit further includes:Third execution unit, for executing the stopping data transmission
Instruction, to stop the data transmission between the electronic equipment and first storage device;And/or it executes the data storage and refers to
It enables, to preserve the data in first storage device.
Further, the 4th detection sub-unit specifically includes:Third pressure sensing cell, at the first moment, leading to
It crosses the pressure sensor and detects third pressure value on two shrapnels on the USB interface;4th pressure sensing cell is used
In the second moment after first moment, then detect by the pressure sensor two bullets on the USB interface
4th pressure value of on piece;4th judging unit, for judging that the third pressure value and the size of the 4th pressure value are closed
System obtains the 4th judging result;Second is inserted into detection unit, for being based on the 4th judging result, has detected whether described
Shrapnel is inserted into the first insertion operation in described two holes.
Further, the second insertion detection unit specifically includes:4th judgment sub-unit, in the 4th pressure
When value is less than the third pressure value, show there is first insertion operation, and it is pre- to judge whether first operation meets one
If condition.
Further, the 4th judgment sub-unit is specifically used for judging whether the 4th pressure value is less than the 4th default threshold
Value, wherein whether the 4th predetermined threshold value is specially to be used for characterizing first storage device having had setting with the electronics
Standby connection, the possible pressure value not powered on but.
Further, the 4th judgment sub-unit specifically includes:4th generation unit, for showing there is described described
One insertion operation, and when the 4th pressure value is more than four predetermined threshold value, generate and first insertion operation pair
Prompting instruction not in place is inserted into the prompting answered.
Further, the 4th judgment sub-unit further includes specifically:4th execution unit refers to for executing the prompting
It enables, it is not in place to remind the first storage device described in the electronic equipment to be inserted into.
One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:
1, it as a result of the first detection device is arranged on first interface, is detected to first by the first detection device
Whether the first operation of storage device meets a scheduled condition, and then generating corresponding control according to the predetermined condition of satisfaction refers to
It enables, by executing the control instruction, control corresponding with the control instruction can be executed to the first storage device and operated, solved
When needing that the read-write task of the file of external storage equipment is waited for complete in the prior art, it could be disconnected from electronic equipment and outer
The connection of storage device is connect, and if when external storage equipment is in no read-write operation for completing file, just it is not intended to by user
Between the technical issues of external storage equipment and electronic equipment are disconnected, the damage to external world's storage device is will result in,
Realizing in turn can be to the first storage device executive control operation so that first storage device avoids the technology to suffer damage
Effect.
2, detecting that meeting one to the first operation of the first storage device presets by the first detection device due to using
When condition, the technical solution for the fileinfo that the task or quick storage of the transmission of data are being read and write in stopping solves
It, just unintentionally will be outer by user in the prior art due to existing when extraneous storage device is in no read-write operation for completing file
When connecing storage device and electronic equipment and disconnecting, the technical issues of being damaged to external storage equipment so that be stored in
The technical issues of file data in external world's storage device is lost, and then realize and can be set with electronics in the first storage device
For before disconnecting, the file for not completing read-write operation is preserved in time, avoids the loss of file data.
3, due to the first operation using the detection of the first detection device to the first storage device, solve needs in the prior art
It to carry out confirming the operation that can be popped up, due to often going out when disconnecting external storage equipment and electronic equipment
Existing system mistake causes pop-up to fail, so, there is technical issues that confirm pop-up operation can not, and then realize nothing
It need to be confirmed whether the operation of pop-up, so that it may with the technique effect for directly disconnecting external storage equipment and electronic equipment.
Description of the drawings
Fig. 1 is a kind of flow chart of control method in the embodiment of the present application;
Fig. 2 is the schematic diagram extracted from the interface of electronic equipment in detection external storage equipment in the embodiment of the present application;
Fig. 3 is that whether detection external storage equipment forms facing of being electrically connected with the interface of electronic equipment in the embodiment of the present application
Boundary's condition schematic diagram;
Fig. 4 is that detection external storage equipment is inserted into the schematic diagram in the interface of electronic equipment in the embodiment of the present application;
Fig. 5 is the module map of a kind of electronic equipment in the embodiment of the present application.
Specific implementation mode
The embodiment of the present application solves in the prior art by a kind of control method of offer and a kind of electronic equipment external
Storage device is in no read-write operation for completing file, when just disconnecting the external storage equipment and electronic equipment, Yi Zao
The technical issues of damage of the pairs of external storage equipment.
Technical solution in the embodiment of the present application is to solve the above-mentioned technology for easily causing the damage to the external storage equipment
Problem, general thought are as follows:
By taking the storage device of USB interface as an example, when positioned at electronic equipment, e.g. on the USB interface of laptop
One detection device is detected when being inserted into or extracting the operation for the storage device for being circumscribed with USB interface, can be judged such
Insertion operation extracts whether operation meets certain preset condition, for example, in place whether the interface being inserted into, or extract
Whether interface meets a certain distance value etc., after meeting these preset conditions, can trigger corresponding with preset condition
Control instruction can control the storage device of USB interface by executing control instruction.
In order to better understand the above technical scheme, in conjunction with appended figures and specific embodiments to upper
Technical solution is stated to be described in detail.
The application provides a kind of control method, is applied to first interface and the first inspection being connect with the first interface
It surveys in the electronic equipment of device, as shown in Figure 1, the method includes:
S10 detects whether the first operation for the first storage device by first detection device;
S20 judges whether first operation meets a preset condition when there is first operation;
S30 generates one and first operation corresponding first when first operation meets the preset condition
Control instruction;
S40 executes first control instruction, to be executed and the first control instruction phase to first storage device
Corresponding first control operation.
Wherein, in S10, the first behaviour for first storage device is detected whether by first detection device
Make, specially:It has detected whether to pull out first for the storage device from the first interface by first detection device
First gone out extracts operation;Or it detects whether first storage device being inserted into described the by first detection device
First insertion operation of one interface.
In a particular embodiment, which is specifically located on the interface of electronic equipment, which can
To be parallel port (EPP), USB interface also has IEEE1394 interfaces, be arranged the detection device on these interfaces can detect with should
The external storage equipment of interface connection has the extraction operation extracted outward, or can detect that connect with the interface external is deposited
The insertion operation that the oriented interface slot of equipment is inserted into is stored up, specifically how to detect above-mentioned extraction operation or has insertion operation,
There is more specific description below.
First, the detection method that can be applicable in most of generic interface is introduced.
First, detect whether that the extraction extracted from the first interface operates.
At the first moment, the first storage device working as in the first interface, is detected by first detection device
Anteposition is set to first position;The second moment after first moment, by working as described in first detection device detection
Anteposition is set to the second position;Judge the position relationship between the first position and the second position, the first of acquisition judges knot
Fruit;Based on first judging result, extract first storage device from the first interface is detected whether
One extracts operation.
In a particular embodiment, which can constantly detect on the interface that the external storage equipment connects
Certain location information of point relative to the interface of electronic equipment, for example, as described in Figure 2, at the first moment, when the external storage is set
The interface of standby connection is located at the position of P1 relative to the first position of the interface of electronic equipment;By after 0.3s second when
It carves, detects that the interface of the external equipment is located at the position of P2 relative to the second position of the interface of electronic equipment, then according to
The position of the position of P1 points and P2 points judges whether the external storage equipment is extracted from the interface of electronic equipment.Based on artificial
Macro-view cognition just illustrate the operation when the point positions P2 are closer to outside the interface of electronic equipment relative to the position of P1 points
It is one to operate the extraction that external storage equipment is extracted outward, but for electronic equipment, so that it may with based on distance
It detects to judge the operation to the external storage equipment.
Therefore, in S20, when there is first operation, judge whether first operation meets a preset condition, have
Body includes:Obtain second distance and the first position distance of the second position apart from the outer end of the first interface
First distance of the outer end;The second distance be less than described first apart from when, show to have described first to extract operation, and
Judge whether first operation meets a preset condition.
In a particular embodiment, so that it may to detect the interface outer peripheral first of the positional distance electronic equipment of P1
The outer peripheral second distance value of interface of the positional distance electronic equipment of distance value and P2, if when second distance value is less than
When the first distance value, illustrate that the external storage equipment is extracted outward, certainly, which is also required to meet centainly
Preset condition can just make the connection of the interface of the external storage equipment and the interface of electronic equipment is realized to disconnect, so, under
The interface of external storage equipment is introduced in face and how the connection of the interface of electronic equipment meets the condition disconnected.
Accordingly, it is possible to judge whether the second distance is more than the first predetermined threshold value, wherein first predetermined threshold value
Specially it is used for characterizing first storage device whether having had and disconnects the possible distance being electrically connected with the electronic equipment
Value.
In a particular embodiment, which can set in this way, as shown in figure 3, the position of P0 is one
A critical point, the outer peripheral distance of interfaces of the P0 apart from electronic equipment are X, which is a preset threshold value, when the position of the P2
When the outer peripheral distance of interface apart from electronic equipment is less than X, just illustrate the interface of the external storage equipment and the electronic equipment
It is disconnected connection, if the outer peripheral distance of interface of the positional distance electronic equipment of P2 is more than X, just illustrates the external storage
Equipment and the interface of the electronic equipment will disconnect, but disconnect not yet.
After obtaining above-mentioned judging result, S30 is then executed, the default item met is operated meeting the extraction
When part, first control instruction corresponding with first operation is generated, specially:Show there is described first to extract described
Operation, and when the second distance is more than first predetermined threshold value, generate stopping corresponding with the first extraction operation
Data transfer instruction and/or instruction data storage.
After having executed S30, S40 is then executed, first control instruction is executed, with to first storage device
The first control operation corresponding with first control instruction is executed, which is specially:Execute the stopping data transmission
Instruction, to stop the data transmission between the electronic equipment and first storage device;And/or it executes the data storage and refers to
It enables, to preserve the data in first storage device.
In a particular embodiment, when the interface that the external storage equipment is wanted with electronic equipment will disconnect, still
When there are no disconnecting, the termination that one carries out the task termination that the external storage equipment is carrying out will be generated and referred to
It enables, that is to say, that if the external storage equipment is carrying out data transmission task either data store tasks, just immediately eventually
The only task of data transmission, it would be desirable to which the data of preservation are quickly preserved, and stop the preservation of remaining content immediately.Thus
The loss for losing either saved data that transmission data can effectively be avoided, can also avoid the external storage equipment from meeting with
To damage.
For example, electronic equipment to external storage equipment carry out partition table operation when, by the external storage equipment with
The interface of the electronic equipment disconnects, in order to avoid directly in this way operation bring need to format external storage equipment
Consequence can detected by external world's storage device before the operation extracted in the interface of the electronic equipment, quickly
Ground will need the content preserved to preserve so that when the interface of the external storage equipment and the electronic equipment disconnects,
The task of preservation has been completed.
Second, detect whether that the interface of external storage equipment is inserted into the insertion operation of the interface of electronic equipment.
First, at the first moment, first storage device is detected by first detection device and is connect described first
Current location in mouthful is the third place;Then, the second moment after first moment is filled by first detection
It is the 4th position to set the detection current location;Then, judge the position relationship between the third place and the 4th position,
Obtain the second judging result;Finally, it is based on second judging result, has detected whether first storage device being inserted into institute
State the first insertion operation of first interface.
In a particular embodiment, or according to above-mentioned example, as shown in figure 4, at the first moment, when the external world stores
The interface of equipment is located at the position of P3 relative to the third place of the interface of electronic equipment;By after 0.3s second when
It carves, detects that the interface of the external storage equipment is located at the position of P4 relative to the 4th position of the interface of electronic equipment, then
Judge whether the external storage equipment is inserted into the interface of electronic equipment according to the position of P3 points and the position of P4 points.Judging
The operating process whether be an insertion operation it is specific as follows:
Obtain the 4th distance and the third place distance of the outer end of first interface described in the 4th positional distance
The third distance of the outer end;It is described 4th distance be more than the third apart from when, show there is first insertion operation, and
Judge whether first operation meets a preset condition.
In a particular embodiment, can detect the outer peripheral third of interface of the positional distance electronic equipment of P3 away from
From and P4 positional distance electronic equipment outer peripheral 4th distance value of interface, if when the 4th distance value be more than third
When distance value, that is to say, that the outer edge that is located closer to interface of the position of P4 compared to P3, which just meets default
Condition, it is believed that be one insertion operation.After judging that the operation is an operation being inserted into, need to judge to be somebody's turn to do
Whether operation meets a preset condition, is described below how the insertion operation meets a preset condition.
Accordingly, it is possible to judge whether the 4th distance is less than the second predetermined threshold value, wherein second predetermined threshold value
Specially be used for characterizing first storage device and whether having had connecting with the electronic equipment, the possibility not powered on but away from
From.
In a particular embodiment, which can set in this way, and the position of P0 is a critical point, P0
The outer peripheral distance of interface apart from electronic equipment is X, which is a predetermined threshold value, when the positional distance electronic equipment of the P4
The outer peripheral distance of interface be less than X when, just illustrate that the external storage equipment and the interface of the electronic equipment are not linked to be access,
It is, the interface that the external storage equipment is inserted into the electronic equipment is not inserted into place;If the positional distance electronics of P4 is set
When the outer peripheral distance of standby interface is more than X, just illustrate that the external storage equipment and the interface of the electronic equipment form access,
It is, the interface that the external storage equipment is inserted into the electronic equipment is inserted in place.
After obtaining above-mentioned judging result, that is, when meeting the preset condition that the insertion operation is met,
First control instruction corresponding with first operation is generated, specially:Show there is first insertion operation described,
And when the second distance is less than second predetermined threshold value, generates prompting corresponding with first insertion operation and be inserted into not
Prompting instruction in place executes the prompting instruction, not in place to remind the electronic equipment first storage device to be inserted into.
In a particular embodiment, when the interface of extraneous storage device and electronic equipment will be linked to be access, but without
It is linked to be access, that is, external storage equipment is inserted into situation not in place when being inserted into the interface of electronic equipment, will generate one
A external storage equipment for reminding the electronic equipment to be attached thereto does not have the prompting of successful connection to instruct, and executes this prompting and refers to
It enables, it is not in place to remind the external storage equipment that the electronic equipment is attached thereto to be inserted into, in this way, user is seeing there be such carry
It when information of waking up, can check whether external storage equipment is inserted on the interface of electronic equipment, it is adjusted when passing through user
Afterwards, which can disappear automatically.
By above-mentioned detection external storage equipment in the operation extracted or be inserted into from the interface of electronic equipment, send out in time
Preservation or the instruction of rapid saving are terminated, by read-write operation Quick stop, or reminds and is inserted into equal measures not in place so that
The external storage equipment being connect with the electronic equipment can not be damaged during plug and pull.
Nowadays the interface being connect with external storage equipment is commonly USB interface, is retouched in detail by taking USB interface as an example below
It states.
Therefore, it when first interface is USB interface, has been detected whether for the first storage by first detection device
The first of equipment operates:
It has been detected whether by the way that the pressure sensor in USB interface corresponding with the USB interface storage device is arranged
The first extraction operation that two shrapnels are extracted from two holes of the USB interface storage device;Or
It has been detected whether by the way that the pressure sensor in USB interface corresponding with the USB interface storage device is arranged
Two shrapnels are inserted into the first insertion operation in two holes of the USB interface storage device.
In a particular embodiment, whether detection has the operation of extraction or insertion in the USB interface, specifically logical
The deformation size of detection shrapnel is crossed to detect.
Deformation particularly as shrapnel in different moments below is extracted or is inserted into from USB interface to characterize.
One, the specific detecting step for the extraction operation extracted from USB interface is detected.
At the first moment, the first pressure value on described two shrapnels is detected by the pressure sensor;Described
The second moment after one moment detects the second pressure value on described two shrapnels by the pressure sensor;Judge institute
The magnitude relationship of first pressure value and the second pressure value is stated, third judging result is obtained;Based on the third judging result,
Detect whether that the shrapnel is extracted from described two holes first extracts operation.
In a particular embodiment, two parallel shrapnels are internally provided in USB interface, divided on the two shrapnels
It is not provided with pressure sensor, that is, the first detection device here.First, at the first moment, the pressure on shrapnel is detected
Force value, for example, the pressure value detected at the first moment, which is 1N, then at the second moment after the first moment, detects bullet
The pressure value of on piece is 6N, then, so that it may to compare the pressure value that the pressure value obtained at the first moment is obtained with the second moment
Size finally can determine whether that one is pulled out according to such comparison result to obtain a result of the comparison
The operation gone out.
How to determine that the operation for being to extract is specific as follows according to above-mentioned comparison result:
When the second pressure value is more than the first pressure value, show there is described first to extract operation, and judge institute
State whether the first operation meets a preset condition.
In a particular embodiment, the pressure value obtained to above-mentioned different moments is compared, what the first moment obtained
First pressure value 4N is less than the second pressure value 6N obtained at the second moment, in this way, determining that such operation is one and extracts behaviour
Make, determinations be extract operation after, cannot determine whether be meet certain condition extraction operation, below just to needs
The condition of satisfaction is described.
It is a threshold condition to need the condition met, therefore, judges whether the second pressure value is default more than third
Threshold value, wherein whether the third predetermined threshold value is specifically used for characterizing first storage device having had sets with the electronics
The possible pressure value of standby power-off connection.
In a particular embodiment, the second pressure value 6N for judging to obtain at the second moment and third predetermined threshold value are needed
Relationship, the third predetermined threshold value be one detect whether disconnect electrical connection a critical condition, that is to say, that the USB connects
The threshold condition whether external storage equipment of mouth really disconnects with electronic equipment interfaces.For example, working as threshold limit value
When condition is 7N, so that it may which, to find out, the external storage equipment of the USB interface to be ready extracting from the interface of electronic equipment, still
There are no disconnect between them.If critical threshold conditions are 5N, so that it may to find out, the external storage of the USB interface
Equipment to be ready extracting from the interface of electronic equipment, and already off connection between them.
When the pressure value obtained among the above at the second moment is less than threshold limit value, just calculates and meet preset condition, full
After the such condition of foot, so that it may which, to generate an instruction, which is a stopping number corresponding with the first extraction operation
According to transmission instruction and/or instruction data storage.
Then, the stopping data transfer instruction being executed, to stop between the electronic equipment and first storage device
Data transmission;And/or the instruction data storage is executed, to preserve the data in first storage device.
In a particular embodiment, when the external storage equipment detected in USB interface be extract operation, together
When, it detects that the pressure value at the second moment meets the condition of predetermined threshold value, just generates an instruction, the instruction is for stopping
The task that only external storage equipment carries out data transmission with electronic equipment, if working as the external storage equipment of the USB interface just
In the operation for executing partitions of file table, then, the instruction of generation is the instruction of rapid saving this document partition table, then, so that it may
To execute the task of rapid saving, when avoiding the external storage equipment of the USB interface read-write task has not been completed, just disconnect
It when connection, will not make loss of data, or need being formatted to external storage equipment for task.
Two, the specific detecting step for the insertion operation being inserted into from USB interface is detected:
At the first moment, the third pressure value on described two shrapnels is detected by the pressure sensor;Described
The second moment after one moment, then detect by the pressure sensor the 4th pressure value on described two shrapnels;Judge
The magnitude relationship of the third pressure value and the 4th pressure value obtains the 4th judging result;Judge knot based on the described 4th
Fruit detects whether that the sheet insertion enters the first insertion operation in described two holes.
In a particular embodiment, first at the first moment, detect that pressure value on shrapnel is 7N, then, the
The second moment after one moment detects that the pressure value on shrapnel is 4N, then, so that it may to compare the pressure of the first moment acquisition
The size for the pressure value that force value is obtained with the second moment finally can be according to such to obtain a result of the comparison
Comparison result come determine the operation whether be one insertion operation.
How to determine that the operation for being to be inserted into is specific as follows according to above-mentioned comparison result:
When the 4th pressure value is less than third pressure value, show there is such a insertion operation, and judge this
Whether one operation meets a preset condition.
In a particular embodiment, the pressure value obtained to above-mentioned different moments is compared, and the first moment obtained the
Three pressure value 7N are more than the 4th pressure value 4N obtained at the 4th moment, in this way, determine that such operation is an insertion operation,
After determination is insertion operation, cannot determine whether to be the insertion operation for meeting certain condition, below it is just full to needing
The condition of foot is described.
The condition for needing exist for meeting is a threshold condition, therefore, judges whether the 4th pressure value is less than the 4th
Predetermined threshold value, wherein the 4th predetermined threshold value is specifically to be used for characterizing whether first storage device has set with electronics
Standby connection, the possible pressure value not powered on but.
In a particular embodiment, the 4th pressure value 4N for judging to obtain at the second moment and the 4th predetermined threshold value are needed
Relationship, the 4th predetermined threshold value is one and detects whether a critical condition powering on of connection, that is to say, that the USB interface
External storage equipment the threshold condition powered on whether is really connect with electronic equipment interfaces, for example, work as the threshold limit value
Condition is 3N, so that it may to find out, the external storage equipment of the USB interface is inserted into the interface of electronic equipment, but it
Between there is no connection on, if critical threshold conditions be 5N, so that it may to find out, the external storage equipment of the USB interface
It is inserted into the interface of positive electronic equipment, and has formed the relationship that connection powers between them.
When the pressure value obtained among the above at the second moment is more than critical value, just calculates and meet preset condition, it is,
Detect it is an operation being inserted into, but there is no form the relationship for connecting and powering on.One is thus generated to be inserted into first
It operates corresponding remind and is inserted into prompting instruction not in place.
Then, the prompting instruction is executed, it is not in place to remind the first storage device of electronic equipment to be inserted into.
In a particular embodiment, when detect have in USB interface external storage equipment be inserted into operation, meanwhile, inspection
The condition for meeting predetermined threshold value in the 4th pressure value is measured, just generates an instruction, the instruction is for reminding the electronics to set
The standby external storage equipment is not inserted into prompting message in place, to remind user to be inserted into external equipment, that is, is inserted into
In place.In this way so that user experience is good.
The embodiment of the present application also provides a kind of electronic equipment, as shown in figure 5, the electronic equipment includes:
First interface 10;
First detection device 20, connect with the first interface 10;
Wherein, it is detected whether for described the be connected on the first interface 10 by first detection device 20
First operation of one storage device;When there is first operation, judge whether first operation meets a preset condition;When
When first operation meets the preset condition, first control instruction corresponding with first operation is generated;It executes
First control instruction is grasped with executing the first control corresponding with first control instruction to first storage device
Make.
Further, first detection device 20 specifically includes:First detection sub-unit, will be described for detecting whether having
The first extraction operation that storage device is extracted from the first interface 10;Second detection sub-unit, for detecting whether have by
The storage device is inserted into the first insertion operation of the first interface 10.
Further, first detection sub-unit specifically includes:First position detection unit, at the first moment, leading to
It is first position to cross first detection sub-unit and detect the storage device in the current location of the first interface 10;Second
Position detection unit, for the second moment after first moment, described in first detection sub-unit detection
Current location is the second position;First judging unit, for judging that the position between the first position and the second position is closed
System, the first judging result of acquisition;First extract detection unit, for be based on first judging result, detected whether by
The first extraction operation that the storage device is extracted from the first interface.
Further, the first extraction detection unit specifically includes:First acquisition unit, for obtaining the second position
The first distance of second distance and the first position apart from the outer end apart from the outer end of the first interface;First
Judgment sub-unit, for the second distance be less than described first apart from when, show to have described first to extract operation, and judge
Whether first operation meets a preset condition.
Further, first judgment sub-unit is specifically used for judging whether the second distance is more than the first default threshold
Value, wherein whether first predetermined threshold value is specially to be used for characterizing first storage device having had setting with the electronics
The standby possible distance value for disconnecting electrical connection.
Further, first judgment sub-unit specifically includes:First generation unit shows there is described first for described
Operation is extracted, and when the second distance is more than first predetermined threshold value, generated corresponding with the first extraction operation
Stop data transfer instruction and/or instruction data storage.
Further, first judgment sub-unit further includes specifically:First execution unit, for executing the stopping data
Transmission instruction, to stop the data transmission between the electronic equipment and first storage device;And/or it executes the data and deposits
Storage instruction, to preserve the data in first storage device.
Further, second detection sub-unit specifically includes:The third place detection unit, at the first moment, leading to
It is the third place to cross first detection device and detect current location of first storage device in the first interface;The
Four position detection units, for the second moment after first moment, described in first detection device detection
Current location is the 4th position;Second judgment unit, for judging that the position between the third place and the 4th position is closed
System obtains the second judging result;First is inserted into detection unit, for being based on second judging result, has detected whether institute
State the first insertion operation that the first storage device is inserted into the first interface 10.
Further, the first insertion detection unit specifically includes:Second acquisition unit, for obtaining the 4th position
Third distance apart from the 4th distance of the outer end of the first interface 10 and the third place apart from the outer end;The
Two judgment sub-units, for it is described 4th distance be more than the third apart from when, show there is first insertion operation, and sentence
Whether disconnected first operation meets a preset condition.
Further, second judgment sub-unit is specifically used for judging whether the 4th distance is less than the second default threshold
Value, wherein whether second predetermined threshold value is specially to be used for characterizing first storage device having had setting with the electronics
Standby connection, the potential range not powered on but.
Further, second judgment sub-unit specifically includes:Second generation unit, for showing there is described described
One insertion operation, and when the second distance is less than second predetermined threshold value, generate corresponding with first insertion operation
Prompting be inserted into prompting instruction not in place.
Further, second judgment sub-unit further includes specifically:Second execution unit refers to for executing the prompting
It enables, it is not in place to remind the first storage device described in the electronic equipment to be inserted into.
Further, when the storage device is specially USB interface storage device, and the first interface 10 is USB interface
When, first detection device specifically includes:Third detection sub-unit is set for passing through to be arranged with the USB interface storage
Pressure sensor in standby corresponding USB interface detects whether that there are two shrapnels from two holes of the USB interface storage device
The first of middle extraction extracts operation;4th detection sub-unit, for by being arranged corresponding with the USB interface storage device
Pressure sensor in USB interface detects whether be inserted into there are two shrapnel in two holes of the USB interface storage device the
One insertion operation.
Further, the third detection sub-unit specifically includes:First pressure detection unit, at the first moment, leading to
It crosses the pressure sensor and detects first pressure value on described two shrapnels;Second pressure detection unit, for described the
The second moment after one moment detects the second pressure value on described two shrapnels by the pressure sensor;Third is sentenced
Disconnected unit, the magnitude relationship for judging the first pressure value and the second pressure value obtain third judging result;Second
Detection unit is extracted, for being based on the third judging result, detects whether what the shrapnel was extracted from described two holes
First extracts operation.
Further, the second extraction detection unit specifically includes:Third judgment sub-unit, in the second pressure
When value is more than the first pressure value, show there is described first to extract operation, and it is pre- to judge whether first operation meets one
If condition.
Further, the third judgment sub-unit is specifically used for judging whether the second pressure value is more than third and presets threshold
Value, wherein the third predetermined threshold value is specifically used for characterizing whether first storage device has had and the electronic equipment
Power off the possible pressure value of connection.
Further, the third judgment sub-unit specifically includes:Third generation unit, for showing described first described
When extracting operation, and when the second pressure value is less than the third predetermined threshold value, generates and extract operation pair with described first
The stopping data transfer instruction and/or instruction data storage answered.
Further, the third judgment sub-unit further includes:Third execution unit, for executing the stopping data transmission
Instruction, to stop the data transmission between the electronic equipment and first storage device;And/or it executes the data storage and refers to
It enables, to preserve the data in first storage device.
Further, the 4th detection sub-unit specifically includes:Third pressure sensing cell, at the first moment, leading to
It crosses the pressure sensor and detects third pressure value on two shrapnels on the USB interface;4th pressure sensing cell is used
In the second moment after first moment, then detect by the pressure sensor two bullets on the USB interface
4th pressure value of on piece;4th judging unit, for judging that the third pressure value and the size of the 4th pressure value are closed
System obtains the 4th judging result;Second is inserted into detection unit, for being based on the 4th judging result, has detected whether described
Shrapnel is inserted into the first insertion operation in described two holes.
Further, the second insertion detection unit specifically includes:4th judgment sub-unit, in the 4th pressure
When value is less than the third pressure value, show there is first insertion operation, and it is pre- to judge whether first operation meets one
If condition.
Further, the 4th judgment sub-unit is specifically used for judging whether the 4th pressure value is less than the 4th default threshold
Value, wherein whether the 4th predetermined threshold value is specially to be used for characterizing first storage device having had setting with the electronics
Standby connection, the possible pressure value not powered on but.
Further, the 4th judgment sub-unit specifically includes:4th generation unit, for showing there is described described
One insertion operation, and when the 4th pressure value is more than four predetermined threshold value, generate and first insertion operation pair
Prompting instruction not in place is inserted into the prompting answered.
Further, the 4th judgment sub-unit further includes specifically:4th execution unit refers to for executing the prompting
It enables, it is not in place to remind the first storage device described in the electronic equipment to be inserted into.
One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:
1, it as a result of the first detection device is arranged on first interface, is detected to first by the first detection device
Whether the first operation of storage device meets a scheduled condition, and then generating corresponding control according to the predetermined condition of satisfaction refers to
It enables, by executing the control instruction, control corresponding with the control instruction can be executed to the first storage device and operated, solved
When needing that the read-write task of the file of external storage equipment is waited for complete in the prior art, it could be disconnected from electronic equipment and outer
The connection of storage device is connect, and if when external storage equipment is in no read-write operation for completing file, just it is not intended to by user
Between the technical issues of external storage equipment and electronic equipment are disconnected, the damage to external world's storage device is will result in,
Realizing in turn can be to the first storage device executive control operation so that first storage device avoids the technology to suffer damage
Effect.
2, detecting that meeting one to the first operation of the first storage device presets by the first detection device due to using
When condition, the technical solution for the fileinfo that the task or quick storage of the transmission of data are being read and write in stopping solves
It, just unintentionally will be outer by user in the prior art due to existing when extraneous storage device is in no read-write operation for completing file
When connecing storage device and electronic equipment and disconnecting, the technical issues of being damaged to external storage equipment so that be stored in
The technical issues of file data in external world's storage device is lost, and then realize and can be set with electronics in the first storage device
For before disconnecting, the file for not completing read-write operation is preserved in time, avoids the loss of file data.
3, due to the first operation using the detection of the first detection device to the first storage device, solve needs in the prior art
It to carry out confirming the operation that can be popped up, due to often going out when disconnecting external storage equipment and electronic equipment
Existing system mistake causes pop-up to fail, so, there is technical issues that confirm pop-up operation can not, and then realize nothing
It need to be confirmed whether the operation of pop-up, so that it may with the technique effect for directly disconnecting external storage equipment and electronic equipment.
Although preferred embodiments of the present invention have been described, it is created once a person skilled in the art knows basic
Property concept, then additional changes and modifications may be made to these embodiments.So it includes excellent that the following claims are intended to be interpreted as
It selects embodiment and falls into all change and modification of the scope of the invention.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art
God and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies
Within, then the present invention is also intended to include these modifications and variations.
Claims (46)
1. a kind of control method is applied to the electronics with first interface and the first detection device being connect with the first interface
In equipment, which is characterized in that the method includes:
The first operation for the first storage device is detected whether by first detection device;
When there is first operation, judge whether first operation meets a preset condition;
When first operation meets the preset condition, generates first control corresponding with first operation and refer to
It enables;
First control instruction is executed, to execute corresponding with first control instruction the to first storage device
One control operation;
Wherein, first operation detected whether by first detection device for first storage device, including:
Institute of the interface of the first storage device connection relative to the first electronic equipment is detected by first detection device
State the location information of first interface, and the detection based on the location information judges described the to first storage device
One operation;And/or
The pressure value on two shrapnels is detected by the pressure sensor being arranged in the first interface, and is based on the pressure
The detection of value judges first operation to first storage device, wherein the setting of described two shrapnels is described the
One interface internal.
2. the method as described in claim 1, which is characterized in that described to be detected whether for the by first detection device
First operation of one storage device, specially:
Extract first storage device from the first interface is detected whether by first detection device
One extracts operation;Or
Detect whether that first storage device, which is inserted into the first of the first interface, inserts by first detection device
Enter operation.
3. method as claimed in claim 2, which is characterized in that described to have been detected whether institute by first detection device
It states the first storage device is extracted from the first interface first and extracts operation, specially:
At the first moment, by first detection device detect first storage device the first interface present bit
It is set to first position;
At the second moment after first moment, it is second to detect the current location by first detection device
It sets;
Judge the position relationship between the first position and the second position, the first judging result of acquisition;
Based on first judging result, extract first storage device from the first interface is detected whether
One extracts operation.
4. method as claimed in claim 3, which is characterized in that it is described when there is first operation, judge first behaviour
Whether meet a preset condition, specifically includes:
It obtains described in second distance and first position distance of the second position apart from the outer end of the first interface
First distance of outer end;
The second distance be less than described first apart from when, show to have described first to extract operation, and judge first behaviour
Whether a preset condition is met.
5. method as claimed in claim 4, which is characterized in that described to judge whether first operation meets a default item
Part, specially:
Judge whether the second distance is more than the first predetermined threshold value, wherein first predetermined threshold value is specially to be used for characterizing
Whether first storage device has had disconnects the possible distance value being electrically connected with the electronic equipment.
6. method as claimed in claim 5, which is characterized in that it is described when first operation meets the preset condition,
First control instruction corresponding with first operation is generated, specially:
Show there is described first to extract operation described, and when the second distance is more than first predetermined threshold value, generates
Stopping data transfer instruction corresponding with the first extraction operation and/or instruction data storage.
7. method as claimed in claim 6, which is characterized in that it is described to execute first control instruction, with to described first
Storage device executes the first control operation corresponding with first control instruction, specially:
The stopping data transfer instruction being executed, to stop the biography of the data between the electronic equipment and first storage device
It is defeated;And/or
The instruction data storage is executed, to preserve the data in first storage device.
8. method as claimed in claim 2, which is characterized in that described to have been detected whether institute by first detection device
The first insertion operation that the first storage device is inserted into the first interface is stated, specially:
At the first moment, it is current in the first interface that first storage device is detected by first detection device
Position is the third place;
At the second moment after first moment, it is the 4th to detect the current location by first detection device
It sets;
Judge the position relationship between the third place and the 4th position, obtains the second judging result;
Based on second judging result, detect whether that first storage device, which is inserted into the first of the first interface, inserts
Enter operation.
9. method as claimed in claim 8, which is characterized in that it is described when there is first operation, judge first behaviour
Whether meet a preset condition, specifically includes:
It obtains described in the 4th distance and the third place distance of the outer end of first interface described in the 4th positional distance
The third distance of outer end;
It is described 4th distance be more than the third apart from when, show there is first insertion operation, and judge it is described first behaviour
Whether a preset condition is met.
10. method as claimed in claim 9, which is characterized in that described to judge whether first operation meets a default item
Part, specially:
Judge whether the 4th distance is less than the second predetermined threshold value, wherein second predetermined threshold value is specially to be used for characterizing
Whether first storage device has had connect with the electronic equipment, the potential range not powered on but.
11. method as claimed in claim 10, which is characterized in that described to judge that first operation meets the preset condition
When, first control instruction corresponding with first operation is generated, specially:
Show there is first insertion operation described, and when the 4th distance is less than second predetermined threshold value, generates
Remind corresponding with first insertion operation is inserted into prompting instruction not in place.
12. method as claimed in claim 11, which is characterized in that it is described to execute first control instruction, with to described the
One storage device executes the first control operation corresponding with first control instruction, specially:
The prompting instruction is executed, it is not in place to remind the first storage device described in the electronic equipment to be inserted into.
13. the method as described in claim 1, which is characterized in that when first storage device is USB interface storage device
When, first operation detected whether by first detection device for first storage device, specially:
By being arranged there are two the pressure sensor in USB interface corresponding with the USB interface storage device detects whether
The first extraction operation that shrapnel is extracted from two holes of the USB interface storage device;Or
By being arranged there are two the pressure sensor in USB interface corresponding with the USB interface storage device detects whether
Shrapnel is inserted into the first insertion operation in two holes of the USB interface storage device.
14. method as claimed in claim 13, which is characterized in that by being arranged corresponding with the USB interface storage device
USB interface in pressure sensor detect whether to be extracted from two holes of the USB interface storage device there are two shrapnel
First extract operation, specially:
At the first moment, the first pressure value on described two shrapnels is detected by the pressure sensor;
The second moment after first moment detects the second pressure on described two shrapnels by the pressure sensor
Force value;
Judge the magnitude relationship of the first pressure value and the second pressure value, obtains third judging result;
Based on the third judging result, detect whether that the shrapnel is extracted from described two holes first extracts operation.
15. method as claimed in claim 14, which is characterized in that it is described when there is first operation, judge described first
Whether operation meets a preset condition, specifically includes:
When the second pressure value is more than the first pressure value, show to have described first to extract operation, and judges described the
Whether one operation meets a preset condition.
16. method as claimed in claim 15, which is characterized in that described to judge whether first operation meets a default item
Part, specially:
Judge whether the second pressure value is more than third predetermined threshold value, wherein the third predetermined threshold value specifically is used for characterizing
Whether first storage device has had the possible pressure value with electronic equipment power-off connection.
17. the method described in claim 16, which is characterized in that described when first operation meets the preset condition
When, first control instruction corresponding with first operation is generated, specially:
It is described show to have described first extract operation when, and when the second pressure value is less than the third predetermined threshold value,
Generate stopping data transfer instruction corresponding with the first extraction operation and/or instruction data storage.
18. method as claimed in claim 17, described to execute first control instruction, to be held to first storage device
Row the first control operation corresponding with first control instruction, specially:
The stopping data transfer instruction being executed, to stop the biography of the data between the electronic equipment and first storage device
It is defeated;And/or
The instruction data storage is executed, to preserve the data in first storage device.
19. method as claimed in claim 13, which is characterized in that it is described by setting with the USB interface storage device
Pressure sensor in corresponding USB interface detects whether that there are two two holes that shrapnel is inserted into the USB interface storage device
In the first insertion operation, specially:
At the first moment, the third pressure value on described two shrapnels is detected by the pressure sensor;
The second moment after first moment, then detected by the pressure sensor on described two shrapnels the 4th
Pressure value;
Judge the magnitude relationship of the third pressure value and the 4th pressure value, obtains the 4th judging result;
Based on the 4th judging result, detect whether that the sheet insertion enters the first insertion operation in described two holes.
20. method as claimed in claim 19, which is characterized in that it is described when there is first operation, judge described first
Whether operation meets a preset condition, specifically includes:
When the 4th pressure value is less than the third pressure value, show there is first insertion operation, and judges described the
Whether one operation meets a preset condition.
21. method as claimed in claim 20, which is characterized in that described to judge whether first operation meets a default item
Part, specially:
Judge whether the 4th pressure value is less than the 4th predetermined threshold value, wherein the 4th predetermined threshold value is specially to be used for table
Levy whether first storage device has had the possible pressure value for connecting with the electronic equipment, not powering on but.
22. method as claimed in claim 21, which is characterized in that described to judge that first operation meets the preset condition
When, first control instruction corresponding with first operation is generated, specially:
Show there is first insertion operation described, and when the 4th pressure value is more than four predetermined threshold value, it is raw
It is inserted into prompting instruction not in place at remind corresponding with first insertion operation.
23. method as claimed in claim 22, which is characterized in that it is described to execute first control instruction, with to described the
One storage device executes the first control operation corresponding with first control instruction, specially:
The prompting instruction is executed, it is not in place to remind the first storage device described in the electronic equipment to be inserted into.
24. a kind of electronic equipment, which is characterized in that including:
First interface;
First detection device is connect with the first interface;
Wherein, it is detected whether for the first storage device being connected on the first interface by first detection device
First operation;When there is first operation, judge whether first operation meets a preset condition;When first operation
When meeting the preset condition, first control instruction corresponding with first operation is generated;Execute first control
Instruction is operated, wherein described with executing the first control corresponding with first control instruction to first storage device
The first operation for first storage device is detected whether by first detection device, including:
Institute of the interface of the first storage device connection relative to the first electronic equipment is detected by first detection device
State the location information of first interface, and the detection based on the location information judges described the to first storage device
One operation;And/or
The pressure value on two shrapnels is detected by the pressure sensor being arranged in the first interface, and is based on the pressure
The detection of value judges first operation to first storage device, wherein the setting of described two shrapnels is described the
One interface internal.
25. electronic equipment as claimed in claim 24, which is characterized in that first detection device specifically includes:
First detection sub-unit, for detecting whether there is extract first storage device from the first interface first
Extract operation;
Second detection sub-unit is inserted into for detecting whether have first storage device being inserted into the first of the first interface
Operation.
26. electronic equipment as claimed in claim 25, which is characterized in that first detection sub-unit specifically includes:
First position detection unit, at the first moment, detecting first storage by first detection sub-unit and setting
Standby in the current location of the first interface is first position;
Second position detection unit passes through first detection sub-unit for the second moment after first moment
It is the second position to detect the current location;
First judging unit, for judging the position relationship between the first position and the second position, the first of acquisition sentences
Disconnected result;
First extract detection unit, for be based on first judging result, detected whether by first storage device from
First extracted in the first interface extracts operation.
27. electronic equipment as claimed in claim 26, which is characterized in that the first extraction detection unit specifically includes:
First acquisition unit, for obtaining second distance of the second position apart from the outer end of the first interface, Yi Jisuo
State first distance of the first position apart from the outer end;
First judgment sub-unit, for the second distance be less than described first apart from when, show to have described first to extract behaviour
Make, and judges whether first operation meets a preset condition.
28. electronic equipment as claimed in claim 27, which is characterized in that first judgment sub-unit is specifically used for judging institute
State whether second distance is more than the first predetermined threshold value, wherein first predetermined threshold value is specially to be used for characterizing described first depositing
Whether storage equipment has had disconnects the possible distance value being electrically connected with the electronic equipment.
29. electronic equipment as claimed in claim 28, which is characterized in that first judgment sub-unit specifically includes:
First generation unit shows have described first to extract operation for described, and when the second distance is more than described first
When predetermined threshold value, stopping data transfer instruction corresponding with the first extraction operation and/or instruction data storage are generated.
30. electronic equipment as claimed in claim 29, which is characterized in that first judgment sub-unit further includes specifically:
First execution unit is deposited with stopping the electronic equipment with described first for executing the stopping data transfer instruction
Store up the data transmission of equipment room;And/or the instruction data storage is executed, to preserve the data in first storage device.
31. electronic equipment as claimed in claim 25, which is characterized in that second detection sub-unit specifically includes:
The third place detection unit, at the first moment, first storage device to be detected by first detection device
Current location in the first interface is the third place;
4th position detection unit is examined for the second moment after first moment by first detection device
It is the 4th position to survey the current location;
Second judgment unit obtains second and judges for judging the position relationship between the third place and the 4th position
As a result;
First is inserted into detection unit, for being based on second judging result, has detected whether to insert first storage device
Enter the first insertion operation of the first interface.
32. electronic equipment as claimed in claim 31, which is characterized in that the first insertion detection unit specifically includes:
Second acquisition unit, the 4th distance for obtaining the outer end of first interface described in the 4th positional distance, Yi Jisuo
State third distance of the third place apart from the outer end;
Second judgment sub-unit, for the 4th distance be more than the third apart from when, show to have described first to be inserted into behaviour
Make, and judges whether first operation meets a preset condition.
33. electronic equipment as claimed in claim 32, which is characterized in that second judgment sub-unit is specifically used for judging institute
State whether the 4th distance is less than the second predetermined threshold value, wherein second predetermined threshold value is specially to be used for characterizing described first depositing
Whether storage equipment has had connect with the electronic equipment, the potential range not powered on but.
34. electronic equipment as claimed in claim 33, which is characterized in that second judgment sub-unit specifically includes:
Second generation unit, for showing there is first insertion operation described, and when the 4th distance is less than described the
When two predetermined threshold values, generates remind corresponding with first insertion operation and be inserted into prompting instruction not in place.
35. electronic equipment as claimed in claim 34, which is characterized in that second judgment sub-unit further includes specifically:
Second execution unit, for executing the prompting instruction, to remind the first storage device described in the electronic equipment to be inserted into
It is not in place.
36. electronic equipment as claimed in claim 24, when first storage device is specially USB interface storage device, and
When the first interface is USB interface, first detection device specifically includes:
Third detection sub-unit is passed for the pressure by being arranged in USB interface corresponding with the USB interface storage device
Sensor detects whether that extracted from two holes of the USB interface storage device there are two shrapnel first extracts operation;
4th detection sub-unit is passed for the pressure by being arranged in USB interface corresponding with the USB interface storage device
Sensor detects whether the first insertion operation being inserted into there are two shrapnel in two holes of the USB interface storage device.
37. electronic equipment as claimed in claim 36, which is characterized in that the third detection sub-unit specifically includes:
First pressure detection unit detects the on described two shrapnels by the pressure sensor at the first moment
One pressure value;
Second pressure detection unit is detected for the second moment after first moment by the pressure sensor
Second pressure value on described two shrapnels;
Third judging unit, the magnitude relationship for judging the first pressure value and the second pressure value obtain third and sentence
Disconnected result;
Second extracts detection unit, for being based on the third judging result, has detected whether the shrapnel from described two holes
The first of middle extraction extracts operation.
38. electronic equipment as claimed in claim 37, which is characterized in that the second extraction detection unit specifically includes:
Third judgment sub-unit, for when the second pressure value is more than the first pressure value, showing there is described first to pull out
Go out operation, and judges whether first operation meets a preset condition.
39. electronic equipment as claimed in claim 38, which is characterized in that the third judgment sub-unit is specifically used for judging institute
State whether second pressure value is more than third predetermined threshold value, wherein the third predetermined threshold value, which specifically is used for characterizing described first, deposits
Whether storage equipment has had the possible pressure value with electronic equipment power-off connection.
40. electronic equipment as claimed in claim 39, which is characterized in that the third judgment sub-unit specifically includes:
Third generation unit, for it is described show to have described first extract operation when, and when the second pressure value is less than institute
When stating third predetermined threshold value, generates stopping data transfer instruction corresponding with the first extraction operation and/or data storage refers to
It enables.
41. electronic equipment as claimed in claim 40, which is characterized in that the third judgment sub-unit further includes:
Third execution unit is deposited with stopping the electronic equipment with described first for executing the stopping data transfer instruction
Store up the data transmission of equipment room;And/or the instruction data storage is executed, to preserve the data in first storage device.
42. electronic equipment as claimed in claim 36, which is characterized in that the 4th detection sub-unit specifically includes:
Third pressure sensing cell, at the first moment, two on the USB interface to be detected by the pressure sensor
Third pressure value on shrapnel;
4th pressure sensing cell for the second moment after first moment, then is examined by the pressure sensor
Survey the 4th pressure value on two on the USB interface shrapnels;
4th judging unit, the magnitude relationship for judging the third pressure value and the 4th pressure value obtain the 4th and sentence
Disconnected result;
Second is inserted into detection unit, and for being based on the 4th judging result, it is described two to have detected whether that the sheet insertion enters
The first insertion operation in hole.
43. electronic equipment as claimed in claim 42, which is characterized in that the second insertion detection unit specifically includes:
4th judgment sub-unit, for when the 4th pressure value is less than the third pressure value, showing there is described first to insert
Enter operation, and judges whether first operation meets a preset condition.
44. electronic equipment as claimed in claim 43, which is characterized in that the 4th judgment sub-unit is specifically used for judging institute
State whether the 4th pressure value is less than the 4th predetermined threshold value, wherein the 4th predetermined threshold value is specially to be used for characterizing described first
Whether storage device has had connect with the electronic equipment, the possible pressure value not powered on but.
45. electronic equipment as claimed in claim 44, which is characterized in that the 4th judgment sub-unit specifically includes:
4th generation unit, for showing there is first insertion operation described, and when the 4th pressure value is more than described
When four predetermined threshold values, generates remind corresponding with first insertion operation and be inserted into prompting instruction not in place.
46. electronic equipment as claimed in claim 45, which is characterized in that the 4th judgment sub-unit further includes specifically:
4th execution unit, for executing the prompting instruction, to remind the first storage device described in the electronic equipment to be inserted into
It is not in place.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310097734.1A CN104077193B (en) | 2013-03-25 | 2013-03-25 | A kind of control method and a kind of electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310097734.1A CN104077193B (en) | 2013-03-25 | 2013-03-25 | A kind of control method and a kind of electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104077193A CN104077193A (en) | 2014-10-01 |
CN104077193B true CN104077193B (en) | 2018-08-31 |
Family
ID=51598462
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310097734.1A Active CN104077193B (en) | 2013-03-25 | 2013-03-25 | A kind of control method and a kind of electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104077193B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105072268B (en) * | 2015-07-31 | 2018-08-14 | 努比亚技术有限公司 | Mobile terminal and its method for stopping application |
CN105824736A (en) * | 2016-03-29 | 2016-08-03 | 乐视控股(北京)有限公司 | Method and device for detecting disconnection risk of external equipment |
CN106886695A (en) * | 2017-03-13 | 2017-06-23 | 联想(北京)有限公司 | Electronic equipment and its method for unlocking |
CN107861839A (en) * | 2017-10-18 | 2018-03-30 | 深圳市汉普电子技术开发有限公司 | USB hot plug data anti-loss method, equipment and storage medium |
CN111338526B (en) * | 2020-02-25 | 2021-09-21 | 维沃移动通信有限公司 | Screenshot method and device |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6131134A (en) * | 1998-05-12 | 2000-10-10 | Primax Electronics Ltd. | Hot plug-and-play converter of a universal serial bus interface |
CN101383627A (en) * | 2007-09-04 | 2009-03-11 | 大唐移动通信设备有限公司 | Device and method for terminal charger charging, USB charging and data communication |
US7635280B1 (en) * | 2008-07-30 | 2009-12-22 | Apple Inc. | Type A USB receptacle with plug detection |
CN102053941A (en) * | 2009-11-06 | 2011-05-11 | 创见资讯股份有限公司 | Portable device with reciprocating type detection terminal and detection and control method thereof |
CN202275990U (en) * | 2011-10-17 | 2012-06-13 | 山东科技大学 | Protector of universal serial bus (USB) plug |
-
2013
- 2013-03-25 CN CN201310097734.1A patent/CN104077193B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6131134A (en) * | 1998-05-12 | 2000-10-10 | Primax Electronics Ltd. | Hot plug-and-play converter of a universal serial bus interface |
CN101383627A (en) * | 2007-09-04 | 2009-03-11 | 大唐移动通信设备有限公司 | Device and method for terminal charger charging, USB charging and data communication |
US7635280B1 (en) * | 2008-07-30 | 2009-12-22 | Apple Inc. | Type A USB receptacle with plug detection |
CN102053941A (en) * | 2009-11-06 | 2011-05-11 | 创见资讯股份有限公司 | Portable device with reciprocating type detection terminal and detection and control method thereof |
CN202275990U (en) * | 2011-10-17 | 2012-06-13 | 山东科技大学 | Protector of universal serial bus (USB) plug |
Also Published As
Publication number | Publication date |
---|---|
CN104077193A (en) | 2014-10-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104077193B (en) | A kind of control method and a kind of electronic equipment | |
EP1840702A3 (en) | Information processing device, power supply control method and storage medium | |
US9444278B2 (en) | USB charging with data communication | |
WO2005114535A3 (en) | Method and apparatus for automatic detection of meter connection and transfer of data | |
TWI456489B (en) | Systems and methods for hot plug gpu power control | |
CN102073602B (en) | Computer system, connection control device as well as connecting and disconnecting method | |
WO2011088672A1 (en) | Intelligent charging method and device for terminal | |
WO2005076132A3 (en) | A test system | |
US9634517B2 (en) | Battery charging mode selection | |
JP2007213557A5 (en) | ||
CN103838470B (en) | A kind of method obtaining option of operation and electronic equipment | |
WO2009094207A3 (en) | Device, method, and system for calibration of a flow meter used in conjunction with a ventricular assist device | |
CN106961044B (en) | Mobile terminal and the method for anti-OTG false triggering | |
CN108181056A (en) | Indoor water-leakage detection method, system, storage medium and electronic equipment | |
CN109215656A (en) | Speech remote controller device and method, storage medium, electronic device | |
CN102810840B (en) | Voltage protection system | |
CN103123463B (en) | A kind of method and device of control system state | |
CN201667067U (en) | USB interface | |
EP2101254A3 (en) | Computer system and storage operation takeover method | |
CN109936761A (en) | VR all-in-one machine and the synchronous method of external terminal, system and VR all-in-one machine | |
CN105138320B (en) | Control the method and relevant device of screen display direction | |
CN108021402A (en) | Start-up control method and processing equipment | |
CN103809879B (en) | Information processing method and electronic equipment | |
CN107360290A (en) | Mobile terminal and its falling protection method | |
CN107305514A (en) | Notebook computer closes machine dormancy Auto-Test System and method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |