Processing method and device based on remote access to subscriber identity module SIM card
By establishing a communication connection between the first device and the second device and utilizing a predefined card file set and cache mechanism, the problems of slow SIM card loading and high energy consumption are solved, and fast loading and secure access to remote SIM cards are achieved.
Patent Information
- Application Number
- CN202211521386.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-30
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2042-11-30
AI Technical Summary
In the prior art, users need to manually remove and insert the card to switch the SIM card, which makes it impossible for remote devices to access the SIM card, resulting in slow SIM card loading and high energy consumption.
By establishing a communication connection between the first device and the second device, a card file requesting access to the SIM card of the second device is obtained, and a predefined card file set and cache mechanism are used to reduce unnecessary card file reading and realize remote and fast loading of the SIM card.
It improves the SIM card loading speed, reduces energy consumption, and ensures the security of card file information and the normal operation of services.
Smart Images

Figure CN118118887B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a processing method and device based on remote access to a SIM card. Background Art
[0002] A subscriber identity module (SIM) is a module in a wireless cellular communication system that provides user information, enables access to the mobile cellular network, and supports SIM-related functions. For example, an electronic device with a SIM card slot and card reader can register with the mobile cellular network using an inserted SIM card. This means that the cellular communication system can identify specific user information through the SIM card.
[0003] Typically, when a user wants to switch their SIM card to another electronic device, they need to manually remove and insert the card so that the other electronic device can access the SIM card. However, manually removing and inserting the card to switch SIM cards cannot support the remote device's request to access the SIM card. Summary of the Invention
[0004] The embodiments of the present application provide a processing method and apparatus based on remote access to a SIM card, so that a first device can quickly load a SIM card during the process of accessing the SIM card of a second device.
[0005] In a first aspect, an embodiment of the present application provides a processing method based on remote access to a user identification module (SIM) card, the method comprising: establishing a communication connection between a first device and a second device; the first device obtaining a first request; the first request being used to request access to a first card file in a first SIM card of the second device, the first request carrying a first identifier corresponding to the first card file; when the first device determines that the first identifier is included in a first set, the first device obtaining response data corresponding to the first request, and processing a first service based on the response data corresponding to the first request; wherein the number of card files indicated in the first set is less than the number of card files in the first SIM card. Since the number of card files indicated in the first set is less than the total number of card files in the first SIM card, the first device can determine whether the first card file is included in the first set, thereby enabling the first device to read the portion of card files in the SIM card of the second device that meet the first set, thereby reducing energy consumption caused by the first device reading all card files in the SIM card of the second device and accelerating SIM card loading.
[0006] Among them, the first request can be an APDU request, and the response data corresponding to the first request can be an APDU result; the first set can be the target type set described in the embodiment of the present application.
[0007] In one possible implementation, the method further includes: the first device sending a second request to the second device; the second request being used to instruct the first device to request remote access to the first SIM card; and the first device obtaining the first request, including: upon the first device receiving response data corresponding to the second request from the second device, the first device obtaining the first request; wherein the response data corresponding to the second request is used to instruct the second device to allow the first device to remotely access the first SIM card. In this way, when the first device remotely accesses the first SIM card in the second device, the SIM card loading speed can be accelerated, thereby reducing the time consumption of remote SIM card access.
[0008] The second request may be the rSIM request described in the embodiment of the present application, and the response data corresponding to the second request may be the rSIM response described in the embodiment of the present application.
[0009] In one possible implementation, the card files indicated in the first set include files that do not support updating of the card files by the device and files that support reading of the card files by the device. This allows the first device to quickly load card files that do not support updating and card files that support reading, thereby improving the SIM card loading speed while ensuring the security of information in the card files.
[0010] In one possible implementation, when the first device determines that the first identifier is included in the first set, the first device obtains response data corresponding to the first request, including: when the first device determines that the first identifier is included in the first set and the cached first card file is not found in the first device, the first device sends the first request to the second device; the first device receives the response data corresponding to the first request from the second device.
[0011] In one possible implementation, when the first device determines that the first identifier is included in the first set, the first device obtains response data corresponding to the first request. The method further includes: when the first device determines that the first identifier is included in the first set and finds the first card file cached in the first device, the first device generates response data corresponding to the first request using the first card file. In this way, the first device can provide a caching mechanism, allowing the first device to read the card file locally cached, reducing the time consumed by remotely accessing the SIM card to read the card file.
[0012] In one possible implementation, before the first device sends the first request to the second device, the method further includes: the first device recording the first identifier and the second identifier corresponding to the first card file; after the first device receives the response data corresponding to the first request from the second device, the method further includes: the first device obtaining the first card file from the response message corresponding to the first request based on the first identifier, and caching the first card file based on the second identifier. In this way, the setting of the first identifier and the second identifier enables the first device to determine whether the card file needs to be cached when receiving the card file returned by the second device, and to improve the subsequent loading speed of the card file by the first device by caching the card file.
[0013] Among them, the second identifier can be the cache identifier described in the embodiment of the present application.
[0014] In one possible implementation, the first device includes a remote SIM service module. Caching the first card file includes caching the first card file in the remote SIM service module or caching the first card file in a preset file or database of the first device. This allows the first device to properly store the card file, allowing it to retrieve the required card file in the cache, reducing frequent remote access to the card file and improving SIM card loading speed.
[0015] In a possible implementation, the first identifier is a file identifier FID or a short file identifier SFI; the first device includes: a mapping relationship between the first FID corresponding to the first card file and the first SFI corresponding to the first card file.
[0016] In one possible implementation, the first set includes the second set, the card file indicated in the second set is the card file corresponding to the target service, the target service is a service allowed to be executed during the process of the first device remotely accessing the first SIM card, and the target service includes the first service.
[0017] Among them, the second set can be the whitelist described in the embodiment of this application.
[0018] In one possible implementation, the second set includes: a card file determined when the user selects a first service. The method further includes: the first device displaying a first interface; wherein the first interface includes: a first control for setting the second set; in response to an operation on the first control, the first device displays a second interface; the second interface includes: at least one second control corresponding to at least one second service; the at least one second control includes: a third control corresponding to the first service; in response to an operation on the third control, the first device determines the second set based on the card file corresponding to the first service. In this way, the first device can support the user's selection of a service and determine the second set, thereby accelerating SIM card loading while ensuring normal service operation.
[0019] The first interface can be Figure 7 In the interface shown in b, the first control may be control 702; the second interface may be Figure 7 In the interface shown in c, the second control can be Figure 7 The control corresponding to the business in c in , the third control can be a control corresponding to any business.
[0020] In one possible implementation, the method further includes: when the first device determines that the first identifier is not included in the second set, the first device does not process the first service. In this way, the first device can also increase the SIM card loading speed by reducing access to files unrelated to the service.
[0021] In one possible implementation, a first device includes: a remote SIM service module and a modem; the first device obtains a first request, including: the modem obtains the first request and sends the first request to the remote SIM service module; when the first device determines that the first identifier is included in a first set, the first device obtains response data corresponding to the first request, and processes a first service based on the response data corresponding to the first request, including: when the remote SIM service module determines that the first identifier is included in the first set, the remote SIM service module obtains the response data corresponding to the first request, and when the modem receives the response data corresponding to the first request from the remote SIM service module, the modem processes the first service based on the response data corresponding to the first request.
[0022] In a possible implementation, the first request is an application protocol data unit (APDU) request.
[0023] In a second aspect, an embodiment of the present application provides a processing device based on a remote access user identification module SIM card, the device including a communication unit and a processing unit: the communication unit is used to establish a communication connection with a second device; the processing unit is used to obtain a first request; the first request is used to request access to a first card file in a first SIM card of the second device, and the first request carries a first identifier corresponding to the first card file; the processing unit is also used to obtain response data corresponding to the first request when it is determined that the first identifier is included in the first set, and process the first service based on the response data corresponding to the first request; wherein the number of card files indicated in the first set is less than the number of card files in the first SIM card.
[0024] In one possible implementation, the communication unit is further used to: send a second request to the second device; the second request is used to instruct the first device to request remote access to the first SIM card; when the communication unit receives response data corresponding to the second request from the second device, the processing unit is used to obtain the first request; wherein the response data corresponding to the second request is used to instruct the second device to allow the first device to remotely access the first SIM card.
[0025] In a possible implementation, the card files indicated in the first set are: files that do not support the device updating the card files, and files that support the device reading the card files.
[0026] In one possible implementation, when the processing unit determines that the first identifier is included in the first set and the cached first card file is not found in the first device, the communication unit is also used to send a first request to the second device; the communication unit is also used to receive response data corresponding to the first request from the second device.
[0027] In a possible implementation, when the first device determines that the first identifier is included in the first set and finds the cached first card file in the first device, the processing unit is further configured to generate response data corresponding to the first request using the first card file.
[0028] In one possible implementation, the processing unit is further used to record the first identifier and the second identifier corresponding to the first card file; the processing unit is further used to obtain the first card file from the response message corresponding to the first request based on the first identifier, and cache the first card file based on the second identifier.
[0029] In a possible implementation, the first device includes a remote SIM service module: caching the first card file includes caching the first card file in the remote SIM service module, or caching the first card file in a preset file or preset database of the first device.
[0030] In a possible implementation, the first identifier is a file identifier FID or a short file identifier SFI; the first device includes: a mapping relationship between the first FID corresponding to the first card file and the first SFI corresponding to the first card file.
[0031] In one possible implementation, the first set includes the second set, the card file indicated in the second set is the card file corresponding to the target service, the target service is a service allowed to be executed during the process of the first device remotely accessing the first SIM card, and the target service includes the first service.
[0032] In one possible implementation, the second set includes: a card file determined when the user selects the first service, and a display unit for displaying the first interface; wherein the first interface includes: a first control for setting the first set; in response to an operation on the first control, the display unit is also used to display the second interface; the second interface includes: at least one second control corresponding to at least one second service; the at least one second control includes: a third control corresponding to the first service; in response to an operation on the third control, the processing unit is also used to determine the first set based on the card file corresponding to the first service.
[0033] In a possible implementation, when the processing unit determines that the first identifier is not included in the second set, the processing unit is further configured not to process the first service.
[0034] In one possible implementation, a first device includes: a remote SIM service module and a modem processor; the first device obtains a first request, including: a communication unit, configured to obtain the first request and send the first request to the remote SIM service module; when the processing unit determines that the first identifier is included in the first set, the processing unit is further configured to obtain response data corresponding to the first request; when the communication unit receives the response data corresponding to the first request from the remote SIM service module, the processing unit is further configured to process the first service based on the response data corresponding to the first request.
[0035] In a possible implementation, the first request is an application protocol data unit (APDU) request.
[0036] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the computer program, the electronic device executes the method described in the first aspect or any one of the implementations of the first aspect.
[0037] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores instructions. When the instructions are executed, the computer executes the method described in the first aspect or any implementation of the first aspect.
[0038] In a fifth aspect, a computer program product includes a computer program, which, when executed, enables a computer to execute the method described in the first aspect or any one of the implementations of the first aspect.
[0039] It should be understood that the second to fifth aspects of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 A schematic diagram of a card file provided in an embodiment of the present application;
[0041] Figure 2 A schematic diagram of a scenario provided in an embodiment of the present application;
[0042] Figure 3 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0043] Figure 4 A schematic diagram of the system architecture of a processing method based on remote access to a SIM card provided in an embodiment of the present application;
[0044] Figure 5 A flowchart of a method for remotely accessing a SIM card provided in an embodiment of the present application;
[0045] Figure 6 A schematic diagram of a process for quickly loading a SIM card provided in an embodiment of the present application;
[0046] Figure 7 A schematic diagram of an interface for setting a whitelist provided in an embodiment of the present application;
[0047] Figure 8 A schematic structural diagram of a processing device for remotely accessing a SIM card provided in an embodiment of the present application;
[0048] Figure 9 A schematic diagram of the structure of a chip provided in an embodiment of the present application. DETAILED DESCRIPTION
[0049] In order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. For example, the first value and the second value are merely used to distinguish different values and do not limit their order. Those skilled in the art will understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit different values.
[0050] It should be noted that, in this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this application as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0051] In this application, "at least one" means one or more, and "more" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can mean: a, b, c, a and b, a and c, b and c, or a, b and c, where a, b, c can be single or multiple.
[0052] The SIM card described in the embodiment of the present application can be a physical card (or hard card) or a virtual SIM card (or soft card), such as an embedded chip-type user identity card (embedded-SIM, eSIM), etc. The specific form of the SIM card is not limited in the embodiment of the present application.
[0053] The modem described in the embodiments of this application runs on a baseband chip and a coprocessor. The modem is equipped with a SIM card module, which can be used to provide network registration, authentication, and other SIM information-related functions. For example, when using an electronic device equipped with a modem, a user can trigger a local application to implement a series of SIM card functions. Alternatively, the user can remotely access the SIM card of another electronic device through the remote SIM function, enabling the local device to implement a series of SIM card functions.
[0054] The remote SIM function described in the embodiment of the present application can be understood as a method for enabling a local device to access the SIM card in another device. For example, a first device can initiate a request to a second device to access the SIM card in the second device. The second device can send the SIM card information of the second device to the first device when allowing the first device to remotely access the SIM card, so that the first device can use the SIM card information of the second device to register the cellular network. Among them, the SIM card in the second device that is remotely accessed by the first device can also be called a remote SIM card. The specific implementation of the remote SIM function can be found in Figure 4 The description in the corresponding embodiments will not be repeated here.
[0055] The SIM card file (or card file) described in the embodiments of the present application can be used to store information related to the SIM card. Typically, a SIM card may include: a master file (MF), a dedicated file (DF), and an elementary file (EF).
[0056] There is only one MF in a SIM card. All files in the SIM card except the MF are subfiles of the MF. A DF may include DF and EF belonging to the same function.
[0057] Among them, the application definition file (ADF) is a special DF. The ADF may include the DF and EF belonging to a unified application. A SIM card may include multiple ADFs. Each time the SIM card file is used, one of the ADF files may be mainly used.
[0058] The EF may include a directory (DIR) file. The DIR is a file under the MF used to determine the ADF stored in the current SIM card. The DIR file may store the application identifier (AID) of the APP in the SIM card.
[0059] For example, the main file 3F00 is used as an example to illustrate various types of files included in the SIM card file. Figure 1 This is a schematic diagram of a card file provided in an embodiment of the present application. Figure 1 As shown, the SIM card may include: MF, which may include: EF5, EF6, EF4, DF1, and DF2. DF1 may include: EF7, DF11, and DF12; DF2 may include: EF2 and EF3. DF11 may include: DF111; and DF12 may include: EF1.
[0060] The following describes the use scenario of the processing method based on remote access to SIM card provided in the embodiment of the present application. Figure 2 A schematic diagram of a scenario provided in an embodiment of the present application. The processing method based on remote access to a SIM card provided in an embodiment of the present application can be applied to Figure 2 The scene shown.
[0061] like Figure 2 As shown, this scenario may include: a first device (or client) placed at work, and a second device (or server) placed at home with a SIM card inserted. The first device may be a smartwatch 202, tablet 203, or mobile phone 204, etc.; the second device may be a mobile phone 201, etc. The specific form of the first device or the second device is not limited in the embodiments of this application.
[0062] When the user at the company determines that he has left the mobile phone 201 at home and needs to use the SIM card of the mobile phone 201, it is difficult to use the mobile phone 204 to access the SIM card of the mobile phone 201 at home by plugging and unplugging the card.
[0063] Therefore, the embodiment of the present application can provide a method for remotely accessing a SIM card, so that the mobile phone 204 placed at the company can access the SIM card of the mobile phone 201 placed at home. In the process of mobile phone 204 remotely accessing the SIM card of mobile phone 201, mobile phone 201 needs to exchange approximately 50-100 different SIM card information with mobile phone 204, and usually mobile phone 204 needs to access different SIM card information in mobile phone 201 in sequence through a serial access mechanism of sending an application protocol data unit (APDU) request, receiving an APDU response corresponding to the APDU request, and sending the next APDU request and receiving the APDU response corresponding to the next APDU request.
[0064] However, the two-way transmission delay for completing an APDU request and an APDU response can typically be 200-300 milliseconds (ms). Therefore, based on the APDU request and the APDU response, the total time required to read all SIM card information in the SIM card of the second device and then complete a remote SIM card loading can be at least 10 seconds (s). The SIM card loading time is long, and the long SIM card loading time also brings inconvenience to users when using the remote SIM function.
[0065] In view of this, an embodiment of the present application provides a processing method based on remote access to a SIM card, so that before initiating a first request to a second device, a first device can determine whether the first card file accessed in the first request is included in a first set, and obtain a response message corresponding to the first request if it is determined that the first card file belongs to the first set. Since the number of card files indicated in the first set is less than the total number of card files in the SIM card of the second device, the first device can read the portion of the card files in the SIM card of the second device that meet the first set by determining whether the first card file is included in the first set, thereby reducing the energy consumption caused by the first device reading all the card files in the SIM card of the second device.
[0066] It is understandable that in Figure 2 In the far-field scenario shown, the second device and the first device can both connect to the communication service cloud to implement functions such as data exchange, device authentication, and data channel establishment between the first and second devices. In possible implementations, the processing method based on remote access to a SIM card provided in the embodiments of the present application can also be applied to near-field scenarios, which is not limited in the embodiments of the present application.
[0067] The first device (or second device) described in the embodiments of the present application may also be referred to as: user equipment (UE), mobile station (MS), mobile terminal (MT), etc. The first device (or second device) may be: a mobile phone, a smart TV, a wearable device, a tablet computer (Pad), a computer with wireless transceiver function, a virtual reality (VR) device, an augmented reality (AR) device, a wireless terminal in industrial control (industrial control), a wireless terminal in self-driving (self-driving), a wireless terminal in remote medical surgery (remote medical surgery), a wireless terminal in a smart grid (smart grid), a wireless terminal in transportation safety (transportation safety), a wireless terminal in a smart city (smart city), a wireless terminal in a smart home (smart home), etc. The embodiments of the present application do not limit the specific technology and specific device form adopted by the first device (or second device).
[0068] In order to more clearly describe the contents of the embodiments of the present application, the hardware structure of the first device and the hardware structure of the second device involved in the embodiments of the present application are introduced below.
[0069] For example, Figure 3 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.
[0070] It is understandable that Figure 3 The electronic device shown may be the first device or the second device in the embodiment of the present application, and the electronic device includes a modem 210A and a SIM card interface 295, in which a SIM card may be inserted. Figure 3 When the electronic device shown is the first device described in the embodiment of the present application, the first device may be provided with a modem 210A; Figure 3 When the electronic device shown is the second device described in the embodiment of the present application, the second device may be provided with a SIM card interface 295 .
[0071] The hardware structure of the first device and the hardware structure of the second device may be the same or different, which is not limited in the embodiments of the present application. The first device may also be referred to as a user terminal for accessing a remote SIM card, and the second device may also be referred to as a server for providing a SIM card to the first device.
[0072] In an embodiment of the present application, the electronic device may include a processor 210, an external memory interface 220, an internal memory 231, a universal serial bus (USB) interface 230, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a sensor module 280, a camera 293, a display screen 294, and a SIM card interface 295, etc.
[0073] It should be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than shown, or may combine or separate certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0074] The processor 210 may also include a memory for storing instructions and data.
[0075] It is understood that the interface connection relationship between the modules illustrated in this embodiment is only a schematic illustration and does not constitute a structural limitation of the electronic device. In other embodiments of the present application, the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0076] The wireless communication function of the electronic device can be implemented through antenna 1, antenna 2, mobile communication module 250, wireless communication module 260, modem 210A and baseband processor.
[0077] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals.
[0078] The mobile communication module 250 can provide solutions for wireless communications, including 2G / 3G / 4G / 5G, applied to electronic devices. The mobile communication module 250 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. In some embodiments, at least some of the functional modules of the mobile communication module 250 may be provided in the processor 210. In some embodiments, at least some of the functional modules of the mobile communication module 250 may be provided in the same device as at least some of the modules of the processor 210.
[0079] Modem 210A may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker, a receiver, etc.) or displays an image or video through the display screen 294. In some embodiments, modem 210A may be an independent device. In other embodiments, modem 210A may be independent of processor 210 and be provided in the same device as mobile communication module 250 or other functional modules.
[0080] The wireless communication module 260 can provide wireless communication solutions for electronic devices, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc.
[0081] The SIM card interface 295 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device by inserting it into or removing it from the SIM card interface 295. When the electronic device is a first device, the first device can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 295 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 295 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 295 can also be compatible with different types of SIM cards. The SIM card interface 295 can also be compatible with external memory cards. Electronic devices interact with the network through SIM cards to implement functions such as calls and data communications. In some embodiments, the electronic device uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device and cannot be separated from the electronic device.
[0082] In addition, the electronic device also runs an operating system on top of the above components. For example, the operating system may include one or more of the following, such as the iOS operating system, the Android operating system, or the Windows operating system. Applications can be installed and run on the operating system.
[0083] For example, Figure 4 A schematic diagram of a system architecture for a remote access SIM card processing method provided in an embodiment of the present application. The system architecture for the remote access SIM card processing method may involve a first device and a second device, and a communication connection may be established between the first device and the second device via a communication service cloud.
[0084] like Figure 4 As shown, in some embodiments, the layered architecture of the first device divides the software into several layers, each with clear roles and divisions of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into multiple layers, from top to bottom, namely the application layer, the application framework layer, the radio interface layer (RIL), and the modem.
[0085] The application layer can include a series of applications. Figure 4 As shown, the application package includes: SIM card management application 4001, navigation, Bluetooth and short message applications. In the embodiment of the present application, the SIM card management application 4001 is used to provide a management interface for remote SIM functions.
[0086] The application framework layer provides application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions. Figure 4 As shown, the application framework layer may include a telephone manager (telephony) 4002, a remote SIM service module 4012, and the like.
[0087] The phone manager 4002 is used to provide the SIM card function of the first device. For example, the phone manager 4002 is used to provide call status management (including answering and hanging up, etc.).
[0088] The remote SIM service module 4012 is used to forward the instruction issued by the RIL for accessing the SIM card of the second device (or called a remote SIM request, or rSIM request, or a second request) to the remote SIM service module 4015 of the second device; alternatively, the remote SIM service module 4012 is also used to forward the response data rSIM response (or called a remote SIM response, or rSIM response) corresponding to the rSIM request sent by the remote SIM service module 4015 of the second device to the RIL.
[0089] In a possible implementation, the remote SIM service module 4012 may include: a remote SIM access interface adaptation module, a SIM connection management module, a SIM instruction encoding and decoding module, and a RIL interface proxy module.
[0090] Remote SIM access interface adapter module: can be used to adapt the remote SIM access and control interfaces of RIL modules of different chip manufacturers. It is understandable that different chip manufacturers have different definitions of the rSIM HIDL interface 4011, and the data structure of the messages carried therein may also be different. Therefore, the remote SIM access interface adapter module can implement the normal call of the rSIM request. Among them, the remote SIM access interface adapter module can also be set in the remote SIM RIL module 4010 in the RIL layer, and its function is not repeated here.
[0091] SIM connection management module: used to implement a device connection function between the first device and the second device based on rSIM-related instructions. The rSIM-related instructions may include rSIM requests.
[0092] SIM command encoding and decoding module: used to implement the encoding function for rSIM-related commands to be sent and the decoding function for received rSIM-related commands.
[0093] RIL interface proxy module: used to connect to the rSIM HIDL interface 4011 to implement functions such as receiving or forwarding data plane messages and control plane messages.
[0094] Distributed bus 4013 is used to establish a connection channel between the remote SIM service module 4012 of the first device and the remote SIM service module 4015 of the second device, connecting the remote SIM service module 4012 of the first device and the remote SIM service module 4015 of the second device. In some embodiments, distributed bus 4013 can be responsible for device discovery, self-connection, and authentication management for devices under the same account in close proximity, within a local area network, or over long distances. Distributed bus 4013 can also be responsible for scheduling and managing different channels, assessing service quality, and other aspects, transparently to the application layer. Distributed bus 4013 can also be responsible for maintaining channels and providing low-power standby mechanisms.
[0095] In a possible implementation, the application framework layer may also include: a window manager, a notification manager, a content manager, a view system, and a resource manager, etc. ( Figure 4 (not shown in the figure), which is not limited in the embodiments of the present application.
[0096] The window manager manages window applications. It can determine the display size, determine whether a status bar exists, lock the screen, touch the screen, drag the screen, and take screenshots. The notification manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically, requiring no user interaction. For example, the notification manager is used to notify applications of download completions and message reminders. The content provider stores and retrieves data and makes it accessible to applications. This data can include video, images, audio, incoming and outgoing calls, browsing history and bookmarks, and the phone book. The view system includes visual controls, such as those that display text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text message notification icon might include a view that displays text and a view that displays images. The resource manager provides applications with various resources, such as localized strings, icons, images, layout files, and video files.
[0097] The RIL is responsible for providing telephone services and serves as an intermediate layer between upper-layer applications and lower-layer modems, responsible for reliable data transmission. The RIL may include a radio interface layer daemon (RILD), which may include a native RIL service module (or standard RIL service module) 4004 and a remote SIM RIL module 4010.
[0098] Native RIL service module 4004: used to forward the rSIM request sent by the telephony manager 4002 via the HIDL interface 4003 to the modem, and forward the rSIM response returned by the modem to the telephony manager 4002. The communication interface between the native RIL service module 4004 and the modem can be a conventional communication interface between a RIL service module and a modem.
[0099] Remote SIM RIL module 4010: used to forward the rSIM request sent by the modem via the rSIM interface 4008 to the remote SIM service module 4012 via the rSIM HIDL interface 4011; and forward the rSIM response sent by the remote SIM service module 4012 via the rSIM HIDL interface 4011 to the modem via the rSIM interface 4008.
[0100] The remote SIM RIL module 4010 may include an rSIM request processing module 4009. The rSIM request processing module 4009 is configured to perform message processing on the rSIM request. For example, the rSIM request processing module 4009 is configured to parse the rSIM request sent by the modem and convert it into a message type that can be processed by the rSIM HIDL interface 4011; or, the rSIM request processing module 4009 is further configured to parse the rSIM response transmitted via the rSIM HIDL interface 4011 and convert it into a message type that can be recognized by the modem.
[0101] The modem includes: a SIM card module 4005, a local SIM card module 4006, a remote SIM card module 4007, and a SIM card slot driver 4025. The SIM card slot driver 4025 may be connected to a SIM hard card 4026, or the first device may not have a SIM card.
[0102] SIM card module 4005: used to provide network registration, authentication and other SIM information related functions. The SIM card module 4005 can support two SIM card calling modes, such as the local SIM card calling mode provided by the local SIM card module 4006 and the remote SIM card calling mode provided by the remote SIM card module 4007.
[0103] Local SIM card module 4006: used to use the SIM card slot driver to access local SIM card information.
[0104] Remote SIM card module 4007: used to call a remote SIM card, for example, call the SIM card of the second device, to access the remote SIM card information.
[0105] In a possible implementation, the first device may also use a local eSIM or a remote SIM card, wherein the remote SIM card may be the SIM hard card 4022 of the second device.
[0106] like Figure 4 As shown, the layered architecture of the second device also divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into multiple layers, from top to bottom, including the application layer, application framework layer, RIL, and modem. Figure 4 In the second device, the application layer and the application framework layer can exchange data through a conventional interface; the application framework layer and the RIL can exchange data through a HIDL interface and an rSIM HIDL interface 4016; the RIL and the modem can exchange data through an rSIM interface 4019 and a conventional interface.
[0107] The application layer can include a series of applications. Figure 4 As shown, the application programs may include: SIM card management application, navigation, Bluetooth, short message application and the like.
[0108] The application framework layer provides application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions. Figure 4 As shown, the application framework layer may include a phone manager, and a remote SIM service module 4015 .
[0109] In some embodiments, the phone manager can be used to provide the SIM card function of the second device. For example, the phone manager 4002 is used to provide management of call status (including answering, hanging up, etc.).
[0110] The remote SIM service module 4015 is configured to forward the rSIM request sent by the first device to the remote SIM RIL module 4017 via the rSIM HIDL interface 4016, and forward the rSIM response to the first device via the distributed bus 4014. The modules included in the remote SIM service module 4015 and their functions can be found in the relevant description of the remote SIM service module 4012 and will not be repeated here. The principle and execution process of the distributed bus 4014 of the second device are similar to those of the distributed bus 4013 of the first device and will not be repeated here.
[0111] In a possible implementation, the application framework layer may also include: a window manager, a notification manager, a content manager, a view system, and a resource manager, etc. ( Figure 4 (not shown in the figure), which is not limited in the embodiments of the present application.
[0112] The RIL may include a native RIL service module and a remote SIM RIL module 4017. The remote SIM RIL module 4017 may include an rSIM request processing module 4018. It is understood that the other modules included in the RIL and their functions can be found in the relevant description of the RIL of the first device, and will not be repeated here.
[0113] The modem may include: a SIM card module 4024, a local SIM card module 4023, a remote SIM card module 4020, a SIM card slot driver 4021, and a SIM hard card 4022 connected to the SIM card slot driver 4021. The SIM hard card 4022 may be used to provide SIM card information to the first device. For other modules included in the modem and their functions, refer to the description of the modem in the first device and are not further described here.
[0114] It should be noted that although the embodiments of the present application are described using the Android system as an example, its basic principles are also applicable to electronic devices based on operating systems such as iOS or Windows.
[0115] based on Figure 4 For the first device and the second device described in the corresponding embodiment, the process of the first device initiating a rSIM request may be: when the SIM card management application 4001 of the first device receives an operation for accessing the SIM card of the second device, the SIM card management application 4001 in S4101 sends the rSIM request to the phone manager 4002; in S4102, the phone manager 4002 sends the rSIM request to the native RIL service module 4004 via the HIDL interface 4003; in S4103, the native RIL service module 4004 sends the rSIM request to the modem of the first device via a conventional interface. In S4104, the remote SIM card module 4007 of the modem sends the rSIM request to the remote SIM RIL module 4010 via the rSIM interface 4008; in S4105, the remote SIM RIL module 4010 sends the rSIM request to the remote SIM service module 4012 via the rSIM HIDL interface 4011; in S4106, the remote SIM service module 4012 of the first device uses the distributed bus 4013 of the first device and the distributed bus 4014 of the second device to send the rSIM request to the remote SIM service module 4015 of the second device.
[0116] Adaptively, the process of the second device returning the rSIM response may be: in S4107, when the remote SIM service module 4015 of the second device receives the rSIM request from the first device, the remote SIM service module 4015 of the second device sends the rSIM request to the remote SIM RIL module 4017 via the rSIM HIDL interface 4016; in S4108, the remote SIM RIL module 4017 may send the rSIM request to the remote SIM card module 4020 in the modem via the rSIM interface 4019; the remote SIM card module 4020 may obtain the SIM information in the SIM hard card 4022 through the SIM card slot driver 4021 and generate an rSIM response; in S4109, the remote SIM card module 4020 may send the rSIM response to the remote SIM RIL module 4017 via the rSIM interface 4019; in S4110, the remote SIM RIL module 4017 may send the rSIM request to the remote SIM card module 4020 in the modem via the rSIM interface 4019 HIDL interface 4016, the rSIM response is sent to the remote SIM service module 4015; in S4111, the remote SIM service module 4015 of the second device can send the rSIM response to the remote SIM service module 4012 of the first device through the distributed bus 4014 of the second device and the distributed bus 4013 of the first device; in S4112, the remote SIM service module 4012 can send the rSIM response to the remote SIM RIL module 4010 via the rSIM HIDL interface 4011; in S4113, the remote SIM RIL module 4010 can send the rSIM response to the remote SIM card module 4007 via the rSIM interface 4008. Further, the modem can also return the rSIM response to the SIM card management application 4001 based on the steps shown in S4114-S4116.
[0117] The following specific embodiments are used to describe in detail the technical solution of the present application and how the technical solution of the present application solves the above technical problems. The following specific embodiments can be implemented independently or in combination with each other. For the same or similar concepts or processes, some embodiments may not be described in detail.
[0118] Before introducing a processing method based on remote access to a SIM card provided in an embodiment of the present application, the process of remote access to a SIM card by a first device may be introduced first. For example, Figure 5 A flowchart of a method for remotely accessing a SIM card provided in an embodiment of the present application.
[0119] like Figure 5 As shown, the method for remotely accessing a SIM card may include the following steps:
[0120] S501: When a first device receives an operation from a user to enable a remote SIM function, a SIM card management application of the first device queries all available devices.
[0121] All available devices may be second devices that allow sharing of their own SIM cards. For example, the second device may be a device that allows other devices to share their own SIM cards by default, or may be a device that allows other devices to share their own SIM cards based on a user's triggering operation.
[0122] For example, when the second device shares its own SIM card, when the first device turns on the remote SIM function, the second device is in a state that can be discovered by other devices, and the identifier of the second device is displayed in the interface of the first device. There are many ways for the second device to be in a state that can be discovered by the first device, for example, when the second device turns on Bluetooth, it can be discovered by the first device that turns on Bluetooth, when the second device is connected to a local area network, it can be discovered by the first device in the local area network, when the second device is connected to a near-field network (such as a wireless network), it can be discovered by the first device in the near field, when the second device logs in to an account, it can be discovered by the first device under the account, etc. This is not limited in the embodiments of the present application.
[0123] S502: When the first device receives an operation by the user to select a second device from all available devices, the first device establishes a communication connection with the second device.
[0124] For example, the first device and the second device may establish a connection via a distributed bus. After the first device and the second device establish a connection via the distributed bus, the distributed communication bus may maintain the connection channel. The distributed bus may also be in a low-power standby mode while the first and second devices are connected, operating only when the distributed bus is needed for transmission and remaining in a low-power standby mode at all other times.
[0125] Possible implementations include Figure 4 As shown, the first device can send a device connection request to the second device via the distributed bus 4013 and the distributed bus 4014. In addition, the data interaction between the first device and the second device in the embodiment of the present application can be transmitted based on the above-mentioned distributed bus, which will not be described in detail below.
[0126] S503: The first device sends a rSIM request to the second device.
[0127] The rSIM request is used to indicate that the first device requests remote access to the SIM card of the second device.
[0128] The first device can be based on Figure 4The steps S4101-S4106 in the embodiment send the rSIM request to the second device; adapted, the second device may also return the rSIM request to the modem of the second device based on the steps S4107-S4108.
[0129] S504: The second device switches the SIM card mode to a remote server mode.
[0130] Remote service mode is used to instruct the SIM card slot driver of the second device to forward the SIM card information to the first device via the remote SIM service module instead of the local SIM processing module after reading the SIM card information. For example, after the modem of the second device receives the rSIM request, the modem can switch the SIM card mode to remote service mode.
[0131] S505: The second device sends an rSIM response to the first device.
[0132] The rSIM response is used to indicate that the second device allows the SIM card information of the second device to be shared with the first device, so that the first device can use the SIM card information of the second device to perform SIM card-related services.
[0133] Possible implementations include Figure 4 As shown, the second device may return the rSIM response to the first device based on the steps shown in S4109-S4111; adapted, the first device may return the rSIM response to the modem of the first device based on the steps shown in S4112-S4113.
[0134] S506: The first device switches the SIM card mode to a remote client mode.
[0135] Remote client mode is used to instruct the first device to read the SIM card information of the second device through a remote SIM card module, etc., instead of reading the SIM card information through the local SIM card slot driver. For example, when the modem of the first device receives the rSIM response, the modem can switch the SIM card mode to remote client mode.
[0136] S507: The first device sends an answer to reset (ATR) request to the second device.
[0137] Among them, the ATR request and the ATR response can be understood as instructions commonly used in the SIM card communication protocol. For example, the ATR request is used to request a signal agreement with the second device. The agreed content may include one or more of the following: high level valid or low level valid, communication rate, or voltage type, etc.
[0138] Possible implementations include Figure 4 As shown, the ATR request may be initiated by the modem of the first device and sent to the second device along the steps shown in S4104-S4106; suitably, the second device may send the ATR request to the modem of the second device along the steps shown in S4107-S4108.
[0139] S508: The second device sends an ATR response to the first device.
[0140] The ATR response may be understood as response data corresponding to the ATR request, and the ATR response may be generated by a modem of the second device.
[0141] In a possible implementation, when the modem of the second device receives the ATR request, it can generate an ATR response and return the ATR response to the first device based on the steps shown in S4109-S4111; optionally, the first device can return the ATR response to the modem of the first device based on the steps shown in S4112-S4113.
[0142] S509: The first device sends an application protocol data unit (APDU) request to the second device.
[0143] The APDU request is used to read the SIM card file of the second device, which may store the SIM card information of the second device. The APDU request may include: an identifier for indicating the card file to be read, such as a file identity (FID) or a short file identity (SFI).
[0144] In a possible implementation, the APDU request may also include: the maximum number of bytes of expected response data, the requested reading method and other contents, which are not limited in the embodiments of the present application.
[0145] S510: The second device sends an APDU response to the first device.
[0146] The APDU response can be understood as the response data corresponding to the APDU request. For example, when the APDU request is used to access a certain card file, the APDU response can include information about the card file.
[0147] It is understandable that when a first device loads the SIM card of a second device, the first device needs to exchange approximately 50-100 different pieces of SIM card information with the second device. Typically, a communication device (such as the first device) must follow a specific communication protocol to access a SIM card. Specifically, the communication device must follow a serial access mechanism that involves sending an APDU instruction, receiving an APDU response, sending the next APDU instruction, and receiving the next APDU response. Therefore, the first device can also remotely access the SIM card of the second device through this serial access mechanism.
[0148] For example, the first device can access the SIM card information of the second device based on multiple APDU requests and APDU responses. The transmission process of the APDU request between the first device and the second device can be referred to as the transmission process of the ATR request in S507; the transmission process of the APDU response between the first device and the second device can be referred to as the transmission process of the ATR response in step S508, which will not be repeated here.
[0149] S511 : The first device uses APDU to respond to the processing service.
[0150] Exemplarily, the first device can obtain the card file in the APDU response and process services based on the SIM card information indicated in the card file, such as making calls and registering on a cellular network, so that the first device can remotely access the SIM card of the second device.
[0151] Based on this, the first device can achieve remote access to the SIM card of the second device through data interaction with the second device.
[0152] exist Figure 5 Based on the corresponding embodiment, since the two-way transmission delay for completing an APDU request and an APDU response between the first device and the second device through the communication service cloud in S509-S510 is generally 200-300 milliseconds (ms), and the total time for completing a remote SIM card loading based on the APDU request and the APDU response can be at least 10s, for some special SIM cards, the total time for remote SIM card loading can exceed 30s, etc.
[0153] Therefore, in order to solve the problem of slow SIM card loading speed during remote SIM card access, an embodiment of the present application can provide a method for processing remote access to a SIM card.
[0154] For example, Figure 6 A schematic diagram of a process for quickly loading a SIM card provided in an embodiment of the present application.
[0155] like Figure 6As shown, the method for processing remote access to a SIM card may include the following steps:
[0156] S601: A modem of a first device sends an APDU request to a remote SIM service module of the first device.
[0157] The APDU request can be generated by the modem of the first device, and the APDU request may include: an FID for indicating the target card file to be read (or an SFI for indicating the target card file to be read), information for indicating whether the device has update permission for the target card file, and information for indicating whether the device has read permission for the target card file. This allows the first device (and / or the second device) to determine the card file that the first device needs to access based on the FID (or SFI) in the APDU request. Both the FID and the SFI can be understood as identifiers specified in the standard for identifying different card files.
[0158] S602: The remote SIM service module of the first device determines whether to read a target type file in the APDU request.
[0159] The target type files may include: files for which the device does not have update permission (or files that do not support the device's update operation on the card file), and files for which the device has read permission. The number of target type files is less than the total number of card files in the SIM card of the second device. The set containing the target type files may be referred to as a first set.
[0160] Exemplarily, when the remote SIM service module of the first device receives an APDU request, the remote SIM service module may determine whether the target card file satisfies the target type file based on the data format of the APDU request. Furthermore, when the remote SIM service module of the first device determines that the target type file is read in the APDU request, the remote SIM service module of the first device may execute the step shown in S603. Alternatively, when the remote SIM service module of the first device determines that the APDU request cannot read the target type file, the remote SIM service module of the first device may execute the step shown in S608 and directly send the APDU request to the second device.
[0161] It is understandable that the card file that does not belong to the target type file may be a file whose data may change each time it is read. Therefore, the first device does not need to store the card file that does not belong to the target type file to avoid errors when reading the card file again later.
[0162] S603: The remote SIM service module of the first device determines whether the target card file to be read in the APDU request is in the whitelist.
[0163] The whitelist may include: FIDs (or SFIs) corresponding to service-required files, which may be understood as card files related to services allowed to be executed during remote SIM access, wherein the service-required files meet the target type file described in step S602.
[0164] In a possible implementation, a mapping table between FID and SFI may be provided in the whitelist, so that the first device can recognize different identification card files.
[0165] Exemplarily, a whitelist may be stored in the remote SIM service module of the first device. When the remote SIM service module of the first device receives an APDU request, it may determine whether the FID corresponding to the target card file in the APDU request is in the whitelist; when the remote SIM service module of the first device determines that the FID corresponding to the target card file in the APDU request is in the whitelist, the remote SIM service module of the first device may execute the step shown in S605, or when the remote SIM service module of the first device determines that the FID corresponding to the target card file in the APDU request is not in the whitelist, the remote SIM service module of the first device may execute the step shown in S604.
[0166] The business-required files may include: some mandatory files specified in the protocol, and some optional files specified in the protocol. For example, the business-required files may include one or more of the following: elementary files (EF) 集成电路卡识别码(integrate circuit card identity,ICCID)、EF访问条件应用(access rule reference,ARR) EF 国际移动用户识别码(international mobile subscriber identification number,IMSI) , or EF 全球用户识别卡服务表(universal subscriber identity module service table,UST) wait.
[0167] It is understandable that for devices supporting different distributed communication services, the contents of the service-required files set in the devices may be different, and the embodiments of the present application do not specifically limit the types and quantities of service-required files.
[0168] In the embodiment of the present application, the service-required files in the whitelist may be pre-set in the first device. Alternatively, the service-required files in the whitelist may be set by the user when using the remote SIM function by checking the services supported by the remote SIM function.
[0169] For example, Figure 7 A schematic diagram of an interface for setting a whitelist is provided in an embodiment of the present application. Figure 7In the corresponding embodiment, the first device is taken as a mobile phone as an example for illustration, and this example does not constitute a limitation to the embodiments of the present application.
[0170] The first device displays Figure 7 The interface shown in a in the figure is used to manage the SIM card. The interface may include: card 1 in the card-inserted state, and card 2 in the card-uninserted state, controls for setting the default mobile data, controls for setting the default dial-up card, controls for setting call forwarding between dual cards, controls for using a remote SIM card, and controls 701 for setting quick loading of the SIM card, etc.
[0171] The control 701 is used to quickly load the SIM card in the remote SIM function. The control 701 can also be set to the interface displayed by the first device after triggering the control for using the remote SIM card, etc., which is not limited in the embodiment of the present application.
[0172] In such Figure 7 In the interface shown in a of FIG, when the first device receives the user's trigger operation on the control 701, the first device may display Figure 7 The interface shown in b in the figure. Figure 7 The interface shown in b in FIG. 7 may include: a control 702 for setting a fast loading of services used in the SIM.
[0173] When the first device receives the user's trigger operation on the control 702, the first device may display the following Figure 7 The interface shown in c. Figure 7 The interface shown in c in the figure may include: basic public service control 703, email service control, fixed dialing service control, and access to user identification application development tool (SIM tool kit, STK) menu service control, etc. Figure 7 The business type described in the interface shown in c is only an example and does not constitute a limitation on the embodiments of the present application.
[0174] For example, when the first device receives a user trigger operation on the basic public service control 703, the first device can set the card file FID corresponding to the basic public service control in the whitelist, so that the first device can manage the card file that ensures the basic public service during the process of remotely accessing the SIM card.
[0175] It is understandable that files other than business-required files may be referred to as business-independent files, which will not affect the first device's use of basic communication services such as phone calls, text messages, and / or Internet access.
[0176] S604: The remote SIM service module of the first device sends a message to the modem of the first device indicating that the card file cannot be accessed.
[0177] The message indicating that the card file cannot be accessed may be 6A82, which is also understood to mean that the card file does not exist. Suitably, upon receiving the message indicating that the card file cannot be accessed, the modem of the first device may determine that the card file does not exist.
[0178] It is understood that card files not in the whitelist can be understood as card files corresponding to functions that the device cannot provide in remote SIM card access scenarios, and / or card files corresponding to functions that the user does not need in remote SIM card access scenarios. Therefore, the device can speed up the SIM card loading process by not accessing these card files not in the whitelist. Card files not in the whitelist can also meet the target file type.
[0179] S605: The remote SIM service module of the first device determines whether the target card file in the APDU request has been cached.
[0180] The remote SIM service module of the first device may cache a card file, which may have been stored when the first device previously used the remote SIM function. Exemplarily, the remote SIM service module of the first device may determine whether the target card file has been cached based on the FID (or SFI) of the target card file. For example, when the remote SIM service module of the first device determines that the target card file in the APDU request has been cached, the remote SIM service module of the first device may execute the steps shown in S606; alternatively, when the remote SIM service module of the first device determines that the target card file in the APDU request has not been cached, the remote SIM service module of the first device may execute the steps shown in S607-S611.
[0181] In a possible implementation, the remote SIM service module of the first device may also cache card files corresponding to multiple SIM cards, for example, caching card files corresponding to different ICCIDs respectively by using the ICCID of the SIM card as an index.
[0182] In a possible implementation, the first device may determine the target card file reading method based on one or more determination steps in S602, S603, and S605.
[0183] S606: The remote SIM service module of the first device sends an APDU response to the modem of the first device.
[0184] Exemplarily, when the remote SIM service module of the first device determines that the target card file in the APDU request has been cached, the first device can add the cached card file to the APDU response based on a preset rule and return the APDU response to the modem of the first device.
[0185] S607: The remote SIM service module of the first device records the FID of the target card file to be cached and the cache identifier.
[0186] The target card file to be cached can be understood as a card file included in the whitelist and not yet stored in the remote SIM service module. The cache identifier can also be called a second identifier.
[0187] It is understandable that the FID (or SFI) of the target card file to be cached and the cache identifier enable the remote SIM service module of the first device to determine whether any card file needs to be cached when receiving any card file returned by the second device.
[0188] S608: The remote SIM service module of the first device sends an APDU request to the remote SIM service module of the second device.
[0189] S609: The remote SIM service module of the second device sends an APDU request to the modem of the second device.
[0190] S610: The modem of the second device sends an APDU response to the remote SIM service module of the second device.
[0191] S610: The remote SIM service module of the second device sends an APDU response to the remote SIM service module of the first device.
[0192] The description of the APDU request and APDU response in steps S608-S610 can be found in steps S509-S510, and will not be repeated here.
[0193] S612: The remote SIM service module of the first device determines whether the card file in the APDU response needs to be cached.
[0194] Exemplarily, the remote SIM service module of the first device can determine whether the card file in the APDU response needs to be cached based on the FID (or SFI) corresponding to the card file in the APDU response, and the FID (or SFI) corresponding to the target card file to be cached recorded in the remote SIM service module of the first device in the step shown in S607 and the cache identifier.
[0195] In an embodiment of the present application, when the remote SIM service module of the first device determines that the card file in the APDU response needs to be stored, the remote SIM service module of the first device can execute the steps shown in S613-S614; or, when the remote SIM service module of the first device determines that the card file in the APDU response does not need to be stored, the remote SIM service module of the first device can execute the step shown in S614 and directly return the received APDU response to the modem of the first device.
[0196] S613: The remote SIM service module of the first device caches the card file that needs to be cached in the APDU response.
[0197] Furthermore, after executing S613 , the remote SIM service module of the first device may execute the step shown in S614 to return an APDU response to the modem of the first device.
[0198] It can be understood that after S613, when the remote SIM service module of the first device receives the same APDU request again, the remote SIM service module of the first device can query the card file corresponding to the APDU request in the cache, thereby reducing the energy consumption when remotely accessing the SIM based on APDU requests and APDU responses.
[0199] In the embodiment of the present application, two caching methods can be provided, for example, caching the card file based on FID (as described in the corresponding method one), and caching the card file based on SFI (as described in the corresponding method two).
[0200] Method 1: The first device caches the card file based on the FID.
[0201] When accessing any card file using the FID in an APDU request, the APDU request may typically include an update command, a select command, and a read command. When the APDU request includes an update command, the first device may directly forward the APDU request containing the update command to the second device, and the card file cached by the first device may be a card file that does not support the device's update operation.
[0202] Therefore, when the APDU request includes a select command and a read command, the results returned in the APDU response for the select command and the read command are different, and the remote SIM service module of the first device can divide the cache into two parts, the first part being the result corresponding to the select command and the second part being the result corresponding to the read command. The read command can be a read binary command, a read cyclic file command, or a read record command, etc.
[0203] For example, Table 1 is a schematic table of FID memory card files provided in an embodiment of the present application.
[0204] Table 1 Schematic table based on FID memory card files
[0205]
[0206] As shown in Table 1, the first device may store FID1 and FID2, and respectively store select result 1 and read result 1 corresponding to FID1, and select result 2 and read result 2 corresponding to FID2.
[0207] Specifically, when the modem of the first device sends a select command, the result returned by the select command may be an FCP code stream or an exception error code. When the modem of the first device sends a read binary command, the result returned by the read binary command is typically only a single code stream. When the modem of the first device sends a read record command, the result returned by the read record command may be multiple records. The remote SIM service module of the first device can determine the cached content for the corresponding code stream based on the code stream number requested in the read record command.
[0208] It's understandable that during the APDU process of accessing a card file via FID, the read command doesn't include the FID of the card file being accessed. However, the read command and the select command are serial. That is, when reading a card file via FID, the select command must first be issued to select the current card file, and then the read command is issued to read the contents of the card file. Therefore, the select command is a prerequisite for the read command, and for each card file's FID, the first device caches both the select command's return value and the read command's return value.
[0209] Method 2: The first device caches the card file based on SFI.
[0210] When accessing any card file using the SFI in the APDU request, only the read instruction is usually required, and then the remote SIM service module of the first device can map the SFI to the FDI, and then cache the result corresponding to the read instruction. For example, when the read binary code stream appears, the first device determines whether the reading method is SFI or FID. If it is SFI, it can be mapped to the corresponding FID and cache the current read value. For example, when the first device determines that the highest bit of the third byte of the read binary instruction is 1, it determines that the read binary is the SFI reading method, then there is no need to cache the result corresponding to the relect instruction, and cache the result corresponding to the current read instruction.
[0211] For example, Table 2 is a schematic table of mapping between FID and SFI provided in an embodiment of the present application.
[0212] Table 2 Schematic diagram of the mapping between FID and SFI
[0213]
[0214] S614: The remote SIM service module of the first device sends an APDU response to the modem of the first device.
[0215] It can be understood that the method for processing remote access to a SIM card provided in the embodiment of the present application can shorten the loading of a remote SIM card by screening target type files and a whitelist, and reduce the subsequent loading time of a remote SIM card by caching card files, thereby improving the user experience of using the remote SIM function.
[0216] In possible implementations, Figure 6 In the corresponding embodiment, based on the rapid loading of the SIM card, the first device further supports a method for managing cache.
[0217] The embodiments of the present application may provide two methods for managing cache. For example, the first device may cache the card file in the running memory of the remote SIM service module for temporary storage, and / or the first device may cache the card file in a preset file or database for long-term storage.
[0218] In one implementation, the first device can record the card file cache information in the running memory of the remote SIM service module based on the ICCID that identifies the unique SIM card as an index. In addition, the first device sets a maximum number of records in the running memory and determines the relationship between the number of cached SIM cards and the maximum number of records based on the ICCID index. Taking the maximum number of records as 5 as an example, when the first device determines that the card files of 5 SIM cards have been cached based on the ICCID index and is preparing to cache the card file of the 6th SIM card, the first device can overwrite the card file of the 6th SIM card with the card file of the cached 1st SIM card.
[0219] It is understood that the running memory may store a mapping relationship between an ICCID and at least one card file corresponding to the ICCID. The first device may automatically clear all cached card files in the running memory after the device is restarted. Therefore, caching card files in the running memory can be used for temporary storage of card files.
[0220] In another implementation, the first device may encrypt and record the card file in a file or database based on the ICCID as an index. Furthermore, the first device may set a maximum number of records and / or a maximum storage duration in the file or database. For example, the first device may automatically clear the cached card file when it determines that the number of cached SIM cards exceeds the maximum number of records and / or the duration of the cached card file exceeds the maximum storage duration.
[0221] It is understandable that a mapping relationship between an ICCID and at least one card file corresponding to the ICCID may be stored in a file or database, etc. Restarting the first device will not affect the cache of the card file, so the method of caching the card file in a file or database can be used for long-term storage of the card file.
[0222] The first device may also be indexed by other parameters that can identify the SIM card in addition to the ICCID, which is not limited in the embodiments of the present application.
[0223] Based on this, the first device can achieve reasonable storage of card files, so that the first device can find the required card files in the cache, reduce the situation of accessing card files from a remote end, and improve the loading speed of the SIM card.
[0224] In a possible implementation, Figure 6 In the corresponding embodiment, based on the rapid loading of the SIM card, the first device further supports a method for switching cache records when changing the SIM card access object.
[0225] For example, when the first device remotely accesses the IMS card of the second device, when the second device replaces the SIM card with a new one, the first device can search for the card file corresponding to the new ICCID based on the new ICCID corresponding to the new SIM card.
[0226] In one implementation, the first device's whitelist may not store the FID corresponding to the ICCID file. That is, each time remote SIM card access is enabled, the first device can read the ICCID corresponding to the second device's SIM card from the second device in real time. Furthermore, the first device uses the retrieved ICCID as an index to query the corresponding card file. If a cached card file can be found based on the ICCID, the retrieved card file is used. If a cached card file cannot be found based on the ICCID, a newly cached card file is recorded using the ICCID as an index.
[0227] In another implementation, the first device can add the FID corresponding to the ICCID file to the whitelist, and the second device determines whether the ICCID of the currently inserted SIM card has changed. For example, the modem of the second device can read the information of any SIM card inserted into the second device. When the second device determines that the ICCID of the inserted SIM card has changed, it can send a new ICCID to the first device. Adaptively, when the first device receives the new ICCID, the first device can query the cached card file based on the new ICCID as an index (it can be understood that the first device may have cached the card file corresponding to the new ICCID). If the cached card file can be queried based on the new ICCID, the queried card file is used; if the cached card file cannot be queried based on the new ICCID, the newly cached card file is recorded with the new ICCID as the index. When the first device does not receive the new ICCID, it can be understood that the SIM card inserted into the second device has not changed, so the first device can directly use the card file corresponding to the last ICCID.
[0228] Based on this, the first device can cache the card file data corresponding to multiple SIM cards, so that the first device can quickly load the SIM cards when accessing different SIM cards.
[0229] Combined with the above Figure 4-Figure 7 , the method provided in the embodiment of the present application is described, and the device for executing the above method provided in the embodiment of the present application is described below. Figure 8 As shown, Figure 8 This is a structural diagram of a processing device for remotely accessing a SIM card provided in an embodiment of the present application. The processing device for remotely accessing a SIM card may be the first device in the embodiment of the present application, or may be a chip or chip system within the first device.
[0230] It is understandable that if Figure 8 As shown, the processing device 80 for remotely accessing a SIM card described in the embodiment of the present application may be a device corresponding to the method executed in the first device, or may be a device corresponding to the method executed in the second device.
[0231] The remote access SIM card processing device includes a display unit 801, a processing unit 802, and a communication unit 803. The display unit 801 supports the display step performed by the remote access SIM card processing device 80; the processing unit 802 supports the information processing step performed by the remote access SIM card processing device 80; and the communication unit supports the data transmission and reception steps performed by the remote access SIM card processing device 80. The communication unit 803 may be an input or output interface, pin, or circuit.
[0232] Specifically, an embodiment of the present application provides a processing device 80 based on remote access to a user identification module SIM card, the device including a communication unit 803 and a processing unit 802: the communication unit 803 is used to establish a communication connection with a second device; the processing unit 802 is used to obtain a first request; the first request is used to request access to a first card file in a first SIM card of the second device, and the first request carries a first identifier corresponding to the first card file; the processing unit 802 is also used to obtain response data corresponding to the first request when it is determined that the first identifier is included in the first set, and process the first service based on the response data corresponding to the first request; wherein the number of card files indicated in the first set is less than the number of card files in the first SIM card.
[0233] In a possible implementation, the processing device for remotely accessing a SIM card may further include a storage unit 804. The processing unit 802 and the storage unit 804 are connected via a circuit. The storage unit 804 may include one or more memories, which may be devices in one or more devices or circuits for storing programs or data. The storage unit 804 may exist independently and be connected to the processing unit 802 of the processing device for remotely accessing a SIM card via a communication circuit. The storage unit 804 may also be integrated with the processing unit 802.
[0234] The storage unit 804 can store computer-executable instructions for the method in the electronic device, so that the processing unit 802 executes the method in the above embodiment. The storage unit 804 can be a register, a cache, or a RAM, etc., and the storage unit 804 can be integrated with the processing unit 802. The storage unit 804 can be a read-only memory (ROM) or other type of static storage device that can store static information and instructions. The storage unit 804 can be independent of the processing unit 802.
[0235] A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can store or a data storage device such as a server or data center that includes one or more available media integrated. For example, the available medium can include magnetic media (e.g., floppy disk, hard disk or tape), optical media (e.g., digital versatile disc (DVD)), or semiconductor media (e.g., solid state disk (SSD)).
[0236] For example, Figure 9 A schematic diagram of the structure of a chip provided in an embodiment of the present application. The chip 90 includes one or more (including two) processors 920 and a communication interface 930. The chip can be a chip in the first device or a chip in the second device.
[0237] In some embodiments, the memory 940 stores the following elements: executable modules or data structures, or a subset thereof, or an extended set thereof.
[0238] In the embodiment of the present application, the memory 940 may include a read-only memory and a random access memory, and provides instructions and data to the processor 920. A portion of the memory 940 may also include a non-volatile random access memory (NVRAM).
[0239] In the embodiment of the present application, the memory 940, the communication interface 930 and the memory 940 are coupled together through the bus system 910. In addition to the data bus, the bus system 910 may also include a power bus, a control bus and a status signal bus. For ease of description, Figure 9 Various buses are labeled as bus system 910 .
[0240] The method described in the above embodiment of the present application can be applied to the processor 920, or implemented by the processor 920. The processor 920 may be an integrated circuit chip with signal processing capabilities. During the implementation process, the steps of the above method can be completed by the hardware integrated logic circuit in the processor 920 or the instructions in the form of software. The above-mentioned processor 920 can be a general-purpose processor (for example, a microprocessor or a conventional processor), a digital signal processor (digital signal processing, DSP), an application specific integrated circuit (application specific integrated circuit, ASIC), a field-programmable gate array (field-programmable gate array, FPGA) or other programmable logic devices, discrete gates, transistor logic devices or discrete hardware components. The processor 920 can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present invention.
[0241] The steps of the method disclosed in the embodiments of the present application can be directly implemented as being executed by a hardware decoding processor, or can be implemented by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the art, such as a random access memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable read-only memory (EEPROM). The storage medium is located in the memory 940, and the processor 920 reads the information in the memory 940 and completes the steps of the above method in combination with its hardware.
[0242] In the above embodiment, the instructions stored in the memory for execution by the processor may be implemented in the form of a computer program product, wherein the computer program product may be pre-written in the memory or downloaded and installed in the memory in the form of software.
[0243] An embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the electronic device executes the method described in the embodiment of the present application.
[0244] The present application also provides a computer-readable storage medium. The methods described in the above embodiments can be implemented in whole or in part via software, hardware, firmware, or any combination thereof. Computer-readable media can include computer storage media and communication media, and can also include any medium that can transfer a computer program from one location to another. The storage medium can be any target medium that can be accessed by a computer.
[0245] As one possible design, computer-readable media may include compact disc read-only memory (CD-ROM), RAM, ROM, EEPROM or other optical disc storage; computer-readable media may include magnetic disk storage or other magnetic disk storage devices. Moreover, any connecting line may also be appropriately referred to as a computer-readable medium. For example, if the software is transmitted from a website, server or other remote source using a coaxial cable, fiber optic cable, twisted pair, DSL or wireless technologies such as infrared, radio and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technologies such as infrared, radio and microwave are included in the definition of medium. Disk and disc as used herein include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc, where disks usually reproduce data magnetically, while discs reproduce data optically using lasers.
[0246] The above combinations are also included within the scope of computer-readable media. The above are only specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
[0247] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
Claims
1. A processing method based on remote access to a subscriber identity module (SIM) card, characterized in that: The method comprises: A first device establishes a communication connection with a second device; the first device includes: a remote SIM service module and a modem processor; The modem obtains a first request and sends the first request to the remote SIM service module; the first request is used to request access to a first card file in a first SIM card of the second device, and the first request carries a first identifier corresponding to the first card file; When the first device determines that the first identifier is included in a first set, the first device obtains response data corresponding to the first request and processes a first service based on the response data corresponding to the first request; wherein, the number of card files indicated in the first set is less than the number of card files in the first SIM card, and the card files indicated in the first set are: files that do not support the device to update the card files, and files that support the device to read the card files; the first set includes a second set, and the card files indicated in the second set are card files corresponding to a target service, and the target service is a service allowed to be executed during the process of the first device remotely accessing the first SIM card, and the target service includes the first service.
2. The method according to claim 1, characterized in that The method further comprises: The first device sends a second request to the second device; the second request is used to instruct the first device to request remote access to the first SIM card; The first device obtains the first request, including: when the first device receives response data corresponding to the second request from the second device, the first device obtains the first request; wherein the response data corresponding to the second request is used to indicate that the second device allows the first device to remotely access the first SIM card.
3. The method according to claim 1, characterized in that When the first device determines that the first identifier is included in the first set, the first device obtains response data corresponding to the first request, including: When the first device determines that the first identifier is included in the first set and the first card file is not found in the cache in the first device, the first device sends the first request to the second device; The first device receives response data corresponding to the first request from the second device.
4. The method according to any one of claims 1 to 3, characterized in that When the first device determines that the first identifier is included in the first set, the first device obtains response data corresponding to the first request, and the method further includes: When the first device determines that the first identifier is included in the first set and finds the first card file cached in the first device, the first device generates response data corresponding to the first request using the first card file.
5. The method according to claim 3, characterized in that Before the first device sends the first request to the second device, the method further includes: The first device records the first identifier and the second identifier corresponding to the first card file; After the first device receives response data corresponding to the first request from the second device, the method further includes: the first device obtaining the first card file from the response message corresponding to the first request based on the first identifier, and caching the first card file based on the second identifier.
6. The method according to claim 5, characterized in that The first device includes a remote SIM service module: caching the first card file includes: caching the first card file in the remote SIM service module, or caching the first card file in a preset file or preset database of the first device.
7. The method according to claim 5 or 6, characterized in that The first identifier is a file identifier FID or a short file identifier SFI; the first device includes: a mapping relationship between a first FID corresponding to the first card file and a first SFI corresponding to the first card file.
8. The method according to claim 1, characterized in that The second set includes: a card file determined when the user selects the first service, and the method further includes: The first device displays a first interface; wherein the first interface includes: a first control for setting the second set; In response to an operation on the first control, the first device displays a second interface; the second interface includes: at least one second control corresponding to at least one second service; the at least one second control includes: a third control corresponding to the first service; In response to an operation on the third control, the first device determines the second set based on the card file corresponding to the first service.
9. The method according to claim 1, characterized in that The method further comprises: When the first device determines that the first identifier is not included in the second set, the first device does not process the first service.
10. The method according to any one of claims 1-3, 5-6, 8-9, characterized in that: When the first device determines that the first identifier is included in the first set, the first device obtains response data corresponding to the first request, and processes the first service based on the response data corresponding to the first request, including: When the remote SIM service module determines that the first identifier is included in the first set, the remote SIM service module obtains response data corresponding to the first request. When the modem receives the response data corresponding to the first request from the remote SIM service module, the modem processes the first service based on the response data corresponding to the first request.
11. The method according to any one of claims 1-3, 5-6, 8-9, characterized in that: The first request is an application protocol data unit (APDU) request.
12. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the electronic device is caused to perform the method according to any one of claims 1 to 11.
13. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the computer is caused to perform the method according to any one of claims 1 to 11.
14. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the computer is caused to perform the method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Mobile terminal and method for mobile terminal
CN107948978A
Method for obtaining virtual SIM card, mobile terminal and server
CN107995613A