Summary of the invention
The present invention provides a kind of terminal card abnormal detector, method, terminal and computer readable storage medium, it is intended to
Solve in the prior art, need to tear open machine testing terminal can not identification terminal card the reason of so that detection is cumbersome, and easily give
User brings the problem of distrust.
In order to solve the above technical problems, the present invention provides a kind of terminal card abnormal detector, it is applied to include center
The terminal of processor, power management chip, deck, level path control element, data path control element and data-interface,
Include:
Power supply module, for powering to the central processing unit, deck;
Abnormality detection module, the level access for the central processing unit to be connect with the deck connect with the data
Mouth is connected.
Optionally, the abnormality detection module includes:
The part GPIO port of the central processing unit is correspondingly connected with by the part of interface of the deck and terminal card,
Level access is formed, at least one access in the level access passes through level path control element and the first transmission channel phase
Even;
The central processing unit is connect with the data-interface by the first transmission channel and the second transmission channel, wherein institute
It states and is connected with the first data path control element on the first transmission channel;
It is connected between the power management chip and the data-interface by the first transmission channel and the second transmission channel,
Wherein the second data path control element is connected on first transmission channel;
The level path control element is connected with the first GPIO port of central processing unit;
The second of the first data path control element and the second data path control element and the central processing unit
GPIO port is connected.
Optionally, the level path control element is the single pole multiple throw with clocking capability, according to setting time
Individually the level access for switching one end is connected to first transmission channel of the other end.
Optionally, the data path control element is NMOS tube.
Further, the present invention also provides a kind of terminal card method for detecting abnormality, it is applied to that there is above-mentioned terminal card
The terminal of piece abnormal detector, the terminal card method for detecting abnormality include:
The terminal determines card reading failure, and the central processing unit issues control signal;
First GPIO port exports the first current potential according to control signal, and second GPIO port is according to control signal
Export the second current potential;
The first data path control element and the second data path control element receive second GPIO port
Second current potential of output turns off the first data path control element and the second data path control element;
The level path control element receives the first current potential of the first GPIO port output, and the level is led to
Road is connected to first transmission channel.
Optionally, terminal determines after knowing card crash, by the external data line matched with the data-interface and the data
Interface is connected, and the voltage value of the signal of the first transmission channel in external data line is measured with external equipment.
Optionally, when receiving recovery control instruction, it is corresponding with the first current potential to control the first GPIO port output
Opposite potential, second GPIO port export opposite potential corresponding with the second current potential;
The first data path control element and the second data path control element receive second GPIO port
The opposite potential corresponding with the second current potential of output triggers the first data path control element and the second data path control member
Part;
The level path control element receives the corresponding opposite with the first current potential of the first GPIO port output
Current potential disconnects the level access and first transmission channel.
Optionally, the control signal can directly be issued after terminal determines card reading failure by central processing unit, can also be by
User is issued by software interface or physical button;
After the recovery control instruction can be issued by the control signal, when reaching the preset time, by central processing unit
It issues, can also be issued by user by software interface or physical button.
Further, the present invention also provides a kind of terminal, packet expands terminal card abnormal detector, further include memory with
And communication bus;
The communication bus is for realizing the communication connection between the processor and the memory;
Central processing unit in the terminal card abnormal detector for execute one stored in memory or
Multiple programs, the step of to realize terminal card method for detecting abnormality as described in any one of claim 5-8.
Further, the present invention also provides a kind of computer readable storage medium, the computer readable storage mediums
It is stored with one or more program, one or more of programs can be executed by one or more processor, to realize
The step of above-mentioned terminal card method for detecting abnormality.
Beneficial effect
The present invention provides a kind of terminal card abnormal detector, method, terminal and computer readable storage medium.It is existing
Terminal card reads exception, when needing test problems, it is necessary to disassemble to terminal, tear machine testing not only low efficiency open, difficulty is high
And damage is easily caused, while also bringing distrust to user.In view of the above-mentioned problems, the present invention is read in terminal card
When abnormal, CPU receives exception information, and by the output current potential of control the first GPIO port and the second GPIO port, and then controls
Level path control element processed is opened, and level path control element then individually distinguishes several level accesses of terminal card
It is attached with the first data path, by controlling the switching of level path control element, and then controls and the first data path
Connected level access.At this point, user only needs data line corresponding with terminal data interface accessing data-interface, then by outer
The signal of first transmission channel in portion's device measuring data line, and with the switching of level path control element, successively measurement is believed
Number waveform, the level access to go wrong can be judged according to the waveform of signal, more quick orientation problem repairs,
It avoids machine of tearing open and carries out signal measurement, not only save a large amount of time, also reduce user to needing to tear machine open in detection process
And the distrust generated.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
In subsequent description, it is only using the suffix for indicating such as " module ", " component " or " unit " of element
Be conducive to explanation of the invention, itself there is no a specific meaning.Therefore, " module ", " component " or " unit " can mix
Ground uses.
Terminal can be implemented in a variety of manners.For example, terminal described in the present invention may include such as mobile phone, plate
Computer, laptop, palm PC, personal digital assistant (Personal Digital Assistant, PDA), portable
Media player (Portable Media Player, PMP), navigation device, wearable device, Intelligent bracelet, pedometer etc. move
The fixed terminals such as dynamic terminal, and number TV, desktop computer.
It will be illustrated by taking mobile terminal as an example in subsequent descriptions, it will be appreciated by those skilled in the art that in addition to special
Except element for moving purpose, the construction of embodiment according to the present invention can also apply to the terminal of fixed type.
Referring to Fig. 1, a kind of hardware structural diagram of its mobile terminal of each embodiment to realize the present invention, the shifting
Dynamic terminal 100 may include: RF (Radio Frequency, radio frequency) unit 101, WiFi module 102, audio output unit
103, A/V (audio/video) input unit 104, sensor 105, display unit 106, user input unit 107, interface unit
108, the components such as memory 109, processor 110 and power supply 111.It will be understood by those skilled in the art that shown in Fig. 1
Mobile terminal structure does not constitute the restriction to mobile terminal, and mobile terminal may include components more more or fewer than diagram,
Perhaps certain components or different component layouts are combined.
It is specifically introduced below with reference to all parts of the Fig. 1 to mobile terminal:
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, to processor 110 handle;In addition, the data of uplink are sent 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, penetrating
Frequency unit 101 can also be communicated with network and other equipment by wireless communication.Any communication can be used in above-mentioned wireless communication
Standard or agreement, including but not limited to GSM (Global System of Mobile communication, global system for mobile telecommunications
System), GPRS (General Packet Radio Service, general packet radio service), CDMA2000
(CodeDivision Multiple Access 2000, CDMA 2000), WCDMA (Wideb and Code
Division Multiple Access, wideband code division multiple access), TD-SCDMA (Time Division-Synchronous
Code Division Multiple Access, TD SDMA), FDD-LTE (Frequency Division
Duplexing-Long Term Evolution, frequency division duplex long term evolution) and TDD-LTE (Time Division
Duplexing-Long Term Evolution, time division duplex long term evolution) etc..
WiFi belongs to short range wireless transmission technology, and mobile terminal can help user to receive and dispatch electricity by WiFi module 102
Sub- mail, browsing webpage and access streaming video etc., it provides wireless broadband internet access for user.Although Fig. 1 shows
Go out WiFi module 102, but it is understood that, and it is not belonging to must be configured into for mobile terminal, it completely can be according to need
It to omit within the scope of not changing the essence of the invention.
Audio output unit 103 can be in call signal reception pattern, call mode, record mould in mobile terminal 100
When under the isotypes such as formula, speech recognition mode, broadcast reception mode, by radio frequency unit 101 or WiFi module 102 it is received or
The audio data stored in memory 109 is converted into audio signal and exports to be sound.Moreover, audio output unit 103
Audio output relevant to the specific function that mobile terminal 100 executes can also be provided (for example, call signal receives sound, disappears
Breath receives sound etc.).Audio output unit 103 may include loudspeaker, buzzer etc..
A/V input unit 104 is for receiving audio or video signal.A/V input unit 104 may include graphics processor
(Graphics Processing Unit, GPU) 1041 and microphone 1042, graphics processor 1041 is in video acquisition mode
Or the image data of the static images or video obtained in image capture mode by image capture apparatus (such as camera) carries 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 WiFi 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 (audio data), and can be audio data by such acoustic processing.Audio that treated (voice) data can
To be converted to the format output that can be sent to mobile communication base station via radio frequency unit 101 in the case where telephone calling model.
Microphone 1042 can be implemented various types of noises elimination (or inhibition) algorithms and send and receive sound to eliminate (or inhibition)
The noise generated during frequency signal 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 a kind of motion sensor, accelerometer sensor can detect in all directions (general
For three axis) size of acceleration, it can detect that size and the direction of gravity when static, can be used to identify the application of 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 sensor, details are not described herein.
Display unit 106 is for showing information input by user or being 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 can be used
Forms such as (Organic Light-Emitting Diode, OLED) configure display panel 1061.
User input unit 107 can be used for receiving the number or character information of input, and generate the use with mobile terminal
Family setting and the related key signals input of function control.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 the touch operation of user on it or nearby
(for example user uses any suitable objects or attachment such as finger, stylus 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
It is converted into contact coordinate, then gives processor 110, and order that processor 110 is sent can be received and executed.In addition, can
To realize touch panel 1071 using multiple types such as resistance-type, condenser type, infrared ray and surface acoustic waves.In addition to touch panel
1071, user input unit 107 can also include other input equipments 1072.Specifically, other input equipments 1072 can wrap
Include but be not limited to physical keyboard, function key (such as volume control button, level path control element key etc.), trace ball, mouse
One of mark, operating stick etc. are a variety of, specifically herein without limitation.
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 function that outputs and inputs of realizing mobile terminal as two independent components, 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) connect with mobile terminal 100 can by interface.For example,
External device (ED) may include wired or wireless headphone port, external power supply (or battery charger) port, wired or nothing
Line data port, memory card port, the port for connecting the device 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 storing software program and various data.Memory 109 can mainly include storing program area
The storage data area and, wherein storing program area can (such as the sound of application program needed for storage program area, at least one function
Sound playing function, image player function etc.) etc.;Storage data area can store according to mobile phone use created data (such as
Audio data, phone directory etc.) etc..In addition, memory 109 may include high-speed random access memory, it 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 by running or execute the software program and/or module that are stored in memory 109, and calls and is stored in storage
Data in device 109 execute the various functions and processing data of mobile terminal, to carry out integral monitoring to mobile terminal.Place
Managing device 110 may include one or more processing units;Preferably, processor 110 can integrate application processor and modulatedemodulate is mediated
Manage device, wherein the main processing operation system of application processor, user interface and application program etc., modem processor is main
Processing wireless communication.It is understood that above-mentioned modem processor can not also be integrated into processor 110.
Mobile terminal 100 can also include the power supply 111 (such as battery) powered to all parts, it is preferred that power supply 111
Can be logically contiguous by power-supply management system and processor 110, 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.
Embodiment to facilitate the understanding of the present invention, the communications network system that mobile terminal of the invention is based below into
Row description.
Referring to Fig. 2, Fig. 2 is a kind of communications network system architecture diagram provided in an embodiment of the present invention, the communication network system
System is the LTE system of universal mobile communications technology, which includes UE (User Equipment, the use of successively communication connection
Family equipment) (the land Evolved UMTS Terrestrial Radio Access Network, evolved UMTS 201, E-UTRAN
Ground wireless access network) 202, EPC (Evolved Packet Core, evolved packet-based core networks) 203 and operator IP operation
204。
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 connect with other eNodeB2022, and eNodeB2021 is connected to EPC203,
ENodeB2021 can provide the access of UE201 to EPC203.
EPC203 may include MME (Mobility Management Entity, mobility management entity) 2031, HSS
(Home Subscriber Server, home subscriber server) 2032, other MME2033, SGW (Serving Gate Way,
Gateway) 2034, PGW (PDN Gate Way, grouped data network gateway) 2035 and PCRF (Policy and
Charging Rules Function, policy and rate functional entity) 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 home location register (not shown) etc, and preserves some related service features, data rates etc. and use
The dedicated information in family.All customer data can be sent by SGW2034, and PGW2035 can provide the IP of UE 201
Address distribution and other functions, PCRF2036 are strategy and the charging control strategic decision-making of business data flow and IP bearing resource
Point, it selects and provides available strategy and charging control decision with charge execution function unit (not shown) for strategy.
IP operation 204 may include internet, Intranet, IMS (IP Multimedia Subsystem, IP multimedia
System) or other IP operations etc..
Although above-mentioned be described by taking LTE system as an example, those skilled in the art should know the present invention is not only
Suitable for LTE system, be readily applicable to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA with
And the following new network system etc., herein without limitation.
Based on above-mentioned mobile terminal hardware configuration and communications network system, each embodiment of the method for the present invention is proposed.
First embodiment
To solve in existing scheme, terminal card reads exception, when needing to detect failure, it is necessary to terminal is disassembled,
Tear machine testing not only low efficiency open, difficulty is high and easily causes damage, while the problem of also bring distrust to user, the present embodiment
A kind of terminal card abnormal detector is provided, referring specifically to Fig. 2.
The device includes deck S203, central processing unit S201, power management chip S202, level path control element
S204, the first data path control element S206, the second data path control element S207 and data-interface S205.
The device is divided into power supply module and abnormality detection module, and in power supply module, power management chip is deck and center
Processor power supply;Abnormality detection module is as described below:
Terminal card is placed on deck S203, and the part pin of terminal card is by deck with central processing unit S201's
Part GPIO port is connected, and forms level access;It should be understood that deck herein can be multiple types, such as SD card card
Seat, SIM card deck etc..By taking SIM card deck as an example, the VCC pin of deck is connected with the port GPIO-1 of central processing unit, eventually
The DATA pin of end card is connected with the port GPIO-2 of central processing unit, the RST pin of terminal card and central processing unit
The port GPIO-3 is connected, and the CLK pin of terminal card is connected with the port GPIO-4 of central processing unit.
Level path control element S204 is used for the through and off of control circuit, it should be appreciated that level access control member
The type of part is unlimited, as long as having the function of the connection status of two accesses of control, can be coaxial switch, relay etc.
Deng level path control element can also have certain additional function, such as clocking capability;The quantity of level path control element
Also unlimited, it can be single or multiple;The connection of level path control element one end connects above-mentioned deck S203 and centre
At least one of the level access between device S201 is managed, the other end is connected by the first data path with data-interface;It should
Understand, the type and quantity for the level access being connected by level path control element with the first data path are can
Choosing, it can choose be easier to break down in four level accesses one or more by level path control element and first
Data path is connected, to reach higher detection efficiency;All level accesses can also all be passed through into level path control element
It is connected with the first data path, to reach most comprehensive detection range.For example, can be used four when deck is SIM card holder
Single-pole single-throw switch (SPST) with clocking capability is connected, by central processing unit respectively at tetra- level accesses of VCC, RST, CLK, DATA
Each single-pole single-throw(SPST level path control element is individually controlled, or by preset time-count cycle, so that every time most
Only one more level path control element are in closed state;Also the hilted broadsword four-throw level with clocking capability can be used
Path control element, while tetra- level accesses of VCC, RST, CLK, DATA are connected, by central processing unit to each single-pole single-throw(SPST
Switch is individually controlled, or by preset time-count cycle, so that at most only one single-pole single-throw switch (SPST) is in every time
Closed state.
Data-interface S205 is connected with the level path control element by the first data path;The first of data-interface
Data path passes through the first data path control element S206, is connected with the port of central processing unit S201, by the second data
Path control element S207 is connected with power management chip S202;The second data path and central processing unit and electricity of data-interface
Source control chip is connected.It is understood that data path control element is for controlling the first data path and central processing unit
With the connection of power management chip, it is not limited to a certain element, the element of effect same can be reached, such as NMOS tube, PMOS
Pipe etc..The second GPIO port of central processing unit S201 exports the 4th current potential, the first number under the 4th current potential by default
The first data path is connected with the port of central processing unit according to path control element, the second data path control element is by first
Data path is connected with the port of power management chip;After receiving control signal, the output of the second GPIO port and the 4th current potential
The second opposite current potential closes the first data path control element and the second data path control element, the first data path control
The closing of element processed has separated contacting for the first data path and central processing unit, the closing of the second data path control element every
Break the contacting of the first data path signal and power management chip.The first GPIO port and the electricity of central processing unit S201
Flat path control element is connected, and the first GPIO port exports third current potential by default, and third current potential will not triggering level
Path control element S204, level path control element are opened a way output at this time;After receiving control signal, central processing unit control
First GPIO port exports first current potential opposite with third current potential, to activate above-mentioned level path control element, at this time first
The signal of data path transmission is the voltage signal in the level access being connected with level path control element.It should be understood that
Be, above-mentioned first, second, third and the 4th current potential be used to indicate current potential height, the first current potential and third current potential are on the contrary, the
On the contrary, for example, when the first current potential is high potential, third current potential is low potential for two current potentials and the 4th current potential, and the second current potential is low
When current potential, the 4th current potential is high potential.
Data-interface S205 passes through the USB-DM interface and power management core of the second data path and central processing unit S201
The USB-DM interface of piece S202 is connected, it is to be understood that the type of data-interface is unlimited, can be Type-C interface, Micro
Usb interface, Lighting interface etc.;It is external by the way that the data line matched with the data-interface is connected with the data-interface
Equipment can obtain the signal in the first data path by data line;It is understood that external equipment herein include but
It is not limited to the voltage measuring apparatus such as voltmeter, oscillograph.
A kind of terminal card abnormal detector is present embodiments provided, which goes out in terminal
When existing card reading exception, the level access between terminal card pin and central processing unit is transmitted by level path control element
To data-interface, maintenance personal can detect the route for causing card reading exception, solve existing skill by measuring the level signal
It in art, when terminal card reading exception, needs to tear machine testing open, so that detection efficiency is low, difficulty is high and easily causes damage, while also to use
The problem of distrust, is brought at family, and realizing terminal can also detect to lead to terminal card without tearing machine operation open
The effect of the route of card reading exception.
Second embodiment
To solve in existing scheme, terminal card reads exception, when needing test problems, it is necessary to terminal is disassembled,
Tear machine testing not only low efficiency open, difficulty is high and easily causes damage, while the problem of also bring distrust to user, the present embodiment
A kind of terminal card abnormal detector is provided.In order to better understand the content of the present embodiment, this sentences SIM card abnormality detection
It is illustrated for device, referring specifically to Fig. 3.
SIM card abnormal detector includes SIM card holder S303, central processing unit S301, power management chip S302, band meter
Four throw switch S304 of hilted broadsword, the first NMOS tube S306, the second NMOS tube S307 and Type-C male seat S305 of Shi Gongneng.
The SIM card abnormal detector is divided into power supply module and abnormality detection module, in power supply module, power management chip
It powers for deck and central processing unit;Abnormality detection module is as described below:
SIM card is placed on SIM card holder S303, and the part pin of SIM card passes through the portion of deck and central processing unit S301
Divide GPIO port to be connected, forms level access;Specifically, the port the GPIO-1 phase of the VCC pin of SIM card and central processing unit
Even, the DATA pin of SIM card is connected with the port GPIO-2 of central processing unit, the RST pin of SIM card and central processing unit
The port GPIO-3 is connected, and the CLK pin of SIM card is connected with the port GPIO-4 of central processing unit;The GND interfacing ground of SIM card.
The four throw switch S304 of hilted broadsword with clocking capability is triggered by high level, and one end connection connects above-mentioned SIM card
Seat S303 and central processing unit S301 between tetra- level accesses of VCC, RST, CLK, DATA, the other end by D+ access with
Type-C male seat S305 is connected, and four throw switch of hilted broadsword with clocking capability can pass through preset timing in triggering state
Period successively chooses a level access and is attached with D+ access;For example, in four throw switch of hilted broadsword with clocking capability
After triggering, selection VCC access first is connected with D+ access, and after reaching the timing duration of setting, switching switch makes DATA access
It is connected with D+ access, repeats the operation, until four throw switch of hilted broadsword with clocking capability is closed.It should be understood that
It is that the order of connection of tetra- level accesses of four throw switch of hilted broadsword and VCC, RST, CLK, DATA with clocking capability is variable
, it is not limited to a certain sequence.
Type-C male seat S305 is connected by the four throw switch S304 of hilted broadsword with clocking capability with D+ access;Type-C
The D+ access of male seat is connected, by the second NMOS tube by the first NMOS tube S306 with the port USB-DP of central processing unit
S307 is connected with the port USB-DP of power management chip;First NMOS tube is connected with the GATE grid of the second NMOS tube, is formed
Access.
Between the port GPIO-6 of central processing unit S301 and above-mentioned first NMOS tube S306 and the second NMOS tube S307
GATE gate vias is connected;The port GPIO-6 exports high potential by default, and the first NMOS tube is by D+ access under high potential
It is connected with the port USB-DP of central processing unit S301, the second NMOS tube is by the USB-DP of D+ access and power management chip S302
Port is connected;When GPIO-6 exports low potential, the first NMOS tube and the second NMOS tube are closed, the closing of the first NMOS tube separates
D+ signal and central processing unit contact, and the closing of the second NMOS tube has separated contacting for D+ signal and power management chip.
The port GPIO-5 of central processing unit S301 is connected with the four throw switch S304 of hilted broadsword with clocking capability,
The port GPIO-5 exports low potential by default, and low potential will not trigger four throw switch of hilted broadsword with clocking capability,
Four throw switch of hilted broadsword with clocking capability is opened a way output at this time;When GPIO-5 exports high potential, activate described with clocking capability
Four throw switch of hilted broadsword.
Type-C male seat S305 passes through the USB-DM interface and power management chip of D- access and central processing unit S301
The USB-DM interface of S302 is connected;It only need to be by the data line and the Type-C male seat phase with Type-C base that will match
Even, external equipment can obtain the voltage signal of D+ access in data line;It is understood that external equipment herein include but
It is not limited to voltmeter, oscillograph etc..
A kind of SIM card abnormal detector is present embodiments provided, which card reading occurs in terminal
When abnormal, the level signal between SIM card pin and central processing unit is transmitted to data-interface by control switch, repairs people
Member can detect the pin for causing card reading exception, solve in the prior art, SIM card card reading is different by measuring the level signal
Chang Shi needs to tear machine testing open, so that detection efficiency is low, difficulty is high and easily causes damage, while also bringing distrust to user
The problem of, the effect for leading to the route of card reading exception can also be detected without tearing machine operation open by realizing terminal.
3rd embodiment
To solve in existing scheme, terminal card reads exception, when needing test problems, it is necessary to terminal is disassembled,
Tear machine testing not only low efficiency open, difficulty is high and easily causes damage, while the problem of also bring distrust to user, the present embodiment
A kind of terminal card method for detecting abnormality is provided, referring specifically to Fig. 4.
The terminal card method for detecting abnormality of the present embodiment includes:
S401, terminal determine knowledge card crash, receive control signal;
S402, the first GPIO port export the first current potential according to control signal, and the second GPIO port is defeated according to control signal
Second current potential out;
S403, the first data path control element and the second data path control element receive the output of the second GPIO port
The second current potential, turn off the first data path control element and the second data path control element;
S404, level path control element receive the first current potential of the first GPIO port output, by level access and the
The connection of one transmission channel;
S405, recovery control instruction is received, the first GPIO port of control exports third current potential, the output of the second GPIO port
4th current potential.
Wherein, it is mobile to can be mobile phone, tablet computer, laptop, palm PC, PDA etc. for the terminal of the present embodiment
Terminal is also possible to fixed terminals such as number TV, desktop computer etc..
In S401, terminal determines after knowing card crash, and central processing unit, which can obtain, knows card crash information, controls signal at this time
It can directly be issued by central processing unit, after can also issuing detection instruction by user, central processing unit issues control signal again, can be with
Understand, the detection instruction of user includes but is not limited to issue at least one of in many ways in software interface, such as hand
Gesture, click virtual key etc., can also be triggered by the physical button in terminal;The first end GPIO is controlled according to control signal
The output current potential of mouth and the second GPIO port.
In S402, the second GPIO port exports the second current potential, closes the first data path control element and the second data
Path control element.
First GPIO port is connected with the level path control element, and the first GPIO port exports the first current potential, with touching
Send out level path control element described.
In S403, the closing of the first data path control element has separated the connection of the first data path and central processing unit
System, the closing of the second data path control element have separated contacting for the first data path and power management chip;Data-interface
The first data path be connected by the first data path control element with the port of central processing unit, it is logical by the second data
Road control element is connected with the port of power management chip.
In S404, terminal card is placed on deck, and the part pin of terminal card passes through deck and central processing unit
Part GPIO port be connected, formed level access.
The type of level path control element is unlimited, as long as having the function of the connection status of two accesses of control,
It can be coaxial switch, relay etc., level path control element can also have certain additional function, such as clocking capability
Deng;The quantity of level path control element is also unlimited, can be single or multiple;The connection of level path control element one end
At least one of the level access between above-mentioned deck and central processing unit is connected, the other end passes through the first data path and number
It is connected according to interface;It should be understood that the level access being connected by level path control element with the first data path
Type and quantity be it is optional, it is logical by level to can choose be easier to break down in four level accesses one or more
Road control element is connected with the first data path, to reach higher detection efficiency;All level accesses can also all be passed through
Level path control element is connected with the first data path, to reach most comprehensive detection range.For example, when deck is SIM card
When seat, four single-pole single-throw switch (SPST)s with clocking capability can be used, respectively at tetra- level accesses of VCC, RST, CLK, DATA
It is connected, each single-pole single-throw(SPST level path control element is individually controlled by central processing unit, or passes through preset meter
When the period so that every time at most only one level path control element be in closed state;Also a band timing can be used
The hilted broadsword four-throw level path control element of function, while tetra- level accesses of VCC, RST, CLK, DATA are connected, by centre
Reason device individually controls each single-pole single-throw switch (SPST), or by preset time-count cycle, so that at most there was only one every time
A single-pole single-throw switch (SPST) is in closed state.
By using with the matched data line of the data-interface, be connected with the data-interface, external equipment can be direct
The voltage value of first data path in measurement data line can be sentenced by comparing with the voltage value of normal first data path
It is disconnected whether normal with the level access of the first data path being connected at this time out;It is understood that external equipment packet herein
Include but be not limited to voltmeter, oscillograph etc..
In S405, recovery control instruction is received, the first GPIO port of control exports third current potential, the second GPIO port
Export the 4th current potential.After recovery control instruction can control signal sending described in S401, when reaching the preset time, by center
Processor issues, and recovery control instruction can also be issued by user, it is to be understood that the recovery control instruction of user includes but not
It is limited to issue at least one of in many ways in software interface, such as gesture, clicks virtual key, end can also be passed through
Physical button triggering on end.It should be understood that above-mentioned first, second, third and the 4th current potential be used to indicate current potential
Just, the first current potential and third current potential on the contrary, the second current potential and the 4th current potential on the contrary, for example, when the first current potential is high potential,
Third current potential is low potential.
A kind of terminal card method for detecting abnormality is present embodiments provided, which goes out in terminal
When existing card reading exception, the level access between terminal card pin and central processing unit is passed through into control level path control element
It is connected with the first data path, maintenance personal can measure the voltage value in the first data path by external equipment, detect to draw
The route for sending out card reading exception, solves in the prior art, when terminal card reading exception, needs to tear machine testing open, so that detection efficiency is low,
Difficulty is high and easily causes damage, while the problem of also bring distrust to user, realizing terminal and operating without tearing machine open
In the case where can also detect the effect for leading to the route of card reading exception.
Fourth embodiment
The present embodiment also provides a kind of terminal, the terminal can be mobile phone, tablet computer, laptop, palm PC,
The mobile terminals such as PDA are also possible to the fixed cellular terminals such as number TV, desktop computer.It is shown in Figure 5 comprising
Locate memory 52, communication bus 53 and terminal card abnormal detector 51, in which:
Communication bus 53 is for realizing between the central processing unit and memory 52 in terminal card abnormal detector 51
Connection communication;
Central processing unit in terminal card abnormal detector 51 is used to execute the detection control stored in memory 52
Program, to perform the steps of
Detection meets the event for sending associated control signal or restoring control instruction;
Central processing unit in terminal card abnormal detector 51 according to associated control signal or restores control instruction, control
Make the first GPIO port output first or third current potential, the output second of the second GPIO port of control or the 4th current potential;
Level path control element is connected to or disconnects level access and first according to the current potential that the first GPIO port exports
Connection between data path, the first data path control element and the second data path control element are according to the second GPIO port
The current potential of output is connected to or disconnects the connection between the second data path and central processing unit, data path control element according to
Connection between the current potential connection of second GPIO port output or the second data path of disconnection and power management chip;
When satisfaction sends control signal conditioning and may is that terminal determines to know card crash, and/or, receive the inspection of user
Survey instruction;When meeting at least one above-mentioned condition, central processing unit will be triggered and send control signal.It is understood that with
The detection instruction at family includes but is not limited to issue at least one of in many ways in software interface, such as gesture, click it is virtual
Key etc. can also be triggered by the physical button in terminal.
The condition for meeting recovery control instruction may is that after the sending of above-mentioned control signal, when reaching the preset time,
And/or user issues when restoring control instruction.When meeting at least one above-mentioned condition, it is extensive that central processing unit transmission will be triggered
Multiple control instruction.It is understood that the recovery control instruction of user include but is not limited to software interface in many ways in
At least one issue, such as gesture, click virtual key, can also be triggered by the physical button in terminal.
After central processing unit sends control signal, the first GPIO port exports the first current potential, activation level access control member
Level access is connected by part, level path control element with the first data path;Second GPIO port exports the second current potential, shutdown
First data path control element and the second data path control element disconnect central processing unit and power management chip and first
The connection of data path.
After central processing unit sends recovery control instruction, the first GPIO port exports third current potential, closes the control of level access
Element processed, level path control element disconnect level access and the first data path;Second GPIO port exports the 4th current potential,
Trigger the first data path control element and the second data path control element, restore central processing unit and power management chip with
The connection of first data path.
It should be understood that above-mentioned first, second, third and the 4th current potential be used to indicate current potential height, first electricity
With third current potential on the contrary, the second current potential and the 4th current potential are on the contrary, for example, when the first current potential is high potential, third current potential is for position
Low potential.
A kind of terminal, including memory, terminal card abnormal detector and communication bus are present embodiments provided, at end
When card reading exception occurs in end, by the way that the level access between terminal card pin and central processing unit is controlled by level access
For element transmission to data-interface, maintenance personal can detect the route for causing card reading exception, solution by measuring the level signal
In the prior art, it when terminal card reading exception, needs to tear machine testing open, so that detection efficiency is low, difficulty is high and easily causes damage, together
When the problem of also bringing distrust to user, realizing terminal can also detect to cause without tearing machine operation open
The effect of the route of terminal card card reading exception.
5th embodiment
Present embodiments provide a kind of computer readable storage medium, the computer-readable recording medium storage have one or
The multiple programs of person, one or more program can be executed by one or more processor, with realize as first embodiment and/
Or the step of control of shooting described in second embodiment and/or 3rd embodiment, which is not described herein again.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row
His property includes, so that the process, method, article or the device that include a series of elements not only include those elements, and
And further include other elements that are not explicitly listed, or further include for this process, method, article or device institute it is intrinsic
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do
There is also other identical elements in the process, method of element, article or device.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art
The part contributed out can be embodied in the form of software products, which is stored in a storage medium
In (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal (can be mobile phone, computer, service
Device, air conditioner or network equipment etc.) execute method described in each embodiment of the present invention.
The embodiment of the present invention is described with above attached drawing, but the invention is not limited to above-mentioned specific
Embodiment, the above mentioned embodiment is only schematical, rather than restrictive, those skilled in the art
Under the inspiration of the present invention, without breaking away from the scope protected by the purposes and claims of the present invention, it can also make very much
Form, all of these belong to the protection of the present invention.