CN113179344B - SIM card detection method, device, storage medium and terminal - Google Patents
SIM card detection method, device, storage medium and terminal Download PDFInfo
- Publication number
- CN113179344B CN113179344B CN202110436542.3A CN202110436542A CN113179344B CN 113179344 B CN113179344 B CN 113179344B CN 202110436542 A CN202110436542 A CN 202110436542A CN 113179344 B CN113179344 B CN 113179344B
- Authority
- CN
- China
- Prior art keywords
- program
- sim card
- running
- program process
- terminal
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04M—TELEPHONIC COMMUNICATION
- H04M1/00—Substation equipment, e.g. for use by subscribers
- H04M1/24—Arrangements for testing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/50—Testing arrangements
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Telephone Function (AREA)
Abstract
The embodiment of the application discloses a method and a device for detecting an SIM card, a storage medium and a terminal. According to the scheme, the counting process is set, the counting process is started when the SIM card of the terminal is detected to be plugged, the counting value of the counting process is obtained at set intervals, and when the counting value meets the preset condition, the SIM card detection process is triggered to execute the SIM card detection operation. The method aims to carry out cooperative detection processing on a plurality of SIM cards when the plurality of SIM cards are arranged in the terminal, and avoids the influence among the detection pins of each SIM card, thereby improving the operation speed of the terminal.
Description
Technical Field
The application relates to the field of terminal application, in particular to a method and a device for detecting an SIM card, a storage medium and a terminal.
Background
A SIM (Subscriber Identity Module) card, also called a Subscriber Identity Module card. The GSM (Global System for Mobile Communication) digital Mobile phone can be used by being equipped with the card. 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. An SIM card slot is arranged in the terminal, and the SIM card can be placed in the SIM card slot for use.
In the related art, when detecting whether the SIM card exists in the terminal, the SIM card detection pin may be set in the SIM card slot inside the terminal, and the SIM card detection pin is triggered to detect whether the SIM card exists. However, when the terminal supports multiple SIM cards, the detection method may cause mutual influence between the detection pins, which results in a slow operation rate of the terminal.
Disclosure of Invention
The embodiment of the application provides a method and a device for detecting an SIM card, a storage medium and a terminal, and improves the running speed of the terminal.
The embodiment of the application provides a method for detecting an SIM card, which comprises the following steps:
receiving a detection instruction, and triggering a designated program process according to the detection instruction, wherein the detection instruction indicates that the state of an SIM card of the terminal is detected, and the designated program process is used for accumulating and superposing preset values on initial values every preset time period;
acquiring a counting numerical value of the designated program process;
and if the counting numerical value is greater than or equal to a preset threshold value, responding to the detection instruction to detect the state of the SIM card of the terminal.
Correspondingly, the embodiment of the present application further provides a SIM card detection apparatus, including:
the terminal comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a detection instruction and triggering a designated program process according to the detection instruction, the detection instruction indicates that the state of an SIM card of the terminal is detected, and the designated program process is used for accumulating and superposing a preset value on an initial value every preset time period;
a first acquiring unit configured to acquire a count value of the designated program process;
and the detection unit is used for responding to the detection instruction to detect the state of the SIM card of the terminal if the counting numerical value is greater than or equal to a preset threshold value.
In some embodiments, the apparatus further comprises:
a second obtaining unit, configured to obtain program priority information when detecting that another program process of the terminal is started, where the another program process is used to configure SIM card detection parameters, and the program priority information includes an operation level of each program process;
a first determination unit configured to determine an operation state of the designated program process based on the program priority information.
In some embodiments, the determining unit comprises:
an obtaining subunit, configured to obtain, from the program priority information, an operation level of the specified program process and an operation level of the other program process;
the first execution subunit is used for continuously running the specified program process if the running level of the specified program process is higher than the running levels of the other program processes;
and the second execution subunit is used for interrupting the running of the specified program process if the running level of the other program process is higher than that of the specified program process.
In some embodiments, the determining unit further comprises:
and the switching subunit is used for switching the running state of the specified program process from the interrupted running to the continuous running when the running of the other program processes is finished.
In some embodiments, the apparatus further comprises:
a third acquiring unit configured to acquire an operation sequence of a plurality of other program processes;
a first execution unit configured to execute the plurality of other program processes based on the execution sequence;
a second running unit, configured to run the specified program process after the running of the plurality of other program processes is completed.
In some embodiments, the apparatus further comprises:
the fourth acquisition unit is used for acquiring the running times and the running duration of each other program process in the appointed historical time period;
the second determining unit is used for determining the current operation time length of each other program process according to the operation times and the operation time length;
a third determining unit, configured to determine a total operating duration based on current operating durations of all other program processes;
and the third running unit is used for running the specified program process after waiting for the total running time.
Correspondingly, an 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 SIM card detection method described above.
Correspondingly, an embodiment of the present application further provides a terminal, which includes a processor and a memory, where the memory stores a plurality of instructions, and the processor loads the instructions to execute the SIM card detection method described above.
According to the embodiment of the application, the counting process is set, the counting process is started when the SIM card of the terminal is detected to be plugged and unplugged, the counting value of the counting process is obtained every set time, and when the counting value meets the preset condition, the SIM card detecting process is triggered to execute the SIM card detecting operation. The method aims to detect and process a plurality of SIM cards in a coordinated manner when the plurality of SIM cards are arranged in the terminal, and avoids the influence between detection pins of each SIM card, thereby improving the operation speed of the terminal.
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 SIM card detection method according to an embodiment of the present application.
Fig. 2 is a schematic diagram of a SIM card placement structure according to an embodiment of the present application.
Fig. 3 is a schematic flowchart of another SIM card detection method according to an embodiment of the present application.
Fig. 4 is a block diagram of a structure of a SIM card detection apparatus according to an embodiment of the present disclosure.
Fig. 5 is a block diagram of another SIM card detection apparatus according to an embodiment of the present disclosure.
Fig. 6 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 method and an apparatus for detecting an SIM card, a storage medium, and a terminal, which can improve a terminal operation speed. 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 specific flow of the SIM card detection method can be as follows:
101. and receiving a detection instruction, and triggering the specified program process according to the detection instruction.
In this embodiment of the application, the terminal may be provided with a card slot and a card holder, where the card slot may be used to place the card holder, and the card holder is used to place the SIM card, and after completing the SIM card detection operation and initialization, the terminal may execute a corresponding function of the SIM card by placing the SIM card in the card holder and then placing the card holder in the card slot. Through designing the card slot and the card support of the terminal, one or more SIM cards can be placed in the terminal to realize the functions of one or more SIM cards.
Wherein, the detection instruction indicates the SIM card status of the detection terminal, and the SIM card status may include: the SIM card management system comprises a presence state and a non-presence state, wherein the presence state represents that the SIM card is placed in the terminal, and the non-presence state represents that the SIM card is not placed in the terminal.
For example, the card holder of current terminals may include two SIM card positions: and when the position of the SIM card 1 and the position of the SIM card 2 are detected, the SIM card is placed at the position of the SIM card 1, and the SIM card is not placed at the position of the SIM card 2, the state of the SIM card at the position of the SIM card 1 can be determined to be in-place state, and the state of the SIM card at the position of the SIM card 2 is determined to be out-of-place state.
In some embodiments, in order to ensure normal use of the terminal SIM card, the trigger mode of the detection instruction may be set in multiple ways, for example, the detection instruction may be triggered by a change in a distance between the card slot and the card holder. Wherein causing the change in the distance between the card slot and the card holder may include: terminal collision and plugging operation of the card support. Since the card holder is triggered to move due to terminal collision or plugging operation of the card holder by a user, the state of the SIM card of the terminal needs to be detected.
Referring to fig. 2, fig. 2 is a schematic view illustrating a SIM card placement structure according to an embodiment of the present disclosure. In the terminal shown in fig. 2, a card slot is arranged inside the terminal, and a detection pin is arranged in the card slot: detection leg 1, detection leg 2, detection leg 3, and detection leg 4. The card holds in the palm and is provided with: SIM card 1 position, SIM card 2 position, SIM card 3 position, and SIM card 4 position, each of which may be used to place a SIM card.
The detection pin 1 is used for detecting the SIM card at the position of the SIM card 1, the detection pin 2 is used for detecting the SIM card at the position of the SIM card 2, the detection pin 3 is used for detecting the SIM card at the position of the SIM card 3, and the detection pin 4 is used for detecting the SIM card at the position of the SIM card 4. And the detection pin 1 is connected with the detection pin 2, the detection pin 2 is connected with the detection pin 3, and the detection pin 3 is connected with the detection pin 4, so that the detection pins can be triggered to start detection by the same trigger source, and each detection pin does not need to be triggered respectively, thereby saving the working efficiency.
Wherein, detect the foot and can set up to the sheetmetal of elastic construction, after the SIM card is placed to the SIM card position that the card held in the palm, put into the draw-in groove with the card support, thereby the SIM card can trigger the detection foot and take place the level change that deformation leads to detecting the foot, obtains corresponding testing result according to the level change result.
And the appointed program process is used for accumulating and superposing the initial numerical value with a preset numerical value every a preset time period. For example, the preset time period may be: 5 milliseconds, the initial value may be: 0, the preset value can be: 1, executing the specified program process as follows: and (3) performing 1 adding operation on the initial value 0 every 5 milliseconds, and then designating the program process to run for 5 milliseconds, wherein the counting value is 1, the program process runs for 10 milliseconds, the counting value is 2, and so on.
In some embodiments, in order to ensure that the configuration of the SIM card detection parameters is completed before the SIM card detection is performed, so as to avoid the influence of the configuration of the SIM card detection parameters on the SIM card detection, in the step "triggering a specified program process according to the detection instruction", the following steps may be further included:
when detecting that other program processes of the terminal are started, acquiring program priority information;
the operating state of the designated program process is adjusted based on the program priority information.
The other program processes are used to configure the SIM card detection parameters, and before the SIM card detection is executed, the SIM detection parameters need to be configured first, that is, the detection pin parameters need to be configured, for example, the detection pin parameters may include a level.
In digital circuits, the high and low of a voltage are represented by logic levels. The logic level includes both a high level and a low level. The digital circuits formed by different components have different logic levels corresponding to voltages. In a digital integrated gate circuit, a voltage greater than 3.5 volts is specified as a logic high level, represented by the number 1; a voltage of less than 0.3 volts is defined as a logic low level, represented by the number 0.
Wherein the program priority information includes an operation level of each program process, and each program process includes: specifying program processes and other program processes. The running order of the different program processes may be determined according to the running grades of the program processes. For example, a program process with a higher running level may be preferentially run, and after the program process with the higher running level is run, a program process with a lower running level may be run.
Further, the running state of the designated program process may be adjusted according to the program priority information. The operating state may include: continuous operation and interrupted operation. The continuous running means to continue running the designated program process, and the interrupted running means to suspend running the designated program process.
In some embodiments, in order to quickly determine the running state of a given program process, the step "adjusting the running state of the given program process based on program priority information" may include the operations of:
acquiring the running grade of a designated program process and the running grades of other program processes from the program priority information;
if the running grade of the appointed program process is higher than that of other program processes, the appointed program process is continuously run;
and if the operation level of other program processes is higher than that of the specified program process, interrupting the operation of the specified program process.
Specifically, the operation level of each program process is set in advance, and the operation level of each program process is stored in the program priority information. The setting of the operation level of the program process may be set according to actual applications, and is not limited herein.
For example, the operation level from high to low may be: and if the operation level of the obtained specified program process can be the first operation level and the operation levels of the other program processes can be the second operation levels, it can be determined that the operation level of the specified program process is higher than the operation levels of the other program processes. At this time, the designated program process may continue to run, and after the designated program process is completed, other program processes may be executed.
For another example, if the operation level of the obtained specified program process may be the second operation level, and the operation level of the other program process may be the first operation level, it may be determined that the operation level of the other program process is higher than the operation level of the specified program process. At this time, the running of the designated program process may be suspended, and after the designated program process is completed, the execution of the other program processes may be resumed.
In the embodiment of the present application, in order to ensure that the configuration of the SIM card detection parameter is completed in advance, the operation level of the other program process may be set to be higher than that of the specified program process. For example, the operation level from high to low may be: the first operation level and the second operation level may set the operation level of the designated program process as: and a second operation level, wherein the operation levels of other program processes are set as follows: a first operational level.
For example, in the process of counting and accumulating the specified running program every 5 milliseconds, if the running level of other program processes is higher than that of the specified program process when the starting of other program processes is detected at the current time, the specified program process is suspended.
In some embodiments, in order to improve the SIM card detection efficiency, after the step "interrupting the running of the specified program process", the following steps may be further included:
and when the running of other program processes is finished, switching the running state of the specified program process from the interrupted running to the continued running.
For example, when the runtime is interrupted, the count value for a given program process may be: 10. and then, after the other program processes are finished, continuing to execute the specified program process, namely according to the counting value before the interruption operation: counting continues until the designated program process is completed 10.
In some embodiments, when the terminal supports multiple SIM cards, in order to avoid the influence between the detection pins of the respective SIM cards during SIM card detection, after the step "receiving a detection instruction", the following steps may be further included:
acquiring running sequences of a plurality of other program processes;
running a plurality of other program processes based on the run sequence;
after the execution of the plurality of other program processes is completed, the specified program process is executed.
When the terminal supports a plurality of SIM cards, a plurality of other program processes can be set, which are respectively used for SIM card detection on different SIM card positions.
For example, the terminal may support 2 SIM cards, that is, set the SIM card 1 position and the SIM card 2 position in the cradle, and then may set another program process a and another program process B. The other program process a is configured to configure the detection leg parameter corresponding to the position of the SIM card 1, and the other program process B is configured to configure the detection leg parameter corresponding to the position of the SIM card 2.
The running sequence refers to a running sequence of a plurality of other program processes, and may be set in advance. For example, other program processes may include: the other program process a and the other program process B may be configured to run in the following sequence: the other program process a and the other program process B are executed, that is, the other program process a is executed first, and then the other program process B is executed.
In some embodiments, in order to speed up the SIM card detection time, it may be set that other program processes corresponding to the SIM card position that is first in contact with the card slot during the card holder insertion are preferentially run.
For example, the card holder includes: SIM card 1 position and SIM card 2 position, SIM card 1 position corresponds other procedure process A, SIM card 2 position corresponds other procedure process B, when the card asks to insert the draw-in groove, SIM card 1 position can be earlier with the draw-in groove contact, then can trigger other procedure process A earlier, in other procedure process A operation, accomplish the card and ask to insert, so after other procedure process A operation are accomplished, SIM card 2 position also inserts the draw-in groove, can be with other procedure process B of execution, with this, can save SIM card check-out time.
After the operation sequence of the plurality of other program processes is determined, the other program processes can be sequentially operated according to the operation sequence, namely, the parameter configuration of the detection pin of each SIM card position is completed, and after the parameter configuration of the detection pins of all the SIM card positions is completed, the appointed program process is triggered to start to operate, so that the operation of the appointed program process can be prevented from being interrupted, and the operation rate of the terminal is improved.
In some embodiments, to improve SIM card detection efficiency, the method may further include the steps of:
acquiring the running times and running duration of each other program process in a specified historical time period;
determining the current operation time length of each other program process according to the operation times and the operation time length;
determining the total running time length based on the current running time lengths of all other program processes;
and after waiting for the total running time, running the specified program process.
The designated historical time period refers to a time period before the current time, for example, the designated historical time period may be: past 5 days, past 7 days, etc. Preferably, in order to ensure the accuracy of the running time of other program processes, the specified historical time period can be set to be longer, such as 7 days.
Furthermore, the running times and the running duration of other program processes in the historical time period are obtained, and the running time can be recorded and stored when other program processes run.
For example, other program processes include: other program process a and other program process B, the specified historical time period may be: in the last 7 days, the number of times of acquiring the operation of the other program process a in the last 7 days may be: 5 times, and the duration of 5 runs can be respectively: 6 seconds, 10 seconds, 4 seconds, 3 seconds, 8 seconds. The number of runs of the other program process B in the past 7 days may be acquired as: 5 times, and the time duration of 5 runs can be respectively: 7 seconds, 8 seconds, 5 seconds, 7 seconds, 8 seconds.
When the current running time length of each program process is determined according to the running times and the running time length, the current running time length may be obtained in various ways, for example, by calculating an average running time length of each program process.
For example, the number of runs of other program process a in the past 7 days may be: 5 times, and the duration of 5 runs can be respectively: 6 seconds, 9 seconds, 4 seconds, 3 seconds, 8 seconds. The number of runs of other program process B over the last 7 days may be: 5 times, and the duration of 5 runs can be respectively: 7 seconds, 8 seconds, 5 seconds, 7 seconds, 8 seconds. According to the running times and the running duration of the other program processes a, the average running duration may be calculated as follows: 6 seconds; and according to the running times and the running duration of the other program processes B, calculating the average running duration may be: 7 seconds, it may be determined that the current running time of the other program process a may be: 6 seconds, the current running time of the other program process B may be: and 7 seconds.
The total running duration refers to the sum of the current running durations of other specified program processes, for example, the current running duration of the other program process a may be: 6 seconds, the current running time of the other program process B may be: 7 seconds, the total duration of the run may be 13 seconds.
Further, when the sum of the total operating time lengths is determined, the specified program process can be executed after waiting for the total operating time length when the detection instruction is received, and the total operating time length is determined according to the operating time length in the historical time period of each other program process, so that the other program processes can be ensured to finish operating within the total operating time length, and the waiting time of the specified program process cannot be wasted.
102. A count value for a specified program process is obtained.
The count value of the designated program process may be obtained in various manners, for example, in order to speed up the detection of the SIM card, the count value may be obtained in real time. For another example, in order to save the terminal power consumption, the acquisition may be performed based on a preset time interval, for example, every 1 second, 2 seconds, and the like.
103. And if the counting value is greater than or equal to the preset threshold value, responding to the detection instruction to detect the state of the SIM card of the terminal.
The preset threshold indicates that the maximum count value for triggering the SIM card detection is satisfied, for example, the preset threshold may be: 20, if the count interval time of the specified program process is: if 5 milliseconds, the count time of the designated program process is 100 milliseconds, that is, the running time from the start of the designated program process to the time when the count value reaches 20 is 100 milliseconds, and since the other program processes run and the designated program process interrupts running, the running time of the other program processes is not included in the 100 milliseconds.
Wherein, the counting value is greater than or equal to the preset threshold value, which means that the counting value is greater than or equal to the counting value.
Specifically, the counting time corresponding to the preset threshold value can facilitate other preparation works of the terminal SIM card detection, for example, parameter initialization of the SIM card position in the card support, parameter initialization of the detection pin in the card slot, and the like, so that before the SIM card detection, the stability of the detection environment is ensured, and an accurate SIM card detection result is obtained.
For example, the count value to get to a specified program process may be: 20, if the preset threshold may be 20, it may be determined that the count value is greater than or equal to the preset threshold, that is, it may be determined that preparation for detecting the SIM card is completed, the detection of the state of the SIM card may be started, and the current detection instruction is completed, so as to obtain the detection result.
The embodiment of the application discloses an SIM card detection method, which comprises the following steps: receiving a detection instruction, and triggering a designated program process according to the detection instruction, wherein the detection instruction indicates the state of an SIM card of the detection terminal, and the designated program process is used for accumulating and superposing preset values on the initial values every preset time period; acquiring a counting numerical value of a designated program process; and if the counting value is greater than or equal to a preset threshold value, responding to a detection instruction to detect the state of the SIM card of the terminal. Therefore, the SIM card detection efficiency can be improved.
Referring to fig. 3, fig. 3 is a schematic flowchart of another SIM card detection method according to an embodiment of the present application. Taking the application of the SIM card detection method to a terminal as an example, the SIM card detection method may specifically be as follows:
201. and when the terminal detects that the SIM is plugged, starting a counting process.
The counting process may be executed at a lower priority, and the counting process is configured to perform counting and accumulating operations from the initial count value according to a set time period, for example, the set time may be: 5 milliseconds, the initial count value may be: 0, the count accumulation may be: the add 1 operation, i.e. the count is incremented by 1 every 5 milliseconds while the counting process is running.
The counting time may be recorded when each counting is increased by 1, so as to perform the next counting operation according to the counting time, and store the counting value and the counting time, and the counting information of the counting process may include: count value, count time. For example, the count value: and 3, counting time: 10:02:02.
Specifically, the SIM card can be detected by arranging a distance sensor at the terminal card slot, and when the change of the distance between the card slot and the card support is detected, the SIM card is determined to be detected, so that a starting process can be triggered to start counting and accumulating operation.
When the counting process is started, a SIM card detection blocking process is started at the same time, and the SIM card detection blocking process is used for suspending SIM card detection. In the embodiment of the application, the SIM card detection blocking process is set, so that the stability of SIM card detection can be ensured.
202. The terminal acquires a count value of a counting process based on a preset time interval.
In order to ensure the terminal operation speed, a plurality of preset time intervals can be set, wherein the preset time intervals are respectively different in time length.
For example, the preset time intervals may be set to 2, including a first preset time interval and a second preset time interval, where the first preset time interval may be 10 milliseconds, and the second preset time interval may be 1 second.
Specifically, a suitable preset time interval may be selected according to the power condition of the terminal. For example, if the remaining power of the current terminal is greater than the preset power value, that is, the power is sufficient, a first preset time interval may be selected, the count value may be obtained based on the first preset time interval, the count value may be quickly determined when the count value reaches a preset threshold, and the SIM card detection operation may be accelerated. Or, if the remaining power of the current terminal is less than the preset power value, that is, the power is low, the second preset time interval may be selected, and the count value is obtained based on the second preset time interval, so that the power consumption of the terminal may be saved.
In some embodiments, the preset time interval may also be selected according to the terminal operation condition, which is not described herein again.
203. The terminal judges whether the count value is greater than the count threshold value.
The counting threshold indicates that the terminal completes the SIM card detection configuration corresponding counting value, namely the trigger condition of the SIM card detection.
For example, the count threshold may be: 10, the count value obtained by the terminal may be 11, the count value is compared with the count threshold, and if the count value is determined to be greater than the count threshold, step 204 may be executed.
For another example, the count threshold may be: 10, the count value obtained by the terminal may be 8, the count value is compared with the count threshold, and if the count value is determined to be smaller than the count threshold, step 205 may be executed.
204. The terminal starts SIM card detection and closes the counting process.
When the count value of the counting process is greater than the counting threshold value, the count value also meets the preset condition. The current counting process and the SIM card detection blocking process can be closed, and simultaneously, the SIM card detection activation process can be triggered to carry out SIM card detection, wherein the SIM card detection activation process is used for executing SIM card detection operation.
And when the SIM card is inserted and pulled out next time, restarting the counting process to count and accumulate the initial count value.
205. And the terminal continues to acquire the count value of the counting process based on the preset time interval until the count value is greater than the counting threshold.
When the count value of the counting process is smaller than the count threshold, that is, the count value does not satisfy the preset condition. And the terminal continues to execute the counting process to carry out counting operation until the counting value of the counting process meets the counting threshold value, and if the counting value meets the triggering condition of SIM card detection, SIM card detection can be executed.
The embodiment of the application discloses a method for detecting an SIM card, which comprises the following steps: when the terminal detects that the SIM is plugged, starting a counting process; the terminal acquires a counting value of a counting process based on a preset time interval; the terminal judges whether the count value is greater than a count threshold value; if the counting value is larger than the counting threshold value, the terminal starts SIM card detection and closes the counting process; and if the count value is smaller than the count threshold, the terminal continues to acquire the count value of the counting process based on the preset time interval until the count value is larger than the count threshold. Therefore, when the mobile terminal is provided with the plugging and unplugging detection function of the multiple SIM cards and the card slots, the multiple SIM cards can be subjected to cooperative processing, the instability of the function when the SIM cards are detected is avoided, and the user experience is 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. 4, fig. 4 is a block diagram of a SIM card detection apparatus according to an embodiment of the present disclosure, where the SIM card detection apparatus may be applied to a mobile terminal such as a mobile phone, a tablet computer, a notebook computer, a palm top computer, a Portable Media Player (PMP), and a fixed terminal such as a desktop computer, and the apparatus includes:
a receiving unit 301, configured to receive a detection instruction, and trigger a designated program process according to the detection instruction, where the detection instruction indicates to detect a state of an SIM card of the terminal, and the designated program process is configured to accumulate and superimpose a preset value on an initial value every preset time period;
a first obtaining unit 302, configured to obtain a count value of the specified program process;
the detecting unit 303 is configured to detect a SIM card status of the terminal in response to the detection instruction if the count value is greater than or equal to a preset threshold.
In some embodiments, please refer to fig. 5, where fig. 5 is a block diagram of a structure of another SIM card detection apparatus provided in the embodiments of the present application, the apparatus may further include:
a second obtaining unit 304, configured to obtain program priority information when detecting that another program process of the terminal is started, where the another program process is used to configure SIM card detection parameters, and the program priority information includes an operation level of each program process;
a first determining unit 305, configured to determine an operating status of the specified program process based on the program priority information.
In some embodiments, the first determining unit 305 may include:
an obtaining subunit, configured to obtain, from the program priority information, an operation level of the specified program process and an operation level of the other program process;
the first execution subunit is used for continuously running the specified program process if the running level of the specified program process is higher than the running levels of the other program processes;
and the second execution subunit is used for interrupting the running of the specified program process if the running level of the other program process is higher than the running level of the specified program process.
In some embodiments, the first determining unit 305 may further include:
and the switching subunit is used for switching the running state of the specified program process from the interrupted running to the continuous running when the running of the other program processes is finished.
In some embodiments, the apparatus may further comprise:
a third acquiring unit configured to acquire an operation sequence of a plurality of other program processes;
a first execution unit configured to execute the plurality of other program processes based on the execution sequence;
a second running unit, configured to run the specified program process after the running of the plurality of other program processes is completed.
In some embodiments, the apparatus may further comprise:
the fourth acquisition unit is used for acquiring the running times and running duration of each other program process in the appointed historical time period;
the second determining unit is used for determining the current operation time length of each other program process according to the operation times and the operation time length;
a third determining unit, configured to determine a total operating duration based on current operating durations of all other program processes;
and the third running unit is used for running the specified program process after waiting for the total running time.
The embodiment of the application discloses SIM card detection device, this SIM card detection device includes: the receiving unit 301 receives a detection instruction, and triggers a designated program process according to the detection instruction, wherein the detection instruction indicates to detect the state of the SIM card of the terminal, and the designated program process is used for cumulatively superimposing a preset value on an initial value every preset time period; the first acquisition unit 302 acquires the count value of the specified program process; if the count value is greater than or equal to a preset threshold, the detection unit 303 responds to the detection instruction to detect the SIM card status of the terminal. Thereby, the terminal operation rate can be increased.
The embodiment of the application also provides a terminal. As shown in fig. 6, 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. 6 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 SIM card detection by executing 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 may be transmitted to the processor 608 to determine the type of touch event, and the processor 608 may then provide a corresponding visual output on the display panel based on the type of touch event. Although in FIG. 6 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.
WiFi belongs to a 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. 6 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:
receiving a detection instruction, and triggering a designated program process according to the detection instruction, wherein the detection instruction indicates that the state of an SIM card of the terminal is detected, and the designated program process is used for accumulating and superposing preset values on initial values every preset time period;
acquiring a counting numerical value of the designated program process;
and if the counting numerical value is greater than or equal to a preset threshold value, responding to the detection instruction to detect the state of the SIM card of the terminal.
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: receiving a detection instruction, and triggering a specified program process according to the detection instruction, wherein the detection instruction indicates that the state of the SIM card of the terminal is detected, and the specified program process is used for cumulatively superposing preset values on initial values every other preset time period; acquiring a counting numerical value of the designated program process; and if the counting numerical value is greater than or equal to a preset threshold value, responding to the detection instruction to detect the state of the SIM card of the terminal. According to the method and the device, the counting process is started when the SIM card of the terminal is detected to be plugged, the counting value of the counting process is obtained at set intervals, and when the counting value meets the preset condition, the SIM card detection process is triggered to execute the SIM card detection operation. The method aims to carry out cooperative detection processing on a plurality of SIM cards when the plurality of SIM cards are arranged in the terminal, and avoids the influence among the detection pins of each SIM card, thereby improving the operation speed of the terminal.
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, where multiple instructions are stored, where the instructions can be loaded by a processor to perform 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:
receiving a detection instruction, and triggering a designated program process according to the detection instruction, wherein the detection instruction indicates that the state of an SIM card of the terminal is detected, and the designated program process is used for accumulating and superposing preset values on initial values every preset time period; acquiring a counting numerical value of the designated program process; and if the counting numerical value is greater than or equal to a preset threshold value, responding to the detection instruction to detect the state of the SIM card of the terminal.
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, the specific implementation manner and the application scope may be changed, 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, and the method comprises the following steps:
receiving a detection instruction, and triggering a designated program process according to the detection instruction, wherein the detection instruction indicates that the state of an SIM card of the terminal is detected, and the designated program process is used for accumulating and superposing preset values on initial values every preset time period;
acquiring a running sequence of a plurality of other program processes, wherein the other program processes are used for configuring SIM card detection parameters, the terminal supports a plurality of SIM cards, and each SIM card corresponds to one other program process;
running the plurality of other program processes based on the run sequence;
after the running of the plurality of other program processes is completed, running the specified program process;
acquiring a counting numerical value of the designated program process;
and if the counting numerical value is greater than or equal to a preset threshold value, responding to the detection instruction to detect the state of the SIM card of the terminal.
2. The method of claim 1, after said triggering a specified program process according to said detection instruction, further comprising:
when detecting that other program processes of the terminal are started, acquiring program priority information, wherein the other program processes are used for configuring SIM card detection parameters, and the program priority information comprises the operation level of each program process;
and adjusting the running state of the specified program process based on the program priority information.
3. The method of claim 2, wherein the operational state comprises: continuous operation and interrupted operation;
the adjusting the running state of the designated program process based on the program priority information comprises:
acquiring the running grade of the appointed program process and the running grade of the other program processes from the program priority information;
if the running grade of the specified program process is higher than the running grades of the other program processes, continuously running the specified program process;
and if the running grade of the other program processes is higher than that of the specified program process, interrupting the running of the specified program process.
4. The method of claim 3, further comprising, after the interrupting the specified program process,:
and when the running of the other program processes is finished, switching the running state of the specified program process from interrupted running to continued running.
5. The method of claim 1, further comprising:
acquiring the running times and running duration of each other program process in a specified historical time period;
determining the current operation time length of each other program process according to the operation times and the operation time length;
determining the total running time length based on the current running time lengths of all other program processes;
after the receiving the detection instruction, further comprising:
and after waiting for the total running time, running the specified program process.
6. An apparatus for detecting a SIM card, applied to a terminal, the apparatus comprising:
the terminal comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a detection instruction and triggering a designated program process according to the detection instruction, the detection instruction indicates that the state of an SIM card of the terminal is detected, and the designated program process is used for accumulating and superposing a preset value on an initial value every preset time period;
a third obtaining unit, configured to obtain a running sequence of multiple other program processes, where the other program processes are used to configure SIM card detection parameters, and the terminal supports multiple SIM cards, and each SIM card corresponds to one other program process;
a first execution unit configured to execute the plurality of other program processes based on the execution sequence;
a second running unit configured to run the specified program process after the running of the plurality of other program processes is completed;
a first acquiring unit configured to acquire a count value of the designated program process;
and the detection unit is used for responding to the detection instruction to detect the state of the SIM card of the terminal if the counting value is greater than or equal to a preset threshold value.
7. The apparatus of claim 6, further comprising:
a second obtaining unit, configured to obtain program priority information when detecting that another program process of the terminal is started, where the another program process is used to configure SIM card detection parameters, and the program priority information includes an operation level of each program process;
a first determination unit configured to determine an operation state of the designated program process based on the program priority information.
8. A storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the SIM card detection method according to any one of claims 1 to 5.
9. A terminal comprising a processor and a memory, the memory storing a plurality of instructions, the processor loading the instructions to perform the SIM card detection method of any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110436542.3A CN113179344B (en) | 2021-04-22 | 2021-04-22 | SIM card detection method, device, storage medium and terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110436542.3A CN113179344B (en) | 2021-04-22 | 2021-04-22 | SIM card detection method, device, storage medium and terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113179344A CN113179344A (en) | 2021-07-27 |
CN113179344B true CN113179344B (en) | 2022-09-02 |
Family
ID=76924681
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110436542.3A Active CN113179344B (en) | 2021-04-22 | 2021-04-22 | SIM card detection method, device, storage medium and terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113179344B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101740105A (en) * | 2008-11-24 | 2010-06-16 | 联发科技股份有限公司 | System and method for accessing memory card |
CN106527607A (en) * | 2016-10-12 | 2017-03-22 | 惠州Tcl移动通信有限公司 | Configuration method and system of mobile terminal pin |
CN106792863A (en) * | 2017-02-24 | 2017-05-31 | 惠州Tcl移动通信有限公司 | A kind of SIM triggers the method and mobile terminal of recognition detection automatically |
CN111355505A (en) * | 2020-02-18 | 2020-06-30 | 深圳信可通讯技术有限公司 | SIM card seat type identification method, device and computer readable medium |
CN112018534A (en) * | 2019-05-31 | 2020-12-01 | 北京小米移动软件有限公司 | Terminal device |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101879251B1 (en) * | 2012-01-16 | 2018-07-17 | 삼성전자주식회사 | Apparatus and method for setting an interface |
CN105188050B (en) * | 2014-05-27 | 2020-09-11 | 中兴通讯股份有限公司 | Method, device and system for dynamically binding machine card |
CN104702784B (en) * | 2015-03-05 | 2017-07-11 | 惠州Tcl移动通信有限公司 | A kind of detection method and system of the hot plug of mobile terminal plurality of SIM cards |
CN107069272B (en) * | 2017-03-13 | 2021-07-20 | 宇龙计算机通信科技(深圳)有限公司 | SIM card holder, terminal, SIM card detection method and detection device |
-
2021
- 2021-04-22 CN CN202110436542.3A patent/CN113179344B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101740105A (en) * | 2008-11-24 | 2010-06-16 | 联发科技股份有限公司 | System and method for accessing memory card |
CN106527607A (en) * | 2016-10-12 | 2017-03-22 | 惠州Tcl移动通信有限公司 | Configuration method and system of mobile terminal pin |
CN106792863A (en) * | 2017-02-24 | 2017-05-31 | 惠州Tcl移动通信有限公司 | A kind of SIM triggers the method and mobile terminal of recognition detection automatically |
CN112018534A (en) * | 2019-05-31 | 2020-12-01 | 北京小米移动软件有限公司 | Terminal device |
CN111355505A (en) * | 2020-02-18 | 2020-06-30 | 深圳信可通讯技术有限公司 | SIM card seat type identification method, device and computer readable medium |
Also Published As
Publication number | Publication date |
---|---|
CN113179344A (en) | 2021-07-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106294168B (en) | A kind of method and system carrying out Application testing | |
CN106919458B (en) | Method and device for Hook target kernel function | |
CN110968508B (en) | Method, device, terminal and storage medium for determining loading time of applet | |
CN110912574B (en) | SIM card detection method, device, storage medium and terminal | |
CN111273955B (en) | Thermal restoration plug-in optimization method and device, storage medium and electronic equipment | |
CN110688051B (en) | Screen recording operation method and device, computer readable storage medium and terminal | |
CN109669662A (en) | A kind of pronunciation inputting method, device, storage medium and mobile terminal | |
CN112040324A (en) | Playing progress adjusting method and device, storage medium and terminal | |
CN106532876B (en) | Power supply control method and device and computer equipment | |
CN104102560A (en) | Method and device for testing system performance | |
CN110896240B (en) | Charging control method and device, computer readable storage medium and terminal | |
CN113179344B (en) | SIM card detection method, device, storage medium and terminal | |
CN110636526A (en) | NFC communication detection method and device, computer readable storage medium and terminal | |
WO2013152656A1 (en) | Method and mobile terminal for drawing sliding track | |
CN110944318A (en) | Lock card setting method and device, storage medium and terminal | |
CN110989816A (en) | Application processing method and device and storage medium | |
CN110471622B (en) | SD card data writing method and device, storage medium and terminal | |
CN106445458B (en) | Playing control method, device and terminal | |
CN106155733B (en) | Method and device for running application program | |
CN113835555A (en) | Touch screen adjusting method and device, storage medium and terminal | |
CN104871636B (en) | A kind of method, terminal, the network equipment and the system of secondary carrier change | |
CN111651299A (en) | Wireless chip reset control method and device, storage medium and mobile terminal | |
CN111542037A (en) | Instruction transmission method, device and storage medium | |
CN106982177B (en) | Upgrade control method, device and terminal | |
CN106033358B (en) | Batch installation method and device of application programs |
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 |