IMSI (International Mobile Subscriber Identity) data switching method, card application and SIM card

By pre-setting multiple IMSI data files in the SIM card and automatically switching between them with the card application, the problem of SIM card not being recognized during cross-border roaming is solved, achieving seamless communication and improved user experience.

CN120916218APending Publication Date: 2025-11-07GUANGDONG CHUTIAN DRAGON SMART CARD

Patent Information

Application Number
CN202511245815.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-02
Publication Date
2025-11-07

AI Technical Summary

Technical Problem

When users travel across borders, the IMSI of the SIM card in the current technology cannot be recognized by the local operator, resulting in the inability to access the network normally. Users need to manually replace the SIM card, which causes communication interruption, additional costs and management chaos.

Method used

Multiple IMSI data files are preset in the SIM card, and the card application, combined with the mobile country code reported by the terminal, automatically determines and switches between them, achieving seamless IMSI switching and avoiding manual operation by the user.

Benefits of technology

It achieves communication continuity and improves user experience in cross-border roaming scenarios, avoiding communication interruptions and inconveniences caused by frequent SIM card replacements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120916218A_ABST
    Figure CN120916218A_ABST
Patent Text Reader

Abstract

The invention provides an IMSI (International Mobile Subscriber Identity) data switching method, a card application and an SIM (Subscriber Identity Module) card. The method comprises the following steps: acquiring current position information of a mobile terminal; judging whether the current mobile country code belongs to a current mobile country code group associated with the current IMSI data file or not; if not, traversing other IMSI data files to judge whether other mobile country code groups matched with the current mobile country code exist or not; if yes, determining the IMSI data file corresponding to the other matched mobile country code blocks as a target IMSI data file; writing the target IMSI data into a network access authentication file to generate target network access authentication data; and sending a refreshing instruction to the mobile terminal, so that the mobile terminal completes network registration based on the target network access authentication data. According to the mode, it can be ensured that the card application can determine an available target IMSI data file in any network environment, and then communication continuity and user experience in a transnational roaming scene are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of mobile communication technology, in particular to an IMSI data switching method, card application and SIM card. BACKGROUND

[0002] With the globalization of mobile communication, when users go abroad or cross-regional roaming, they usually hope that the mobile terminal can seamlessly access the local operator network and continuously enjoy voice, SMS and data services. Most current mobile terminals rely on the IMSI (International Mobile Subscriber Identification Number) in the SIM (Subscriber Identity Module) card as the only user identity identifier for network registration and authentication.

[0003] In the prior art, when the user enters the target country, if the IMSI in the original SIM card cannot be identified by the local operator, the user cannot normally access the network and needs to manually replace the SIM card to adapt to the new network. Therefore, the user usually needs to prepare multiple SIM cards in advance, or purchase a new SIM card in the local area and replace it by plugging and unplugging, which is a cumbersome process. The difference in numbers between different operators can also cause communication interruption, additional charges or loss of contacts, etc. In addition, frequent replacement of cards can also cause loss of cards or management confusion. SUMMARY

[0004] Therefore, the purpose of the present application is to provide an IMSI data switching method, card application and SIM card, which can realize automatic switching of IMSI without user intervention, thereby avoiding communication interruption caused by frequent replacement of SIM cards or change of numbers, and further improving communication continuity and user experience in the cross-country roaming scenario.

[0005] In a first aspect, the present application provides a method for switching IMSI data, which is applied to a card application, the card application is pre-installed in a SIM card of a mobile terminal, and at least one IMSI data file is pre-set in the SIM card; each IMSI data file is associated with a mobile country code group, and the mobile country code group includes at least one mobile country code; the method includes the following steps: obtaining current location information of the mobile terminal; the current location information includes a current mobile country code; determining whether the current mobile country code belongs to a current mobile country code group associated with the current IMSI data file; if the current mobile country code does not belong to the current mobile country code group, traversing other IMSI data files to determine whether there is a matched other mobile country code group; if there is a matched other mobile country code group, determining an IMSI data file corresponding to the matched other mobile country code group as a target IMSI data file; the target IMSI data file includes target IMSI data; writing the target IMSI data into a pre-set network access authentication file in the SIM card to generate target network access authentication data; and sending a refreshing instruction to the mobile terminal to enable the mobile terminal to complete network registration based on the target network access authentication data.

[0006] In an optional implementation, the step of obtaining the current location information of the mobile terminal includes the following steps: after the mobile terminal is powered on, sending a location obtaining request to the mobile terminal; if the current location information returned by the mobile terminal is not received, entering a waiting state until a location event notification actively sent by the mobile terminal is received; the location event notification is generated by the mobile terminal when a location change occurs; the current location information is included in the location event notification; after the location event notification is received, obtaining a current network access state value of the mobile terminal; if the current network access state value is a first preset value, extracting the current mobile country code in the current location information.

