A kind of hot plug implementation method, terminal and storage medium
Technical field
The present invention relates to a kind of terminal hot plug technology field more particularly to hot plug implementation method, terminal and storages to be situated between
Matter.
Background technology
Hot plug is used to implement the hardware in the case where not closing system and not cutting off the power, taking out damage, carries out
It replaces, ensure that the uninterrupted normal operation of system.At present, for the terminals such as mobile phone, tablet, the hardware such as storage card can be with
It supports hot plug, i.e., can be taken out at any time during terminal operating, and not influence the normal work of terminal.
However, since the initialization of liquid crystal display and touch panel in terminal and drive load are all to start rank in system
Section is completed, and therefore, in the case where terminal is powered, first extracts liquid crystal display or touch panel and then access, liquid crystal
Display and touch panel cannot complete initialization and drive load accordingly, can not work normally.I.e. terminal can not realize liquid
The hot plug of crystal display and touch panel.In the prior art, terminal realizes that the scope of warm connection function is smaller.
The content of the invention
To solve the above-mentioned problems, an embodiment of the present invention provides a kind of hot plug implementation method, terminal and storage medium,
Terminal can realize the hot plug of liquid crystal display and touch panel, expand the scope that terminal realizes warm connection function.
The technical proposal of the invention is realized in this way:
An embodiment of the present invention provides a kind of hot plug implementation method, the described method includes:
When detecting in electriferous state, and when target device is with the completion object run of corresponding target bus, according to institute
The port level change information of target bus is stated, the target bus is triggered and interrupts;
The facility information of the target device is obtained by interrupt service routine;
The default finger daemon of control, according to the facility information and the port level change information, performance objective operation;
Wherein, the object run is used to implement the warm connection function of the target device.
It is described after the facility information that the target device is obtained by interrupt service routine in said program
Method further includes:
The facility information and the port level change information are reported to by the default finger daemon by socket.
In said program, the default finger daemon of control changes according to the facility information and the port level
Information, performance objective operation, including:
The default finger daemon is controlled, according to the facility information, the target device is determined as to perform object;
The default finger daemon is controlled, according to the port level change information and the execution object, is determined described
Object run;
The default finger daemon is controlled to perform the object run.
In said program, the control default finger daemon, according to the port level change information and described
Object is performed, determines the object run, including:
When the port level change information is the first change information, the default finger daemon is controlled, according to described
First operation is determined as the object run by the first change information and the execution object;Wherein, first change information
For characterizing the target device off-state is converted to from connection status with the target bus;
When the port level change information is the second change information, the default finger daemon is controlled, according to described
Second operation is determined as the object run by the second change information and the execution object;Wherein, second change information
For characterizing the target device connection status is converted to from off-state with the target bus.
In said program, the control default finger daemon performs the object run, including:
When the object run runs for first, it is corresponding that the control default finger daemon unloads the target device
Initialization program and driver;
When the object run runs for second, it is corresponding that the control default finger daemon loads the target device
Initialization program and driver.
The embodiment of the present invention additionally provides a kind of terminal, and the terminal includes:Processor, memory, target bus and logical
Believe bus;
The communication bus, the connection communication being used to implement between the processor and the memory;
The target bus, for being attached with target device;
The processor is used to perform the hot plug realization program stored in the memory, to realize following steps:
When detecting in electriferous state, and when the target device is with the completion object run of corresponding target bus, root
According to the port level change information of the target bus, trigger the target bus and interrupt;Institute is obtained by interrupt service routine
State the facility information of target device;The default finger daemon of control, according to the facility information and the port level change information,
Performance objective is run;Wherein, the object run is used to implement the warm connection function of the target device.
In above-mentioned terminal, the processor is believed in the equipment that the target device is obtained by interrupt service routine
After breath, it is additionally operable to perform the hot plug realization program, to realize following steps:
The facility information and the port level change information are reported to by the default finger daemon by socket.
In above-mentioned terminal, the processor is specifically used for performing the hot plug realization program, to realize following steps:
The default finger daemon is controlled, according to the facility information, the target device is determined as to perform object;Control
The default finger daemon is made, according to the port level change information and the execution object, determines the object run;Control
It makes the default finger daemon and performs the object run.
In above-mentioned terminal, the processor is specifically used for performing the hot plug realization program, to realize following steps:
When the port level change information is the first change information, the default finger daemon is controlled, according to described
First operation is determined as the object run by the first change information and the execution object;Wherein, first change information
For characterizing the target device off-state is converted to from connection status with the target bus;When the port level changes
When information is the second change information, the default finger daemon is controlled, according to second change information and the execution object,
Second operation is determined as the object run;Wherein, second change information characterizes the target device and the target
Bus is converted to connection status from off-state;
When the object run runs for first, it is corresponding that the control default finger daemon unloads the target device
Initialization program and driver;When the object run runs for second, described in the control default finger daemon loading
The corresponding initialization program of target device and driver.
The embodiment of the present invention additionally provides a kind of computer readable storage medium, the computer-readable recording medium storage
There are one or multiple programs, one or more of programs can be performed by one or more processor, in realization
The method for stating hot plug realization.
It can be seen that in the technical solution of the embodiment of the present invention, terminal, which is worked as, to be detected in electriferous state, and target is set
During the standby completion object run with corresponding target bus, according to the port level change information of target bus, target bus are triggered
It interrupts;The facility information of target device is obtained by interrupt service routine;The default finger daemon of control, according to facility information and end
Mouth level change information, performance objective operation;Wherein, object run is used to implement the warm connection function of target device.Namely
It says, in the technical solution of the embodiment of the present invention, terminal can control default finger daemon to perform definite object run, so as to
Ensure in the case where terminal is in electriferous state, target device access target bus remain to work normally, and expand terminal and realize that heat is inserted
Pull out the scope of function.
Description of the drawings
A kind of hardware architecture diagram of Fig. 1 optional mobile terminals of each embodiment to realize the present invention;
Fig. 2 is a kind of communications network system Organization Chart provided in an embodiment of the present invention;
Fig. 3 is a kind of flow diagram of hot plug implementation method provided in an embodiment of the present invention;
Fig. 4 is a kind of schematic diagram one of illustrative object run provided in an embodiment of the present invention;
Fig. 5 is a kind of schematic diagram two of illustrative object run provided in an embodiment of the present invention;
Fig. 6 is a kind of flow diagram of performance objective operation provided in an embodiment of the present invention;
Fig. 7 is the schematic diagram that a kind of illustrative terminal provided in an embodiment of the present invention carries out hot plug prompting;
Fig. 8 is a kind of structure diagram of terminal provided in an embodiment of the present invention.
Specific embodiment
It should be appreciated that the technical solution that the specific embodiments described herein are merely illustrative of the present invention, is not used to
Limit protection scope of the present invention.
In subsequent description, using for representing that the suffix of such as " module ", " component " or " unit " of element is only
Be conducive to the explanation of the present invention, itself there is no specific meanings.Therefore, " module " can mixedly make with " component "
With.
Terminal can be implemented in a variety of manners.For example, terminal described in the present invention can include such as mobile phone, tablet
Computer, laptop, palm PC, personal digital assistant (Personal Digital Assistant, PDA), portable
The shiftings such as media player (Portable Media Player, PMP), guider, wearable device, Intelligent bracelet, pedometer
The dynamic fixed terminals such as terminal and number TV, desktop computer.
It will be illustrated in subsequent descriptions by taking mobile terminal as an example, it will be appreciated by those skilled in the art that except special
For moving outside the element of purpose, construction according to the embodiment of the present invention can also apply to the terminal of fixed type.
Referring to Fig. 1, its to realize the present invention a kind of optional mobile terminal of each embodiment hardware configuration signal
Figure, the mobile terminal 100 can include:Radio frequency (Radio Frequency, RF) unit 101, Wi-Fi module 102, audio
Output unit 103, audio/video (A/V) input unit 104, sensor 105, display unit 106, user input unit 107,
The components such as interface unit 108, memory 109, processor 110 and power supply 111.It will be understood by those skilled in the art that Fig. 1
In the mobile terminal structure that shows do not form restriction to mobile terminal, mobile terminal can include more more or less than illustrating
Component either combine some components or different components arrangement.
The all parts of mobile terminal are specifically introduced with reference to Fig. 1:
Radio frequency unit 101 can be used for receiving and sending messages or communication process in, signal sends and receivees, specifically, by base station
Downlink information receive after, handled to processor 110;In addition, by the data sending of uplink to base station.In general, radio frequency unit 101
Including but not limited to antenna, at least one amplifier, transceiver, coupler, low-noise amplifier, duplexer etc..In addition, it penetrates
Frequency unit 101 can also be communicated by wireless communication with network and other equipment.Above-mentioned wireless communication can use any communication
Standard or agreement include but not limited to global system for mobile communications (Global System of Mobile
Communication, GSM), general packet radio service (General Packet Radio Service, GPRS), code it is point more
Location 2000 (Code Division Multiple Access 2000, CDMA2000), wideband code division multiple access (Wideband
Code Division Multiple Access, WCDMA), TD SDMA (Time Division-
Synchronous Code Division Multiple Access, TD-SCDMA), frequency division duplex Long Term Evolution
(Frequency Division Duplexing-Long Term Evolution, FDD-LTE) and time division duplex Long Term Evolution
(Time Division Duplexing-Long Term Evolution, TDD-LTE) etc..
Wi-Fi belongs to short range wireless transmission technology, and mobile terminal can help user to receive and dispatch by Wi-Fi module 102
Email, browsing webpage and access streaming video etc., it has provided wireless broadband internet to the user and has accessed.Although Fig. 1
Show Wi-Fi module 102, but it is understood that, and must be configured into for mobile terminal is not belonging to, it completely can basis
It needs to omit in the scope of essence for not changing invention.
Audio output unit 103 can be in call signal reception pattern, call mode, record mould in mobile terminal 100
Formula, speech recognition mode, broadcast reception mode when under isotypes, by radio frequency unit 101 or Wi-Fi module 102 it is receiving or
The voice data that person stores in memory 109 is converted into audio signal and exports as sound.Moreover, audio output unit
103 can also provide with mobile terminal 100 perform the relevant audio output of specific function (for example, call signal receive sound,
Message sink sound etc.).Audio output unit 103 can include loud speaker, buzzer etc..
A/V input units 104 are used to receive audio or video signal.A/V input units 104 can include graphics processor
(Graphics Processing Unit, GPU) 1041 and microphone 1042, graphics processor 1041 is in video acquisition mode
Or the static images or the image data of video obtained in image capture mode by image capture apparatus (such as camera) carry out
Reason.Treated, and picture frame may be displayed on display unit 106.Through graphics processor 1041, treated that picture frame can be deposited
Storage is sent in memory 109 (or other storage mediums) or via radio frequency unit 101 or Wi-Fi module 102.Mike
Wind 1042 can connect in telephone calling model, logging mode, speech recognition mode etc. operational mode via microphone 1042
Quiet down sound (voice data), and can be voice data by such acoustic processing.Audio that treated (voice) data can
To be converted to the form output that mobile communication base station can be sent to via radio frequency unit 101 in the case of telephone calling model.
Microphone 1042 can implement various types of noises eliminations or restrainable algorithms to eliminate or inhibit sending and receiving audio letter
The noise generated during number or interference.
Mobile terminal 100 further includes at least one sensor 105, such as optical sensor, motion sensor and other biographies
Sensor.Specifically, optical sensor includes ambient light sensor and proximity sensor, wherein, ambient light sensor can be according to environment
The light and shade of light adjusts the brightness of display panel 1061, and proximity sensor can close when mobile terminal 100 is moved in one's ear
Display panel 1061 and/or backlight.As one kind of motion sensor, accelerometer sensor can detect in all directions (general
For three axis) size of acceleration, size and the direction of gravity are can detect that when static, the application available for identification mobile phone posture
(such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, percussion) etc.;
The fingerprint sensor that can also configure as mobile phone, pressure sensor, iris sensor, molecule sensor, gyroscope, barometer,
The other sensors such as hygrometer, thermometer, infrared ray sensor, details are not described herein.
Display unit 106 is used to show by information input by user or be supplied to the information of user.Display unit 106 can wrap
Display panel 1061 is included, liquid crystal display (Liquid Crystal Display, LCD), Organic Light Emitting Diode may be employed
Forms such as (Organic Light-Emitting Diode, OLED) configure display panel 1061.
User input unit 107 can be used for the number for receiving input or character information and generation and the use of mobile terminal
The key signals input that family is set and function control is related.Specifically, user input unit 107 may include touch panel 1071 with
And other input equipments 1072.Touch panel 1071, also referred to as touch-screen, collect user on it or neighbouring touch operation
(for example user uses any suitable objects such as finger, stylus or attachment on touch panel 1071 or in touch panel 1071
Neighbouring operation), and corresponding attachment device is driven according to preset formula.Touch panel 1071 may include touch detection
Two parts of device and touch controller.Wherein, the touch orientation of touch detecting apparatus detection user, and detect touch operation band
The signal come, transmits a signal to touch controller;Touch controller receives touch information from touch detecting apparatus, and by it
Contact coordinate is converted into, then gives processor 110, and the order that processor 110 is sent can be received and performed.It in addition, can
To realize touch panel 1071 using polytypes such as resistance-type, condenser type, infrared ray and surface acoustic waves.Except touch panel
1071, user input unit 107 can also include other input equipments 1072.Specifically, other input equipments 1072 can wrap
It includes but is not limited to physical keyboard, in function key (such as volume control button, switch key etc.), trace ball, mouse, operation lever etc.
One or more, do not limit herein specifically.
Further, touch panel 1071 can cover display panel 1061, when touch panel 1071 detect on it or
After neighbouring touch operation, processor 110 is sent to determine the type of touch event, is followed by subsequent processing device 110 according to touch thing
The type of part provides corresponding visual output on display panel 1061.Although in Fig. 1, touch panel 1071 and display panel
1061 be the component independent as two to realize the function that outputs and inputs of mobile terminal, but in certain embodiments, it can
The function that outputs and inputs of mobile terminal is realized so that touch panel 1071 and display panel 1061 is integrated, is not done herein specifically
It limits.
Interface unit 108 be used as at least one external device (ED) be connected with mobile terminal 100 can by interface.For example,
External device (ED) can include wired or wireless head-band earphone port, external power supply (or battery charger) port, wired or nothing
Line data port, memory card port, the port for device of the connection with identification module, audio input/output (I/O) end
Mouth, video i/o port, ear port etc..Interface unit 108 can be used for receiving the input from external device (ED) (for example, number
It is believed that breath, electric power etc.) and the input received is transferred to one or more elements in mobile terminal 100 or can be with
For transmitting data between mobile terminal 100 and external device (ED).
Memory 109 can be used for storage software program and various data.Memory 109 can mainly include storing program area
And storage data field, wherein, storing program area can storage program area, application program (such as the sound needed at least one function
Sound playing function, image player function etc.) etc.;Storage data field can store according to mobile phone use created data (such as
Voice data, phone directory etc.) etc..In addition, memory 109 can include high-speed random access memory, can also include non-easy
The property lost memory, a for example, at least disk memory, flush memory device or other volatile solid-state parts.
Processor 110 is the control centre of mobile terminal, utilizes each of various interfaces and the entire mobile terminal of connection
A part is stored in storage by running or performing the software program being stored in memory 109 and/or module and call
Data in device 109 perform the various functions of mobile terminal and processing data, so as to carry out integral monitoring to mobile terminal.Place
Reason device 110 may include one or more processing units;Preferably, processor 110 can integrate application processor and modulatedemodulate is mediated
Device is managed, wherein, the main processing operation system of application processor, user interface and application program etc., modem processor is main
Handle wireless communication.It is understood that above-mentioned modem processor can not also be integrated into processor 110.
Mobile terminal 100 can also be included to the power supply 111 (such as battery) of all parts power supply, it is preferred that power supply 111
Can be logically contiguous by power-supply management system and processor 110, so as to realize management charging by power-supply management system, put
The functions such as electricity and power managed.
Although Fig. 1 is not shown, mobile terminal 100 can also be including bluetooth module etc., and details are not described herein.
For the ease of understanding the embodiment of the present invention, below to the communications network system that is based on of mobile terminal of the present invention into
Row description.
Referring to Fig. 2, Fig. 2 is a kind of communications network system Organization Chart provided in an embodiment of the present invention, the communication network system
It unites as the LTE system of universal mobile communications technology, user equipment (User of the LTE system including communicating connection successively
Equipment, UE) 201, evolved UMTS Terrestrial radio access network (Evolved UMTS Terrestrial Radio
Access Network, E-UTRAN) 202, evolved packet-based core networks (Evolved Packet Core, EPC) 203 and operation
The IP operation 204 of business.
Specifically, UE201 can be above-mentioned terminal 100, and details are not described herein again.
E-UTRAN202 includes eNodeB2021 and other eNodeB2022 etc..Wherein, eNodeB2021 can be by returning
Journey (backhaul) (such as X2 interface) is connected with other eNodeB2022, and eNodeB2021 is connected to EPC203,
ENodeB2021 can provide the access of UE201 to EPC203.
EPC203 can include mobility management entity (Mobility Management Entity, MME) 2031, ownership
Client server (Home Subscriber Server, HSS) 2032, other MME2033, gateway (Serving Gate
Way, SGW) 2034, grouped data network gateway (PDN Gate Way, PGW) 2035 and policy and rate functional entity
(Policy and Charging Rules Function, PCRF) 2036 etc..Wherein, MME2031 be processing UE201 and
The control node of signaling, provides carrying and connection management between EPC203.HSS2032 is all to manage for providing some registers
Such as the function of attaching position register (not shown) etc, and some are preserved in relation to use such as service features, data rates
The dedicated information in family.All customer data can be sent by SGW2034, and PGW2035 is with can providing the IP of UE201
Location is distributed and other functions, and PCRF2036 is business data flow and the strategy of IP bearing resources and charging control strategic decision-making
Point, it selects and provides available strategy and charging control decision-making with charge execution function unit (not shown) for strategy.
IP operation 204 can include internet, Intranet, IP multimedia subsystem (IP Multimedia
Subsystem, IMS) or other IP operations etc..
Although above-mentioned be described by taking LTE system as an example, those skilled in the art it is to be understood that the present invention not only
Suitable for LTE system, be readily applicable to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA with
And following new network system etc., it does not limit herein.
Based on above-mentioned mobile terminal hardware configuration and communications network system, each embodiment of the method for the present invention is proposed.
Embodiment one
An embodiment of the present invention provides a kind of hot plug implementation method, Fig. 3 inserts for a kind of heat provided in an embodiment of the present invention
Pull out the flow diagram of implementation method.As shown in figure 3, it mainly includes the following steps that:
S301, when detecting in electriferous state, and when target device is with the completion object run of corresponding target bus, root
According to the port level change information of target bus, triggering target bus interrupt.
In an embodiment of the present invention, terminal, which ought detect, itself is in electriferous state, and target device and terminal inner
When corresponding target bus complete object run, according to the port level change information of target bus, so as to trigger target bus
It interrupts.
It should be noted that in an embodiment of the present invention, target device can be realized by target bus and terminal to be connected
It connects or disconnects, object run is that target device and target bus are changed into connection status from off-state, alternatively, by mesh
Marking device and operation of the target bus performed by from connection status to off-state, that is to say, that object run is by target
Equipment removes target bus or access target bus.
Fig. 4 is a kind of schematic diagram one of illustrative object run provided in an embodiment of the present invention.As shown in figure 4, terminal
When under electriferous state, target device is in connection status by target bus and terminal, afterwards, if user or external force
Target device and target bus are disconnected, i.e., target device and target bus are changed into off-state from connection status, and target is set
It is standby to complete object run with target bus, wherein, it is changed into off-state from connection status in target device and target bus
During, terminal is also constantly in electriferous state.
Fig. 5 is a kind of schematic diagram two of illustrative object run provided in an embodiment of the present invention.As shown in figure 5, terminal
When under electriferous state, target device is disconnected by target bus and terminal, afterwards, if user or external force set target
Standby to be connected with target bus, i.e., target device and target bus are changed into connection status, target device and target from off-state
Bus completes object run, wherein, in target device and target bus from during off-state is changed into connection status,
Terminal is also constantly in electriferous state.
It should be noted that in an embodiment of the present invention, target device is the equipment for itself not possessing warm connection function,
And the warm connection function of target device can be realized by terminal of the present invention.The specific target device embodiment of the present invention does not limit
It is fixed.
Optionally, in an embodiment of the present invention, target device includes at least following one of which:Liquid crystal display and touch
Control panel.
It should be noted that if target device is liquid crystal display, liquid crystal display is connect by mobile Industry Processor
Mouth (Mobile Industry Processor Interface, MIPI) bus is connected with terminal handler, i.e. liquid crystal display
Corresponding target bus are MIPI buses.
If target device is touch panel, touch panel is by twin wire universal serial bus (Inter-Integrated
Circuit, I2C) it is connected with terminal handler, i.e., the corresponding target bus of touch panel are I2C buses.
It should be noted that in an embodiment of the present invention, MIPI buses or I2C buses possess itself port of detection
The function of interrupt service routine.
Illustratively, in an embodiment of the present invention, if target device is liquid crystal display, target bus are total for MIPI
Line, when terminal is detected in electriferous state, and liquid crystal display and MIPI buses from connection status be converted to off-state when,
Alternatively, terminal is detected in electriferous state, liquid crystal display and MIPI buses from off-state be converted to connection status when,
The port level of MIPI buses can change, and terminal is according to the port level change informations of MIPI buses, so as to trigger
MIPI buses are interrupted.
Illustratively, in an embodiment of the present invention, if target device is touch panel, target bus are I2C buses, when
Terminal detected in electriferous state, and touch panel and I2C buses from connection status be converted to off-state when, alternatively, touching
Control panel and I2C buses from off-state be converted to connection status when, the port level of I2C buses will change, terminal
According to the port level change information of I2C buses, interrupted so as to trigger I2C buses.
It should be noted that in an embodiment of the present invention, target device is whether removed target bus by object run
Or access target bus, i.e. target bus and target device are whether converted to off-state or from disconnection from connection status
State transition is connection status, and the port level of target bus will all change, as long as the port level of target bus occurs
Variation triggers target bus and interrupts.
It should be noted that the port level change information of target bus can be the first change information or the second variation letter
Breath.Wherein, the first information converting is converted to off-state with target bus for characterizing target device from connection status, and second becomes
Change information and be converted to connection status from off-state with target bus for characterizing target device.The port level of target bus becomes
It is the first change information and the second change information to change information, triggers target bus and interrupts.
It is understood that in the prior art, liquid crystal display and touch panel are not support hot plug, i.e. terminal
In the energized state, liquid crystal display and touch panel are disconnected, then is accessed, liquid crystal display and touch panel are can not normal work
Make.And in an embodiment of the present invention, terminal in the energized state, disconnects liquid crystal display and touch panel, then accesses, liquid
Crystal display and touch panel can be worked normally directly, i.e., terminal can realize that the heat of liquid crystal display and touch panel is inserted
It pulls out.
S302, the facility information that target device is obtained by interrupt service routine.
In an embodiment of the present invention, for terminal after triggering target bus interrupt, outage service routine passes through interruption
Service routine obtains the facility information of target device.
Specifically, in an embodiment of the present invention, the interrupt service routine in terminal can directly read target device
Facility information.
It should be noted that in an embodiment of the present invention, the facility information of target device is the mark of target device itself
Know.
Optionally, if target device is liquid crystal display, the facility information of target device is to characterize the target device to be
The information of liquid crystal display.
If target device is touch panel, the facility information of target device is to characterize the target device as touch panel
Information.
It should be noted that in an embodiment of the present invention, since MIPI buses or I2C buses possess itself end of detection
The function of the interrupt service routine of mouth, i.e. MIPI buses or I2C buses can also obtain the facility information of target device.
S303, the default finger daemon of control, according to facility information and port level change information, performance objective operation;Its
In, object run is used to implement the warm connection function of target device.
In an embodiment of the present invention, terminal got by interrupt service routine target device facility information it
Afterwards, default finger daemon is controlled, according to the facility information of target device and the port level change information of target bus, performs mesh
Mark operation.
It should be noted that in an embodiment of the present invention, default finger daemon can be the interior of terminal system Plays
The process of core notice application layer existence variation or the process developed in advance, are used to implement target device
Warm connection function.Specifically the default finger daemon embodiment of the present invention is not construed as limiting.
Fig. 6 is a kind of flow diagram of performance objective operation provided in an embodiment of the present invention.As shown in fig. 6, terminal control
System is default to guard and carries out performance objective operation and mainly include the following steps that:
S601, the default finger daemon of control according to facility information, target device are determined as to perform object.
In an embodiment of the present invention, terminal controls default finger daemon first, will according to the facility information of target device
Target device is determined as performing object.
It is understood that in an embodiment of the present invention, since the facility information of target device is to characterize the target
The information of device type presets finger daemon according to the facility information of target device, directly can be determined as holding by target device
Row object.
It should be noted that in an embodiment of the present invention, the facility information of target device can be for target device in itself
Mark, or character of target device etc., as long as the corresponding specific type of target device can be symbolized i.e.
It can.That is, the facility information embodiment of the present invention of specific target device is not construed as limiting.
Illustratively, in an embodiment of the present invention, if the facility information of target device is characterization, the target device is liquid
The information of crystal display, the i.e. controllable default finger daemon of terminal, liquid crystal display is determined as to perform object.If target device
Facility information be to characterize the information that the target device is touch panel, the i.e. controllable default finger daemon of terminal, by touch surface
Plate is determined as performing object.
S602, the default finger daemon of control, according to port level change information and perform object, determine object run.
In an embodiment of the present invention, terminal is after the default finger daemon of control determines to perform object, further, control
The default finger daemon of system according to the port level change information of target bus and definite execution object, then determines target fortune
Row.
Specifically, in an embodiment of the present invention, when port level change information is the first change information, control is default
Finger daemon, according to the first change information and performs object, and the first operation is determined as object run;Wherein, the first variation letter
Breath is converted to off-state with target bus for characterizing target device from connection status.When port level change information is second
During change information, default finger daemon is controlled, according to the second change information and performs object, the second operation is determined as target fortune
Row;Wherein, the second change information is converted to connection status with target bus for characterizing target device from off-state.
Illustratively, it is liquid crystal display to perform object, if port level change information is the first change information, terminal
First operation is determined as object run by the default finger daemon of control, wherein, first to operate to unloading liquid crystal display corresponding
Initialization program and driver, if port level change information is the second change information, terminal controls default finger daemon,
Second operation is determined as object run, wherein, second operates to the corresponding initialization program of loading liquid crystal display and driving
Program.
Illustratively, it is touch panel to perform object, if port level change information is the first change information, terminal is controlled
First operation is determined as object run by the default finger daemon of system, wherein, first to operate to unloading touch panel corresponding initial
Change program and driver, if port level change information is the second change information, terminal controls default finger daemon, by the
Two operations are determined as object run, wherein, second operates to the corresponding initialization program of loading touch panel and driver.
It should be noted that the corresponding initialization of target device is previously stored in an embodiment of the present invention, in terminal
Program and driver for being initialized to target device, are set since the embodiment of the present invention does not limit specific target
It is standby, that is to say, that the corresponding initialization program of plurality of target equipment and driver can be stored in terminal.For example, terminal
On can be stored with the corresponding initialization program of liquid crystal display and driver and the corresponding initialization program of touch panel
And driver.The specific corresponding initialization program of target device and the driver embodiment of the present invention are not construed as limiting, terminal
In pre-stored initialization program and the quantity embodiment of the present invention of driver be not construed as limiting.
It is understood that in an embodiment of the present invention, object run includes performing object and performs operation two parts,
Object, that is, target device is performed, it is load or unload to perform operation, performs the definite target device for depending on getting of object
Facility information, perform the port change information determined depending on target bus of operation, i.e. target device and target bus
Connection status.
S603, the default finger daemon performance objective operation of control.
In an embodiment of the present invention, after the default finger daemon of control determines object run, control is default to keep terminal
Shield process performance objective is run.
Specifically, in an embodiment of the present invention, when object run runs for first, terminal control presets finger daemon
Unload the corresponding initialization program of target device and driver.When object run runs for second, terminal control, which is preset, keeps
The corresponding initialization program of shield process loaded targets equipment and driver.
It is understood that terminal control presets finger daemon loading or the corresponding initialization program of unloading target device
During with driver, if terminal current-configuration when having display interface, can also on display interface display alarm message, for reminding
Just in the corresponding initialization program of load or unload target device and driver.If terminal current-configuration has indicator light, indicate
Lamp can also into line flicker, so as to remind just in the corresponding initialization program of load or unload target device and driver, when
After the completion of load or unload, indicator light then automatic distinguishing.
Illustratively, target device is touch panel, and terminal control presets finger daemon according to execution object, i.e. touch surface
Plate and the second change information, after the first operation is determined as object run, terminal control presets finger daemon and performs first
Operation controls the corresponding initialization program of default finger daemon loading touch panel and driver.
Fig. 7 is the schematic diagram that a kind of illustrative terminal provided in an embodiment of the present invention carries out hot plug prompting.Such as Fig. 7 institutes
Show, be provided with indicator light in terminal in advance, when terminal control presets the operation of finger daemon performance objective, i.e. load or unload target
When the corresponding initialization program of equipment and driver, indicator light starts to flicker, and presets finger daemon when terminal control and completes to add
After carrying or unloading the corresponding initialization program of target device and driver, indicator light stops flicker, that is, completes target device
Hot plug remind.
Further, in an embodiment of the present invention, after step S302, step S304 is further included before S303, specifically
It is as follows:
S304, facility information and port level change information are reported to by default finger daemon by socket.
In an embodiment of the present invention, terminal is in the facility information for getting target device and the port level of target bus
, it is necessary to will be on the port level change information of the facility information of target device and target bus by socket after change information
Offer default finger daemon.Afterwards, terminal can control default finger daemon, determine object run.
It should be noted that in an embodiment of the present invention, socket can realize consumer process and kernel process communication,
It namely realizes and facility information and port level change information is reported to default finger daemon.
It is understood that in an embodiment of the present invention, terminal can control default finger daemon, band is at itself
Under electricity condition, when target device is switched in or out, real-time loading or the corresponding initialization program of unloading target device and driving journey
Sequence so as to ensure that target device works normally, that is, realizes the hot plug of target device.
An embodiment of the present invention provides a kind of hot plug implementation method, terminal, which is worked as, to be detected in electriferous state, and target
When equipment completes object run with corresponding target bus, according to the port level change information of target bus, triggering target is total
Line interrupts;The facility information of target device is obtained by interrupt service routine;The default finger daemon of control, according to facility information and
Port level change information, performance objective operation;Wherein, object run is used to implement the warm connection function of target device.Also
It is to say, in the technical solution of the embodiment of the present invention, terminal can control default finger daemon to perform definite object run, from
And ensure in the case where terminal is in electriferous state, target device access target bus remain to work normally, and expand terminal and realize heat
Plug the scope of function.
Embodiment two
Fig. 8 is a kind of schematic diagram of terminal structure provided in an embodiment of the present invention.As shown in figure 8, the terminal includes:Processing
Device 801, memory 802, target bus 803 and communication bus 804;
The communication bus 803 is used to implement the processor 801, the memory 802 and the target bus 803
Between connection communication;
The target bus 803, for being attached with target device;
The processor 801 is used to perform the hot plug realization program stored in the memory 802, to realize following step
Suddenly:
When detecting in electriferous state, and when the target device is with the completion object run of corresponding target bus 803,
According to the port level change information of the target bus 803, trigger the target bus 803 and interrupt;Journey is serviced by interrupting
Sequence obtains the facility information of the target device;The default finger daemon of control, according to the facility information and the port level
Change information, performance objective operation;Wherein, the object run is used to implement the warm connection function of the target device.
Optionally, the processor 801 is in the facility information that the target device is obtained by interrupt service routine
Afterwards, it is additionally operable to perform the hot plug realization program, to realize following steps:
The facility information and the port level change information are reported to by the default finger daemon by socket.
Optionally, the processor 801 is specifically used for performing the hot plug realization program, to realize following steps:
The default finger daemon is controlled, according to the facility information, the target device is determined as to perform object;Control
The default finger daemon is made, according to the port level change information and the execution object, determines the object run;Control
It makes the default finger daemon and performs the object run.
Optionally, the processor 801 is specifically used for performing the hot plug realization program, to realize following steps:
When the port level change information is the first change information, the default finger daemon is controlled, according to described
First operation is determined as the object run by the first change information and the execution object;Wherein, first change information
For characterizing the target device off-state is converted to from connection status with the target bus 803;When the port level
When change information is the second change information, the default finger daemon is controlled, according to second change information and the execution
Second operation is determined as the object run by object;Wherein, second change information characterize the target device with it is described
Target bus 803 are converted to connection status from off-state;
When the object run runs for first, it is corresponding that the control default finger daemon unloads the target device
Initialization program and driver;When the object run runs for second, described in the control default finger daemon loading
The corresponding initialization program of target device and driver.
An embodiment of the present invention provides a kind of terminal, terminal when detecting in electriferous state, and target device with it is corresponding
Target bus when completing object run, according to the port level change information of target bus, triggering target bus interrupt;Pass through
Interrupt service routine obtains the facility information of target device;The default finger daemon of control, becomes according to facility information and port level
Change information, performance objective operation;Wherein, object run is used to implement the warm connection function of target device.It is that is, of the invention
The terminal that embodiment provides can control default finger daemon to perform definite object run, so as to ensure to be in band in terminal
Under electricity condition, target device access target bus remain to work normally, and expand the scope that terminal realizes warm connection function.
An embodiment of the present invention provides a kind of computer readable storage medium, the computer-readable recording medium storage has
One or more program, one or more of programs can be performed by one or more processor, above-mentioned to realize
Hot plug implementation method.Computer readable storage medium can be volatile memory (volatile memory), such as with
Machine access memory (Random-Access Memory, RAM);Or nonvolatile memory (non-volatile
Memory), such as read-only memory (Read-Only Memory, ROM), flash memory (flash memory), hard disk
(Hard Disk Drive, HDD) or solid state disk (Solid-State Drive, SSD);Can also include above-mentioned memory
One of or any combination respective equipment, such as mobile phone, computer, tablet device, personal digital assistant.
It should be noted that herein, term " comprising ", "comprising" or its any other variant are intended to non-row
His property includes, so that process, method, article or device including a series of elements not only include those elements, and
And it further includes other elements that are not explicitly listed or further includes as this process, method, article or device institute inherently
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including this
Also there are other identical elements in the process of element, method, article or device.
The embodiments of the present invention are for illustration only, do not represent the quality of embodiment.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on such understanding, technical scheme substantially in other words does the prior art
Going out the part of contribution can be embodied in the form of software product, which is stored in a storage medium
In (such as ROM/RAM, magnetic disc, CD), used including some instructions so that a station terminal (can be mobile phone, computer services
Device, air conditioner or network equipment etc.) perform method described in each embodiment of the present invention.
The embodiment of the present invention is described above in conjunction with attached drawing, but the invention is not limited in above-mentioned specific
Embodiment, above-mentioned specific embodiment is only schematical rather than restricted, those of ordinary skill in the art
Under the enlightenment of the present invention, present inventive concept and scope of the claimed protection are not being departed from, can also made very much
Form, these are belonged within the protection of the present invention.