A SIM card switching method and related equipment
By setting up a PDU keep-alive strategy in the dual-card terminal to maintain the PDU connection between the main card and the secondary card, the problem of the dual-card terminal being unable to access the Internet when switching data service SIM cards is solved, and the switching efficiency and user experience are improved.
Patent Information
- Application Number
- CN202310549745.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-15
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2043-05-15
AI Technical Summary
When the dual-card terminal switches the data service SIM card, it will take a long time to access the Internet, which will affect the user experience.
By setting a PDU keep-alive policy in the terminal, the main card and the secondary card keep PDU connections during the switching process, avoid disconnection and rebuilding of connections, and shorten the switching time.
It greatly shortens the deactivation and activation time of SIM cards for dual-card terminal switching data service, reduces the time when you cannot access the Internet, and improves the user experience.
Smart Images

Figure CN117693075B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communications, and in particular to a SIM card switching method and related equipment. Background Art
[0002] At present, many terminals can support the use of dual cards, that is, two subscriber identification (Subscriber Identity Module, SIM) cards. These terminals can also be called dual-card terminals. Dual-card terminals only support one of the SIM cards to use radio frequency (Radio Frequency, RF) resources at the same time. In other words, dual-card terminals can only use one of the SIM cards as a data service Internet card at the same time. It can be understood that the dual-card terminal originally used card 1 as the data service SIM card, and card 2 can be used as the data service SIM card later. In the process of the dual-card terminal switching the data service SIM card from card 1 to card 2, the dual-card terminal first needs to deactivate the data service of card 1, and after the deactivation of the data service by card 1 is completed, card 2 activates the data service. In other words, only when one SIM card in the dual-card terminal deactivates the data service can the other SIM card activate the data service. In the process of deactivating and activating the data service, the dual-card terminal cannot access the Internet, affecting the user's Internet experience.
[0003] Therefore, how to reduce the time during which a dual-SIM terminal cannot access the Internet when switching data service SIM cards is a problem that needs to be solved urgently. Summary of the invention
[0004] The present application provides a SIM card switching method and related equipment. The method can be applied to a terminal provided with two SIM cards. According to the method, in the process of the terminal switching the data service SIM card from the main card to the secondary card, the main card in the terminal does not need to disconnect the PDU connection, and in the subsequent process of the terminal switching the data service SIM card from the secondary card to the main card again, the secondary card in the terminal does not need to disconnect the PDU connection, and the main card in the terminal does not need to re-establish the PDU connection. After the above-mentioned switching from the secondary card to the main card is completed, the secondary card in the terminal can disconnect the PDU connection.
[0005] In a first aspect, the present application provides a SIM card switching method. The method can be applied to a terminal including a first SIM card and a second SIM card. The first SIM card is a data service SIM card used by the terminal by default. The method may include: when the terminal detects that the current scenario is a first switching scenario, the terminal may switch the used data service SIM card from the first SIM card to the second SIM card; the terminal may set the second SIM card PDU to be kept alive; when the terminal detects exiting the first switching scenario, the terminal may switch the used data service SIM card from the second SIM card to the first SIM card. In the process of switching the used data service SIM card from the second SIM card to the first SIM card, the terminal may maintain the PDU connection of the second SIM card.
[0006] In the solution provided by the present application, the terminal can switch the data service SIM card from the first SIM card to the second SIM card in a specific scenario (for example, the first switching scenario), and set the second SIM card PDU keep alive after completing the switch, so that in the subsequent process of switching the data service SIM card back to the first SIM card, the second SIM card can maintain the PDU connection without disconnecting. The above method can greatly shorten the time for the terminal to switch the data service SIM card while avoiding the secondary card from receiving network junk packets as much as possible.
[0007] In some embodiments of the present application, when the terminal detects that the data service is turned on for the first time, the terminal can set the PDU keepalive for the first SIM card, and the terminal turns on the PDU keepalive for the first SIM card regardless of whether the second SIM card sets the PDU keepalive subsequently.
[0008] In some embodiments of the present application, when the terminal detects for the first time that the data service is turned on, the terminal can set the second SIM card not to perform PDU keep-alive, and then in a specific scenario (for example, completing the switching of the data service card to the second SIM card in the first switching scenario), the terminal sets the second SIM card to perform PDU keep-alive.
[0009] It can be understood that the data service SIM card is the SIM card corresponding to the data service used by the terminal. That is, the data service used by the terminal is the data service of the data service SIM card. The terminal sets the second SIM card PDU keep alive, which can be understood as: the second SIM card in the terminal performs PDU keep alive. That is, the terminal turns on the second SIM card PDU keep alive.
[0010] In some embodiments of the present application, the first SIM card is card 1 and the second SIM card is card 2 .
[0011] In some embodiments of the present application, the first switching scenario refers to an automatic switching data service SIM card scenario. The relevant description of the automatic switching data service SIM card scenario can be found in the following text and will not be described in detail here.
[0012] In combination with the first aspect, in a possible implementation manner, the method may further include: after the terminal switches the data service SIM card to be used from the second SIM card to the first SIM card, the terminal may disconnect the PDU connection of the second SIM card.
[0013] In the solution provided by the present application, after the terminal switches the data service SIM card from the first SIM card to the second SIM card and sets the PDU keep-alive of the second SIM card, once the terminal detects the exit from the first switching scenario, the terminal can switch the data service SIM card from the second SIM card to the first SIM card, and in this process, the terminal maintains the PDU connection between the first SIM card and the second SIM card. After the terminal switches the data service SIM card from the second SIM card to the first SIM card, the terminal uses the data service of the first SIM card. In this case, the terminal can disconnect the PDU connection of the second SIM card. In the above manner, during the process of the terminal switching the data service SIM card, the terminal does not need to disconnect the PDU connection of the SIM card and rebuild the PDU connection of the SIM card, which reduces the time for the terminal to switch the data service SIM card. In addition, through the above method, after completing the switching of the data service SIM card to the second SIM card, the terminal can no longer maintain the PDU connection of the second SIM card, avoiding receiving network junk packets when using the data service of the first SIM card because the PDU connection of the second SIM card is not disconnected.
[0014] In combination with the first aspect, in a possible implementation manner, the terminal disconnects the PDU connection of the second SIM card, which may specifically include: when the time after the data service SIM card in use is switched from the second SIM card to the first SIM card exceeds the first time threshold, the terminal may disconnect the PDU connection of the second SIM card.
[0015] In the solution provided by the present application, the terminal does not need to disconnect the PDU connection of the second SIM card immediately after completing the switching of the data service card from the second SIM card to the first SIM card, but disconnects the PDU connection of the second SIM card after a period of time after completing the switching. In this way, the terminal can disconnect the PDU connection of the second SIM card while stably using the data service of the first SIM card.
[0016] In some embodiments of the present application, the first time threshold is a default duration defined by a timer referred to below.
[0017] In combination with the first aspect, in a possible implementation method, the terminal sets the second SIM card PDU to be kept alive, which may specifically include: when the terminal completes switching the data service SIM card to be used from the first SIM card to the second SIM card, the terminal may send an instruction to enable the second SIM card PDU keep alive to the second SIM card baseband chip in the terminal through the data service SIM card management module.
[0018] In some embodiments of the present application, the second SIM card baseband chip may be a card 2 baseband chip. The instruction for enabling the second SIM card PDU keep alive may be a card 2 PDU keep alive strategy_2.
[0019] In some embodiments of the present application, the data service SIM card management module is not integrated into the Telephony in the terminal. That is, the terminal includes the data service SIM card management module and the Telephony. In this case, the terminal completes the switching of the data service SIM card to be used from the first SIM card to the second SIM card, which may specifically include: the data service SIM card management module receives the switching completion message_1 sent by the Telephony. It is understood that this implementation method can be specifically referred to Figure 5A Related description.
[0020] In some embodiments of the present application, the data service SIM card management module is integrated into the Telephony in the terminal. That is, the terminal includes the Telephony, and the Telephony integrates the function of the data service SIM card management module. In this case, the terminal completes the switching of the data service SIM card used from the first SIM card to the second SIM card, which may specifically include: the Telephony receives the card 2 activation completion message sent by the card 2 baseband chip. It can be understood that this implementation method can be specifically referred to Figure 5B Related description.
[0021] In combination with the first aspect, in a possible implementation, the terminal switches the data service SIM card used from the second SIM card to the first SIM card, which may specifically include: the terminal deactivates the data service of the second SIM card and activates the data service of the first SIM card. The terminal deactivates the second SIM card, which may specifically include: the terminal may send a first deactivation instruction to the second SIM card baseband chip in the terminal through Telephony; when the second SIM card baseband chip maintains the PDU connection of the second SIM card, the terminal may send a first deactivation completion message to Telephony through the second SIM card baseband chip.
[0022] In the solution provided in the present application, after the terminal sets the second SIM card to keep alive, the terminal does not need to disconnect the PDU connection of the second SIM card during the process of deactivating the data service of the second SIM card, which can reduce the time for switching the data service SIM card.
[0023] In some embodiments of the present application, the first deactivation instruction may be an instruction to deactivate card 2. The first deactivation completion message may be a card 2 deactivation completion message.
[0024] In combination with the first aspect, in a possible implementation manner, before the terminal disconnects the PDU connection of the second SIM card, the method may also include: when the terminal completes switching the data service SIM card in use from the second SIM card to the first SIM card, the terminal may send an instruction to turn off the second SIM card PDU keep-alive to the second SIM card baseband chip in the terminal through the data service SIM card management module.
[0025] In the solution provided by the present application, the terminal can disconnect the PDU connection of the second SIM card after sending an instruction to turn off the PDU keep-alive of the second SIM card to the second SIM card baseband chip in the terminal through the data service SIM card management module. This method can minimize the time that the terminal maintains the PDU connection of the two SIM cards at the same time, thereby reducing the situation where too many network junk packets are received due to the failure to disconnect the PDU connection of the second SIM card when the first SIM card is used as the data service SIM card.
[0026] In some embodiments of the present application, the instruction to turn off the second SIM card PDU keep-alive may be card 2 PDU keep-alive policy_3.
[0027] In combination with the first aspect, in a possible implementation manner, during the process of switching the data service SIM card in use from the first SIM card to the second SIM card, and during the process of switching the data service SIM card in use from the second SIM card to the first SIM card, the terminal can maintain the PDU connection of the first SIM card.
[0028] In the solution provided by the present application, the terminal can set the PDU keep alive of the first SIM card, and the terminal can always maintain the PDU keep alive policy of the first SIM card. In the above manner, the terminal does not need to disconnect or establish the PDU connection of the first SIM card during the process of switching the data service SIM card, thereby reducing the time required for the terminal to switch the data service SIM card.
[0029] In conjunction with the first aspect, in a possible implementation, the first switching scenario may be that the second SIM card enters a call state. Exiting the first switching scenario may specifically include: the second SIM card exits the call state.
[0030] It is understandable that the first switching scenario may be a scenario in which the terminal automatically switches the data service SIM card. That is, the terminal may automatically switch the data service SIM card when detecting that the current scenario is the first switching scenario.
[0031] In the solution provided in the present application, the terminal can automatically switch the data service SIM card when the second SIM card enters a call state.
[0032] In combination with the first aspect, in a possible implementation, the first switching scenario may be that the first SIM card network is stuck. Exiting the first switching scenario may specifically include any one or more of the following: the duration of the terminal being in the screen-off state exceeds the second time threshold; the duration of the terminal's foreground application retreating to the background exceeds the third time threshold; the duration of the terminal switching the data service SIM card used from the first SIM card to the second SIM card exceeds the fourth time threshold, and the signal strength of the first SIM card exceeds the first signal strength threshold, and the network standard of the first SIM card meets the first network standard condition; the second SIM card network is stuck, and the signal strength of the first SIM card exceeds the first signal strength threshold, and the network standard of the first SIM card meets the first network standard condition.
[0033] In the solution provided in the present application, the terminal can automatically switch the data service SIM card when the first SIM card network is stuck.
[0034] In some embodiments of the present application, the second time threshold may be time threshold_1. The third time threshold may be time threshold_2. The fourth time threshold may be time threshold_3. The first signal strength threshold may be signal strength threshold_1. The first network standard condition may be network standard condition_1. It is understood that the relevant descriptions of time threshold_1, time threshold_2, time threshold_3, signal strength threshold_1 and network standard condition_1 can be referred to below and will not be described in detail here.
[0035] In combination with the first aspect, in a possible implementation manner, the network standard of the first SIM card satisfies the first network standard condition, specifically including: the network standard of the first SIM card is 4G or 5G.
[0036] In a second aspect, the present application provides an electronic device. The electronic device may include a display screen, one or more memories, and one or more processors. The one or more processors are coupled to the display screen and the one or more memories. The memory may be used to store a computer program. The processor may be used to call the computer program so that the electronic device performs the method described in the first aspect or any one of the implementations of the first aspect.
[0037] In a third aspect, the present application provides a computer storage medium, which includes computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the method described in the first aspect or any one of the implementations of the first aspect.
[0038] In a fourth aspect, an embodiment of the present application provides a chip. The chip can be applied to an electronic device, and the chip includes one or more processors, and the processor is used to call computer instructions to enable the electronic device to execute the method described in the first aspect or any implementation of the first aspect.
[0039] In a fifth aspect, an embodiment of the present application provides a computer program product comprising instructions. When the computer program product is run on an electronic device, the electronic device executes the method described in the first aspect or any one of the implementations of the first aspect.
[0040] It is understandable that the electronic device provided in the second aspect, the computer storage medium provided in the third aspect, the chip provided in the fourth aspect, and the computer program product provided in the fifth aspect are all used to execute the method described in the first aspect or any one of the implementations of the first aspect. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects of any possible implementation of the first aspect, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 A schematic diagram of the software and hardware architecture of a terminal provided in an embodiment of the present application;
[0042] Figure 2A and Figure 2B A set of software and hardware interaction schematic diagrams provided for embodiments of the present application;
[0043] Figure 3A A flowchart of a SIM card switching method provided in an embodiment of the present application;
[0044] Figure 3B A flowchart of another SIM card switching method provided in an embodiment of the present application;
[0045] Figure 4A-4C Another set of software and hardware interaction schematic diagrams provided for embodiments of the present application;
[0046] Figure 5A A flowchart of another SIM card switching method provided in an embodiment of the present application;
[0047] Figure 5B A flowchart of another SIM card switching method provided in an embodiment of the present application;
[0048] Figure 6A schematic diagram of the hardware structure of a terminal provided in an embodiment of the present application. DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in the text is only a description of the association relationship of the associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0050] It should be understood that the terms "first", "second", etc. in the specification, claims and drawings of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.
[0051] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments.
[0052] For a terminal that supports the use of dual cards (i.e., two SIM cards), it can only use one of the dual cards as a data service SIM card at the same time, that is, it can only use the data service of one of the dual cards at the same time. In the process of switching the data service SIM card of the terminal, the data service SIM card originally used by the terminal first needs to deactivate the data service. After the deactivation of the data service is completed, the other SIM card in the terminal can activate the data service. After the activation of the data service is completed, the terminal has completed the switching of the data service SIM card. This means that only when one SIM card in the terminal deactivates the data service can the other SIM card activate the data service. In the process of deactivating the data service and activating the data service, the terminal cannot use the data service, that is, the terminal cannot use the SIM card to access the Internet.
[0053] The embodiment of the present application provides a SIM card switching method and related equipment. The method can be applied to a terminal provided with two SIM cards. According to the method, the terminal can execute a strategy for keeping the protocol data unit (PDU) of the main card alive. Specifically, in the process of the terminal switching the data service SIM card from the main card to the secondary card, the main card in the terminal does not need to disconnect the PDU connection when deactivating the data service. In the subsequent process of the terminal switching the data service SIM card from the secondary card to the main card again, the main card in the terminal does not need to re-establish the PDU connection when activating the data service, which greatly shortens the deactivation time and activation time of the terminal when switching the data service SIM card. According to the method, in the scenario where the terminal automatically switches the data service SIM card, the terminal can execute the strategy for keeping the main card PDU alive and the secondary card PDU alive. Specifically, after the terminal automatically switches the data service SIM card from the main card to the secondary card, and then switches the data service SIM card from the secondary card to the main card, not only does the main card in the terminal not need to change the PDU connection state when deactivating and activating the data service, but the secondary card in the terminal does not need to disconnect the PDU connection when deactivating the data service. Instead, after the main card in the terminal activates the data service, the secondary card in the terminal stops the PDU keep alive and deactivates the data service. This method can greatly shorten the deactivation time and activation time of the terminal when switching the data service SIM card while minimizing the reception of network junk packets by the secondary card.
[0054] It is understood that the main card in the terminal refers to the default data service SIM card in the terminal, that is, the SIM card used for Internet access by default when the terminal is turned on. The secondary card in the terminal refers to another SIM card in the terminal other than the main card. For ease of description, this application refers to the main card in the terminal as card 1, and the secondary card in the terminal as card 2.
[0055] It is understandable that in the scenario where the terminal automatically switches the data service SIM card, the terminal can switch the data service SIM card based on the above method. The scenario where the terminal automatically switches the data service SIM card may specifically include but is not limited to: card 1 network freezes, and card 2 enters the call state.
[0056] It can be understood that a terminal, namely a terminal device (terminal), which can also be called a mobile station (Mobile Station, MS), a mobile terminal (Mobile Terminal, MT), etc., is a device that provides voice and / or data connectivity to users. The terminal may be a handheld terminal, a laptop computer, a subscriber unit, a cellular phone, a smart phone, a wireless data card, a personal digital assistant (PDA) computer, a tablet computer, a wireless modem, a handheld device (handheld), a laptop computer (Laptop Computer), a cordless phone (Cordless Phone) or a wireless local loop (Wireless Local Loop, WLL) station, a machine type communication (Machine Type Communication, MTC) terminal, a wearable device (such as a smart watch, a smart bracelet, a pedometer, etc.), a vehicle-mounted device (such as a car, a bicycle, an electric car, an airplane, a ship, a train, a high-speed rail, etc.), a virtual reality (Virtual Reality, VR) device, an augmented reality (Augmented Reality, AR) device, a wireless terminal in industrial control (Industrial Control), a smart home device (such as a refrigerator, a television, an air conditioner, an electric meter, etc.), an intelligent robot, a workshop device, a wireless terminal in self-driving, a remote surgery (Remote The wireless terminals include wireless terminals in medical surgery, wireless terminals in smart grid, wireless terminals in transportation safety, wireless terminals in smart city, wireless terminals in smart home, flying equipment (e.g., smart robots, drones) or other devices that can access the network.
[0057] The following first introduces the software and hardware architecture of a terminal provided by this application.
[0058] The software and hardware architecture of the terminal can be divided into the AP side and the BP side. Among them, AP refers to Application Processor, that is, the application processor. The operating system, user interface and application programs all run on the AP. The AP side refers to the application processor side. The software and hardware architecture of the terminal AP side can be understood as the software architecture of the terminal running on the AP, and the hardware modules related to the AP. BP refers to Baseband Processor, that is, the baseband processor. The baseband RF communication and control software all run on the BP. The BP side refers to the baseband processor side. The software and hardware architecture of the terminal BP side can be understood as the software architecture running on the BP in the terminal, and the hardware modules related to the BP.
[0059] See also Figure 1 , Figure 1 A schematic diagram of the software and hardware architecture of a terminal provided in an embodiment of the present application.
[0060] It is understandable that the software system of the terminal can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a microservice architecture, or a cloud architecture. The embodiment of the present application takes the Android operating system with a layered architecture as an example to illustrate the software architecture of the terminal. The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. Figure 1 As shown, the software architecture of the AP side of the terminal includes an application layer and an application framework layer (Application Framework).
[0061] The application layer may include a series of application packages, such as camera, gallery, settings, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications. It is understood that the application layer may include system applications and third-party applications.
[0062] The application framework layer provides an application programming interface (API) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions. The application framework layer can include a series of system services. System services are modular components that focus on specific functions. The functions provided by the application framework API can communicate with system services to access the underlying hardware.
[0063] like Figure 1 As shown, the application framework layer in the software architecture of the AP side of the terminal may include Telephony, a data service SIM card management module, a window manager, a notification manager, a view system, a resource manager, and a content provider.
[0064] It can be understood that Telephony refers to the system service that provides support for the Telephony Application Programming Interface (TAPI) of the phone application (i.e. the call application), which can be understood as the Telephony Framework in Android Telephony. Telephony can also be called Telephony service. Telephony can be used to provide communication functions for electronic devices, manage the call status of mobile phones (including connected, hung up, etc.), obtain phone information (device information, SIM card information and network information), listen to the phone status (call status service status, signal strength status, etc.), and call the phone dialer to make calls.
[0065] The data service SIM card management module is used to control the PDU keep-alive strategy of the SIM card in the terminal. Specifically, the data service SIM card management module is used to control the PDU connection state of the SIM card in the terminal during the process of deactivating and activating data services.
[0066] The data service SIM card management module can also be used to detect the automatic switching of data service SIM card scenarios. In some embodiments of the present application, the data service SIM card management module can monitor the main card information and the secondary card information in the terminal, as well as the call status of the main card and the secondary card. If the secondary card enters the call state, the PDU keep-alive module can determine that the current scenario is the automatic switching of the data service SIM card. In some embodiments of the present application, the data service SIM card management module can monitor the current network status (that is, the status of the network provided by the current data service SIM card). If the current network is in a stuck state, the data service SIM card management module can determine that the current scenario is the automatic switching of the data service SIM card.
[0067] In some embodiments of the present application, the data service SIM card management module can obtain relevant information of the message (or data packet) sent by the terminal to the network side. For example, the number of messages sent by the terminal to the network side, and the number of response messages received by the terminal from the network side. If several messages (or data packets) sent by the terminal to the network side do not receive responses from the network side one by one, the data service SIM card management module can determine that the current network is stuck. Exemplarily, the terminal sends 10 data packets to the network side within 10 seconds, and the terminal only receives 8 response messages sent by the network side, then the data service SIM card management module in the terminal can determine that the current network is stuck. In some embodiments of the present application, the data service SIM card management module can obtain relevant information of the message (or data packet) sent by the terminal to the network side from the corresponding module of the kernel layer.
[0068] In some embodiments of the present application, the function of the data service SIM card management module can be integrated into Telephony. In this case, the terminal can implement PDU policy delivery and automatic switching scene detection through Telephony.
[0069] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0070] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications from applications running in the background, or a notification that appears on the screen in the form of a dialogue interface. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
[0071] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
[0072] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0073] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0074] It should be noted that Figure 1 Only the layers of the software modules on the terminal AP side involved in this application are shown, and the layers of other software modules are not shown. It is understandable that the software architecture on the AP side of the terminal may also include other layers (for example, system library, runtime, hardware abstraction layer and kernel layer), which is not limited in this application. Figure 1 The software architecture of the terminal AP side shown is only an example and does not limit the specific module division in different layers of the Android operating system. For details, please refer to the introduction of the Android operating system software architecture in conventional technology. In addition, the method provided by this application can also be implemented based on other operating systems, and this application will not give examples one by one. It is understandable that Figure 1Only the software architecture of the terminal AP side is shown as an example, and the hardware structure of the AP side is not shown. The hardware structure of the terminal AP side can be found in the following text and related technical documents, and will not be described in detail here.
[0075] like Figure 1 As shown, the BP side of the terminal may include a card 1 baseband chip and a card 2 baseband chip. The card 1 baseband chip is used to manage card 1, and specifically can be used to manage the voice service (e.g., telephone service) and data service (e.g., Internet access service, video phone service, etc.) of card 1. The card 2 baseband chip is used to manage card 2, and specifically can be used to manage the voice service and data service of card 2. It can be understood that the card 1 baseband chip is a software and hardware module related to card 1, and the card 2 baseband chip is a software and hardware module related to card 2.
[0076] It should be noted that Figure 1 Only the software and hardware modules on the terminal AP side involved in this application are exemplarily shown, and other modules are not shown. It is understandable that the BP side of the terminal may also include other software modules and hardware modules, and this application does not limit this.
[0077] based on Figure 1 The software and hardware architecture shown in the figure, the following introduces a SIM card switching method provided by the present application from the perspective of software and hardware interaction.
[0078] See also Figure 2A and Figure 2B , Figure 2A and Figure 2B A set of software and hardware interaction schematic diagrams provided for an embodiment of the present application.
[0079] It is understandable that in the initial state (i.e., when the terminal detects that the data service is turned on for the first time), the terminal can use card 1 as a data service SIM card. Figure 2A As shown, when the terminal detects that the data service is turned on for the first time, the data service SIM card management module in the terminal can send the card 1 PDU keep-alive policy to the card 1 baseband chip, and send the card 2 PDU keep-alive policy_1 to the card 2 baseband chip.
[0080] It is understandable that the card 1 PDU keep-alive strategy may specifically include: card 1 performs PDU keep-alive. PDU keep-alive refers to maintaining the PDU connection. Card 2 PDU keep-alive strategy_1 may specifically include: card 2 does not perform PDU keep-alive. In some embodiments of the present application, the data service SIM card management module may only send an instruction to the card 1 baseband chip to perform PDU keep-alive, without sending an instruction to the card 2 baseband chip not to perform PDU keep-alive. In the case where the card 2 baseband chip does not receive the corresponding instruction sent by the data service SIM card management module, it can determine that card 2 does not perform PDU keep-alive.
[0081] In some embodiments of the present application, after the terminal is turned on, the data service of the primary card (i.e., card 1) can be used by default, without the need for the user to manually turn on the data service. In this case, the terminal detects that the data service is turned on for the first time, which may specifically include: the terminal detects that the data service is turned on after the terminal is turned on. At this time, the terminal can use the data service of card 1.
[0082] In some other embodiments of the present application, after the terminal is turned on, the user needs to manually turn on the data service. In this case, the terminal first detects that the data service is turned on, which may specifically include: the terminal first detects the user's operation of turning on the data service.
[0083] When the terminal detects a scenario of automatically switching the data service SIM card, the terminal may switch the data service SIM card from card 1 to card 2.
[0084] Specifically, Figure 2A As shown, the data service SIM card management module in the terminal can detect the automatic switching of the data service SIM card scenario, and send a switching data service SIM card instruction_1 to the Telephony in the terminal. After receiving the switching data service SIM card instruction_1 sent by the data service SIM card management module, the Telephony can send a deactivation card 1 instruction to the card 1 baseband chip. After the card 1 baseband chip receives the deactivation card 1 instruction sent by the Telephony, since the card 1 performs PDU keep alive, the card 1 baseband chip can send a card 1 deactivation completion message to the Telephony without disconnecting the PDU connection of the card 1. After the Telephony receives the card 1 deactivation completion message sent by the card 1 baseband chip, it can send an activation card 2 instruction to the card 2 baseband chip. After the card 2 baseband chip receives the activation card 2 instruction sent by the Telephony, since the card 2 does not perform PDU keep alive, the card 2 baseband chip needs to establish a PDU connection for the card 2, and after the establishment of the PDU connection of the card 2 is completed, it sends a card 2 activation completion message to the Telephony. After Telephony receives the card 2 activation completion message sent by the card 2 baseband chip, the terminal completes the switching of the data service SIM card from card 1 to card 2. In this way, the terminal can use the data service of card 2.
[0085] It can be understood that the data service SIM card instruction_1 can be used to instruct Telephony to switch the data service SIM card. Specifically, the data service SIM card instruction_1 can be used to instruct Telephony to switch the data service SIM card from card 1 to card 2. The deactivate card 1 instruction can be used to instruct to deactivate the data service of card 1. The activate card 2 instruction can be used to instruct to activate the data service of card 2.
[0086] When the terminal detects that the automatic switching of the data service SIM card scenario is exited, the terminal may switch the data service SIM card from card 1 to card 2 .
[0087] Specifically, Figure 2B As shown, the data service SIM card management module in the terminal can detect the exit from the automatic switching of the data service SIM card scenario, and send a switching data service SIM card instruction_2 to the Telephony in the terminal. After Telephony receives the switching data service SIM card instruction_2 sent by the data service SIM card management module, it can send a deactivation card 2 instruction to the baseband chip of card 2. After the baseband chip of card 2 receives the deactivation card 2 instruction sent by Telephony, since card 2 does not perform PDU keep-alive, the baseband chip of card 2 needs to disconnect the PDU connection of card 2. After the PDU connection of card 2 is disconnected, the baseband chip of card 2 can send a card 2 deactivation completion message to Telephony. After Telephony receives the card 2 deactivation completion message sent by the baseband chip of card 2, it can send an activation card 1 instruction to the baseband chip of card 1. After the card 1 baseband chip receives the activation card 1 instruction sent by Telephony, since card 1 performs PDU keep alive and the PDU connection of card 1 is not disconnected, the card 1 baseband chip can send a card 1 activation completion message to Telephony without re-establishing the PDU connection of card 1. After Telephony receives the card 1 activation completion message sent by the card 1 baseband chip, the terminal completes the switching of the data service SIM card from card 2 to card 1. In this way, the terminal can use the data service of card 1.
[0088] It can be understood that the data service SIM card instruction_2 can be used to instruct Telephony to switch the data service SIM card. Specifically, the data service SIM card instruction_2 can be used to instruct Telephony to switch the data service SIM card from card 2 to card 1. The deactivate card 2 instruction can be used to instruct to deactivate the data service of card 2. The activate card 1 instruction can be used to instruct to activate the data service of card 1.
[0089] In some embodiments of the present application, the data service SIM card management module in the terminal detects the automatic switching of the data service SIM card scenario, which may specifically include: the data service SIM card management module in the terminal detects that the card 2 enters the call state. The data service SIM card management module in the terminal detects the exit from the automatic switching of the data service SIM card scenario, which may specifically include: the data service SIM card management module in the terminal detects that the card 2 exits the call state.
[0090] It is understandable that the above-mentioned card 2 enters the call state, which may specifically include: entering the call state in the called scenario of card 2, and entering the call state in the calling scenario of card 2. It is understandable that the call state may specifically include: the ringing state when not connected, and the calling state after being connected. The call state entered in the called scenario of card 2 may specifically include: the ringing state when not connected in the called scenario of card 2, and the calling state after being connected in the called scenario of card 2. The call state entered in the calling scenario of card 2 may specifically include: the ringing state when not connected in the calling scenario of card 2, and the calling state when connected in the calling scenario of card 2. In layman's terms, calling means "making a call" and called means "answering a call". The specific meanings of calling and called can be referred to the relevant technical documents, which will not be explained in detail here.
[0091] It is understandable that the above-mentioned card 2 exits the call state, which may specifically include: exiting the call state in the card 2 called scenario, and exiting the call state in the card 2 calling scenario. It is understandable that exiting the call state may specifically include: exiting the ringing state (i.e. the ringing state when not connected), and exiting the calling state (i.e. the calling state after being connected). Exiting the call state in the card 2 called scenario may specifically include: in the card 2 called scenario, no answer or hang up in the ringing state, and hanging up in the calling state. Exiting the call state in the card 2 calling scenario may specifically include: in the card 2 calling scenario, no answer or hang up in the ringing state, and hanging up in the calling state. It is understandable that both parties of the call can hang up, and this application does not limit this.
[0092] In some embodiments of the present application, the data service SIM card management module in the terminal detects the automatic switching of the data service SIM card scenario, which may specifically include: the data service SIM card management module in the terminal detects that the card 1 network is stuck. The data service SIM card management module exits the automatic switching of the data service SIM card scenario, which may specifically include any one or more of the following:
[0093] (1) The duration of the terminal being in the screen-off state exceeds time threshold_1;
[0094] (2) The time duration for which the foreground application of the terminal retreats to the background exceeds time threshold_2;
[0095] (3) The time after the terminal switches the data service SIM card from card 1 to card 2 exceeds time threshold_3, the signal strength of card 1 exceeds signal strength threshold_1, and the network standard of card 1 meets network standard condition_1;
[0096] (4) The network of card 2 is stuck, the signal strength of card 1 exceeds the signal strength threshold_1, and the network standard of card 1 meets the network standard condition_1.
[0097] It is understandable that the network standard of card 1 satisfies the network standard condition_1, which may specifically include: the network standard of card 1 is not less than 4G (Generation). For example, the network standard of card 1 is 4G or 5G.
[0098] It is understandable that time threshold_1, time threshold_2, time threshold_3 and signal strength threshold_1 can be set according to actual needs, and the present application does not impose specific restrictions on this. For example, time threshold_1 can be 5 seconds. For example, time threshold_2 can be 60 seconds. Time threshold_3 can be 5 minutes.
[0099] Combine the following Figure 3A The specific implementation of the above embodiment is introduced.
[0100] See also Figure 3A , Figure 3A A flowchart of a SIM card switching method provided in an embodiment of the present application. The method may include but is not limited to the following steps:
[0101] S101: When the terminal detects that the data service is turned on for the first time, the data service SIM card management module sends a card 1 PDU keep-alive strategy to the card 1 baseband chip. The card 1 PDU keep-alive strategy includes card 1 performing PDU keep-alive.
[0102] When the terminal detects that the data service is turned on for the first time, the data service SIM card management module can send the card 1 PDU keep-alive policy to the card 1 baseband chip to instruct the card 1 to perform PDU keep-alive. Correspondingly, the card 1 baseband chip can receive the card 1 PDU keep-alive policy sent by the data service SIM card management module. The card 1 PDU keep-alive policy includes card 1 performing PDU keep-alive. It can be understood that PDU keep-alive means maintaining the PDU connection.
[0103] In some embodiments of the present application, after the terminal is turned on, the data service of the primary card (i.e., card 1) can be used by default, without the need for the user to manually turn on the data service. In this case, the terminal detects that the data service is turned on for the first time, which may specifically include: the terminal detects that the data service is turned on after the terminal is turned on. At this time, the terminal can use the data service of card 1.
[0104] In some other embodiments of the present application, after the terminal is turned on, the user needs to manually turn on the data service. In this case, the terminal first detects that the data service is turned on, which may specifically include: the terminal first detects the user's operation of turning on the data service.
[0105] S102: When the terminal detects that the data service is turned on for the first time, the data service SIM card management module sends the card 2 PDU keep-alive strategy_1 to the card 2 baseband chip. The card 2 PDU keep-alive strategy_1 includes that the card 2 does not perform PDU keep-alive.
[0106] When the terminal detects that the data service is turned on for the first time, the data service SIM card management module can send the card 2 PDU keep alive strategy_1 to the card 2 baseband chip to indicate that the card 2 does not perform PDU keep alive. Correspondingly, the card 2 baseband chip can receive the card 2 PDU keep alive strategy_1 sent by the data service SIM card management module. It can be understood that the card 2 PDU keep alive strategy_1 includes that the card 2 does not perform PDU keep alive.
[0107] In some embodiments of the present application, the terminal may not perform step S102. When the baseband chip of card 2 does not receive the corresponding instruction sent by the data service SIM card management module, it may determine that card 2 does not perform PDU keep alive.
[0108] It is understandable that the description related to the terminal detecting the start of the data service for the first time can be referred to above and will not be repeated here.
[0109] S103: When the data service SIM card management module detects that the current scenario is the automatic data service SIM card switching scenario, the data service SIM card management module sends a data service SIM card switching instruction_1 to Telephony.
[0110] When the data service SIM card management module detects that the current scenario is an automatic data service SIM card switching scenario, the data service SIM card management module may send a data service SIM card switching instruction_1 to Telephony. It is understandable that the data service SIM card instruction_1 may be used to instruct Telephony to switch the data service SIM card. Specifically, the data service SIM card instruction_1 may be used to instruct Telephony to switch the data service SIM card from card 1 to card 2.
[0111] According to the above, the scenario of automatically switching the data service SIM card may include but is not limited to: card 2 enters the call state, and the network of card 1 is stuck. The relevant description of the scenario of automatically switching the data service SIM card can be referred to above, and will not be repeated here.
[0112] Correspondingly, Telephony may receive the data service SIM card switching instruction_1 sent by the data service SIM card management module.
[0113] S104: Telephony sends a deactivation card 1 instruction to the card 1 baseband chip.
[0114] After receiving the switch data service SIM card instruction_1 sent by the data service SIM card management module, Telephony can send a deactivate card 1 instruction to the baseband chip of card 1. It can be understood that the deactivate card 1 instruction is used to instruct to deactivate the data service of card 1.
[0115] Correspondingly, the card 1 baseband chip can receive the deactivation card 1 instruction sent by Telephony.
[0116] S105: Based on the card 1 PDU keep-alive strategy, the card 1 baseband chip sends a card 1 deactivation completion message to Telephony.
[0117] It is understood that the card 1 PDU keep alive strategy includes card 1 performing PDU keep alive. That is, card 1 can maintain the PDU connection. After the card 1 baseband chip receives the deactivation card 1 instruction sent by Telephony, the card 1 baseband chip can send a card 1 deactivation completion message to Telephony without disconnecting the PDU connection of card 1. It is understood that the card 1 deactivation completion message is used to indicate that card 1 has deactivated the data service.
[0118] Correspondingly, Telephony can receive the card 1 deactivation completion message sent by the card 1 baseband chip.
[0119] S106: Telephony sends an activation card 2 instruction to the card 2 baseband chip.
[0120] After receiving the card 1 deactivation completion message sent by the card 1 baseband chip, Telephony can send an activation card 2 instruction to the card 2 baseband chip. It can be understood that the activation card 2 instruction is used to instruct to activate the data service of card 2.
[0121] Correspondingly, the card 2 baseband chip can receive the activation card 2 instruction sent by Telephony.
[0122] S107: Based on the card 2 PDU keep-alive strategy_1, the card 2 baseband chip establishes a PDU connection for card 2.
[0123] It can be understood that the card 2 PDU keep alive strategy_1 includes that the card 2 does not perform PDU keep alive. That is, the card 2 does not need to maintain the PDU connection. After the card 2 baseband chip receives the activation card 2 instruction sent by Telephony, the PDU connection of the card 2 can be established.
[0124] In some embodiments of the present application, if the data service SIM card management module does not send the card 2 PDU keep-alive strategy_1 to the card 2 baseband chip, the card 2 baseband chip can determine that the card 2 does not perform PDU keep-alive. In this case, once the card 2 baseband chip receives the activation card 2 instruction sent by Telephony, the card 2 baseband chip can establish the PDU connection of the card 2.
[0125] S108: The card 2 baseband chip sends a card 2 activation completion message to Telephony.
[0126] After the card 2 baseband chip successfully establishes the PDU connection of card 2, the card 2 baseband chip can send a card 2 activation completion message to Telephony.
[0127] Correspondingly, Telephony can receive the card 2 activation completion message sent by the card 2 baseband chip.
[0128] It can be understood that after the terminal executes step S108, the data service SIM card is switched from card 1 to card 2. In this case, the data service SIM card is switched to card 2, and the terminal can use the data service of card 2, that is, the terminal can access the Internet through card 2.
[0129] S109: When the data service SIM card management module detects that the terminal exits the automatic data service SIM card switching scenario, the data service SIM card management module sends a data service SIM card switching instruction_2 to Telephony.
[0130] When the data service SIM card management module detects that the terminal exits the automatic switching of the data service SIM card scenario, the data service SIM card management module may send a switch data service SIM card instruction_2 to Telephony. It is understandable that the data service SIM card instruction_2 may be used to instruct Telephony to switch the data service SIM card. Specifically, the data service SIM card instruction_2 may be used to instruct Telephony to switch the data service SIM card from card 2 to card 1.
[0131] It can be understood that when the automatic switching data service SIM card scenario is that card 2 enters the call state, the terminal exits the automatic switching data service SIM card scenario, which may specifically include: card 2 exits the call state.
[0132] It should be noted that, when the call status is specifically a ringing state when the call is not connected, exiting the call status may be exiting the ringing state when the call is not connected (specifically, it may be hanging up when there is no answer or the call is not connected), or may be exiting the calling state after the call is connected (specifically, it may be hanging up after the call is connected). When the call status is specifically a calling state after the call is connected, exiting the call status may be exiting the calling state.
[0133] It can be understood that in the case where the automatic switching of data service SIM card scenario is that the network of card 1 is stuck, the terminal exits the automatic switching of data service SIM card scenario, which may specifically include any one or more of the following: (1) the terminal detects that the duration of the terminal being in the screen-off state exceeds the time threshold_1; (2) the terminal detects that the duration of the terminal's foreground application retreating to the background exceeds the time threshold_2; (3) the terminal detects that the duration after the data service SIM card is switched from card 1 to card 2 exceeds the time threshold_3, and the signal strength of card 1 exceeds the signal strength threshold_1, and the network standard of card 1 meets the network standard condition_1; (4) the terminal detects that the network of card 2 is stuck, and the signal strength of card 1 exceeds the signal strength threshold_1, and the network standard of card 1 meets the network standard condition_1.
[0134] Correspondingly, Telephony may receive the data service SIM card switching instruction_2 sent by the data service SIM card management module.
[0135] S110: Telephony sends a deactivation card 2 instruction to the card 2 baseband chip.
[0136] After receiving the switch data service SIM card instruction_2 sent by the data service SIM card management module, Telephony can send a deactivation card 2 instruction to the baseband chip of card 2. It can be understood that the deactivation card 2 instruction can be used to instruct to deactivate the data service of card 2.
[0137] Correspondingly, the card 2 baseband chip can receive the card 2 deactivation instruction sent by Telephony.
[0138] S111: Based on the card 2 PDU keep-alive strategy_1, the card 2 baseband chip disconnects the PDU connection of card 2.
[0139] It can be understood that the card 2 PDU keep alive strategy_1 includes that the card 2 does not perform PDU keep alive. That is, the card 2 does not need to maintain the PDU connection. After the card 2 baseband chip receives the deactivate card 2 instruction sent by Telephony, since the card 2 does not perform PDU keep alive, the card 2 baseband chip can disconnect the PDU connection of the card 2.
[0140] S112: The card 2 baseband chip sends a card 2 deactivation completion message to Telephony.
[0141] After the card 2 baseband chip disconnects the PDU connection of the card 2, it can send a card 2 deactivation completion message to Telephony. It can be understood that the card 2 deactivation completion message can be used to indicate that the card 2 has deactivated the data service.
[0142] Correspondingly, Telephony can receive the card 2 deactivation completion message sent by the card 2 baseband chip.
[0143] S113: Telephony sends an activation card 1 instruction to the card 1 baseband chip.
[0144] After receiving the card 2 deactivation completion message sent by the card 2 baseband chip, Telephony can send an activation card 1 instruction to the card 1 baseband chip. It can be understood that the activation card 1 instruction can be used to instruct the activation of the data service of card 1.
[0145] Correspondingly, the card 1 baseband chip can receive the activation card 1 instruction sent by Telephony.
[0146] S114: Based on the card 1 PDU keep-alive strategy, the card 1 baseband chip sends a card 1 activation completion message to Telephony.
[0147] It is understood that the card 1 PDU keep-alive strategy includes card 1 performing PDU keep-alive. That is, card 1 maintains the PDU connection. After the card 1 baseband chip receives the activation card 1 instruction sent by Telephony, since the PDU connection was not disconnected when the card 1 previously deactivated the data service, the card 1 baseband chip can send the card 1 activation completion message to Telephony without re-establishing the PDU connection of card 1. It is understood that the card 1 activation completion message is used to indicate that the card 1 has activated the data service.
[0148] Correspondingly, Telephony can receive the card 1 activation completion message sent by the card 1 baseband chip.
[0149] It can be understood that after the terminal executes step S114, the data service SIM card is switched from card 2 to card 1. In this case, the data service SIM card is switched to card 1, and the terminal can use the data service of card 1, that is, it can access the Internet through card 1.
[0150] In some embodiments of the present application, the function of the data service SIM card management module can be integrated into Telephony. In this case, Figure 3A The interaction between the data service SIM card management module and other modules involved in the process can be performed by Telephony.
[0151] See also Figure 3B , Figure 3B A flowchart of another SIM card switching method provided in an embodiment of the present application. The method may specifically include but is not limited to the following steps:
[0152] S115: When the terminal detects that the data service is turned on for the first time, Telephony sends a card 1 PDU keep-alive strategy to the card 1 baseband chip. The card 1 PDU keep-alive strategy includes card 1 performing PDU keep-alive.
[0153] S116: When the terminal detects that the data service is turned on for the first time, Telephony sends the card 2 PDU keep-alive strategy_1 to the card 2 baseband chip. The card 2 PDU keep-alive strategy_1 includes that the card 2 does not perform PDU keep-alive.
[0154] S117: When detecting that the current scenario is the automatic switching of the data service SIM card scenario, Telephony sends a deactivation card 1 instruction to the card 1 baseband chip.
[0155] S118: Based on the card 1 PDU keep-alive strategy, the card 1 baseband chip sends a card 1 deactivation completion message to Telephony.
[0156] S119: Telephony sends an activation card 2 instruction to the card 2 baseband chip.
[0157] S120: Based on the card 2 PDU keep-alive strategy_1, the card 2 baseband chip establishes a PDU connection for card 2.
[0158] S121: The card 2 baseband chip sends a card 2 activation completion message to Telephony.
[0159] S122: When detecting that the terminal exits the automatic switching of the data service SIM card scenario, Telephony sends a deactivation card 2 instruction to the card 2 baseband chip.
[0160] S123: Based on the card 2 PDU keep-alive strategy_1, the card 2 baseband chip disconnects the PDU connection of card 2.
[0161] S124: The card 2 baseband chip sends a card 2 deactivation completion message to Telephony.
[0162] S125: Telephony sends an activation card 1 instruction to the card 1 baseband chip.
[0163] S126: Based on the card 1 PDU keep-alive strategy, the card 1 baseband chip sends a card 1 activation completion message to Telephony.
[0164] It is understood that the specific implementation of steps S115 to S126 can refer to Figure 3A The relevant descriptions of steps S101 to S114 are not repeated here.
[0165] It can be understood that according to the above method, when the terminal switches the data service SIM card, it is not necessary to disconnect or re-establish the PDU connection of card 1, thereby reducing the time required for card 1 to deactivate and activate the data service.
[0166] based on Figure 1The software and hardware architecture shown in the figure, another SIM card switching method provided by the present application is introduced below from the perspective of software and hardware interaction.
[0167] See also Figure 4A , Figure 4B and Figure 4C , Figure 4A-4C Another set of software and hardware interaction schematic diagrams provided for embodiments of the present application.
[0168] It is understandable that in the initial state (i.e., when the terminal detects that the data service is turned on for the first time), the terminal can use card 1 as a data service SIM card. Figure 4A As shown, when the terminal detects that the data service is turned on for the first time, the data service SIM card management module in the terminal can send the card 1 PDU keep-alive policy to the card 1 baseband chip, and send the card 2 PDU keep-alive policy_1 to the card 2 baseband chip.
[0169] It is understood that the card 1 PDU keep-alive strategy may specifically include: card 1 performs PDU keep-alive. PDU keep-alive means maintaining the PDU connection. Card 2 PDU keep-alive strategy_1 may specifically include: card 2 does not perform PDU keep-alive. The relevant descriptions of the card 1 PDU keep-alive strategy and the card 2 PDU keep-alive strategy_1 can be referred to above and will not be repeated here.
[0170] When the terminal detects a scenario of automatically switching the data service SIM card, the terminal may switch the data service SIM card from card 1 to card 2.
[0171] Specifically, Figure 4BAs shown, the data service SIM card management module in the terminal can detect the automatic switching of the data service SIM card scenario, and send a switching data service SIM card instruction_1 to the Telephony in the terminal. After receiving the switching data service SIM card instruction_1 sent by the data service SIM card management module, the Telephony can send a deactivation card 1 instruction to the card 1 baseband chip. After the card 1 baseband chip receives the deactivation card 1 instruction sent by the Telephony, since the card 1 performs PDU keep alive, the card 1 baseband chip can send a card 1 deactivation completion message to the Telephony without disconnecting the PDU connection of the card 1. After the Telephony receives the card 1 deactivation completion message sent by the card 1 baseband chip, it can send an activation card 2 instruction to the card 2 baseband chip. After the card 2 baseband chip receives the activation card 2 instruction sent by the Telephony, since the card 2 does not perform PDU keep alive, the card 2 baseband chip needs to establish a PDU connection for the card 2, and after the establishment of the PDU connection of the card 2 is completed, it sends a card 2 activation completion message to the Telephony. It can be understood that after Telephony receives the card 2 activation completion message sent by the card 2 baseband chip, the terminal completes the switching of the data service SIM card from card 1 to card 2. In this way, the terminal can use the data service of card 2.
[0172] It is worth noting that Figure 4B As shown, after Telephony receives the card 2 activation completion message sent by the card 2 baseband chip, it can send a switching completion message_1 to the data service SIM card management module to notify the data service SIM card management module that the terminal has completed the switching of the data service SIM card. It can be understood that the switching completion message_1 can be specifically used to indicate that the terminal has switched the data service SIM card from card 1 to card 2. After the data service SIM card management module receives the switching completion message_1 sent by Telephony, it can send a card 2 PDU keep-alive strategy_2 to the card 2 baseband chip.
[0173] It can be understood that the card 2 PDU keep-alive strategy_2 may specifically include: card 2 performs PDU keep-alive, that is, card 2 maintains the PDU connection.
[0174] When the terminal detects that the automatic switching of the data service SIM card scenario is exited, the terminal may switch the data service SIM card from card 1 to card 2 .
[0175] Specifically, Figure 4CAs shown, the data service SIM card management module in the terminal can detect the exit from the automatic switching of the data service SIM card scenario, and send a switching data service SIM card instruction_2 to the Telephony in the terminal. After Telephony receives the switching data service SIM card instruction_2 sent by the data service SIM card management module, it can send a deactivation card 2 instruction to the baseband chip of card 2. Since the card 2 PDU keep-alive strategy received by the baseband chip of card 2 includes the PDU keep-alive of card 2, after the baseband chip of card 2 receives the deactivation card 2 instruction sent by Telephony, the baseband chip of card 2 can send a card 2 deactivation completion message to Telephony without disconnecting the PDU connection of card 2. After Telephony receives the card 2 deactivation completion message sent by the baseband chip of card 2, it can send an activation card 1 instruction to the baseband chip of card 1. After the baseband chip of card 1 receives the activation card 1 instruction sent by Telephony, since card 1 keeps the PDU alive, the PDU connection of card 1 was not disconnected during the previous switch (such as Figure 4B As shown), the card 1 baseband chip can send a card 1 activation completion message to Telephony without re-establishing the PDU connection of card 1. After Telephony receives the card 1 activation completion message sent by the card 1 baseband chip, the terminal completes the switching of the data service SIM card from card 2 to card 1. In this way, the terminal can use the data service of card 1.
[0176] It is worth noting that Figure 4C As shown, after Telephony receives the card 1 activation completion message sent by the card 1 baseband chip, it can send a switching completion message_2 to the data service SIM card management module to notify the data service SIM card management module that the terminal has completed the switching of the data service SIM card. It can be understood that the switching completion message_2 can be specifically used to indicate that the terminal has achieved the switching of the data service SIM card from card 2 to card 1. After the data service SIM card management module receives the switching completion message_2 sent by Telephony, it can send a card 2 PDU keep-alive strategy_3 to the card 2 baseband chip. It can be understood that the card 2 PDU keep-alive strategy_3 can specifically include: card 2 does not perform PDU keep-alive. That is, card 2 does not need to maintain a PDU connection. After the card 2 baseband chip receives the card 2 PDU keep-alive strategy_3 sent by the data service SIM card management module, the PDU connection of card 2 can be disconnected.
[0177] Combine the following Figure 5A The specific implementation of the above embodiment is introduced.
[0178] See also Figure 5A , Figure 5A A flowchart of another SIM card switching method provided in an embodiment of the present application. The method may include but is not limited to the following steps:
[0179] S201: When the terminal detects that the data service is turned on for the first time, the data service SIM card management module sends a card 1 PDU keep-alive strategy to the card 1 baseband chip. The card 1 PDU keep-alive strategy includes card 1 performing PDU keep-alive.
[0180] S202: When the terminal detects that the data service is turned on for the first time, the data service SIM card management module sends the card 2 PDU keep-alive strategy_1 to the card 2 baseband chip. The card 2 PDU keep-alive strategy_1 includes that the card 2 does not perform PDU keep-alive.
[0181] S203: When the data service SIM card management module detects that the current scenario is the automatic data service SIM card switching scenario, the data service SIM card management module sends a data service SIM card switching instruction_1 to Telephony.
[0182] S204: Telephony sends a deactivation card 1 instruction to the card 1 baseband chip.
[0183] S205: Based on the card 1 PDU keep-alive strategy, the card 1 baseband chip sends a card 1 deactivation completion message to Telephony.
[0184] S206: Telephony sends an activation card 2 instruction to the card 2 baseband chip.
[0185] S207: Based on the card 2 PDU keep-alive strategy_1, the card 2 baseband chip establishes a PDU connection for card 2.
[0186] S208: The card 2 baseband chip sends a card 2 activation completion message to Telephony.
[0187] It can be understood that the specific implementation of steps S201 to S208 can refer to the above description of steps S101 to S108, which will not be repeated here.
[0188] S209: Telephony sends a switching completion message_1 to the data service SIM card management module.
[0189] After receiving the card 2 activation completion message sent by the card 2 baseband chip, Telephony can send a switching completion message_1 to the data service SIM card management module. It can be understood that the switching completion message_1 can be specifically used to indicate that the terminal has switched the data service SIM card from card 1 to card 2.
[0190] Correspondingly, the data service SIM card management module may receive the switching completion message_1 sent by Telephony.
[0191] S210: The data service SIM card management module sends the card 2 PDU keep-alive strategy_2 to the card 2 baseband chip.
[0192] After receiving the switching completion message_1 sent by Telephony, the data service SIM card management module may send a card 2 PDU keep-alive strategy_2 to the card 2 baseband chip. It is understood that the card 2 PDU keep-alive strategy_2 may specifically include: card 2 performs PDU keep-alive, that is, card 2 maintains PDU connection.
[0193] Correspondingly, the card 2 baseband chip can receive the card 2 PDU keep-alive strategy_2 sent by the data service SIM card management module.
[0194] S211: When the data service SIM card management module detects that the terminal exits the automatic data service SIM card switching scenario, the data service SIM card management module sends a data service SIM card switching instruction_2 to Telephony.
[0195] S212: Telephony sends a deactivation card 2 instruction to the card 2 baseband chip.
[0196] It can be understood that the specific implementation of step S211-step S212 can refer to the above description of step S109-step S110, which will not be repeated here.
[0197] S213: Based on the card 2 PDU keep-alive strategy_2, the card 2 baseband chip sends a card 2 deactivation completion message to Telephony.
[0198] It is understood that the card 2 PDU keep alive strategy_2 includes card 2 performing PDU keep alive. That is, card 2 can maintain the PDU connection. After the card 2 baseband chip receives the deactivation card 2 instruction sent by Telephony, the card 2 baseband chip can send a card 2 deactivation completion message to Telephony without disconnecting the PDU connection of card 2. It is understood that the card 2 deactivation completion message is used to indicate that the card 2 has deactivated the data service (that is, the terminal has deactivated the data service of card 2).
[0199] Correspondingly, Telephony can receive the card 2 deactivation completion message sent by the card 2 baseband chip.
[0200] S214: Telephony sends an activation card 1 instruction to the card 1 baseband chip.
[0201] S215: Based on the card 1 PDU keep-alive strategy, the card 1 baseband chip sends a card 1 activation completion message to Telephony.
[0202] It can be understood that the specific implementation method of step S214-step S215 can refer to the above description of step S113-step S114, which will not be repeated here.
[0203] S216: Telephony sends a switching completion message_2 to the data service SIM card management module.
[0204] After receiving the card 1 activation completion message sent by the card 1 baseband chip, Telephony can send a switching completion message_2 to the data service SIM card management module. It can be understood that the switching completion message_2 can be specifically used to indicate that the terminal has switched the data service SIM card from card 2 to card 1.
[0205] Correspondingly, the data service SIM card management module may receive the switching completion message_2 sent by Telephony.
[0206] S217: The data service SIM card management module sends the card 2 PDU keep-alive strategy_3 to the card 2 baseband chip.
[0207] After receiving the switching completion message_2 sent by Telephony, the data service SIM card management module may send a card 2 PDU keep-alive strategy_3 to the card 2 baseband chip. It is understandable that the card 2 PDU keep-alive strategy_3 may specifically include: card 2 does not perform PDU keep-alive. That is, card 2 does not need to maintain a PDU connection.
[0208] In some embodiments of the present application, after the data service SIM card management module receives the switching completion message _2 sent by Telephony, a timer can be started. Once the timer times out, the data service SIM card can send the card 2 PDU keep-alive strategy _3 to the card 2 baseband chip. It can be understood that the timer timeout means that the timing duration reaches the default duration defined by the timer. It can be understood that the default duration defined by the timer can be set according to actual needs, and the present application does not limit this. For example, the default duration defined by the timer can be 5 minutes.
[0209] Correspondingly, the card 2 baseband chip can receive the card 2 PDU keep-alive strategy_3 sent by the data service SIM card management module.
[0210] S218: Based on the card 2 PDU keep-alive strategy_3, the card 2 baseband chip disconnects the PDU connection of card 2.
[0211] It can be understood that the card 2 PDU keep alive strategy_3 includes that the card 2 does not perform PDU keep alive. That is, the card 2 does not need to maintain the PDU connection. After the card 2 baseband chip receives the card 2 PDU keep alive strategy_3 sent by the data service SIM card management module, since the card 2 does not perform PDU keep alive, the card 2 baseband chip can disconnect the PDU connection of the card 2.
[0212] In some embodiments of the present application, the function of the data service SIM card management module can be integrated into Telephony. In this case, Figure 5A The interaction between the data service SIM card management module and other modules involved in the process can be performed by Telephony.
[0213] See also Figure 5B , Figure 5B A flowchart of another SIM card switching method provided in an embodiment of the present application. The method may specifically include but is not limited to the following steps:
[0214] S219: When the terminal detects that the data service is turned on for the first time, Telephony sends a card 1 PDU keep-alive strategy to the card 1 baseband chip. The card 1 PDU keep-alive strategy includes card 1 performing PDU keep-alive.
[0215] S220: When the terminal detects that the data service is turned on for the first time, Telephony sends the card 2 PDU keep-alive strategy_1 to the card 2 baseband chip. The card 2 PDU keep-alive strategy_1 includes that the card 2 does not perform PDU keep-alive.
[0216] S221: When detecting that the current scenario is the automatic switching of the data service SIM card scenario, Telephony sends a deactivation card 1 instruction to the card 1 baseband chip.
[0217] S222: Based on the card 1 PDU keep-alive strategy, the card 1 baseband chip sends a card 1 deactivation completion message to Telephony.
[0218] S223: Telephony sends an activation card 2 instruction to the card 2 baseband chip.
[0219] S224: Based on the card 2 PDU keep-alive strategy_1, the card 2 baseband chip establishes a PDU connection for card 2.
[0220] S225: The card 2 baseband chip sends a card 2 activation completion message to Telephony.
[0221] S226: Telephony sends the card 2 PDU keep-alive strategy_2 to the card 2 baseband chip. The card 2 PDU keep-alive strategy_2 includes card 2 performing PDU keep-alive.
[0222] S227: When detecting that the terminal exits the automatic switching of the data service SIM card scenario, Telephony sends a deactivation card 2 instruction to the card 2 baseband chip.
[0223] S228: Based on the card 2 PDU keep-alive strategy_2, the card 2 baseband chip sends a card 2 deactivation completion message to Telephony.
[0224] S229: Telephony sends an activation card 1 instruction to the card 1 baseband chip.
[0225] S230: Based on the card 1 PDU keep-alive strategy, the card 1 baseband chip sends a card 1 activation completion message to Telephony.
[0226] S231: Telephony sends Card 2 PDU keep-alive strategy_3 to the baseband chip of Card 2. Card 2 PDU keep-alive strategy_3 includes that Card 2 does not perform PDU keep-alive.
[0227] S232: Based on the card 2 PDU keep-alive strategy_3, the card 2 baseband chip disconnects the PDU connection of card 2.
[0228] It is understood that the specific implementation of steps S219 to S232 can refer to Figure 5A The relevant descriptions of steps S201 to S218 are not repeated here.
[0229] The following is an introduction to the device involved in the embodiments of the present application.
[0230] Figure 6 A schematic diagram of the hardware structure of a terminal provided in an embodiment of the present application.
[0231] The terminal may include a processor, an external memory interface, an internal memory, an audio module, a speaker, a receiver, a microphone, and a display screen.
[0232] The structure illustrated in the embodiments of the present application does not constitute a specific limitation on the terminal. In some embodiments of the present application, the terminal may include more components than shown. For example, the terminal may include sensors such as a touch sensor, an acceleration sensor, and a gyroscope sensor. In some embodiments of the present application, the terminal may include fewer components than shown, or combine certain components, or split certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware. The interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration and does not constitute a structural limitation on the terminal.
[0233] The terminal can implement audio functions through an audio module, a speaker, a receiver, a microphone, a headphone jack, and an application processor.
[0234] The terminal can realize the display function through a graphics processing unit (GPU), a display screen, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor may include one or more GPUs, which execute program instructions to generate or change display information. The display screen is used to display images, videos, etc. In some embodiments of the present application, the terminal may include one or more display screens.
[0235] In some embodiments of the present application, the ability of the terminal to display a user interface depends on the display function provided by the above-mentioned GPU, display screen, and application processor.
[0236] The internal memory may include one or more random access memories (RAM) and one or more non-volatile memories (NVM). The random access memory can be directly read and written by the processor, and can be used to store executable programs (e.g., machine instructions) of the operating system or other running programs, and can also be used to store user and application data. The non-volatile memory can also store executable programs and user and application data, and can be loaded into the random access memory in advance for direct reading and writing by the processor.
[0237] In the present application, the code for implementing the SIM card switching method described in the embodiment of the present application can be stored in a non-volatile memory. When running the screen projection application, the terminal can load the executable code stored in the non-volatile memory into the random access memory.
[0238] The external memory interface can be used to connect an external non-volatile memory to expand the storage capacity of the terminal.
[0239] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A SIM card switching method, characterized in that: The method is applied to a terminal including a first SIM card and a second SIM card; The first SIM card is a data service SIM card used by the terminal by default; the method comprises: When the terminal detects that the current scenario is the first switching scenario, the terminal switches the data service SIM card used from the first SIM card to the second SIM card; The terminal sets the second SIM card PDU to keep alive; When the terminal detects that the first switching scenario is exited, the terminal switches the data service SIM card used by the terminal from the second SIM card to the first SIM card; After the terminal switches the data service SIM card used from the second SIM card to the first SIM card, setting the second SIM card not to keep the PDU alive; In the process of the terminal switching the data service SIM card in use from the first SIM card to the second SIM card, and in the process of the terminal switching the data service SIM card in use from the second SIM card to the first SIM card, the terminal maintains the PDU connection of the first SIM card; in the process of the terminal switching the data service SIM card in use from the first SIM card to the second SIM card, the terminal establishes the PDU connection of the second SIM card; in the case of setting the PDU keep alive of the second SIM card, in the process of switching the data service SIM card in use from the second SIM card to the first SIM card, the terminal maintains the PDU connection of the second SIM card; in the case of setting the second SIM card not to perform PDU keep alive, after the data service SIM card in use is switched from the second SIM card to the first SIM card, the terminal disconnects the PDU connection of the second SIM card.
2. The method according to claim 1, characterized in that The method further includes: after the terminal switches the data service SIM card to be used from the second SIM card to the first SIM card, the terminal disconnects the PDU connection of the second SIM card.
3. The method according to claim 2, characterized in that The terminal disconnecting the PDU connection of the second SIM card specifically includes: when the time after the data service SIM card to be used is switched from the second SIM card to the first SIM card exceeds a first time threshold, the terminal disconnecting the PDU connection of the second SIM card.
4. The method according to any one of claims 1 to 3, characterized in that The terminal setting the second SIM card PDU keep alive specifically includes: When the terminal completes switching the used data service SIM card from the first SIM card to the second SIM card, the terminal sends an instruction to enable PDU keep alive of the second SIM card to the second SIM card baseband chip in the terminal through the data service SIM card management module.
5. The method according to any one of claims 1 to 4, characterized in that The terminal switches the data service SIM card used from the second SIM card to the first SIM card, specifically including: the terminal deactivates the data service of the second SIM card and activates the data service of the first SIM card; The terminal deactivating the second SIM card specifically includes: The terminal sends a first deactivation instruction to the second SIM card baseband chip in the terminal through Telephony; In a case where the second SIM card baseband chip maintains the PDU connection of the second SIM card, the terminal sends a first deactivation completion message to the Telephony through the second SIM card baseband chip.
6. The method according to claim 2 or 3, characterized in that: Before the terminal disconnects the PDU connection of the second SIM card, the method further includes: When the terminal completes switching the data service SIM card used from the second SIM card to the first SIM card, the terminal sends an instruction to turn off the PDU keep alive of the second SIM card to the second SIM card baseband chip in the terminal through the data service SIM card management module.
7. The method according to any one of claims 1 to 6, characterized in that In the process of switching the data service SIM card to be used from the first SIM card to the second SIM card, and in the process of switching the data service SIM card to be used from the second SIM card to the first SIM card, the terminal maintains the PDU connection of the first SIM card.
8. The method according to any one of claims 1 to 7, characterized in that The first switching scenario is that the second SIM card enters a call state; and the exiting the first switching scenario specifically includes: the second SIM card exits the call state.
9. The method according to any one of claims 1 to 7, characterized in that The first switching scenario is that the first SIM card network is stuck; and the exiting the first switching scenario specifically includes any one or more of the following: The duration for which the terminal is in the screen-off state exceeds a second time threshold; The duration of the foreground application of the terminal retreating to the background exceeds a third time threshold; The time after the terminal switches the data service SIM card used from the first SIM card to the second SIM card exceeds a fourth time threshold, and the signal strength of the first SIM card exceeds a first signal strength threshold, and the network standard of the first SIM card meets the first network standard condition; The network of the second SIM card is stuck, the signal strength of the first SIM card exceeds the first signal strength threshold, and the network standard of the first SIM card meets the first network standard condition.
10. The method according to claim 9, characterized in that The network standard of the first SIM card meets the first network standard condition, specifically including: the network standard of the first SIM card is 4G or 5G.
11. An electronic device, characterized in that: include: a display screen, one or more memories, and one or more processors; The one or more processors are coupled to the display screen, and the one or more memories; The memory is used to store a computer program; the processor is used to call the computer program so that the electronic device executes the method according to any one of claims 1 to 10.
12. A computer storage medium, characterized in that: include: Computer instructions; when the computer instructions are executed on a first device, the first device is caused to execute the method according to any one of claims 1 to 10.