[0007] In an optional implementation, after the step of obtaining the current network access state value of the mobile terminal, the method further includes the following steps: if the current network access state value is not the first preset value, sending a preset mobile country code obtaining instruction to the mobile terminal to obtain the current mobile country code, and adding 1 to an obtaining times; the initial value of the obtaining times is 0; if the current mobile country code returned by the mobile terminal is received, resetting the obtaining times to the initial value; if the current mobile country code returned by the mobile terminal is not received, sending the preset mobile country code obtaining instruction to the mobile terminal again until the current mobile country code returned by the mobile terminal is received or the obtaining times reaches a preset maximum obtaining times.

[0008] In an optional implementation, the step of obtaining the current location information of the mobile terminal includes the following steps: after the mobile terminal is powered on, periodically sending a location obtaining request to the mobile terminal based on a preset time interval to obtain the current mobile country code returned by the mobile terminal.

[0009] In an optional embodiment, the SIM card further stores a configuration file; the configuration file records a default identifier of a default IMSI data file; after the step of traversing other IMSI data files to determine whether there is a matched other mobile country code group of the current mobile country code, the method further comprises: if there is no matched other mobile country code group, determining the default IMSI data file corresponding to the default identifier as a target IMSI data file based on the configuration file; the target IMSI data file comprises target IMSI data; writing the target IMSI data into a preset network access authentication file of the SIM card to generate target network access authentication data; and sending a refresh instruction to the mobile terminal to enable the mobile terminal to complete network registration based on the target network access authentication data.

[0010] In an optional embodiment, the step of writing the target IMSI data into a preset network access authentication file of the SIM card comprises: writing the target IMSI data into a first network access authentication file; obtaining an access control parameter corresponding to the target IMSI data file and writing the access control parameter into a second network access authentication file; each IMSI data file corresponds to an access control parameter; and setting a third network access authentication file related to operator network access configuration to a default value to clear original registration information.

[0011] In an optional embodiment, after the step of determining the IMSI data file corresponding to the matched other mobile country code group as the target IMSI data file, the method further comprises: updating the current data file identifier to a target identifier corresponding to the target IMSI data file.

[0012] In a second aspect, the present application provides a card application, which is pre-installed in a SIM card of a mobile terminal, and the SIM card is pre-provided with at least one IMSI data file; each IMSI data file is associated with a mobile country code group, and the mobile country code group includes at least one mobile country code; the card application includes: a position information acquisition module, configured to acquire current position information of the mobile terminal; the current position information includes a current mobile country code; a target IMSI data file determination module, configured to determine whether the current mobile country code belongs to a current mobile country code group associated with a current IMSI data file; the target IMSI data file determination module is further configured to, if the current mobile country code does not belong to the current mobile country code group, traverse other IMSI data files, and determine whether there is a matched other mobile country code group matching the current mobile country code; the target IMSI data file determination module is further configured to, if there is a matched other mobile country code group, determine an IMSI data file corresponding to the matched other mobile country code group as a target IMSI data file; the target IMSI data file includes target IMSI data; and an access authentication data determination module, configured to write the target IMSI data into a pre-provided access authentication file of the SIM card, so as to generate target access authentication data; the access authentication data determination module is further configured to send a refreshing instruction to the mobile terminal, so that the mobile terminal completes network registration based on the target access authentication data.

[0013] In a third aspect, the present application provides a SIM card, which includes a SIM card body, and further includes the card application of the foregoing embodiments; the card application is pre-installed in the SIM card body.

[0014] In an optional embodiment, the SIM card is pre-provided with at least one IMSI data file and a configuration file; each IMSI data file is associated with a mobile country code group, and the mobile country code group includes at least one mobile country code; and the configuration file records a default identifier of a default IMSI data file.

[0015] The embodiments of the present application provide an IMSI data switching method, a card application and a SIM card, by pre-providing multiple IMSI data files in the SIM card, and automatically determining whether the current position mobile country code acquired by the terminal matches the current IMSI file, the local automatic switching of the IMSI can be realized without user intervention, so as to avoid the communication interruption and inconvenience caused by frequent replacement of the SIM card or the number by the user, and further improve the continuity, stability and user experience of the communication service in the cross-country roaming scenario.

[0016] Other features and advantages of the present application will be described in the following description, and some will become apparent from the description, or will be learned from the practice of the present application.

[0017] In order to make the above objectives, characteristics and advantages of the present application more apparent, more comprehensible, the following preferred embodiments are specifically described in detail below, together with the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS

[0018] In order to more clearly illustrate the specific embodiments of the present application or the technical solutions in the prior art, the following will briefly introduce the drawings needed to be used in the description of the specific embodiments or the prior art. Obviously, the drawings described below are some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without any creative effort.

[0019] Figure 1 The SIM card schematic diagram provided by the embodiments of the present application; Figure 2 The card application schematic diagram provided by the embodiments of the present application; Figure 3 The IMSI data switching method flowchart provided by the embodiments of the present application.

[0020] Icon: 10-SIM card body; 20-card application; 30-IMSI data file; 40-configuration file; 21-position information acquisition module; 22-target IMSI data file determination module; 23-network access authentication data determination module. DETAILED DESCRIPTION

[0021] In order to make the objectives, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the present application will be described in detail below in conjunction with the drawings. Obviously, the described embodiments are some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without any creative effort fall within the scope of protection of the present application.

[0022] In order to facilitate the understanding of the embodiments, the application scenarios and design ideas of the present application are briefly introduced.

