CN107368763B - SIM card information reading method and device and computer readable storage medium - Google Patents

SIM card information reading method and device and computer readable storage medium Download PDF

Info

Publication number
CN107368763B
CN107368763B CN201710486556.XA CN201710486556A CN107368763B CN 107368763 B CN107368763 B CN 107368763B CN 201710486556 A CN201710486556 A CN 201710486556A CN 107368763 B CN107368763 B CN 107368763B
Authority
CN
China
Prior art keywords
space
user
user space
identifier
sim card
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
CN201710486556.XA
Other languages
Chinese (zh)
Other versions
CN107368763A (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.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co 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 Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201710486556.XA priority Critical patent/CN107368763B/en
Publication of CN107368763A publication Critical patent/CN107368763A/en
Application granted granted Critical
Publication of CN107368763B publication Critical patent/CN107368763B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/0013Methods or arrangements for sensing record carriers, e.g. for reading patterns by galvanic contacts, e.g. card connectors for ISO-7816 compliant smart cards or memory cards, e.g. SD card readers
    • G06K7/0034Methods or arrangements for sensing record carriers, e.g. for reading patterns by galvanic contacts, e.g. card connectors for ISO-7816 compliant smart cards or memory cards, e.g. SD card readers the connector being capable of simultaneously receiving a plurality of cards in the same insertion slot

Landscapes

  • Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Telephone Function (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The disclosure relates to a method and a device for reading SIM card information and a computer readable storage medium, relating to the technical field of terminals, wherein the method comprises the following steps: when at least two SIM cards are inserted, determining an SIM card corresponding to each user space in a multi-user space from the at least two SIM cards, wherein the multi-user space is obtained by dividing a storage space; for any installed application, when the application needs to acquire SIM card information, reading corresponding information from the SIM card corresponding to the user space to which the application belongs. The invention can read the information on different SIM cards through each user space in the multi-user space, but not each user space reads the information on the same SIM card, thereby being beneficial to the privacy requirement of the user and having the flexibility of multiple users.

Description

SIM card information reading method and device and computer readable storage medium
Technical Field
The present disclosure relates to the field of terminal technologies, and in particular, to a method and an apparatus for reading SIM (Subscriber Identity Module) card information, and a computer-readable storage medium.
Background
With the rapid development of terminal technology, the functions of terminals such as mobile phones, tablet computers, smart watches and the like are increasingly powerful, and the terminals become indispensable tools in work and life of people gradually. At present, in order to facilitate the use of a user, two SIM cards may be inserted into a terminal at the same time, and the two SIM cards may be in a standby state, that is, a dual-card dual-standby function. When the user needs to know the information of the two SIM cards, the information of the two SIM cards can be read through the terminal.
In the related art, the same terminal may be used by multiple users at the same time, and the multi-user function of the terminal is generated accordingly. When the terminal supports the multi-user function, the storage space of the terminal is divided into a plurality of user spaces, and the user spaces are mutually independent spaces. For each user space in the plurality of user spaces, when a user corresponding to the user space needs to acquire the SIM card information, the information on the main SIM card in the two SIM cards inserted by the terminal can be read. The primary SIM card is a SIM card currently performing network data connection, and the primary SIM card is generally an SIM card inserted into the card slot 1.
Disclosure of Invention
In order to overcome the problems in the related art, the present disclosure provides a method and an apparatus for reading SIM card information, and a computer-readable storage medium.
According to a first aspect of the embodiments of the present disclosure, a method for reading SIM card information is provided, where the method includes:
when at least two SIM cards are inserted, determining an SIM card corresponding to each user space in a multi-user space from the at least two SIM cards, wherein the multi-user space is obtained by dividing a storage space;
for any installed application, when the application needs to acquire SIM card information, reading corresponding information from the SIM card corresponding to the user space to which the application belongs.
Optionally, the determining, from the at least two SIM cards, a SIM card corresponding to each user space in the multi-user space includes:
determining a space identifier of each user space in the multi-user space;
based on the space identification of each user space, acquiring a card slot identification corresponding to each user space from the corresponding relation between the stored space identification and the card slot identification;
and determining the SIM card inserted into the card slot indicated by the card slot identification corresponding to each user space as the SIM card corresponding to each user space.
Optionally, before obtaining the card slot identifier corresponding to each user space from the stored correspondence between the space identifier and the card slot identifier based on the space identifier of each user space, the method further includes:
when a setting instruction is received, displaying a space setting interface, wherein the space setting interface comprises a space identifier of the multi-user space;
acquiring a card slot identifier of an SIM card set by a user aiming at each user space in the multi-user space;
and storing the space identifier of each user space in the multi-user space and the card slot identifier of the SIM card set for each user space into the corresponding relation between the space identifier and the card slot identifier.
Optionally, the reading of the corresponding information from the SIM card corresponding to the user space to which the application belongs includes:
determining a User Identification (UID) of the application, wherein the UID refers to an identifier which is allocated to each application when an operating system is started and is used for uniquely identifying each application, and determining a User ID (User Identification) to which the application belongs based on the UID of the application;
and determining the user space to which the application belongs from the multi-user space based on the user ID to which the application belongs, and reading corresponding information from the SIM card corresponding to the user space to which the application belongs.
Optionally, the reading of the corresponding information from the SIM card corresponding to the user space to which the application belongs includes:
and reading corresponding information from the SIM card corresponding to the user space to which the application belongs through a Telephony Manager (telephone Manager) interface.
According to a second aspect of the embodiments of the present disclosure, there is provided an apparatus for reading SIM card information, the apparatus including:
the device comprises a determining module and a judging module, wherein the determining module is used for determining an SIM card corresponding to each user space in a multi-user space from at least two SIM cards when at least two SIM cards are inserted, and the multi-user space is obtained by dividing a storage space;
and the reading module is used for reading corresponding information from the SIM card corresponding to the user space to which the application belongs when the application needs to acquire the SIM card information for any installed application.
Optionally, the determining module includes:
a first determining submodule, configured to determine a space identifier of each user space in the multi-user space;
the first obtaining submodule is used for obtaining the card slot identification corresponding to each user space from the corresponding relation between the stored space identification and the card slot identification based on the space identification of each user space;
and the second determining submodule is used for determining the SIM card inserted into the card slot indicated by the card slot identification corresponding to each user space as the SIM card corresponding to each user space.
Optionally, the determining module further comprises:
the display sub-module is used for displaying a space setting interface when a setting instruction is received, wherein the space setting interface comprises a space identifier of the multi-user space;
the second obtaining submodule is used for obtaining the card slot identifier of the SIM card set by the user aiming at each user space in the multi-user space;
and the storage submodule is used for storing the space identifier of each user space in the multi-user space and the card slot identifier of the SIM card set for each user space into the corresponding relation between the space identifier and the card slot identifier.
Optionally, the reading module comprises:
a third determining submodule for determining a UID of the application;
a fourth determining submodule, configured to determine, based on the UID of the application, a user ID to which the application belongs;
a fifth determining submodule, configured to determine, based on a user ID to which the application belongs, a user space to which the application belongs from the multi-user space;
and the first reading submodule is used for reading corresponding information from the SIM card corresponding to the user space to which the application belongs.
Optionally, the reading module further comprises:
and the second reading sub-module is used for reading corresponding information from the SIM card corresponding to the user space to which the application belongs through a Telephony Manager interface.
According to a third aspect of the embodiments of the present disclosure, there is provided an apparatus for reading SIM card information, the apparatus including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to perform the steps of the method of the first aspect.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium having stored thereon instructions which, when executed by a processor, implement the steps of the method of the first aspect described above.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
in the embodiment of the present disclosure, when at least two SIM cards are inserted, the SIM card corresponding to each user space in the multi-user space may be determined from the at least two inserted SIM cards, and when any application installed in the multi-user space needs to acquire SIM card information, the corresponding information is read from the SIM card corresponding to the user space to which the application belongs. Therefore, the multi-user space can read the information of the corresponding SIM card, but not the information of the same SIM card, so that the privacy requirement of the user is facilitated, and the flexibility of multiple users is realized.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
Fig. 1 is a flowchart illustrating a method of reading SIM card information according to an exemplary embodiment.
Fig. 2A is a flowchart illustrating a method of reading SIM card information according to another exemplary embodiment;
FIG. 2B is a schematic diagram illustrating a multi-user spatial settings interface in accordance with an exemplary embodiment;
fig. 3 is a block diagram illustrating a device for reading SIM card information according to an exemplary embodiment.
FIG. 4 is a block diagram illustrating a determination module 301 according to an exemplary embodiment;
FIG. 5 is a schematic diagram illustrating the structure of another determination module 301 in accordance with an exemplary embodiment;
FIG. 6 is a block diagram illustrating a read module 302 according to an example embodiment;
FIG. 7 is a schematic diagram illustrating another read module 302 according to an example embodiment;
fig. 8 is a schematic structural diagram illustrating an apparatus 800 for reading SIM card information according to an exemplary embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
For convenience of understanding, before explaining the embodiments of the present disclosure in detail, an application scenario of the embodiments of the present disclosure will be described.
In the embodiment of the present disclosure, at least two SIM cards may be inserted into the terminal, and the terminal may also be provided with a plurality of user spaces. Since the SIM card may generally store contact information, or operator information registered by the SIM card, etc., for any user space in the multi-user space, when an application installed in the user space needs to acquire the contact information or the operator information, the SIM card information may be read from the SIM card inserted in the terminal.
For example, if two user spaces are set in the terminal, which are respectively a main space and other user spaces, it is assumed that applications installed in the main space include an instant messaging application 1 and a call application 1, and applications installed in the other user spaces include an instant messaging application 2 and a call application 2, when a user uses the terminal, if the instant messaging applications in the two user spaces need to acquire contact information on a SIM card, at this time, the instant messaging application 1 in the main space can read the contact information on the SIM card in the card slot 1, and the instant messaging applications 2 in the other user spaces can read the contact information on the SIM card in the card slot 2, that is, the instant messaging applications in the two user spaces can acquire the contact information on different SIM cards.
For another example, if the call applications in the two user spaces need to acquire the operator information on the SIM card, at this time, the call application 1 in the main space may read the operator information on the SIM card in the card slot 1, and the call applications 2 in the other user spaces may read the operator information on the SIM card in the card slot 2, that is, the call applications in the two user spaces may acquire the operator information on different SIM cards.
In the related art, when an application installed in each user space in a multi-user space needs to acquire SIM card information, the application installed in each user space reads information on a main SIM card, that is, the application installed in each user space reads information on the same SIM card, which is not favorable for privacy requirements of users and does not have flexibility of multiple users. In order to solve this problem, the embodiments of the present disclosure provide a method for reading SIM card information. Next, a method for reading SIM card information provided by the embodiments of the present disclosure will be described in detail with reference to the accompanying drawings.
Fig. 1 is a flowchart illustrating a method for reading SIM card information according to an exemplary embodiment, where the method is used in a terminal, such as a mobile phone, a tablet computer, a smart watch, and the like, as shown in fig. 1, and the method includes the following steps.
In step 101, when at least two SIM cards are inserted, determining an SIM card corresponding to each user space in a multi-user space from the at least two SIM cards, where the multi-user space is obtained by dividing a storage space;
in step 102, for any installed application, when the application needs to acquire SIM card information, reading corresponding information from a SIM card corresponding to a user space to which the application belongs.
In this embodiment of the present disclosure, when at least two SIM cards are inserted into the terminal, the SIM card corresponding to each user space in the multi-user space may be determined from the at least two SIM cards. Therefore, when the application installed in any user space in the multi-user space needs to acquire the information of the SIM card, the corresponding information can be read from the SIM card corresponding to the user space, that is, the applications installed in the multiple user spaces can read the information on different SIM cards, but the applications installed in each user space do not read the information on the same SIM card, so that the privacy requirements of the user are met, and the flexibility of multiple users is achieved.
Optionally, determining, from the at least two SIM cards, a SIM card corresponding to each user space in the multi-user space, includes:
determining a space identifier of each user space in the multi-user space;
based on the space identification of each user space, acquiring a card slot identification corresponding to each user space from the corresponding relation between the stored space identification and the card slot identification;
and determining the SIM card inserted into the card slot indicated by the card slot identification corresponding to each user space as the SIM card corresponding to each user space.
Optionally, before obtaining the card slot identifier corresponding to each user space from the stored correspondence between the space identifier and the card slot identifier based on the space identifier of each user space, the method further includes:
when a setting instruction is received, displaying a space setting interface, wherein the space setting interface comprises a space identifier of a multi-user space;
acquiring a card slot identifier of an SIM card set by a user aiming at each user space in a multi-user space;
and storing the space identifier of each user space in the multi-user space and the card slot identifier of the SIM card set for each user space into the corresponding relation between the space identifier and the card slot identifier.
Optionally, reading corresponding information from a SIM card corresponding to a user space to which the application belongs, including:
determining the UID of the application, and determining the user ID to which the application belongs based on the UID of the application;
and determining the user space to which the application belongs from the multi-user space based on the user ID to which the application belongs, and reading corresponding information from the SIM card corresponding to the user space to which the application belongs.
Optionally, reading corresponding information from a SIM card corresponding to a user space to which the application belongs, including:
and reading corresponding information from the SIM card corresponding to the user space to which the application belongs through a Telephony Manager interface.
All the above optional technical solutions can be combined arbitrarily to form optional embodiments of the present disclosure, and the embodiments of the present disclosure are not described in detail again.
Fig. 2A is a flowchart illustrating a method of reading SIM card information according to an exemplary embodiment. The disclosed embodiment will be discussed in conjunction with fig. 2A for the embodiment shown in fig. 1. The method is used in the terminal and comprises the following steps.
When at least two SIM cards are inserted into the terminal, the SIM card corresponding to each user space in the multi-user space may be determined from the at least two SIM cards according to the following steps 201 and 203.
In step 201, when at least two SIM cards are inserted, a space identifier of each user space in the multi-user space is determined, and the multi-user space is obtained by dividing the storage space.
It should be noted that the same terminal may be used by multiple users at the same time, at this time, corresponding user spaces may be set in the terminal for the multiple users, that is, the storage space of the terminal is divided into multiple user spaces, the first user is the owner of the terminal, the storage space of the first user may be referred to as a main space, the storage spaces of other users may be referred to as other user spaces, and each user has its own application, wallpaper, settings, and the like.
It should be further noted that the space identifier is an identifier that uniquely identifies a user space, and the space identifier may be a text identifier, a number identifier, a shape identifier, a graphic identifier, or the like. For example, the space identifier of the primary user space is "primary space", and the space identifiers of the other user spaces are "other user spaces".
Since the terminal sets a corresponding SIM card for each user space in advance based on the space identifier of each user space in the multi-user space, the terminal may determine the space identifier of each user space in the multi-user space in order to determine the SIM card corresponding to each user space in the multi-user space.
The implementation process of determining the space identifier of each user space in the multi-user space may be: determining UIDs of applications installed in each user space in the multi-user space, dividing the UIDs of the applications by a preset numerical value to obtain an operation result of each application, rounding down the operation result corresponding to each application to obtain a user ID to which each application belongs, and determining the space identification of each user space from the corresponding relation between the stored user ID and the space identification according to the user ID to which each application belongs. The corresponding relationship between the user ID and the space identifier may be configured in advance.
The preset value refers to an application quantity value which is preset in an operating system and can be owned by a user at most. For example, for an android operating system, the preset value may be 10 ten thousand, that is, a user may have a maximum of 10 ten thousand applications.
The UID is an identifier allocated to each application when an operating system installed on the terminal is started, the user ID is a user identity identifier, and a certain operation relation exists between the UID of each application and the user ID to which each application belongs. Therefore, when determining the space identifier of each user space in the multi-user space, the user ID to which each application belongs may be obtained through the conversion relationship based on the UID of the application installed in each user space in the multi-user space, and then the space identifier of the user space to which the application belongs may be determined according to the obtained user ID to which each application belongs.
For example, a communication application is installed in one of the user spaces, the UID of the communication application is 90500, assuming that the preset value specified in the operating system is 100000, the operation result of the communication application is 0.905 by dividing 90500 by 100000, then the operation result of the communication application is rounded down to obtain the user ID to which the communication application belongs as 0, and the space identifier of the user space to which the communication application belongs is obtained as the main space according to the user ID as 0.
In step 202, based on the space identifier of each user space, a card slot identifier corresponding to each user space is obtained from the stored correspondence between the space identifier and the card slot identifier.
When each user space in the multi-user space needs to determine the corresponding SIM card, the card slot identifier corresponding to the user space can be determined, that is, the SIM card inserted in the card slot corresponding to the user space is obtained from the correspondence between the stored space identifier and the card slot identifier. The card slot identifier refers to a number of a card slot in the terminal, into which different SIM cards are inserted, for example, the card slot identifier into which the primary SIM card is inserted may be card slot 1, and the card slot identifier into which the secondary SIM card is inserted may be card slot 2.
The space identification and the card slot identification of each user space can be in one-to-one correspondence or many-to-one correspondence. Therefore, each user space in the multi-user space can be divided by the space identifier of each user space in the multi-user space, that is, after determining the user ID to which the application installed in each user space belongs, it can be determined whether the user space to which the application belongs is the primary space or the other user spaces. Because there is only one master space in the multi-user space, the master space and the card slot identifiers are in one-to-one correspondence, and there may be a plurality of other user spaces, so that the other user spaces and the card slot identifiers may be in many-to-one relationship.
For example, the user space to which the application with the user ID of 0 belongs is the main space, the card slot identifier corresponding to the main space is the card slot 1, the user space to which the user ID belongs is the other user space, and the card slot identifier corresponding to the other user space is the card slot 2.
Further, based on the space identifier of each user space, before the slot identifier corresponding to each user space is obtained from the stored correspondence between the space identifier and the slot identifier, the correspondence between the user space and the slot identifier may also be created. The process of creating the corresponding relationship between the user space and the card slot identifier may be: when a setting instruction is received, a space setting interface is displayed, the space setting interface comprises space identification of a multi-user space, card slot identification of an SIM card set by a user aiming at each user space in the multi-user space is obtained, and the space identification of each user space in the multi-user space and the card slot identification of the SIM card set for each user space are stored in a corresponding relation between the space identification and the card slot identification.
For example, suppose that two user spaces are provided in the terminal, when the terminal receives a setting instruction, the terminal may display a space setting interface as shown in fig. 2B, which includes a main space and other user spaces, and two SIM cards are inserted into the terminal, and the card slot identifiers of the card slots in which the SIM cards are located are card slot 1 and card slot 2, respectively. At this time, in the setting interface, the options of the card slot 1 and the card slot 2 may be displayed for the main space and the other user spaces, respectively. Assume that the user sets the main space to correspond to card slot 1 and the other user spaces to correspond to card slots 2. At this time, the terminal may store the correspondence between the space identifier and the card slot identifier as shown in table 1 below.
TABLE 1
Space identification Card slot identification
Main space Card slot 1
Other user spaces Card slot 2
...... ......
It should be noted that, in the embodiment of the present disclosure, only the correspondence between the space identifier and the slot identifier shown in table 1 is taken as an example for description, and table 1 does not limit the embodiment of the present disclosure.
In step 203, the SIM card inserted into the card slot indicated by the card slot identifier corresponding to each user space is determined as the SIM card corresponding to each user space.
After the terminal acquires the card slot identifier corresponding to each user space, the SIM card corresponding to each user space can be determined in order to facilitate each user space in the subsequent multi-user space to read the corresponding SIM card information. In the embodiment of the present disclosure, the SIM card inserted in the card slot indicated by the card slot identifier corresponding to each user space may be determined as the SIM card corresponding to each user space.
For example, when the card slot identifier corresponding to one user space in the multi-user space is acquired as the card slot 2, the SIM card inserted into the card slot 2 is the SIM card corresponding to the user space.
In step 204, for any installed application, when the application needs to acquire SIM card information, corresponding information is read from the SIM card corresponding to the user space to which the application belongs.
If the application installed in any user space in the multi-user space needs to acquire the information of the SIM card, the corresponding information can be read from the SIM card corresponding to the user space through a Telephony Manager interface. Therefore, each user space in the multi-user space can be ensured to acquire the required information through the Telephony Manager interface, the privacy requirement of the user is facilitated, and the flexibility of multiple users is achieved.
That is, by the method provided by the embodiment of the present disclosure, it is ensured that different SIM card information can be read in the main space and other user spaces in the multi-user space, so that the advantages of multi-user and multi-card multi-standby can be highlighted, the terminal can be conveniently used, or the convenience of using the terminal by the user is improved, and further the user viscosity is improved.
For example, communication applications in the main space and other user spaces need to acquire contact information in the SIM card, and assuming that the communication application 1 in the main space needs to acquire contact information in the SIM card 1 and the communication applications 2 in other user spaces need to acquire contact information in the SIM card 2, at this time, the communication application 1 in the main space and the communication applications 2 in other user spaces can read required contact information from their respective corresponding SIM cards through Telephony Manager interfaces.
It should be noted that the Telephony Manager interface can read various information stored on the SIM card, for example, through public String getImei (int slot id) class, unique identification code information of the device can be obtained; device type information can be acquired through a public int getboottype (int slot id) class; operator information can be obtained through a public String getNetworkOperator (int slotId) class; the name information of the operator can be obtained through a public String getNetworkOperatorName (int slotId) class; the network code information can be obtained through a public String getNetworkCountryIso (int slotId) class.
In the embodiment of the present disclosure, when at least two SIM cards are inserted into the terminal, the space identifier of each user space in the multi-user space is determined, and the card slot identifier corresponding to each user space is obtained from the correspondence between the stored space identifier and the card slot identifier, so that the SIM card corresponding to each user space in the multi-user space can be determined from the at least two SIM cards. Therefore, when any application installed in the multi-user space needs to acquire the information of the SIM card, the corresponding information can be read from the SIM card corresponding to the user space to which the application belongs, that is, the application installed in each user space in the multi-user space can read the information on different SIM cards, but the application installed in each user space can read the information on the same SIM card, so that the privacy requirement of a user is facilitated, and the flexibility of multiple users is achieved.
After the method provided by the embodiment of the present disclosure is explained in detail by the embodiment shown in fig. 1 and fig. 2A, the apparatus provided by the embodiment of the present disclosure will be described.
Fig. 3 is a block diagram illustrating a device for reading SIM card information according to an exemplary embodiment. Referring to fig. 3, the apparatus includes a determination module 301 and a reading module 302.
A determining module 301, configured to determine, when at least two SIM cards are inserted, an SIM card corresponding to each user space in a multi-user space from the at least two SIM cards, where the multi-user space is obtained by dividing a storage space;
the reading module 302 is configured to, for any installed application, read corresponding information from a SIM card corresponding to a user space to which the application belongs when the application needs to acquire SIM card information.
Optionally, referring to fig. 4, the determining module 301 includes:
a first determining sub-module 3011, configured to determine a space identifier of each user space in the multi-user space;
the first obtaining sub-module 3012 is configured to obtain, based on the space identifier of each user space, a slot identifier corresponding to each user space from a correspondence between the stored space identifier and the slot identifier;
the second determining submodule 3013 is configured to determine, as the SIM card corresponding to each user space, the SIM card inserted into the card slot indicated by the card slot identifier corresponding to each user space.
Optionally, referring to fig. 5, the determining module 301 further includes:
the display sub-module 3014 is configured to, when receiving the setting instruction, display a space setting interface, where the space setting interface includes a space identifier of a multi-user space;
a second obtaining submodule 3015, configured to obtain a card slot identifier of a SIM card that is set by a user for each user space in the multi-user space;
the storage submodule 3016 is configured to store the space identifier of each user space in the multi-user space and the card slot identifier of the SIM card set for each user space in a corresponding relationship between the space identifier and the card slot identifier.
Alternatively, referring to fig. 6, the reading module 302 includes:
a third determining submodule 3021 configured to determine the UID of the application;
a fourth determining sub-module 3022, configured to determine, based on the UID of the application, a user ID to which the application belongs;
a fifth determining submodule 3023 configured to determine, from the multi-user space, a user space to which the application belongs based on the user ID to which the application belongs;
the first reading submodule 3024 is configured to read corresponding information from a SIM card corresponding to a user space to which the application belongs.
Optionally, referring to fig. 7, the reading module 302 further includes:
the second reading sub-module 3025 is configured to read, through a Telephony Manager interface, corresponding information from the SIM card corresponding to the user space to which the application belongs.
In the embodiment of the present disclosure, when at least two SIM cards are inserted into the terminal, the space identifier of each user space in the multi-user space is determined, and the card slot identifier corresponding to each user space is obtained from the correspondence between the stored space identifier and the card slot identifier, so that the SIM card corresponding to each user space in the multi-user space can be determined from the at least two SIM cards. Therefore, when any application installed in the multi-user space needs to acquire the information of the SIM card, the corresponding information can be read from the SIM card corresponding to the user space to which the application belongs, that is, the application installed in each user space in the multi-user space can read the information on different SIM cards, but the application installed in each user space can read the information on the same SIM card, so that the privacy requirement of a user is facilitated, and the flexibility of multiple users is achieved.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 8 is a block diagram illustrating a reading apparatus 800 for SIM card information according to an exemplary embodiment. For example, the apparatus 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 8, the apparatus 800 may include one or more of the following components: processing component 802, memory 804, power component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814, and communication component 816.
The processing component 802 generally controls overall operation of the device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operations at the apparatus 800. Examples of such data include instructions for any application or method operating on device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power components 806 provide power to the various components of device 800. The power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power supplies for the apparatus 800.
The multimedia component 808 includes a screen that provides an output interface between the device 800 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 800 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the apparatus 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the device 800. For example, the sensor assembly 814 may detect the open/closed status of the device 800, the relative positioning of components, such as a display and keypad of the device 800, the sensor assembly 814 may also detect a change in the position of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration/deceleration of the device 800, and a change in the temperature of the device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate communications between the apparatus 800 and other devices in a wired or wireless manner. The device 800 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the methods provided by the embodiments shown in fig. 1 or fig. 2A and described above.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 804 comprising instructions, executable by the processor 820 of the device 800 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
A non-transitory computer-readable storage medium in which instructions, when executed by a processor of a mobile terminal, enable the mobile terminal to perform a method of reading SIM card information, the method comprising:
when at least two SIM cards are inserted, determining the SIM card corresponding to each user space in a multi-user space from the at least two SIM cards, wherein the multi-user space is obtained by dividing a storage space;
for any installed application, when the application needs to acquire the SIM card information, reading corresponding information from the SIM card corresponding to the user space to which the application belongs.
Optionally, determining, from the at least two SIM cards, a SIM card corresponding to each user space in the multi-user space, includes:
determining a space identifier of each user space in the multi-user space;
based on the space identification of each user space, acquiring a card slot identification corresponding to each user space from the corresponding relation between the stored space identification and the card slot identification;
and determining the SIM card inserted into the card slot indicated by the card slot identification corresponding to each user space as the SIM card corresponding to each user space.
Optionally, before obtaining the card slot identifier corresponding to each user space from the stored correspondence between the space identifier and the card slot identifier based on the space identifier of each user space, the method further includes:
when a setting instruction is received, displaying a space setting interface, wherein the space setting interface comprises a space identifier of a multi-user space;
acquiring a card slot identifier of an SIM card set by a user aiming at each user space in a multi-user space;
and storing the space identifier of each user space in the multi-user space and the card slot identifier of the SIM card set for each user space into the corresponding relation between the space identifier and the card slot identifier.
Optionally, reading corresponding information from a SIM card corresponding to a user space to which the application belongs, including:
determining the UID of the application, and determining the user ID to which the application belongs based on the UID of the application;
and determining the user space to which the application belongs from the multi-user space based on the user ID to which the application belongs, and reading corresponding information from the SIM card corresponding to the user space to which the application belongs.
Optionally, reading corresponding information from a SIM card corresponding to a user space to which the application belongs, including:
and reading corresponding information from the SIM card corresponding to the user space to which the application belongs through a Telephony Manager interface.
In the embodiment of the present disclosure, when at least two SIM cards are inserted into the terminal, the space identifier of each user space in the multi-user space is determined, and the card slot identifier corresponding to each user space is obtained from the correspondence between the stored space identifier and the card slot identifier, so that the SIM card corresponding to each user space in the multi-user space can be determined from the at least two SIM cards. Therefore, when any application installed in the multi-user space needs to acquire the information of the SIM card, the corresponding information can be read from the SIM card corresponding to the user space to which the application belongs, that is, the application installed in each user space in the multi-user space can read the information on different SIM cards, but the application installed in each user space can read the information on the same SIM card, so that the privacy requirement of a user is facilitated, and the flexibility of multiple users is achieved.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (4)

1. A method for reading SIM card information of a subscriber identity module is applied to a terminal, and is characterized by comprising the following steps:
when at least two SIM cards are inserted, determining an SIM card corresponding to each user space in a multi-user space from the at least two SIM cards, wherein the multi-user space is obtained by dividing a storage space;
for any installed application, when the application needs to acquire SIM card information, determining an identity UID of the application, and determining a user identity userID to which the application belongs through a conversion relation based on the UID of the application, wherein the UID is an identity allocated to each application when an operating system is started, the user ID is a user identity, and a conversion relation exists between the UID of each application and the user ID to which each application belongs;
determining a user space to which the application belongs from a stored corresponding relation between the userID and a space identifier based on the userID to which the application belongs, and reading corresponding information from an SIM card corresponding to the user space to which the application belongs through a Telephony Manager interface, wherein the corresponding relation between the userID and the space identifier is configured in advance, the user space to which the application to which the userID is a preset value belongs is a main space, the main space is a storage space of an owner of the terminal, and the userID is a user space to which other applications belong is other user spaces;
the determining the SIM card corresponding to each user space in the multi-user space from the at least two SIM cards includes:
determining a space identifier of each user space in the multi-user space; based on the space identifier of each user space, acquiring a card slot identifier corresponding to each user space from the corresponding relation between the stored space identifier and the card slot identifier, wherein the card slot identifier is used for indicating the serial number of a card slot in which different SIM cards are inserted in the terminal; determining the SIM card inserted into the card slot indicated by the card slot identifier corresponding to each user space as the SIM card corresponding to each user space, wherein each card slot identifier corresponds to one space identifier or space identifiers of a plurality of other user spaces;
before obtaining the slot identifier corresponding to each user space from the stored correspondence between the space identifier and the slot identifier based on the space identifier of each user space, the method further includes:
when a setting instruction is received, displaying a space setting interface, wherein the space setting interface comprises a space identifier of the multi-user space; acquiring a card slot identifier of an SIM card set by a user aiming at each user space in the multi-user space; and storing the space identifier of each user space in the multi-user space and the card slot identifier of the SIM card set for each user space into the corresponding relation between the space identifier and the card slot identifier.
2. A reading device of SIM card information is applied to a terminal, and is characterized in that the device comprises:
the device comprises a determining module and a judging module, wherein the determining module is used for determining an SIM card corresponding to each user space in a multi-user space from at least two SIM cards when at least two SIM cards are inserted, and the multi-user space is obtained by dividing a storage space;
the reading module is used for reading corresponding information from the SIM card corresponding to the user space to which the application belongs when the application needs to acquire the SIM card information for any installed application;
the reading module includes:
a third determining submodule, configured to determine an identity UID of the application;
a fourth determining submodule, configured to determine, based on the UID of the application, a userID to which the application belongs through a conversion relationship, where the UID is an identifier allocated to each application when an operating system is started, the userID is a user identity identifier, and a conversion relationship exists between the UID of each application and the user ID to which each application belongs;
a fifth determining sub-module, configured to determine, based on a userID to which the application belongs, a user space to which the application belongs from a stored correspondence between the userID and a space identifier, where the correspondence between the userID and the space identifier is configured in advance, the user space to which the application to which the userID is a preset value belongs is a main space, the main space is a storage space of an owner of the terminal, and the user space to which the other application belongs is another user space;
the first reading sub-module is used for reading corresponding information from the SIM card corresponding to the user space to which the application belongs through a Telephony Manager interface;
the determining module comprises:
a first determining submodule, configured to determine a space identifier of each user space in the multi-user space;
the first obtaining submodule is used for obtaining a card slot identifier corresponding to each user space from a corresponding relation between a stored space identifier and a card slot identifier based on the space identifier of each user space, and the card slot identifier is used for indicating the serial number of a card slot for inserting different SIM cards in the terminal;
the second determining submodule is used for determining the SIM card inserted into the card slot indicated by the card slot identifier corresponding to each user space as the SIM card corresponding to each user space, and each card slot identifier corresponds to one space identifier or space identifiers of a plurality of other user spaces;
the determining module further comprises:
the display sub-module is used for displaying a space setting interface when a setting instruction is received, wherein the space setting interface comprises a space identifier of the multi-user space;
the second obtaining submodule is used for obtaining the card slot identifier of the SIM card set by the user aiming at each user space in the multi-user space;
the storage submodule is used for storing the space identifier of each user space in the multi-user space and the card slot identifier of the SIM card set for each user space into the corresponding relation between the space identifier and the card slot identifier;
the reading module further includes:
and the second reading submodule is used for reading corresponding information from the SIM card corresponding to the user space to which the application belongs through a Telephony Manager interface.
3. An apparatus for reading SIM card information, the apparatus comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to perform the steps of the method for reading subscriber identity module, SIM, card information of claim 1.
4. A computer-readable storage medium having stored thereon instructions, which when executed by a processor, carry out the steps of the method for reading SIM card information of a subscriber identity module according to claim 1.
CN201710486556.XA 2017-06-23 2017-06-23 SIM card information reading method and device and computer readable storage medium Active CN107368763B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710486556.XA CN107368763B (en) 2017-06-23 2017-06-23 SIM card information reading method and device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710486556.XA CN107368763B (en) 2017-06-23 2017-06-23 SIM card information reading method and device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN107368763A CN107368763A (en) 2017-11-21
CN107368763B true CN107368763B (en) 2021-01-26

Family

ID=60305069

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710486556.XA Active CN107368763B (en) 2017-06-23 2017-06-23 SIM card information reading method and device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN107368763B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2413456Y (en) * 2000-02-15 2001-01-03 杨金林 Multi-user recognition modular mobile telephone
CN2479691Y (en) * 2001-04-20 2002-02-27 北京邮电通信设备厂 Mobile telephone set with double-user identification module
CN102123379A (en) * 2011-03-11 2011-07-13 华为终端有限公司 User card switching method and device and mobile terminal
CN105472599A (en) * 2015-11-11 2016-04-06 中国联合网络通信集团有限公司 Method for accessing SIM cards and double-card mobile terminal

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1180596C (en) * 2002-01-25 2004-12-15 华为技术有限公司 Method for realizing one card multiuser in mobile communication terminal
KR20150009025A (en) * 2013-07-08 2015-01-26 삼성전자주식회사 Device and method for controlling multi-user authority in portable terminal
CN103428370B (en) * 2013-08-23 2015-07-01 上海华勤通讯技术有限公司 Mobile phone and multi-user control method thereof
CN104468986A (en) * 2014-11-20 2015-03-25 深圳市世纪安软信息技术有限公司 Multi-user operation mode managing method and system for mobile phone

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2413456Y (en) * 2000-02-15 2001-01-03 杨金林 Multi-user recognition modular mobile telephone
CN2479691Y (en) * 2001-04-20 2002-02-27 北京邮电通信设备厂 Mobile telephone set with double-user identification module
CN102123379A (en) * 2011-03-11 2011-07-13 华为终端有限公司 User card switching method and device and mobile terminal
CN105472599A (en) * 2015-11-11 2016-04-06 中国联合网络通信集团有限公司 Method for accessing SIM cards and double-card mobile terminal

Also Published As

Publication number Publication date
CN107368763A (en) 2017-11-21

Similar Documents

Publication Publication Date Title
CN106020943B (en) Application program double-opening method and device
CN107315609B (en) Switching method and device of card simulation function
CN107370772B (en) account login method and device and computer readable storage medium
CN110231901B (en) Application interface display method and device
EP3713327B1 (en) Method for indicating frequency-domain information of common control resource set of remaining minimum system information
CN114554571B (en) Network slice using method and device
US20220256497A1 (en) Methods and apparatuses for receiving paging signaling, and methods and apparatuses for transmitting paging signaling
CN107094094B (en) Application networking method and device and terminal
CN106886416B (en) Multi-user spatial processing method and device
EP3713325A1 (en) Communication link configuration method and device
CN105554215A (en) Automatic selection dialing method and device, and mobile terminal
CN106535166B (en) Data service processing method and device
CN104951522B (en) Method and device for searching
US20170075671A1 (en) Method and apparatus for installing application and smart device using the same
CN107656616B (en) Input interface display method and device and electronic equipment
CN109429567B (en) Signal transmission method and signal transmission device
CN106506808B (en) Method and device for prompting communication message
CN107885464B (en) Data storage method, device and computer readable storage medium
CN111225111A (en) Function control method, function control device, and storage medium
CN107395760B (en) Method and device for loading configuration file
CN107070816B (en) Application identification method and device and mobile terminal
CN107368763B (en) SIM card information reading method and device and computer readable storage medium
CN107315625B (en) SIM card information reading method and device and computer readable storage medium
CN108718450B (en) Telephone card control method, device, storage medium and mobile terminal
CN107708106B (en) User identification card management method and user identification card management device

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