CN110912574B - SIM card detection method, device, storage medium and terminal - Google Patents

SIM card detection method, device, storage medium and terminal Download PDF

Info

Publication number
CN110912574B
CN110912574B CN201911373404.4A CN201911373404A CN110912574B CN 110912574 B CN110912574 B CN 110912574B CN 201911373404 A CN201911373404 A CN 201911373404A CN 110912574 B CN110912574 B CN 110912574B
Authority
CN
China
Prior art keywords
sim card
magnetic field
terminal
field intensity
difference value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911373404.4A
Other languages
Chinese (zh)
Other versions
CN110912574A (en
Inventor
俞斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Huaxi Investment Co ltd
Original Assignee
TCL Mobile Communication Technology Ningbo Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by TCL Mobile Communication Technology Ningbo Ltd filed Critical TCL Mobile Communication Technology Ningbo Ltd
Priority to CN201911373404.4A priority Critical patent/CN110912574B/en
Publication of CN110912574A publication Critical patent/CN110912574A/en
Application granted granted Critical
Publication of CN110912574B publication Critical patent/CN110912574B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B1/00Details of transmission systems, not covered by a single one of groups H04B3/00 - H04B13/00; Details of transmission systems not characterised by the medium used for transmission
    • H04B1/38Transceivers, i.e. devices in which transmitter and receiver form a structural unit and in which at least one part is used for functions of transmitting and receiving
    • H04B1/3816Mechanical arrangements for accommodating identification devices, e.g. cards or chips; with connectors for programming identification devices
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B21/00Measuring arrangements or details thereof, where the measuring technique is not covered by the other groups of this subclass, unspecified or not relevant
    • G01B21/16Measuring arrangements or details thereof, where the measuring technique is not covered by the other groups of this subclass, unspecified or not relevant for measuring distance of clearance between spaced objects
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R33/00Arrangements or instruments for measuring magnetic variables
    • G01R33/02Measuring direction or magnitude of magnetic fields or magnetic flux
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/18Processing of user or subscriber data, e.g. subscribed services, user preferences or user profiles; Transfer of user or subscriber data
    • H04W8/183Processing at user equipment or user record carrier

Abstract

The embodiment of the application discloses a method and a device for detecting an SIM card, a storage medium and a terminal. The SIM card detection method comprises the following steps: when the magnetic field intensity detected by the magnetic sensor changes, acquiring a difference value between a current magnetic field intensity value and a previous historical magnetic field intensity value; comparing the difference value with a preset difference value; when the difference value is larger than the preset difference value, sending a communication signal to the SIM card; and determining the state of the SIM card according to the communication result. According to the embodiment of the application, the magnetic sensor is arranged at the SIM card seat of the terminal, the magnetic field intensity of the SIM card seat is detected, the state of the SIM card is detected according to the magnetic field intensity value, and the detection efficiency of the SIM card of the terminal can be effectively improved.

Description

SIM card detection method, device, storage medium and terminal
Technical Field
The application relates to the field of mobile terminal application, in particular to a method and a device for detecting an SIM card, a storage medium and a terminal.
Background
The SIM card is an abbreviation of Subscriber Identity Module (SIM), also called Subscriber Identity card (SIM), smart card, and GSM digital mobile phone must be installed to be used. The information of the digital mobile phone client, the encrypted key, the telephone book of the user and other contents are stored on the computer chip, so that the identity of the GSM network client can be identified, and the voice information of the client during communication can be encrypted.
In the related technology, the insertion of the SIM card can be detected in the starting state of the mobile terminal, so that the trouble that the user needs to shut down when the SIM card is replaced every time is avoided. However, in the related art, a metal elastic sheet needs to be arranged, and the metal elastic sheet for detecting the insertion of the SIM card is located in the card holder, which results in a larger volume of the card holder. In addition, the metal elastic sheet is difficult to avoid elastic change after being used for many times, and the detection of the SIM card insertion is influenced.
Disclosure of Invention
The embodiment of the application provides an SIM card detection method, an SIM card detection device, a storage medium and a terminal, which can effectively improve the detection efficiency of an SIM card of the terminal.
The embodiment of the application provides a method for detecting an SIM card, which is applied to a terminal, wherein the terminal comprises a magnetic sensor for detecting the intensity of magnetic field and a distance sensor for detecting the distance, the magnetic sensor and the distance sensor are arranged at an SIM card seat of the terminal, and the method comprises the following steps:
when the magnetic field intensity detected by the magnetic sensor changes, acquiring a difference value between a current magnetic field intensity value and a previous historical magnetic field intensity value;
comparing the difference value with a preset difference value;
when the difference value is larger than the preset difference value, sending a communication signal to the SIM card;
and determining the state of the SIM card according to the communication result.
Correspondingly, this application embodiment still provides a SIM card detection device, is applied to the terminal, the terminal is including the magnetic sensor who is used for detecting magnetic field intensity to and be used for detecting the distance sensor of distance, the magnetic sensor with distance sensor sets up in terminal SIM card seat department, includes:
the acquisition unit is used for acquiring the difference value between the current magnetic field strength value and the previous historical magnetic field strength value when the magnetic field strength detected by the magnetic sensor changes;
the comparison unit is used for comparing the difference value with a preset difference value;
the sending unit is used for sending a communication signal to the SIM card when the difference value is larger than the preset difference value;
and the determining unit is used for determining the state of the SIM card according to the communication result.
Correspondingly, the embodiment of the present application further provides a storage medium, where the storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to perform the steps in the SIM card detection method.
Correspondingly, an embodiment of the present application further provides a terminal, including a magnetic sensor, a distance sensor, a processor and a memory, where the magnetic sensor is disposed at the SIM card holder of the terminal and is used for detecting magnetic field intensity, the distance sensor is disposed at the SIM card holder and is used for detecting distance, the memory stores a plurality of instructions, and the processor loads the instructions to execute the steps in the SIM card detection method described above.
The embodiment of the application discloses a method and a device for detecting an SIM card, a storage medium and a terminal. The SIM card detection method comprises the following steps: when the magnetic field intensity detected by the magnetic sensor changes, acquiring a difference value between a current magnetic field intensity value and a previous historical magnetic field intensity value; comparing the difference value with a preset difference value; when the difference value is larger than the preset difference value, sending a communication signal to the SIM card; and determining the state of the SIM card according to the communication result. According to the embodiment of the application, the magnetic sensor is arranged at the SIM card seat of the terminal, the magnetic field intensity of the SIM card seat is detected, the state of the SIM card is detected according to the magnetic field intensity value, and the detection efficiency of the SIM card of the terminal can be effectively improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart of a first SIM card detection method provided in an embodiment of the present application.
Fig. 2 is a schematic flowchart of a second SIM card detection method according to an embodiment of the present application.
Fig. 3 is a block diagram of a first SIM card detection apparatus according to an embodiment of the present disclosure.
Fig. 4 is a block diagram of a second SIM card detection apparatus according to an embodiment of the present disclosure.
Fig. 5 is a schematic structural diagram of a terminal according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Based on the above problems, embodiments of the present application provide a first SIM card detection method, apparatus, storage medium, and terminal, which can effectively improve the detection efficiency of a terminal SIM card. The following are detailed below. It should be noted that the following description of the embodiments is not intended to limit the preferred order of the embodiments.
Referring to fig. 1, fig. 1 is a schematic flow chart illustrating a SIM card detection method according to an embodiment of the present disclosure. The SIM card detection method may be applied to mobile terminals such as mobile phones, tablet computers, notebook computers, palm computers, Portable Media Players (PMPs), and fixed terminals such as desktop computers.
The terminal can comprise a magnetic sensor for detecting the intensity of magnetic field and a distance sensor for detecting distance, and the magnetic sensor and the distance sensor can be arranged in multiple areas inside the terminal, for example, can be arranged at a terminal SIM card seat. The specific process of the SIM card detection method of the terminal may be as follows:
101. when the magnetic field intensity detected by the magnetic sensor changes, the difference value between the current magnetic field intensity value and the previous historical magnetic field intensity value is obtained.
In this embodiment, the magnetic sensor may be disposed inside the terminal, for example, the magnetic sensor may be disposed at a position near the end of the SIM card holder, and the SIM card holder may be made of a metal material. Specifically, the magnetic sensor is started to work to detect the change of the magnetic field intensity through the magnetic sensor, and the change of the magnetic field intensity in the SIM card seat area is detected. Because the magnetic sensor is arranged near the position of the SIM card installed on the SIM card seat, and one surface of the SIM card is generally made of metal material, the magnetic field can be changed by the slave, when a user replaces the SIM card, the magnetic sensor is inevitably caused to detect the magnetic field intensity change of the position of the SIM card, and thus whether the SIM card is inserted or not can be detected timely and conveniently.
Specifically, the magnetic sensor is a device that converts a change in the magnetic property of the sensor due to an external factor such as a magnetic field, a current, a stress strain, a temperature, or light into an electric signal, and detects a corresponding physical quantity in this manner.
The current magnetic field strength value may be acquired when the magnetic sensor detects that the current magnetic field strength has changed, for example, the current magnetic field strength value may be 300 μ T (magnetic field strength unit: microtlas). After the current magnetic field strength value is obtained, the current magnetic field strength value may be compared with the last detected historical magnetic field strength value, and a difference between the current magnetic field strength value and the last historical magnetic field strength value may be obtained.
The historical magnetic field strength value can be used for triggering the magnetic sensor to detect the magnetic strength change value of the SIM card seat area at preset time intervals, and the historical magnetic field strength value can be stored in the memory. After the change of the magnetic field strength value is detected, the current magnetic field strength value and the last detected magnetic field strength value can be processed to obtain the difference value between the current magnetic field strength value and the last magnetic field strength value.
For example, the current magnetic field strength value may be 300 μ T, and the previous historical magnetic field strength value obtained from the memory may be 200 μ T, and the difference between the current magnetic field strength value and the previous historical magnetic field strength value may be 100 μ T.
In some embodiments, in addition to triggering the magnetic sensor to detect the current magnetic field strength at preset time intervals, there may be a plurality of ways to trigger the magnetic field strength to detect the current magnetic field strength value, for example, when detecting that the position of the SIM card holder changes, the magnetic sensor is triggered to start detecting the current magnetic field strength value. Wherein, the SIM card seat can be detachable, and the SIM card detecting method can further include the following steps:
when the distance sensor detects that the distance between the magnetic sensor and the SIM card holder changes, the magnetic sensor is triggered to detect the magnetic field intensity of the SIM card holder.
Specifically, the position of detecting the SIM card holder can be through distance sensor, and this distance sensor can be set up in each position inside the terminal, and this place is mainly to the detection of the position of the SIM card holder, so the preferred can set up near the SIM card holder region, can more accurate detect the position change of the SIM card holder.
A distance sensor, also called a displacement sensor, is a sensor for sensing a distance between the sensor and an object to perform a predetermined function, and the distance sensor may be classified into an optical distance sensor, an infrared distance sensor, an ultrasonic distance sensor, and the like according to its operating principle. At present, most of distance sensors used on mobile phones are infrared distance sensors, the working principles of other types of distance sensors are different, the distance of the distance sensors is judged by transmitting and receiving certain substances, and the transmitted substances can be ultrasonic waves, light pulses and the like.
For example, a user may pull out/insert the SIM card socket, and at this time, the distance sensor may detect that the position of the SIM card socket changes, and then may trigger the magnetic sensor to start detecting the magnetic field strength of the SIM card socket area.
102. The difference is compared with a preset difference.
Specifically, the difference value is compared with a preset difference value, the preset difference value can be obtained through a plurality of experiments in advance, the experiment can be that when the SIM card seat is put in or not put in, the magnetic field strength value detected by the magnetic sensor is set to the preset difference value by acquiring the magnetic field strength value after the SIM card seat is put in the terminal for a plurality of times and the magnetic field strength value after the SIM card seat is taken out from the terminal for a plurality of times, and the current state of the SIM card seat can be judged by comparing the difference value with the preset difference value. For example, the preset difference may be 50 μ T.
103. And when the difference value is larger than the preset difference value, sending a communication signal to the SIM card.
Specifically, after comparing the difference between the current magnetic field strength value and the previous historical magnetic field strength value with the preset difference, a comparison result can be obtained, and then corresponding operation is executed according to the comparison result.
When the difference is greater than the preset difference, it can be determined that the SIM card holder is in the terminal internal state, and then a communication signal can be sent to the SIM card. Specifically, sending a communication signal to the SIM card may mean sending a reset signal to the SIM card, where the reset signal refers to sending the reset signal to a hardware-specific interface by a manual or automatic method to restore the operation of software to a specific program segment, and this process is a reset process; in the process, a signal sent to a hardware specific interface by a manual or automatic method is a reset signal.
In some embodiments, when comparing the difference between the current magnetic field strength value and the previous historical magnetic field strength value with the preset difference, the comparison result may further include a plurality of kinds, that is, the following steps may further be included:
and if the difference is less than or equal to the preset difference, detecting that the SIM card does not exist, and prompting the user that the SIM card does not exist.
Specifically, when the difference is less than or equal to the preset difference, it may be determined that the SIM card holder is in a non-terminal internal state, and it may be detected that the SIM card does not exist in the current SIM card holder, and a prompt message may be displayed on the display interface, for example, the prompt message may include contents such as "SIM card not detected, please insert SIM card", and so on, to prompt the user, and the current terminal does not detect the SIM card.
104. And determining the state of the SIM card according to the communication result.
Specifically, after the communication signal is sent to the SIM card, the state of the SIM card can be determined according to the communication result, so that the SIM card can be accurately detected.
In some embodiments, the step of "determining the state of the SIM card according to the communication result" may include the following steps:
and when the communication result is that a response message of the SIM card for the communication signal is received, judging that the SIM card is in a working state.
And when the communication result is that the response message of the SIM card to the communication signal is not received, judging that the SIM card is in a non-working state.
Specifically, after sending the communication signal to the SIM card, if a response message of the SIM card to the communication signal is received, it may be determined that the SIM card is in a working state, and may normally perform other functions such as communication; or after the communication signal is sent to the SIM card, if the response message of the SIM card to the communication signal is not received, the SIM card can be determined to be in a non-working state, i.e. it can be indicated that the SIM card has a fault problem, and the user can be prompted in time, so as to facilitate replacement of the SIM card.
For example, the sending of the communication signal to the SIM card may be sending a command to the SIM card to read a corresponding register value, and if the corresponding register value of the SIM card is successfully read, the SIM card may be in an operating state, and if the corresponding register value of the SIM card is read, the SIM card may be in a non-operating state.
In some embodiments, after detecting that the SIM card is in the inactive state, various operations may be performed, for example, after the step "determining that the SIM card is in the inactive state", the following steps may be further included:
and displaying a prompt message on the current display interface, wherein the prompt message is used for prompting the user that the SIM card works abnormally.
Specifically, after the SIM card is detected to be in the non-working state, a prompt message may be displayed on the current display interface, where the prompt message may be used to prompt other information such as abnormal working of the SIM card, for example, the prompt message may be content such as "abnormal current SIM card occurs, please confirm by pulling the SIM card", and may be used to prompt the user, and the current terminal detects the abnormal working of the SIM card.
The embodiment of the application discloses an SIM card detection method, which comprises the following steps: when the magnetic field intensity detected by the magnetic sensor changes, acquiring a difference value between a current magnetic field intensity value and a previous historical magnetic field intensity value; comparing the difference value with a preset difference value; when the difference value is larger than the preset difference value, sending a communication signal to the SIM card; and determining the state of the SIM card according to the communication result. According to the embodiment of the application, the magnetic sensor is arranged at the SIM card seat of the terminal, the magnetic field intensity of the SIM card seat is detected, the state of the SIM card is detected according to the magnetic field intensity value, and the detection efficiency of the SIM card of the terminal can be effectively improved.
Referring to fig. 2, fig. 2 is a schematic flowchart of a second SIM card detection method according to an embodiment of the present application. The specific scene application of the SIM card detection method can be as follows:
201. and the terminal detects the magnetic field strength value at the SIM card seat every a preset time period.
In this embodiment, when the terminal is in the power-on state, the terminal may supply power to the magnetic sensor, detect the magnetic field strength at the SIM card holder by the magnetic sensor every preset time period, obtain a detected magnetic field strength value, and store the magnetic field strength value in the memory. The magnetic sensor can be arranged at the SIM card seat, and can detect the magnetic field strength value at the SIM card seat more accurately.
For example, the magnetic field strength value acquired by the terminal may be 200 μ T, 300 μ T, 400 μ T, or the like.
202. And the terminal acquires the difference value between the current magnetic field strength value and the previous historical magnetic field strength value.
Specifically, after obtaining the current magnetic field strength value, the terminal may compare the current magnetic field strength value with a previous historical magnetic field strength value, where the previous historical magnetic field strength value may be obtained from the memory.
After determining the current magnetic field strength value and the previous historical magnetic field strength value, a difference between the current magnetic field strength value and the previous historical magnetic field strength value may be obtained. For example, the current magnetic field strength value may be 200 μ T, the previous historical magnetic field strength value may be 100 μ T, and the difference between the current magnetic field strength value and the previous historical magnetic field strength value may be 100 μ T.
203. And the terminal judges whether the difference value between the current magnetic field strength value and the previous historical magnetic field strength value is larger than a preset difference value.
Specifically, after the difference between the current magnetic field strength value and the previous historical magnetic field strength value is obtained, the difference may be compared with a preset difference, and whether the difference is greater than the preset difference is determined.
For example, the difference between the current magnetic field strength value and the previous historical magnetic field strength value may be 100 μ T, the preset difference may be 50 μ T, 100 μ T, or the like, and if the preset difference is 50 μ T, it may indicate that the difference between the current magnetic field strength value and the previous historical magnetic field strength value is greater than the preset difference, step 205 may be performed; if the predetermined difference is 100 μ T, it may indicate that the difference between the current magnetic field strength value and the previous historical magnetic field strength value is equal to the predetermined difference, and step 203 may be executed.
204. And the terminal displays the prompt message on the current display interface.
Specifically, after the difference value is determined according to the current magnetic field strength value and the previous historical magnetic field strength value, when the difference value between the current magnetic field strength value and the previous historical magnetic field strength value is smaller than or equal to a preset difference value, it can be determined that the SIM card does not exist in the current terminal, because the variation range of the magnetic field strength at the SIM card seat is within the preset variation range, it can be indicated that the SIM card is placed in the SIM card seat, at this time, a prompt message can be displayed on the current display interface, the user can be reminded that the SIM card does not exist in the current terminal, and the user can perform other operations and the like.
For example, the display content of the current display interface may be "to detect the SIM card, please insert the SIM card", or other content.
205. And the terminal sends a communication signal to the SIM card.
Specifically, if it is detected that the difference between the current magnetic field strength value and the previous historical magnetic field strength value is greater than the preset difference, it may be determined that the SIM card exists in the current terminal, and the terminal sends a communication signal to the SIM card, where the definition of the communication signal may be found in the foregoing embodiment, and details are not repeated in this step.
206. And the terminal determines the state of the SIM card according to the communication result with the SIM card.
Specifically, after sending the communication signal to the SIM card, the terminal may determine the state of the SIM card according to a response of the SIM card to the communication signal.
For example, after sending the communication result To the SIM card, the terminal may obtain an ATR (Answer To Reset) of the SIM card, where the ATR is an instruction based on ISO7816 (a contact card reading protocol) specification, and when the SIM card interacts with the mobile terminal, and the SIM card receives the Reset signal, the terminal sends an ATR To the mobile phone, which indicates that the SIM card starts To respond, and this is a function of the SIM card; if the acquisition is successful, the SIM card is in place, otherwise, the SIM card is not in place.
The ISO7816 standard is a standard half-duplex interface, the module is used as a master device to control the operation of the SIM card, and the SIM card is used as a slave device to generate response signals only under two conditions: firstly, after receiving RST signal, sending ATR, and secondly: and responding after receiving the command. Therefore, the SIM card driver module, as a master device, mainly performs two operations: the RST is sent waiting for the ATR, the command is sent and the SIM card is waited for an answer.
The initial communication between the ATR (answer to reset) SIM module and the SIM card requires the exchange of some protocol data, which is done by the ATR protocol specified in ISO 7816. The ATR protocol is implemented by the SIM module controlling the SIM _ rst signal.
The SIM card may return an acknowledgement signal during the time when SIM _ rst is low or during the time when SIM _ rst is high. If the ATR answer signal of the SIM card is still not received after SIM _ rst keeps high level 40000 SIM _ clk cycles, the SIM is not existed or the transmission channel is in problem.
The first character of the ATR answer signal returned by the SIM card indicates whether the SIM card supports direct mode or reverse mode transmission, and this character is defined as the initial character. If 11011100 is returned by the SIM, it indicates that the SIM card supports direct mode; if the SIM card returns 11000000, the reverse mode is supported by the SIM card.
By definition, a reset acknowledgement is the value of a series of bytes that are sent by the card to the interface device as a response to a reset command. On the I/O circuit, each byte is transmitted in an asynchronous character.
The embodiment of the application discloses an SIM card detection method, which comprises the following steps: when the magnetic field intensity detected by the magnetic sensor changes, acquiring a difference value between a current magnetic field intensity value and a previous historical magnetic field intensity value; comparing the difference value with a preset difference value; when the difference value is larger than the preset difference value, sending a communication signal to the SIM card; and determining the state of the SIM card according to the communication result. According to the embodiment of the application, the magnetic sensor is arranged at the SIM card seat of the terminal, the magnetic field intensity of the SIM card seat is detected, the state of the SIM card is detected according to the magnetic field intensity value, and the detection efficiency of the SIM card of the terminal can be effectively improved.
In order to better implement the SIM card detection method provided in the embodiments of the present application, the embodiments of the present application further provide a device based on the SIM card detection method. The meaning of the term is the same as that in the above SIM card detection method, and specific implementation details can refer to the description in the method embodiment.
Referring to fig. 3, fig. 3 is a block diagram illustrating a first SIM card detection apparatus according to an embodiment of the present disclosure, where the SIM card detection apparatus can be applied to mobile terminals such as mobile phones, tablet computers, notebook computers, palm computers, Portable Media Players (PMPs), and fixed terminals such as desktop computers.
The terminal can comprise a magnetic sensor for detecting the intensity of magnetic field and a distance sensor for detecting distance, and the magnetic sensor and the distance sensor can be arranged in multiple areas inside the terminal, for example, can be arranged at a terminal SIM card seat. The SIM card detection device specifically comprises the following components:
an obtaining unit 301, configured to obtain a difference between a current magnetic field strength value and a previous historical magnetic field strength value when a magnetic field strength detected by the magnetic sensor changes;
a comparing unit 302, configured to compare the difference with a preset difference;
a sending unit 303, configured to send a communication signal to the SIM card when the difference is greater than the preset difference;
a determining unit 304, configured to determine a state of the SIM card according to the communication result.
A triggering unit 305, configured to trigger the magnetic sensor to detect a magnetic field strength of the SIM card socket when the distance sensor detects that a distance from the SIM card socket changes.
In some embodiments, the determining unit 304 may include:
a first determining subunit 3041, configured to determine that the SIM card is in a working state when the communication result is that a response message made by the SIM card for the communication signal is received;
a second determining subunit 3042, configured to determine that the SIM card is in a non-operating state when the communication result is that a response message, which is made by the SIM card for the communication signal, is not received.
In some embodiments, referring to fig. 4, fig. 4 is a block diagram of a structure of a second SIM card detection apparatus provided in this embodiment, where the determining unit 304 may further include:
and the display subunit is used for displaying a prompt message on the current display interface, wherein the prompt message is used for prompting the user that the SIM card works abnormally.
In some embodiments, the SIM card detection apparatus may further include:
and the prompting unit is used for detecting that the SIM card does not exist and prompting the user that the SIM card does not exist if the difference is less than or equal to the preset difference.
The embodiment of the application discloses SIM card detection device, this SIM card detection device includes: when the magnetic field intensity detected by the magnetic sensor changes, acquiring a difference value between a current magnetic field intensity value and a previous historical magnetic field intensity value; comparing the difference value with a preset difference value; when the difference value is larger than the preset difference value, sending a communication signal to the SIM card; and determining the state of the SIM card according to the communication result. According to the embodiment of the application, the magnetic sensor is arranged at the SIM card seat of the terminal, the magnetic field intensity of the SIM card seat is detected, the state of the SIM card is detected according to the magnetic field intensity value, and the detection efficiency of the SIM card of the terminal can be effectively improved.
The embodiment of the application also provides a terminal. The terminal can be provided with an SIM card slot for placing an SIM card, and a detachable SIM card seat can be arranged at the card slot for bearing the SIM card, so that a user can conveniently place the SIM card or the SIM card. As shown in fig. 5, the terminal may include a Radio Frequency (RF) circuit 601, a memory 602 including one or more storage media, an input unit 603, a display unit 604, a sensor 605, an audio circuit 606, a Wireless Fidelity (WiFi) module 607, a processor 608 including one or more processing cores, and a power supply 609. Those skilled in the art will appreciate that the terminal structure shown in fig. 5 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the RF circuit 601 may be used for receiving and transmitting signals during the process of transmitting and receiving information, and in particular, for processing the received downlink information of the base station by one or more processors 608; in addition, data relating to uplink is transmitted to the base station. In general, the RF circuit 601 includes, but is not limited to, an antenna, at least one Amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, the RF circuit 601 may also communicate with networks and other devices via wireless communications.
The memory 602 may be used to store software programs and modules, and the processor 608 executes various functional applications and data processing by operating the software programs and modules stored in the memory 602. The memory 602 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function (such as a sound playing function, an image playing function, etc.), and the like. Further, the memory 602 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 602 may also include a memory controller to provide the processor 608 and the input unit 603 access to the memory 602.
The input unit 603 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, in one particular embodiment, input unit 603 may include a touch-sensitive surface as well as other input devices. The touch-sensitive surface, also referred to as a touch display screen or a touch pad, may collect touch operations by a user (e.g., operations by a user on or near the touch-sensitive surface using a finger, a stylus, or any other suitable object or attachment) thereon or nearby, and drive the corresponding connection device according to a predetermined program. The input unit 603 may include other input devices in addition to the touch-sensitive surface. In particular, other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 604 may be used to display information input by or provided to the user and various graphical user interfaces of the server, which may be made up of graphics, text, icons, video, and any combination thereof. The Display unit 604 may include a Display panel, and optionally, the Display panel may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. Further, the touch-sensitive surface may overlay the display panel, and when a touch operation is detected on or near the touch-sensitive surface, the touch operation is transmitted to the processor 608 to determine the type of touch event, and the processor 608 then provides a corresponding visual output on the display panel according to the type of touch event. Although in FIG. 5 the touch-sensitive surface and the display panel are two separate components to implement input and output functions, in some embodiments the touch-sensitive surface may be integrated with the display panel to implement input and output functions.
The terminal may also include at least one sensor 605, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that adjusts the brightness of the display panel according to the brightness of ambient light, and a proximity sensor that turns off the display panel and the backlight when the server moves to the ear. The sensor can also comprise a magnetic sensor, a distance sensor and the like, and the magnetic sensor can be arranged at the SIM card seat of the terminal and used for detecting the intensity of magnetic field; a distance sensor may be provided at the SIM card holder for detecting a distance.
Audio circuitry 606, speakers, and microphones may provide an audio interface between the user and the server. The audio circuit 606 may transmit the electrical signal converted from the received audio data to a speaker, and convert the electrical signal into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 606 and converted into audio data, which is then processed by the audio data output processor 608, and then passed through the RF circuit 601 to be sent to, for example, a terminal, or the audio data is output to the memory 602 for further processing. The audio circuitry 606 may also include an ear-bud jack to provide communication of peripheral headphones with the server.
WiFi belongs to short-distance wireless transmission technology, and the terminal can help a user to receive and send e-mails, browse webpages, access streaming media and the like through the WiFi module 607, and provides wireless broadband internet access for the user. Although fig. 5 shows the WiFi module 607, it is understood that it does not belong to the essential constitution of the terminal, and may be omitted entirely as needed within the scope of not changing the essence of the application.
The processor 608 is a control center of the terminal, connects various parts of the entire handset using various interfaces and lines, and performs various functions of the server and processes data by operating or executing software programs and modules stored in the memory 602 and calling data stored in the memory 602, thereby performing overall monitoring of the handset. Optionally, processor 608 may include one or more processing cores; preferably, the processor 608 may integrate an application processor, which primarily handles operating systems, user interfaces, applications, etc., and a modem processor, which primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 608.
The terminal also includes a power supply 609 (e.g., a battery) for powering the various components, which may preferably be logically connected to the processor 608 via a power management system that may be used to manage charging, discharging, and power consumption. The power supply 609 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
Specifically, in this embodiment, the processor 608 in the terminal loads the executable file corresponding to the process of one or more application programs into the memory 602 according to the following instructions, and the processor 608 runs the application programs stored in the memory 602, thereby implementing various functions:
when the magnetic field intensity detected by the magnetic sensor changes, acquiring a difference value between a current magnetic field intensity value and a previous historical magnetic field intensity value;
comparing the difference value with a preset difference value;
when the difference value is larger than the preset difference value, sending a communication signal to the SIM card;
and determining the state of the SIM card according to the communication result.
The embodiment of the application discloses a method and a device for detecting an SIM card, a storage medium and a terminal. The SIM card detection method comprises the following steps: when the magnetic field intensity detected by the magnetic sensor changes, acquiring a difference value between a current magnetic field intensity value and a previous historical magnetic field intensity value; comparing the difference value with a preset difference value; when the difference value is larger than the preset difference value, sending a communication signal to the SIM card; and determining the state of the SIM card according to the communication result. According to the embodiment of the application, the magnetic sensor is arranged at the SIM card seat of the terminal, the magnetic field intensity of the SIM card seat is detected, the state of the SIM card is detected according to the magnetic field intensity value, and the detection efficiency of the SIM card of the terminal can be effectively improved.
It will be understood by those skilled in the art that all or part of the steps in the methods of the above embodiments may be performed by instructions or by instructions controlling associated hardware, which may be stored in a storage medium and loaded and executed by a processor.
To this end, embodiments of the present application provide a storage medium, in which a plurality of instructions are stored, where the instructions can be loaded by a processor to execute steps in any one of the SIM card detection methods provided in the embodiments of the present application. For example, the instructions may perform the steps of:
when the magnetic field intensity detected by the magnetic sensor changes, acquiring a difference value between a current magnetic field intensity value and a previous historical magnetic field intensity value; comparing the difference value with a preset difference value; when the difference value is larger than the preset difference value, sending a communication signal to the SIM card; and determining the state of the SIM card according to the communication result.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the instructions stored in the storage medium may execute the steps in any one of the SIM card detection methods provided in the embodiments of the present application, beneficial effects that can be achieved by any one of the SIM card detection methods provided in the embodiments of the present application may be achieved, which are detailed in the foregoing embodiments and will not be described herein again.
The SIM card detection method, apparatus, storage medium, and terminal provided in the embodiments of the present application are described in detail above, and a specific example is applied in the description to explain the principle and the implementation of the present application, and the description of the embodiments above is only used to help understanding the method and the core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (9)

1. A SIM card detection method is applied to a terminal, the terminal comprises a magnetic sensor for detecting the intensity of magnetic field and a distance sensor for detecting distance, the magnetic sensor and the distance sensor are arranged at a SIM card seat of the terminal, and the SIM card detection method is characterized by comprising the following steps:
when the distance sensor detects that the distance from the SIM card holder changes, the magnetic sensor is triggered to detect the magnetic field intensity of the SIM card holder;
when the magnetic field intensity detected by the magnetic sensor changes, obtaining a difference value between a current magnetic field intensity value and a previous historical magnetic field intensity value, wherein the historical magnetic field intensity value is obtained by triggering the magnetic sensor to detect the magnetic field intensity change of the SIM card seat area at preset time intervals, and the historical magnetic field intensity value is stored in a memory of the terminal;
comparing the difference value with a preset difference value;
when the difference value is larger than the preset difference value, sending a communication signal to the SIM card;
and determining the state of the SIM card according to the communication result.
2. The method of claim 1, wherein determining the status of the SIM card according to the communication result comprises:
when the communication result is that a response message of the SIM card to the communication signal is received, the SIM card is judged to be in a working state;
and when the communication result is that the response message of the SIM card to the communication signal is not received, judging that the SIM card is in a non-working state.
3. The method of claim 2, after determining that the SIM card is in the inactive state, further comprising:
and displaying a prompt message on the current display interface, wherein the prompt message is used for prompting the user that the SIM card works abnormally.
4. The method of claim 1, further comprising:
and if the difference is less than or equal to the preset difference, detecting that the SIM card does not exist, and prompting the user that the SIM card does not exist.
5. The utility model provides a SIM card detection device, is applied to the terminal, the terminal is including the magnetic sensor who is used for detecting magnetic field intensity to and be used for detecting the distance sensor of distance, the magnetic sensor with the distance sensor setting is in terminal SIM cassette department, its characterized in that includes:
the acquisition unit is used for triggering the magnetic sensor to detect the magnetic field intensity of the SIM card holder when the distance sensor detects that the distance between the SIM card holder and the magnetic sensor changes; when the magnetic field intensity detected by the magnetic sensor changes, obtaining a difference value between a current magnetic field intensity value and a previous historical magnetic field intensity value, wherein the historical magnetic field intensity value is obtained by triggering the magnetic sensor to detect the magnetic field intensity change of the SIM card seat area at preset time intervals, and the historical magnetic field intensity value is stored in a memory of the terminal;
the comparison unit is used for comparing the difference value with a preset difference value;
the sending unit is used for sending a communication signal to the SIM card when the difference value is larger than the preset difference value;
and the determining unit is used for determining the state of the SIM card according to the communication result.
6. The apparatus of claim 5, wherein the determining unit comprises:
the first judging subunit is used for judging that the SIM card is in a working state when the communication result is that a response message of the SIM card for the communication signal is received;
and the second judging subunit is used for judging that the SIM card is in a non-working state when the communication result is that a response message of the SIM card for the communication signal is not received.
7. The apparatus of claim 5, further comprising:
and the triggering unit is used for triggering the magnetic sensor to detect the magnetic field intensity of the SIM card holder when the distance sensor detects that the distance between the SIM card holder and the magnetic sensor changes.
8. A storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the steps of the SIM card detection method according to any one of claims 1 to 4.
9. A terminal comprising a magnetic sensor arranged at a terminal SIM card holder for detecting magnetic field strength, a distance sensor arranged at the SIM card holder for detecting distance, a processor and a memory, the memory storing a plurality of instructions, the processor loading the instructions to perform the steps of the SIM card detection method according to any one of claims 1 to 4.
CN201911373404.4A 2019-12-27 2019-12-27 SIM card detection method, device, storage medium and terminal Active CN110912574B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911373404.4A CN110912574B (en) 2019-12-27 2019-12-27 SIM card detection method, device, storage medium and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911373404.4A CN110912574B (en) 2019-12-27 2019-12-27 SIM card detection method, device, storage medium and terminal

Publications (2)

Publication Number Publication Date
CN110912574A CN110912574A (en) 2020-03-24
CN110912574B true CN110912574B (en) 2022-03-25

Family

ID=69827919

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911373404.4A Active CN110912574B (en) 2019-12-27 2019-12-27 SIM card detection method, device, storage medium and terminal

Country Status (1)

Country Link
CN (1) CN110912574B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112770006B (en) * 2021-02-07 2022-04-22 惠州Tcl移动通信有限公司 SIM card state display method, system, terminal and storage medium
CN113079234B (en) * 2021-03-24 2023-07-04 维沃移动通信有限公司 SIM card loading assembly, method and device for preventing reverse discharge of SIM card and electronic equipment
CN114545091A (en) * 2022-02-25 2022-05-27 Oppo广东移动通信有限公司 SIM card detection device and method and customer premises equipment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105120081A (en) * 2015-07-24 2015-12-02 Tcl移动通信科技(宁波)有限公司 SIM card detection device and method thereof for detecting plugging and unplugging of SIM card
CN106131304A (en) * 2016-06-15 2016-11-16 广东欧珀移动通信有限公司 The processing method and processing device of terminal
CN107391399B (en) * 2017-07-06 2022-01-11 Tcl移动通信科技(宁波)有限公司 Mobile terminal, SD card detection frequency control method thereof and storage medium
CN207926619U (en) * 2018-01-31 2018-09-28 国家电网公司 A kind of portable SIM cards detection device
CN109728830A (en) * 2018-12-26 2019-05-07 Tcl移动通信科技(宁波)有限公司 Mobile terminal SIM detection processing method, mobile terminal and storage medium

Also Published As

Publication number Publication date
CN110912574A (en) 2020-03-24

Similar Documents

Publication Publication Date Title
CN110912574B (en) SIM card detection method, device, storage medium and terminal
KR102267015B1 (en) Method for processing data and an electronic device thereof
CN114565070A (en) Label binding method and device and mobile terminal
CN110688051B (en) Screen recording operation method and device, computer readable storage medium and terminal
WO2014166307A1 (en) Method for determining performance of process of application and computer system
CN111065086A (en) SIM (subscriber identity module) identification method and device, storage medium and mobile terminal
EP3129883B1 (en) Method and apparatus for repairing dynamic link library file
CN106371896B (en) Virutal machine memory configuration method and device, mobile terminal
CN111538391A (en) Temperature control method and device, storage medium and terminal
CN110636526A (en) NFC communication detection method and device, computer readable storage medium and terminal
CN110888093A (en) Display screen connection detection method and device, computer readable storage medium and terminal
CN110944318A (en) Lock card setting method and device, storage medium and terminal
CN112542867B (en) Mobile terminal power supply control method and device, terminal equipment and storage medium
CN106155733B (en) Method and device for running application program
CN110471622B (en) SD card data writing method and device, storage medium and terminal
CN110022189B (en) Data transmission method, device, terminal and storage medium
CN114297322A (en) Data processing method, device, terminal and storage medium
CN109151160B (en) Communication method, communication device, mobile terminal and storage medium
CN111654849A (en) Quick starting method and system for near field communication, storage medium and terminal equipment
CN112286849A (en) Wireless charging base data switching method and system, storage medium and terminal equipment
CN106843440B (en) A kind of mobile terminal restarts control method, device and mobile terminal
CN106921793B (en) information prompting method and device and mobile terminal
CN111290672A (en) Image display method and device, storage medium and terminal
CN112367703B (en) Frequency band registration method and device of identification card, storage medium and mobile terminal
CN111654578B (en) Mobile terminal sensor restoration method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230316

Address after: 518000 Room 201, building A, No. 1, Qian Wan Road, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong (Shenzhen Qianhai business secretary Co., Ltd.)

Patentee after: Shenzhen Huaxi Investment Co.,Ltd.

Address before: 10 / F, No.5 Lane 999, Yangfan Road, high tech Zone, Ningbo City, Zhejiang Province

Patentee before: TCL mobile communication technology (Ningbo) Co.,Ltd.