[0023] With the increasing frequency of users moving between different countries or regions, the traditional SIM card relying on a single IMSI often cannot complete normal registration in some target countries, resulting in communication service interruption, and users need to manually replace the SIM card and reconfigure the number, which is cumbersome and has poor experience.

[0024] To this end, the application provides an IMSI data switching method, a card application and a SIM card. By presetting multiple IMSI data files in the SIM card and automatically judging and switching by the card application in combination with the mobile country code reported by the terminal, local dynamic adjustment of the IMSI is realized, the continuity and convenience of communication access of the user in the global scope are ensured, and the intelligence and practicality are embodied.

[0025] After introducing the application scenario and design idea of the application, the technical solutions provided by the application are described in detail.

[0026] With reference to Figure 1 The application embodiment provides a SIM card, which comprises a SIM card body 10 and a card application 20.

[0027] Here, by the card application 20 pre-installed in the SIM card, the geographical position of the mobile terminal is automatically monitored, and whether the IMSI data in the SIM card needs to be switched is intelligently judged according to the mobile country code (MCC) of the current position, so as to automatically adapt to the local operator network, thereby realizing seamless cross-border roaming communication.

[0028] In an embodiment, at least one IMSI data file 30 and a configuration file 40 are preset in the SIM card; each IMSI data file 30 is associated with a mobile country code group, and the mobile country code group comprises at least one mobile country code; and the configuration file records a default identifier of a default IMSI data file 30.

[0029] Here, in the initial setting stage, the card application 20 will perform initialization operation in the storage space of the SIM card.

[0030] Firstly, in order to realize the perception of the terminal state, the card application 20 will register relevant events to the SIM card operating system when installed, specifically including a location event notification (such as EVENT_DOWNLOAD_LOCATION_STATUS event) for receiving the terminal position change and an event (such as EVENT_PROFILE_DOWNLOAD event) for receiving the terminal boot state.

[0031] Secondly, the card application 20 will create and write the required data files in the SIM card. These files comprise at least one IMSI data file 30 and one configuration file 40. For example, two IMSI data files 30 (the file IDs can be set as 0011 and 0012) and one configuration file 40 (the file ID can be set as 0010) can be created. When initialized, the card application 20 will record an IMSI data file ID variable currently in use, for example, initially pointing to the main IMSI data file with the file ID 0011.

[0032] Each IMSI data file 30 contains a complete IMSI data and is associated with a mobile country code (MCC) group. The MCC group contains at least one MCC. The specific data structure can follow a preset format. The IMSI data includes three parts: MCC, MNC (Mobile Network Code) and MIN (Mobile Identification Number).

[0033] The data structure of the IMSI data file 30 is shown in Table 1 below: Table 1 Data structure of IMSI data file

[0034] The first 9 bytes of the IMSI data file 30 store IMSI data, the 10th byte stores the total length of the mobile country code group followed, and the subsequent bytes store the specific mobile country code, each of which occupies 2 bytes. For example, the content of an IMSI data file 30 can be "2222222222222222220411221122", in which "222222222222222222" represents IMSI, "04" represents that the length of the MCC group data after it is 4 bytes, and the MCC group contains two MCCs: "1122" and "1122". Here, the total length of the MCC group data can be 0, and if the value is not a multiple of 2, the last 1 byte of data is ignored.

[0035] The configuration file 40 is used to store the parameters of the control logic. It predefines a default IMSI file ID, which is used to handle a special case: when the mobile phone roams to a new country, its mobile country code (MCC) does not match any MCC group in all preset IMSI data files 30. The system will switch to the corresponding IMSI data file 30 according to the ID specified in this configuration file 40. In short, it provides a bottom solution to ensure that an effective IMSI switching can be completed in any case, avoiding switching failure.

[0036] The data structure of the configuration file 40 is shown in Table 2 below: Table 2 Data structure of configuration file

[0037] Wherein, the first byte (Byte1) in the configuration file 40 is defined as the current several sets of data, and when it is 1, all the judgment logic is not effective. This indicates that this byte can be used as a general switch to control the entire automatic switching logic. For example, when the value of this byte is set to 01, all the automatic judgment and switching processes can be disabled, and the system will maintain the current IMSI unchanged.

[0038] For example, the content of a configuration file 40 can be "010011FFFF...". Wherein "01" (Byte 1): indicates that there is only one set of data currently, or it can be understood as that the switching logic is not effective. "0011" (Byte 2-3) is the default identifier, which points to the IMSI data file with the file ID of 0011 in the case that all MCCs do not match.

[0039] The SIM card provided by the embodiment of the present application combines the card application carrying the switching logic with the IMSI data file and the configuration file and solidifies them in the SIM card, so that the switching strategy of the IMSI can be flexibly configured and extended without any manual operation of the user, and the communication convenience and service continuity of the user when roaming abroad are greatly improved.

[0040] Based on the above embodiment, referring to Figure 2 The embodiment of the present application provides a card application 20. The card application 20 comprises: A location information obtaining module 21 is configured to obtain the current location information of the mobile terminal, and the current location information comprises a current mobile country code.

[0041] A target IMSI data file determining module 22 is configured to determine whether the current mobile country code belongs to a current mobile country code group associated with the current IMSI data file.

[0042] The target IMSI data file determining module 22 is further configured to, if the current mobile country code does not belong to the current mobile country code group, traverse other IMSI data files to determine whether there is a matched other mobile country code group.

[0043] The target IMSI data file determining module 22 is further configured to, if there is a matched other mobile country code group, determine the IMSI data file corresponding to the matched other mobile country code group as the target IMSI data file; and the target IMSI data file comprises target IMSI data.

[0044] A network access authentication data determining module 23 is configured to write the target IMSI data into a preset network access authentication file in the SIM card to generate target network access authentication data.

[0045] The network access authentication data determination module 23 is further configured to send a refreshing instruction to the mobile terminal, so that the mobile terminal completes network registration based on the target network access authentication data.

[0046] In an optional implementation, the location information acquisition module 21 is further configured to: After the mobile terminal is powered on, send a location acquisition request to the mobile terminal.

[0047] If the current location information returned by the mobile terminal is not received, enter a waiting state until a location event notification actively sent by the mobile terminal is received; the location event notification is generated by the mobile terminal when a location change occurs; the location event notification includes the current location information.

[0048] After the location event notification is received, acquire the current network access state value of the mobile terminal.

[0049] If the current network access state value is a first preset value, extract the current mobile country code in the current location information.

[0050] In an optional implementation, the location information acquisition module 21 is further configured to: If the current network access state value is not the first preset value, send a preset mobile country code acquisition instruction to the mobile terminal to acquire the current mobile country code, and increase the acquisition times by 1; the initial value of the acquisition times is 0.

[0051] If the current mobile country code returned by the mobile terminal is received, reset the acquisition times to the initial value.

[0052] If the current mobile country code returned by the mobile terminal is not received, send the preset mobile country code acquisition instruction to the mobile terminal again until the current mobile country code returned by the mobile terminal is received or the acquisition times reaches a preset maximum acquisition times.

[0053] In an optional implementation, the location information acquisition module 21 is further configured to: After the mobile terminal is powered on, periodically send a location acquisition request to the mobile terminal based on a preset time interval to acquire the current mobile country code returned by the mobile terminal.

[0054] In an optional implementation, the SIM card further stores a configuration file; the configuration file records a default identifier of a default IMSI data file.

[0055] The target IMSI data file determination module 22 is further configured to: If there is no matched other mobile country code group, determine a default IMSI data file corresponding to the default identifier as the target IMSI data file based on the configuration file; the target IMSI data file includes target IMSI data.

[0056] write the target IMSI data into a preset network access authentication file in the SIM card to generate target network access authentication data.

[0057] send a refreshing instruction to the mobile terminal to make the mobile terminal complete network registration based on the target network access authentication data.

[0058] In an optional implementation, the network access authentication data determining module 23 is further configured to: write the target IMSI data into the first network access authentication file.

[0059] obtain an access control parameter corresponding to the target IMSI data file, and write the access control parameter into the second network access authentication file; wherein each IMSI data file corresponds to one access control parameter.

[0060] set a third network access authentication file related to the operator network access configuration to a default value to clear original registration information.

[0061] In an optional implementation, the target IMSI data file determining module 22 is further configured to: update the current data file identifier to a target identifier corresponding to the target IMSI data file.

[0062] The card application provided by the embodiments of the present application can realize the automatic switching of the IMSI data by installing the card application in the SIM card in advance, integrating the switching logic and the SIM card closely, and enabling the SIM card to have the ability of intelligent judgment and autonomous execution of the IMSI switching, so as to convert a passive storage medium into an intelligent device capable of actively ensuring the continuity of user communication. The card application ensures that the entire automatic switching process can be stably and efficiently executed on the terminal, and finally realizes the automatic and intelligent switching of the IMSI when the user roams.

[0063] Based on the above embodiments, referring to Figure 3 The embodiments of the present application provide an IMSI data switching method, which is applied to a card application, the card application is installed in a SIM card of a mobile terminal in advance, and the SIM card is preset with at least one IMSI data file; each IMSI data file is associated with a mobile country code group, and the mobile country code group includes at least one mobile country code.

[0064] Here, at least one IMSI data file and configuration file are pre-set in the SIM card. Specifically, the IMSI data file can be "3F00 / 2730 / 0011" and "3F00 / 2730 / 0012", and the configuration file can be "3F00 / 2730 / 0010", in which configuration data is written; the main IMSI data is stored in the 3F00 / 2730 / 0011 data file, and the standby IMSI data is stored in the 3F00 / 2730 / 0012 data file.

[0065] Here, "3F00" is the root directory of the SIM card file system, a master file (MF), and all files are under it.

[0066] "2730" is a folder under the root directory 3F00, a dedicated file (DF).

[0067] "0010, 0011, 0012" are specific files stored in the folder "2730", elementary files (EF).

[0068] When the card application wants to read or modify the configuration file, it will find the configuration file through the unique path "3F00 / 2730 / 0010" and operate it.

[0069] When the card application is installed, it will register the EVENT_DOWNLOAD_LOCATION_STATUS event for receiving terminal location changes and the EVENT_PROFILE_DOWNLOAD event for receiving terminal boot states, and initialize an internal variable to record the currently used IMSI data file ID (for example, initialized to "0011").

[0070] The method comprises: Step S101, obtaining the current location information of the mobile terminal; the current location information includes the current mobile country code.

[0071] Here, the current location information is the geographical location where the mobile terminal is currently located, in particular, the country where it is located.

[0072] The card application can obtain the current location information of the mobile terminal in the following ways: 1. Active acquisition after booting: After the mobile terminal is booted, the card application can send an active command to request the terminal location information (location info) from the terminal. If it can be successfully acquired, the MCC of the current location is directly parsed from the acquired terminal location information.

[0073] 2. Location event trigger: If the location information is not acquired at power on, the card application waits for a location change notification from the terminal, i.e. D6 event. When the terminal's geographical location changes significantly (e.g. entering a new country), the terminal will send this event to the card application in the SIM card, and the card application can acquire the location information including the MCC from this event.

[0074] 3. Timer trigger: The card application can also start a timer (e.g. status timer with 30 seconds interval) to periodically send a command to the terminal to acquire the location information, thus ensuring that the location change of the terminal is not missed.

[0075] In an embodiment, step S101 specifically comprises steps S201-S204.

[0076] Step S201, after the mobile terminal is powered on, a location acquisition request is sent to the mobile terminal.

[0077] Here, after the mobile terminal is powered on, the card application sends a location request command to the mobile terminal to request the current location info of the terminal. If the mobile terminal can respond immediately and return valid location information, the card application can directly parse the required current mobile country code from the location info.

[0078] Step S202, if the current location information returned by the mobile terminal is not received, a waiting state is entered until a location event notification sent by the mobile terminal is received; the location event notification is generated by the mobile terminal when the location changes; the location event notification includes the current location information.

[0079] Here, if the active request after power on fails (e.g. the terminal has not completed network search at that time and cannot provide location information), the card application will enter a passive waiting state. In this state, it will listen to the location event notification (D6) sent by the mobile terminal.

[0080] The location event notification is an event generated by the mobile terminal when it detects that its location has changed significantly (e.g. roaming from one country to another), in order to notify the SIM card. The event notification includes the new location information of the mobile terminal, including the current mobile country code.

[0081] Step S203, after receiving the location event notification, the current network entry state value of the mobile terminal is acquired.

[0082] Here, when the card application successfully captures the location event notification, the current network entry state value of the mobile terminal is determined.

[0083] Step S204, if the current network entry state value is the first preset value, extracting the current mobile country code in the current location information.

[0084] Here, the first preset value is used to represent that the mobile terminal has been normally registered in the network at the current location, which can be set as "00". In this case, it can be considered that the information in the location event notification is accurate and reliable, and the card application can obtain the current MCC in the location info.

[0085] In an embodiment, after the step of obtaining the current network entry state value of the mobile terminal in step S203, the method further comprises steps S301-S303.

[0086] Step S301, if the current network entry state value is not the first preset value, sending a preset mobile country code acquisition instruction to the mobile terminal to acquire the current mobile country code, and adding 1 to the acquisition times; wherein the initial value of the acquisition times is 0.

[0087] Here, if the acquired current network entry state value is not the first preset value (which can be the second preset value "01" or the third preset value "02"), it indicates that the mobile terminal may not have successfully entered the network or is in an abnormal state, and at this time, the MCC cannot be acquired.

[0088] Initializing the acquisition times counter, i.e. setting the initial value of the acquisition times counter to 0.

[0089] The card application actively sends a mobile country code acquisition instruction to the mobile terminal, and at the same time, adds 1 to the value of the acquisition times counter.

[0090] Step S302, if the current mobile country code returned by the mobile terminal is received, resetting the acquisition times to the initial value.

[0091] Here, if the current mobile country code returned by the mobile terminal is successfully received, it indicates that the acquisition is successful, and the acquisition times counter can be reset to the initial value.

[0092] Step S303, if the current mobile country code returned by the mobile terminal is not received, sending the preset mobile country code acquisition instruction to the mobile terminal again until the current mobile country code returned by the mobile terminal is received or the acquisition times reaches a preset maximum acquisition times.

[0093] Here, if the returned mobile country code cannot be received, it indicates that this attempt has failed. At this time, the card application will send the preset mobile country code acquisition instruction to the mobile terminal again until the returned MCC is successfully received, or the acquisition times reaches the preset maximum acquisition times. In this embodiment, the maximum acquisition times can be set to 3 times (i.e. after the first attempt fails, it is retried twice).

[0094] In another possible implementation, step S101 specifically comprises: After the mobile terminal is powered on, a location obtaining request is periodically sent to the mobile terminal based on a preset time interval, so as to obtain the current MCC returned by the mobile terminal.

[0095] Here, after the mobile terminal is powered on, the card application in the SIM card starts and registers an internal timer, which can be a status event.

[0096] The timer runs at a preset time interval. The preset time interval can be configured according to actual needs. For example, in this embodiment, the preset time interval can be set to 30 seconds.

[0097] Whenever the timer reaches the preset time interval, the card application triggers a predetermined operation, i.e., periodically sends a location obtaining request to the mobile terminal. Specifically, the card application generates a location obtaining request for obtaining location information and sends it to the mobile terminal.

[0098] After the card application sends the request, it waits for the response from the mobile terminal. Once the MCC is successfully obtained from the response of the terminal, the card application compares the obtained MCC with the MCC group associated with the current IMSI to determine whether switching is needed.

[0099] Through this periodic request method based on a preset time interval, the embodiment of the application can ensure continuous monitoring of the location state of the terminal at a fixed frequency, improving the initiative and fault tolerance of the system, so as to fully consider the intelligence, real-time and flexibility of IMSI switching.

[0100] Step S102, determining whether the current MCC belongs to the current MCC group associated with the current IMSI data file.

[0101] Here, after the current MCC is obtained, the card application will perform a matching judgment. First, the currently used IMSI data file (for example, the “0011” file) recorded by the internal variable is read, and the MCC group data therein is extracted. Then, the obtained current MCC is compared with all MCCs in the MCC group. If the current MCC is one of the MCCs in the MCC group, it is determined that the matching is successful, which means that the current IMSI is suitable for the current area and no switching is needed.

[0102] Step S103, if it does not belong to the current MCC group, traversing other IMSI data files to determine whether there is another MCC group matching the current MCC.

[0103] Here, if the current MCC is not in the MCC group of the currently used IMSI data file, the card application initiates the traversal query mechanism. In a preset order, the card application reads other IMSI data files (for example, the "0012" file) stored in the SIM card one by one, compares the current MCC with the MCC group associated with each of the files, and finds an MCC group containing the MCC.

[0104] In an embodiment, the SIM card further stores a configuration file; the configuration file records a default identifier of a default IMSI data file.

[0105] Here, the default identifier is used to indicate which IMSI data file should be switched to when all matching logics fail. For example, referring to Table 2, the bytes Byte 2-3 of the configuration file can be written with the data "0011", which indicates that the IMSI data file with the ID "0011" is designated as the default switching target.

[0106] Step S103 specifically includes the following steps S401-S403.

[0107] Step S401, if there is no matching other mobile country code group, based on the configuration file, a default IMSI data file corresponding to a default identifier is determined as a target IMSI data file; the target IMSI data file includes target IMSI data.

[0108] Here, when the card application obtains the current MCC of the mobile terminal, all the IMSI data files stored in the SIM card have been traversed, but it is found that the MCC does not match the mobile country code group associated with all the IMSI data files. At this time, the default switching mechanism is triggered.

[0109] Once triggered, the card application reads the configuration file. It parses a preset default identifier (for example, "0011") from the configuration file. Then, the card application determines the default IMSI data file corresponding to the default identifier (that is, the file with the ID "0011") as the target IMSI data file for this switching. The target IMSI data file includes target IMSI data to be used.

[0110] Step S402, the target IMSI data is written into a preset network access authentication file in the SIM card to generate target network access authentication data.

[0111] Here, the card application writes the target IMSI data into the preset network access authentication file in the SIM card to generate new target network access authentication data.

[0112] Step S403, a refresh instruction is sent to the mobile terminal, so that the mobile terminal completes network registration based on the target network access authentication data.

[0113] Here, after the internal file of the SIM card is updated, the card application sends a refresh instruction (REFRESH instruction) to the mobile terminal, so that the mobile terminal can complete new network registration based on the target network access authentication data.

[0114] Step S104, if there is a matched other mobile country code group, determining the IMSI data file corresponding to the matched other mobile country code group as a target IMSI data file; the target IMSI data file includes target IMSI data.

[0115] Here, once an IMSI data file is found in the traversal process, and the MCC group associated with the IMSI data file includes the current MCC, the IMSI data file is determined as the target IMSI data file for this switching operation. The target IMSI data file includes target IMSI data to be used for registration in the new country network.

[0116] In an embodiment, after the step of determining the IMSI data file corresponding to the matched other mobile country code group as the target IMSI data file in step S104, the method further includes: updating the current data file identifier to a target identifier corresponding to the target IMSI data file.

[0117] Here, the target identifier is used to record in real time the ID corresponding to the IMSI data file currently being used by the mobile terminal. When the card application is initialized, the target identifier is set to an initial value, for example, "0011". When performing IMSI switching judgment, the card application determines which MCC group in which IMSI data file should be compared with the MCC of the current location according to the target identifier.

[0118] Specifically, the card application updates the value of the current data file identifier variable stored in the card application to the target identifier corresponding to the newly determined target IMSI data file. For example, assuming that the value of the target identifier before switching is "0011". After judgment, it is determined that the IMSI data file with the file ID "0012" needs to be switched to. At this time, the card application modifies the value of the target identifier from "0011" to "0012".

[0119] When the mobile terminal changes its location again and triggers the IMSI switching process again, the card application correctly starts MCC matching from the currently truly effective IMSI data file based on the updated target identifier (for example, "0012").

[0120] Step S105, writing the target IMSI data into a preset network access authentication file in the SIM card to generate target network access authentication data.

[0121] Here, the target IMSI data is written into a first network authentication file for network registration and identity authentication.

[0122] Other related network parameters are updated, such as updating the access control level parameter to a second network authentication file.

[0123] In order to ensure that the terminal can be registered in the new network, some other network authentication files related to the old network registration information are restored to default values.

[0124] At the same time, the card application updates its internal variables, and updates the currently used IMSI file ID to the ID of the target IMSI data file.

[0125] In an embodiment, step S105 specifically includes steps S501-S503.

[0126] Step S501, write the target IMSI data into the first network authentication file.

[0127] Here, the card application writes the target IMSI data read from the target IMSI data file into the preset first network authentication file for storing IMSI. In a specific embodiment, the file path of the first network authentication file is 3F00 / 7FF0 / 6F07.

[0128] Step S502, obtain the access control parameter corresponding to the target IMSI data file, and write the access control parameter into the second network authentication file; wherein each IMSI data file corresponds to an access control parameter.

[0129] Here, in order to ensure the compatibility of network access and the correctness of the authority, in addition to updating the IMSI itself, the associated access control parameter (ACC, Access Control Class, ACC) also needs to be updated synchronously. Each IMSI data file can correspond to a specific access control parameter. When the target IMSI data file is determined, the corresponding ACC value is also determined. The card application will write this new ACC parameter into the preset second network authentication file for storing ACC. In a specific embodiment, the path of the second network authentication file can be 3F00 / 7FF0 / 6F78.

[0130] Step S503, set the third network authentication file related to the operator network access configuration to a default value to clear the original registration information.

[0131] Here, in order to clear the original registration information, avoid the interference of old network configuration or cache data to the network registration using the new IMSI, the card application will restore the data content of at least one third network access authentication file to its preset default value. In a specific embodiment, the third network access authentication files that need to be set to the default value can include multiple, for example: 6F7E, 6F73, 6F7B, wherein the file 6F7E is set to the default value FFFFFF00F0000000FF01. The file 6F73 is set to the default value FFFFFFFFFFF00F0000000FF01. The file 6F7B is set to the default value of all FF.

[0132] In step S106, a refresh instruction is sent to the mobile terminal, so that the mobile terminal completes network registration based on the target network access authentication data.

[0133] Here, after the network access authentication data in the SIM card is completely updated, the card application will assemble a REFRESH instruction (for example, a 00 type REFRESH instruction) and send it to the mobile terminal. After receiving the instruction, the mobile terminal will identify that the SIM card application data has been updated, thereby reinitializing the communication with the SIM card, and initiating a new network registration process based on the target network access authentication data just written to the mobile network currently located. After successful registration, the user can normally use the communication service in the new country.

[0134] The IMSI data switching method provided by the embodiment of the application can intelligently and in real time perceive the terminal position change and autonomously complete the matching, judgment and switching operation of the IMSI, thereby overcoming the defects such as complicated operation, communication interruption and additional cost caused by manual replacement of the SIM card in the traditional roaming, and further guaranteeing the continuity and stability of the communication service of the user in cross-country or cross-region roaming, and improving the automation level, reliability and user experience of the service.

[0135] The computer program product provided by the embodiment of the application includes a computer readable storage medium storing program codes, and the instructions included in the program codes can be used to execute the method described in the foregoing method embodiment. The specific implementation can be referred to the method embodiment, and will not be described here.

[0136] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the foregoing method embodiment, and will not be described here.

[0137] In addition, in the description of the embodiments of the present application, unless otherwise explicitly specified and limited, the terms "mounting", "connection", "connecting" should be understood in a broad sense, for example, can be fixedly connected, or can be detachably connected, or integrally connected; can be mechanically connected, or can be electrically connected; can be directly connected, or can be indirectly connected through an intermediate medium; can be internal communication of two elements. For those skilled in the art, the specific meanings of the above terms in the present application can be understood according to the specific circumstances.

[0138] If the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application or the parts of the present application that essentially contribute to the prior art or the parts of the technical solutions can be embodied in the form of software products. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0139] In the description of the present application, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer" and the like indicate the orientation or positional relationship shown in the drawings, and are only for the purpose of facilitating the description of the present application and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as limiting the present application. In addition, the terms "first", "second", "third" are only for the purpose of description, and cannot be understood as indicating or implying relative importance.

[0140] Finally, it should be noted that: the above-described embodiments are only specific embodiments of the present application, used to illustrate the technical solutions of the present application, and are not limiting, the protection scope of the present application is not limited thereto, although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art within the technical scope disclosed by the present application can modify or easily think of changes to the technical solutions recorded in the foregoing embodiments, or make equivalent replacement to part of the technical features; and these modifications, changes or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be covered within the protection scope of the present application.

Claims

1. A method of switching IMSI data, characterized by, The application is applied to a card application, the card application is pre-installed in a SIM card of a mobile terminal, at least one IMSI data file is preset in the SIM card, each IMSI data file is associated with a mobile country code group, the mobile country code group includes at least one mobile country code, and the method comprises the following steps: Obtaining current location information of the mobile terminal, wherein the current location information includes a current mobile country code; Determining whether the current mobile country code belongs to a current mobile country code group associated with a current IMSI data file; If the current mobile country code does not belong to the current mobile country code group, traversing other IMSI data files to determine whether there is a matched other mobile country code group; If there is a matched other mobile country code group, determining a target IMSI data file corresponding to the matched other mobile country code group, wherein the target IMSI data file includes target IMSI data; Writing the target IMSI data into a preset network access authentication file in the SIM card to generate target network access authentication data; Sending a refresh instruction to the mobile terminal to enable the mobile terminal to complete network registration based on the target network access authentication data.

2. The method of claim 1, wherein, The step of obtaining the current location information of the mobile terminal comprises the following steps: After the mobile terminal is powered on, sending a location obtaining request to the mobile terminal; If the current location information returned by the mobile terminal is not received, entering a waiting state until a location event notification actively sent by the mobile terminal is received, wherein the location event notification is generated when the mobile terminal changes location, and the location event notification includes the current location information; After the location event notification is received, obtaining a current network access state value of the mobile terminal; If the current network access state value is a first preset value, extracting the current mobile country code in the current location information.

3. The method of claim 2, wherein, After the step of obtaining the current network access state value of the mobile terminal, the method further comprises the following steps: If the current network access state value is not the first preset value, sending a preset mobile country code obtaining instruction to the mobile terminal to obtain the current mobile country code, and increasing the obtaining times by 1, wherein the initial value of the obtaining times is 0; If the current mobile country code returned by the mobile terminal is received, resetting the obtaining times to the initial value; If the current mobile country code returned by the mobile terminal is not received, sending the preset mobile country code obtaining instruction to the mobile terminal again until the current mobile country code returned by the mobile terminal is received or the obtaining times reaches a preset maximum obtaining times.

4. The method of claim 1, wherein, The step of obtaining the current location information of the mobile terminal comprises the following steps: After the mobile terminal is powered on, periodically sending a location obtaining request to the mobile terminal based on a preset time interval to obtain the current mobile country code returned by the mobile terminal.

5. The method of claim 1, wherein, The SIM card further stores a configuration file, and the configuration file records a default identifier of a default IMSI data file. If the current mobile country code does not belong to the current mobile country code group, the method further comprises the steps of: If there is no matched mobile country code group, determining the target IMSI data file corresponding to the default identifier based on the configuration file; the target IMSI data file comprises the target IMSI data; writing the target IMSI data into a preset network access authentication file in the SIM card to generate target network access authentication data; sending a refresh instruction to the mobile terminal to enable the mobile terminal to complete network registration based on the target network access authentication data.

6. The method of claim 1, wherein, The step of writing the target IMSI data into a preset network access authentication file in the SIM card comprises: writing the target IMSI data into a first network access authentication file; obtaining an access control parameter corresponding to the target IMSI data file and writing the access control parameter into a second network access authentication file; each IMSI data file corresponds to an access control parameter; setting a third network access authentication file related to operator network access configuration to a default value to clear original registration information.

7. The method of claim 1, wherein, After the step of determining the IMSI data file corresponding to the matched mobile country code group as the target IMSI data file, the method further comprises: updating the current data file identifier to a target identifier corresponding to the target IMSI data file.

8. A card application, characterized by The SIM card is pre-installed in a mobile terminal, and the SIM card is pre-provided with at least one IMSI data file; each IMSI data file is associated with a mobile country code group, and the mobile country code group comprises at least one mobile country code; the card application comprises: a location information acquisition module for acquiring current location information of the mobile terminal; the current location information comprises a current mobile country code; a target IMSI data file determination module for determining whether the current mobile country code belongs to a current mobile country code group associated with a current IMSI data file; the target IMSI data file determination module is further configured to, if the current mobile country code does not belong to the current mobile country code group, traverse other IMSI data files to determine whether there is a matched mobile country code group; the target IMSI data file determination module is further configured to, if there is a matched mobile country code group, determine an IMSI data file corresponding to the matched mobile country code group as a target IMSI data file; the target IMSI data file comprises target IMSI data; a network access authentication data determination module for writing the target IMSI data into a preset network access authentication file in the SIM card to generate target network access authentication data; the network access authentication data determination module is further configured to send a refresh instruction to the mobile terminal to enable the mobile terminal to complete network registration based on the target network access authentication data.

9. A SIM card, characterized by The SIM card comprises a card body and a card application as claimed in claim 8, wherein the card application is pre-installed in the card body.

10. The SIM card of claim 9, wherein, The SIM card is provided with at least one IMSI data file and a configuration file, wherein each IMSI data file is associated with a mobile country code group, and the mobile country code group comprises at least one mobile country code; and the configuration file records a default identifier of a default IMSI data file.

Citation Information

Patent Citations

  • Network switching method and device for multimode card terminal

    CN104754670A

  • International roaming implementation method and system based on card number switching

    CN106792643A

  • Enhanced Cloud Sim

    CN107710799A

  • SIM (Subscriber Identity Module) network access method and device, SIM card and storage medium

    CN119629606A

  • Network registration method and device

    WO2018045805A1

Cited By

  • ESIM card management method and system and eSIM card

    CN121665218A