Telephone card switching method, device and electronic equipment

By automatically identifying and switching the data traffic type of electronic devices, the problem of cumbersome operations when using targeted data traffic is solved, achieving seamless data traffic type switching and avoiding additional costs.

CN116321306BActive Publication Date: 2026-05-01VIVO MOBILE COMM CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
VIVO MOBILE COMM CO LTD
Filing Date
2023-03-28
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

In electronic devices that support multiple SIM cards, the process of using targeted data is cumbersome, requiring users to manually switch SIM cards to avoid extra data charges.

Method used

Electronic devices automatically determine and switch data types, from SIM cards with general data to SIM cards with targeted data. Based on the consumption and remaining targeted data, the system achieves seamless switching by setting data channel priority and binding data ports.

Benefits of technology

It simplifies the process of targeted traffic management, avoids additional traffic fees, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116321306B_ABST
    Figure CN116321306B_ABST
Patent Text Reader

Abstract

The application discloses a telephone card switching method and device and electronic equipment, and belongs to the technical field of communication. The method comprises the following steps: acquiring the directional traffic consumption amount and the directional traffic residual amount of a first telephone card in a first time period, the first time period being any time period in the process of running a target program, and the target program having the use right of the directional traffic of the first telephone card; in the case that the directional traffic consumption amount is less than or equal to a first traffic threshold value and the directional traffic residual amount is greater than or equal to a second traffic threshold value, switching the traffic type used by the target program from the general traffic of a second telephone card to the directional traffic of the first telephone card; wherein the first telephone card is a telephone card with directional traffic, and the second telephone card is a telephone card with general traffic.
Need to check novelty before this filing date? Find Prior Art

Description

Phone card switching methods, devices and electronic equipment Technical Field

[0001] This application belongs to the field of communications, and specifically relates to a method, apparatus and electronic device for switching phone cards. Background Technology

[0002] With the rapid development of Internet technology, electronic devices that support Dual SIM Dual Active (DSDA) have become increasingly popular. Furthermore, as major telecommunications operators and more and more companies form strategic partnerships, operators have gradually launched various targeted data cards or targeted data value-added packages.

[0003] However, since targeted data SIM cards and targeted data add-on packages can only be bundled with one SIM card, users need to determine whether their current SIM card has targeted data permissions before using applications with such permissions. If the current SIM card does not, the user needs to manually switch the SIM card to one with targeted data permissions. If the user fails to switch to a targeted data SIM card in time, the application may use general data, resulting in additional data charges. This makes using targeted data on devices that support multiple SIM cards rather cumbersome. Summary of the Invention

[0004] The purpose of this application is to provide a phone card switching method, apparatus, and electronic device that can simplify the operation process of using targeted data traffic.

[0005] In a first aspect, embodiments of this application provide a phone card switching method, the method comprising: obtaining the targeted data consumption and remaining targeted data of a first phone card within a first time period, wherein the first time period is any time period during the execution of a target program, and the target program has the right to use the targeted data of the first phone card; and, when the targeted data consumption is less than or equal to a first data threshold and the remaining targeted data is greater than or equal to a second data threshold, switching the data type used by the target program from general data of the second phone card to targeted data of the first phone card; wherein the first phone card is a phone card with targeted data and the second phone card is a phone card with general data.

[0006] Secondly, embodiments of this application provide a phone card switching device, which includes: an acquisition module, configured to acquire the targeted data consumption and remaining targeted data of a first phone card within a first time period, wherein the first time period is any time period during the execution of a target program, and the target program has the right to use the targeted data of the first phone card; and a switching module, configured to switch the data type used by the target program from general data of the second phone card to targeted data of the first phone card when the targeted data consumption acquired by the acquisition module is less than or equal to a first data threshold and the remaining targeted data acquired by the acquisition module is greater than or equal to a second data threshold; wherein the first phone card is a phone card with targeted data and the second phone card is a phone card with general data.

[0007] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, wherein the memory stores programs or instructions executable on the processor, and the programs or instructions, when executed by the processor, implement the steps of the method described in the first aspect.

[0008] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.

[0009] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the method as described in the first aspect.

[0010] In a sixth aspect, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the method described in the first aspect.

[0011] In this embodiment, the directional data consumption and remaining directional data of the first SIM card are obtained within a first time period. The first time period is any time period during the execution of the target program, and the target program has the right to use the directional data of the first SIM card. When the directional data consumption is less than or equal to a first data threshold and the remaining directional data is greater than or equal to a second data threshold, the data type used by the target program is switched from the general data of the second SIM card to the directional data of the first SIM card. Here, the first SIM card is a SIM card with directional data, and the second SIM card is a SIM card with general data. Through this scheme, if the directional data consumption of the first SIM card is less than or equal to the first data threshold during the execution of the target program, it can be determined that the electronic device is not using the data of the SIM card with directional data to run the target program, that is, the data type used by the electronic device to run the target program is different from the data type of the SIM card with directional data. If the remaining directional data is greater than or equal to the second data threshold, it can be determined that the SIM card still has sufficient remaining directional data for the execution of the target program. Therefore, the electronic device can automatically switch the data type used by the target program from the general data of the second SIM card to the targeted data of the first SIM card. In other words, the electronic device can determine whether the data type used by the target program is the targeted data of a SIM card with targeted data, based on the amount of targeted data consumed and the remaining targeted data. If the data type used by the target program is not the targeted data of a SIM card with targeted data, it will switch the data type from the general data of the second SIM card to the targeted data of the first SIM card, without requiring manual switching by the user. In this way, the electronic device can complete the data type switching without the user's awareness, thus simplifying the process of using targeted data. Attached Figure Description

[0012] Figure 1 is a flowchart of a phone card switching method provided in some embodiments of this application;

[0013] Figure 2 is one of the example flowcharts of a phone card switching method provided in some embodiments of this application;

[0014] Figure 3 is a second example flowchart of a phone card switching method provided in some embodiments of this application;

[0015] Figure 4 is a schematic diagram of the structure of a phone card switching device provided in some embodiments of this application;

[0016] Figure 5 is a schematic diagram of the hardware structure of an electronic device provided in some embodiments of this application;

[0017] Figure 6 is a schematic diagram of the hardware structure of an electronic device provided in some embodiments of this application. Detailed Implementation

[0018] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0019] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0020] The following description, in conjunction with the accompanying drawings, details the telephone card switching method, apparatus, and electronic device provided in this application through specific embodiments and application scenarios.

[0021] With the increasing prevalence of DSDA-enabled electronic devices, users can now use two different SIM cards to handle various work and life scenarios. Specifically, DSDA not only supports inserting two SIM cards into an electronic device simultaneously, but also allows both SIM cards to transmit data concurrently, enabling both to be online and making calls at the same time. For example, while one SIM card is used for a call, the other can also be online and using mobile data or making calls without interference. This effectively solves the problem of one SIM card being unable to access mobile data during a call in a dual-SIM dual-standby setup. Furthermore, as major telecommunications operators and more companies form strategic partnerships, operators are gradually launching various targeted data cards or value-added data packages, making refined data management services an inevitable trend.

[0022] This application provides a phone card switching method. The method obtains the targeted data consumption and remaining targeted data of a first phone card within a first time period. The first time period is any time period during the execution of a target program, and the target program has access to the targeted data of the first phone card. When the targeted data consumption is less than or equal to a first data threshold, and the remaining targeted data is greater than or equal to a second data threshold, the data type used by the target program is switched from the general data of the second phone card to the targeted data of the first phone card. Here, the first phone card is a phone card with targeted data, and the second phone card is a phone card with general data. Through this scheme, when an electronic device is running a target program, if the targeted data consumption of the first phone card is less than or equal to the first data threshold, it can be determined that the electronic device is not using the data of the phone card with targeted data to run the target program, i.e., the data type used by the electronic device to run the target program is different from the data type of the phone card with targeted data. If the remaining targeted data is greater than or equal to the second data threshold, it can be determined that the phone card still has sufficient remaining targeted data for the target program to run. Therefore, the electronic device can automatically switch the data type used by the target program from the general data of the second SIM card to the targeted data of the first SIM card. In other words, the electronic device can determine whether the data type used by the target program is the targeted data of a SIM card with targeted data, based on the amount of targeted data consumed and the remaining targeted data. If the data type used by the target program is not the targeted data of a SIM card with targeted data, it will switch the data type from the general data of the second SIM card to the targeted data of the first SIM card, without requiring manual switching by the user. In this way, the electronic device can complete the data type switching without the user's awareness, thus simplifying the process of using targeted data.

[0023] The SIM card switching method provided in this application can be executed by a SIM card switching device. Exemplarily, the SIM card switching device can be an electronic device, or a component within that electronic device, such as an integrated circuit or a chip. The SIM card switching method provided in this application will be described below using an electronic device as an example.

[0024] This application provides a method for switching phone cards. Figure 1 shows a flowchart of a phone card switching method provided by this application, which can be applied to electronic devices. As shown in Figure 1, the phone card switching method provided by this application may include the following steps 101 and 102.

[0025] Step 101: The electronic device obtains the amount of targeted data consumed and the amount of targeted data remaining in the first time period of the first SIM card.

[0026] The first time period mentioned above can be any time period during the execution of the target program, and the target program has access to the targeted data traffic of the first phone card. In other words, the target program can be an application installed on the electronic device that supports targeted data traffic, or an application that can run using targeted data traffic.

[0027] In some embodiments of this application, the target program can be any application in an electronic device that has access to the directed traffic of a first SIM card.

[0028] In some embodiments of this application, it is assumed that the communication application 1 in the electronic device has access to the directed traffic of the first phone card, then: the target program can be the communication application 1.

[0029] In some embodiments of this application, it is assumed that both video application 2 and video application 3 in the electronic device have access to the directed traffic of the first phone card. Then, the target program can be either video application 2 or video application 3.

[0030] In some embodiments of this application, the electronic device can obtain the targeted data consumption and the remaining targeted data of the first SIM card within a period of time after running the target program.

[0031] In some embodiments of this application, the electronic device can obtain, after running the target program, the directional data consumption of the first SIM card in the first 10 seconds of running the target program is 10MB, and the remaining directional data is 800MB.

[0032] In some embodiments of this application, after running the target program, the electronic device can obtain that the first SIM card consumed 30MB of targeted data traffic within 10 seconds between the 20th and 30th seconds of running the target program, and that the remaining targeted data traffic was 780MB.

[0033] It is understandable that when an electronic device includes multiple applications that support targeted traffic, the target application can be the currently running application among those multiple applications.

[0034] In some embodiments of this application, the electronic device can run the above-described target program in the foreground or background.

[0035] In this embodiment, the aforementioned phone card can be a physical card or a virtual card. The physical card can be a Subscriber Identity Module (SIM) card for a digital cellular mobile electronic device, which enables data transmission via the electronic device. The virtual card can be an electronic SIM card, essentially a data file that can be downloaded to the electronic device via the network, then recharged and activated via the network before data transmission.

[0036] It is understood that targeted traffic is traffic used only for specified applications and content on electronic devices.

[0037] In some embodiments of this application, the directed traffic can be the traffic used by a designated video application to watch internet videos; or, the directed traffic can also be the traffic used by a designated communication application to make video calls.

[0038] In some embodiments of this application, an electronic device can obtain a list of applications with targeted data usage permissions from the operator of a phone card with targeted data usage permissions. This list includes at least one application identifier, each indicating an application with targeted data usage permissions.

[0039] In some embodiments of this application, an electronic device can determine whether a currently running application has targeted traffic usage permissions by using a list of applications with targeted traffic usage permissions, so as to determine whether it is necessary to switch traffic types in the future.

[0040] In this embodiment of the application, the electronic device may include at least two SIM cards.

[0041] In some embodiments of this application, the aforementioned at least two phone cards may include at least one phone card with targeted data traffic.

[0042] In this embodiment of the application, the first phone card may be one of the at least two phone cards that has a directional data plan.

[0043] In some embodiments of this application, it is assumed that the electronic device includes SIM card 1 and SIM card 2. SIM card 1 is a SIM card with targeted data traffic, and therefore, the first SIM card can be SIM card 1.

[0044] In some embodiments of this application, it is assumed that the electronic device includes SIM card 1, SIM card 2, and SIM card 3. SIM card 1 and SIM card 3 are SIM cards with targeted data traffic, and the first SIM card can be either SIM card 1 or SIM card 2.

[0045] In some embodiments of this application, the aforementioned targeted traffic consumption can be: the amount of targeted traffic consumed by the first SIM card in a first time period. In other words, the aforementioned targeted traffic consumption can be represented by the number of bytes of targeted traffic consumed by the first SIM card in the first time period.

[0046] In some embodiments of this application, the first time period can be set by the user, can be the default time of the electronic device, or can be determined in any other possible way.

[0047] For example, the first time period can be a relatively short period of time, such as 10 seconds, which is the amount of targeted data traffic that the electronic device obtains from the first phone card within 10 seconds.

[0048] In some embodiments of this application, the electronic device can obtain the directional data consumption and remaining directional data of the first SIM card in the first 10 seconds before the target program starts running; or, the electronic device can obtain the directional data consumption and remaining directional data of the first SIM card in the 10 seconds between the 20th and 30th seconds after the target program starts running.

[0049] In some embodiments of this application, the electronic device can obtain the amount of targeted data consumed and the amount of targeted data remaining in a first time period through the operator of the first phone card.

[0050] For example, an electronic device can send a query request to the operator of the first phone card. The query request may include the identifier of the first phone card, the content to be queried, and the time information of the time period to be queried. After receiving the query request from the electronic device, the operator of the first phone card can send a reply message to the electronic device. The reply message may include the first phone card's targeted data consumption and remaining targeted data during the time period to be queried.

[0051] Step 102: When the directional data consumption is less than or equal to the first data threshold and the remaining directional data is greater than or equal to the second data threshold, the electronic device switches the data type used by the target program from the general data of the second phone card to the directional data of the first phone card.

[0052] The first phone card has a specific data allowance, while the second phone card has a general data allowance.

[0053] In this embodiment of the application, the second phone card can be any phone card with general data traffic other than the first phone card in the electronic device.

[0054] In some embodiments of this application, the first traffic threshold and the second traffic threshold can be set by the user, can be the default value of the electronic device, or can be determined based on the historical traffic consumption of the target program when it was run in the past.

[0055] In some embodiments of this application, the first flow threshold and the second flow threshold may be the same or different.

[0056] It is understandable that if the targeted data usage is less than or equal to the first data threshold, it indicates that the electronic device is not using the targeted data of the first SIM card to run the target program; that is, the electronic device is using the general data of the second SIM card to run the target program. In this way, the electronic device can determine that the data type used by the target program is different from the targeted data type of the first SIM card. Therefore, it needs to switch the data type used by the target program from the general data of the second SIM card to the targeted data of the first SIM card, and then switch to the data channel of the first SIM card. This allows the target program to use the targeted data of the first SIM card for data transmission, thereby avoiding the consumption of general data by the target program.

[0057] It is understandable that if the remaining targeted data allowance is greater than or equal to the second data allowance threshold, it indicates that the first SIM card has sufficient targeted data allowance to support the operation of the target program. In other words, the electronic device can use the targeted data allowance of the first SIM card to complete the operation of the target program.

[0058] For example, suppose the first traffic threshold is 20MB and the second traffic threshold is 50MB. If the electronic device obtains that the first SIM card consumes 10MB of targeted traffic in the first 10 seconds before the target program starts running, and the remaining targeted traffic is 800MB, then: the targeted traffic consumption (10MB) is less than the first traffic threshold (20MB), and the remaining targeted traffic (800MB) is greater than the second traffic threshold (50MB). The electronic device can determine that: the electronic device is not using the targeted traffic of the first SIM card to run the target program, and the electronic device can switch the traffic type used by the target program from the general traffic of the second SIM card to the targeted traffic of the first SIM card.

[0059] For example, suppose the first traffic threshold is 5MB and the second traffic threshold is 30MB. If the electronic device obtains that the first SIM card consumes 3MB of targeted traffic within 10 seconds between the 20th and 30th second of running the target program, and the remaining targeted traffic is 500MB, then: since the targeted traffic consumption (3MB) is less than the first traffic threshold (5MB) and the remaining targeted traffic (500MB) is greater than the second traffic threshold (30MB), the electronic device can determine that: the electronic device is not using the targeted traffic of the first SIM card to run the target program, and the electronic device can switch the traffic type used by the target program from the general traffic of the second SIM card to the targeted traffic of the first SIM card.

[0060] This application provides a method for switching phone cards. When an electronic device is running a target program, if the directional data consumption of the first phone card is less than or equal to a first data threshold, it can be determined that the electronic device is not using the data of a phone card with directional data to run the target program; that is, the data type used by the electronic device to run the target program is different from the data type of the phone card with directional data. If the remaining directional data is greater than or equal to a second data threshold, it can be determined that the phone card still has sufficient remaining directional data for the target program to run. Therefore, the electronic device can automatically switch the data type used by the target program from the general data of the second phone card to the directional data of the first phone card. In other words, the electronic device can determine whether the data type used by the target program is the directional data of a phone card with directional data based on the directional data consumption and the remaining directional data. If the data type used by the target program is not the directional data of a phone card with directional data, it will switch the data type used by the target program from the general data of the second phone card to the directional data of the first phone card, without requiring the user to manually switch the data type. Thus, the electronic device can complete the data type switching without the user's awareness, thereby simplifying the process of using directional data.

[0061] In some embodiments of this application, step 102 described above can be implemented by step 102a as follows.

[0062] Step 102a: When the directional data consumption is less than or equal to the first data threshold and the remaining directional data is greater than or equal to the second data threshold, and the data channels of both the first and second SIM cards are open, the electronic device closes the data channel of the second SIM card.

[0063] In some embodiments of this application, when both the traffic channels of the first phone card and the second phone card are open, after the electronic device controls the traffic channel of the second phone card to close, the data that was originally transmitted through the traffic channel of the second phone card can be transferred to the traffic channel of the first phone card for transmission.

[0064] Specifically, after the second SIM card's data transfer channel is closed, data that could be transmitted using targeted data transfer can now be transmitted using the first SIM card's targeted data transfer. Data that cannot use targeted data transfer can be transmitted using the first SIM card's general data transfer if the first SIM card has general data transfer available; otherwise, it can be transmitted using the general data transfer available from other SIM cards, or it can wait until the second SIM card's data transfer channel reopens before transmission.

[0065] In this embodiment of the application, when at least two SIM cards in the electronic device can perform mobile data transmission, the electronic device can establish at least two traffic channels. Different SIM cards can correspond to different traffic channels, and the traffic data generated through different traffic channels can consume the traffic of different SIM cards.

[0066] For example, in an electronic device supporting DSDA, if SIM card 1 and SIM card 2 can simultaneously perform mobile data transmission and calls, the electronic device can establish a data transfer channel 1 and a data transfer channel 2. SIM card 1 uses data transfer channel 1, and SIM card 2 uses data transfer channel 2. When the electronic device transmits data through data transfer channel 1, the generated data consumes the data transfer capacity of SIM card 1; when the electronic device transmits data through data transfer channel 2, the generated data consumes the data transfer capacity of SIM card 2.

[0067] For example, in an electronic device supporting DSDA, if SIM card 1, SIM card 2, and SIM card 3 can simultaneously perform mobile data transmission and calls, the electronic device can establish traffic channels 1, 2, and 3. SIM card 1's traffic channel is traffic channel 1, SIM card 2's traffic channel is traffic channel 2, and SIM card 3's traffic channel is traffic channel 3. When the electronic device transmits data through traffic channel 1, the generated traffic data consumes the traffic of SIM card 1; when the electronic device transmits data through traffic channel 2, the generated traffic data consumes the traffic of SIM card 2; and when the electronic device transmits data through traffic channel 3, the generated traffic data consumes the traffic of SIM card 3.

[0068] In this embodiment of the application, the main traffic channel can be the current default traffic channel of the electronic device.

[0069] It is understandable that if a phone card has both targeted data and general data, the targeted data has a higher priority than the general data; that is, the targeted data of the phone card is used first to transmit data, and the general data of the phone card is used to transmit data that does not support targeted data transmission.

[0070] In some embodiments of this application, the electronic device can quickly open the traffic channel of the second phone card after closing it, so that applications other than those using targeted traffic can transmit data through the traffic channel of the second phone card, thereby maintaining the data transmission capabilities of both the first and second phone cards simultaneously.

[0071] It should be noted that electronic devices can control data transmission by controlling the opening and closing of the main data transmission channel. This main data transmission channel can be understood as the device's current default data transmission channel. In other words, before the electronic device closes the data transmission of the second SIM card, its main data transmission channel is the second SIM card's data transmission channel; after closing the data transmission of the second SIM card, the main data transmission channel switches to the first SIM card's data transmission channel.

[0072] In this embodiment, the main traffic channel of the electronic device can be the highest priority traffic channel, meaning the default traffic channel of the electronic device can be the highest priority traffic channel. Therefore, the electronic device can switch its main traffic channel by setting the priority of the traffic channel. In other words, the electronic device changes the priority of the second SIM card's traffic channel by controlling its shutdown.

[0073] In some embodiments of this application, the electronic device may set the priority of the traffic channel of the first phone card to be higher than the priority of the traffic channel of the second phone card when the directional traffic consumption is less than or equal to a first traffic threshold and the remaining directional traffic is greater than or equal to a second traffic threshold.

[0074] In this embodiment, "setting the priority of the traffic channel of the first SIM card to be higher than the priority of the traffic channel of the second SIM card" can be understood as setting the priority of the traffic channel of the first SIM card to the highest priority traffic channel. That is, the priority of the traffic channels of all SIM cards other than the first SIM card is lower than the priority of the traffic channel of the first SIM card. This allows the traffic channel of the first SIM card to become the main traffic channel or default traffic channel of the electronic device, thereby enabling the electronic device to use the targeted traffic of the first SIM card to run the target program.

[0075] For example, suppose the first traffic threshold is 20MB and the second traffic threshold is 50MB. If the electronic device obtains that the first SIM card consumes 10MB of targeted traffic in the first 10 seconds before starting the target program, and the remaining targeted traffic is 800MB, then: the targeted traffic consumption (10MB) is less than the first traffic threshold (20MB), and the remaining targeted traffic (800MB) is greater than the second traffic threshold (50MB). The electronic device can determine that: the electronic device is not using the targeted traffic of the first SIM card to run the target program. The electronic device can set the priority of the traffic channel of the first SIM card to be higher than the priority of the traffic channel of the second SIM card. That is, when both the traffic channels of the first and second SIM cards are open, the traffic channel of the second SIM card is closed, so that the data originally transmitted through the traffic channel of the second SIM card is transferred to the traffic channel of the first SIM card for transmission.

[0076] For example, suppose the first traffic threshold is 5MB and the second traffic threshold is 30MB. If the electronic device obtains that the first SIM card consumes 3MB of targeted traffic within 10 seconds between the 20th and 30th second of running the target program, and the remaining targeted traffic is 500MB, then: the targeted traffic consumption (3MB) is less than the first traffic threshold (5MB), and the remaining targeted traffic (500MB) is greater than the second traffic threshold (30MB). The electronic device can determine that: the electronic device is not using the targeted traffic of the first SIM card to run the target program. The electronic device can set the priority of the traffic channel of the first SIM card to be higher than the priority of the traffic channel of the second SIM card. That is, when both the traffic channels of the first and second SIM cards are open, the traffic channel of the second SIM card is closed, so that the data originally transmitted through the traffic channel of the second SIM card is transferred to the traffic channel of the first SIM card for transmission.

[0077] Thus, since the electronic device can set the traffic channel of the first SIM card as its primary traffic channel by prioritizing it over the traffic channels of all other SIM cards in the device (excluding the first SIM card), it ensures that the target program can use targeted traffic for data transmission. In other words, when running a targeted traffic application, the electronic device can automatically switch its primary traffic channel to the SIM card with targeted traffic by prioritizing its traffic channels, without requiring manual switching by the user, thereby simplifying the process of using targeted traffic on the electronic device.

[0078] Furthermore, since electronic devices can automatically switch their main data traffic channel to the SIM card with targeted data traffic when running a target program with targeted data traffic access, additional charges can be avoided if the data traffic channel is not switched to the SIM card program with targeted data traffic in a timely manner.

[0079] In this embodiment, when both the first and second SIM cards have their data traffic channels open, the electronic device can close the second SIM card's data traffic channel. The second SIM card's data traffic channel will then have a lower priority than the first SIM card's data traffic channel. In other words, after the second SIM card's data traffic channel is closed and then reopened, the first SIM card's data traffic channel becomes the highest priority among the at least two SIM cards' data traffic channels; that is, the electronic device's main data traffic channel switches to the first SIM card's data traffic channel. At this time, data originally transmitted through the second SIM card's data traffic channel can be transmitted through the second SIM card's data traffic channel, except for applications using dedicated data traffic.

[0080] It should be noted that step 102a above reduces the priority of the data traffic channel by closing the data traffic channel of the phone card.

[0081] In practice, the priority of the traffic channel can also be modified or set directly.

[0082] In addition, when all data channels are closed, electronic devices can set the priority of data channels by directly controlling the opening order of data channels for at least two SIM cards.

[0083] Thus, since the electronic device can control the shutdown of the second SIM card's data traffic channel when both the first and second SIM cards' data traffic channels are open, changing the priority of the data traffic channels, and thereby changing the electronic device's main or default data traffic channel, the data type used by the target program can be switched from the second SIM card's general data traffic to the first SIM card's targeted data traffic. Therefore, applications with targeted data traffic access can transmit data through the data traffic channel of the SIM card with targeted data traffic access. This reduces the consumption of general data traffic by applications with targeted data traffic access on other SIM cards, while also reducing additional data charges incurred due to the inability to switch to the targeted data traffic SIM card in a timely manner.

[0084] In some embodiments of this application, before the electronic device switches the traffic type used by the target program from general traffic of the second phone card to targeted traffic of the first phone card, the traffic port of the target program can be bound to the second phone card. Step 102 described above can also be implemented through step 102b below.

[0085] Step 102b: When the directional traffic consumption is less than or equal to the first traffic threshold and the remaining directional traffic is greater than or equal to the second traffic threshold, the electronic device binds the traffic port of the target program to the first phone card.

[0086] The traffic type associated with the target program is the same as the traffic type of the first phone card.

[0087] In this embodiment of the application, the electronic device can obtain the traffic port of each application in the electronic device and its bound phone card through the framework layer.

[0088] In some embodiments of this application, the electronic device can obtain the traffic port of the video application in the electronic device and bind it to the phone card 1 through the frame layer; or, the electronic device can obtain the traffic port of the audio application in the electronic device and bind it to the phone card 2 through the frame layer.

[0089] In this embodiment of the application, when changing the SIM card bound to the traffic port of the target program, the electronic device can identify the traffic type of the SIM card and bind the traffic port of the target program to the SIM card with the same traffic type.

[0090] For example, suppose the electronic device includes SIM card 1 and SIM card 2. SIM card 1 uses targeted data traffic, and SIM card 2 uses general data traffic. Assume the first data traffic threshold is 20MB and the second data traffic threshold is 50MB. If the electronic device obtains that SIM card 1 consumes 10MB of targeted data traffic in the first 10 seconds before running the target program, and the remaining targeted data traffic is 800MB, then: the targeted data traffic consumption (10MB) is less than the first data traffic threshold (20MB), and the remaining targeted data traffic (800MB) is greater than the second data traffic threshold (50MB). The electronic device can determine that: the electronic device is not using the targeted data traffic of the first SIM card to run the target program, and the electronic device can bind the data traffic port of the target program to SIM card 1.

[0091] For example, suppose the electronic device includes SIM card 3 and SIM card 4. SIM card 3 uses targeted data traffic, and SIM card 4 uses general data traffic. If the electronic device obtains that SIM card 3 consumes 3MB of targeted data traffic within 10 seconds between the 20th and 30th second of running the target program, and that the remaining targeted data traffic is 500MB, then: the targeted data traffic consumption (3MB) is less than the first data traffic threshold (5MB), and the remaining targeted data traffic (500MB) is greater than the second data traffic threshold (30MB). The electronic device can determine that it is not using the targeted data traffic of the first SIM card to run the target program, and can bind the target program's data traffic port to SIM card 3.

[0092] In some embodiments of this application, the traffic type associated with the target program can be the traffic type for which the target program has usage rights.

[0093] Thus, since the electronic device can change the target program's data port from being bound to the second SIM card to being bound to the first SIM card, the data type used by the target program is switched from the general data of the second SIM card to the targeted data of the first SIM card. Therefore, the data port of an application with targeted data usage rights can transmit data through the bound SIM card with targeted data usage rights. This reduces the general data consumption of applications with targeted data usage rights on other SIM cards, while also reducing additional data charges incurred due to the inability to switch to the targeted data SIM card in a timely manner.

[0094] In some embodiments of this application, after step 102 described above, the phone card switching method provided in this application may further include step 103 as described below. Step 102 can be specifically implemented through step 102c as described below.

[0095] Step 103: The electronic device obtains the general data usage of the second SIM card during the first time period.

[0096] In some embodiments of this application, the aforementioned general traffic consumption can be: the amount of general traffic consumed by the second phone card in a first time period. In other words, the aforementioned general traffic consumption can be represented by the number of bytes of general traffic consumed by the second phone card in the first time period.

[0097] In some embodiments of this application, when an electronic device is running an application with targeted data usage permissions, the electronic device can maintain discontinuous monitoring of the data consumption of the second SIM card in order to count the data consumption of the second SIM card.

[0098] For example, an electronic device can use the static long getMobileRxBytes() function to count the general data consumption of the second SIM card during the target time period.

[0099] For example, electronic devices can use the Network StatsManager, a traffic statistics tool, to obtain in real time the general traffic consumption of each application in the traffic channel of the second SIM card within a target time period, so as to obtain the general traffic consumption of the second SIM card.

[0100] In some embodiments of this application, the target time period can be the interval length of non-continuous monitoring.

[0101] In some embodiments of this application, the electronic device may count the general data consumption of the second phone card every 10 minutes (i.e., the target time period); or, the electronic device may count the general data consumption of the second phone card every 5 minutes (i.e., the target time period).

[0102] In some embodiments of this application, the interval duration of discontinuous monitoring can be determined using big data.

[0103] For example, big data can determine the interval of non-continuous monitoring by statistically analyzing how frequently most users use applications with targeted traffic usage permissions.

[0104] In some embodiments of this application, the target time period may be the same as or different from the first time period described above.

[0105] Step 102c: When the directional traffic consumption is less than or equal to the first traffic threshold, the remaining directional traffic is greater than or equal to the second traffic threshold, and the general traffic consumption is greater than or equal to the third traffic threshold, the electronic device switches the traffic type used by the target program from the general traffic of the second phone card to the directional traffic of the first phone card.

[0106] In this embodiment of the application, if the general data consumption of the second phone card is greater than or equal to the third data threshold, it can be said that the data type used by the target program is the general data of the second phone card.

[0107] It is understandable that if the targeted data usage is less than or equal to the first data threshold, the remaining targeted data usage is greater than or equal to the second data threshold, and the general data usage is greater than or equal to the third data threshold, then it can be concluded that the electronic device is running the target program using the general data of the second SIM card, but not the targeted data of the first SIM card. In other words, the target program is using the general data of the second SIM card, not the targeted data of the first SIM card. Thus, the electronic device can determine that the target program is using the general data of the second SIM card, and switch the target program's data usage from the general data of the second SIM card to the targeted data of the first SIM card. This allows the target program to use the targeted data of the first SIM card for data transmission, thereby preventing the target program from consuming the general data of the second SIM card.

[0108] In some embodiments of this application, it is assumed that the first traffic threshold is 5MB, the second traffic threshold is 30MB, and the third traffic threshold is 5MB. The electronic device can use the `static long getMobileRxBytes()` function to calculate the general traffic consumption of the second SIM card from 9:00 to 9:05 as 50MB, and obtain from the first SIM card's operator that the targeted traffic consumption of the first SIM card from 9:00 to 9:05 is 3MB, with a remaining targeted traffic of 100MB. Therefore, the targeted traffic consumption (3MB) is less than the first traffic threshold (5MB), the remaining targeted traffic (100MB) is greater than the second traffic threshold (30MB), and the general traffic consumption (50MB) is greater than the third traffic threshold (5MB). The electronic device can determine that the traffic type used by the target program is the general traffic of the second SIM card. Given sufficient remaining targeted traffic, the electronic device can switch the traffic type used by the target program from the general traffic of the second SIM card to the targeted traffic of the first SIM card.

[0109] In some embodiments of this application, it is assumed that the first traffic threshold is 3MB, the second traffic threshold is 50MB, and the third traffic threshold is 3MB. The electronic device can use the traffic statistics tool Network Stats Manager to calculate that the general traffic consumption of application 1 through the traffic channel of phone card 2 from 9:00 to 9:05 is 49MB; and obtain from the operator of the first phone card that the targeted traffic consumption of the first phone card from 9:00 to 9:05 is 0MB, with a remaining targeted traffic of 200MB. Therefore, the targeted traffic consumption (0MB) is less than the first traffic threshold (3MB), the remaining targeted traffic (200MB) is greater than the second traffic threshold (50MB), and the general traffic consumption (49MB) is greater than the third traffic threshold (3MB). The electronic device can determine that the traffic type used by the target program is the general traffic of the second phone card. Given sufficient remaining targeted traffic, the electronic device can switch the traffic type used by the target program from the general traffic of the second phone card to the targeted traffic of the first phone card.

[0110] In some embodiments of this application, the third traffic threshold can be set by the user, can be the default value of the electronic device, or can be determined based on the historical traffic consumption of the target program when it was run in the past.

[0111] In some embodiments of this application, the third flow threshold may be the same as or different from the first flow threshold.

[0112] Thus, since the electronic device can determine the data type used by the target program is the general data of the second SIM card, rather than the targeted data of the first SIM card, at any time during the operation of the target program, if the targeted data consumption is less than or equal to the first data threshold, the remaining targeted data is greater than or equal to the second data threshold, and the general data consumption is greater than or equal to the third data threshold, the electronic device can automatically switch the data type used by the target program to the targeted data of the first SIM card. That is, the electronic device can determine whether the data type used by the target program is the targeted data of a SIM card with targeted data based on the targeted data consumption, the remaining targeted data, and the general data consumption of other SIM cards. If the data type used by the target program is not the targeted data of a SIM card with targeted data, the electronic device will automatically switch the data type used by the target program to the targeted data of a SIM card with targeted data, without requiring manual switching by the user. In this way, the electronic device can complete the switching of the data type used by the target program without the user's awareness, thereby simplifying the operation process of using targeted data.

[0113] In some embodiments of this application, after step 101 above, the phone card switching method provided in this application may further include steps 104, 105 or 106 as described below.

[0114] Step 104: When the directional data consumption exceeds the first data threshold and the remaining directional data is greater than or equal to the second data threshold, the electronic device controls the target program to continue using the directional data of the first phone card.

[0115] In this embodiment, if the directional data consumption exceeds a first data threshold and the remaining directional data is greater than or equal to a second data threshold, it indicates that the electronic device is using the directional data of the first SIM card to run the target program, and the remaining directional data of the first SIM card is sufficient. In other words, the electronic device does not need to switch the data type used by the target program; that is, the electronic device can control the target program to continue running using the directional data of the first SIM card.

[0116] In some embodiments of this application, it is assumed that the first traffic threshold is 5MB and the second traffic threshold is 30MB. The electronic device can obtain information from the operator of the first phone card that the first phone card's targeted traffic consumption between 9:00 and 9:05 is 30MB, and the remaining targeted traffic is 100MB. Therefore, the targeted traffic consumption (30MB) is greater than the first traffic threshold (5MB), and the remaining targeted traffic (100MB) is greater than the second traffic threshold (30MB). The electronic device can determine that it is using the targeted traffic of the first phone card to run the target program, and that the remaining targeted traffic of the first phone card is sufficient. The electronic device does not need to switch the traffic type used by the target program; that is, the electronic device can control the target program to continue running using the targeted traffic of the first phone card.

[0117] In some embodiments of this application, it is assumed that the first traffic threshold is 3MB and the second traffic threshold is 50MB. The electronic device can obtain information from the operator of the first phone card that the first phone card's targeted traffic consumption between 9:00 and 9:05 is 10MB, and the remaining targeted traffic is 200MB. Therefore, the targeted traffic consumption (10MB) is greater than the first traffic threshold (3MB), and the remaining targeted traffic (200MB) is greater than the second traffic threshold (50MB). The electronic device can determine that it is using the targeted traffic of the first phone card to run the target program, and that the remaining targeted traffic of the first phone card is sufficient. The electronic device does not need to switch the traffic type used by the target program; that is, the electronic device can control the target program to continue running using the targeted traffic of the first phone card.

[0118] Step 105: When the directional traffic consumption is greater than the first traffic threshold, the remaining directional traffic is greater than or equal to the second traffic threshold, and the difference between the directional traffic consumption and the target traffic consumption is less than or equal to the fourth traffic threshold, the electronic device controls the target program to continue using the directional traffic of the first phone card.

[0119] The methods for calculating target traffic consumption and targeted traffic consumption are different.

[0120] In this embodiment of the application, the targeted traffic consumption can be the targeted traffic consumption of the first phone card obtained by the electronic device from the operator of the first phone card in the first time period, and the target traffic consumption can be the traffic consumption of the first phone card obtained by the electronic device in other ways in the first time period.

[0121] In some embodiments of this application, the target traffic consumption can be the traffic consumption of the first SIM card as counted by the electronic device.

[0122] For example, an electronic device can use the static long getMobileRxBytes() function to count the data consumption of the first SIM card during the first time period.

[0123] For example, electronic devices can use the Network StatsManager, a traffic statistics tool, to obtain in real time the traffic consumption of each application in the traffic channel of the first SIM card during a first time period, so as to obtain the traffic consumption of each SIM card.

[0124] It should be noted that because the methods and standards used by operators to count traffic may differ from those used by electronic devices, the targeted traffic consumption of the first SIM card obtained through the operator may differ from the target traffic consumption of the first SIM card as counted by the electronic device.

[0125] In this embodiment of the application, if the targeted traffic consumption is greater than the first traffic threshold, the traffic type used by the target program is the targeted traffic of the first phone card.

[0126] In this embodiment of the application, if the remaining amount of targeted traffic is greater than or equal to the second traffic threshold, it can be said that the first phone card has sufficient targeted traffic to support the operation of the target program.

[0127] In this embodiment of the application, if the difference between the directed traffic consumption and the target traffic consumption is less than or equal to the fourth traffic threshold, then during the first time period, only the target program uses the directed traffic of the first phone card for data transmission, and the judgment of the traffic type used by the target program is accurate at this time.

[0128] It is understandable that if the targeted traffic consumption is greater than the first traffic threshold, the remaining targeted traffic is greater than or equal to the second traffic threshold, and the difference between the targeted traffic consumption and the target traffic consumption is less than or equal to the fourth traffic threshold, it means that the traffic type being used by the target program is the targeted traffic of the first phone card, and the remaining targeted traffic is sufficient. Therefore, there is no need to switch the traffic type used by the target program.

[0129] In some embodiments of this application, the fourth traffic threshold can be set by the user, can be the default value of the electronic device, or can be determined based on the historical traffic consumption of the target program when it was run in the past.

[0130] In some embodiments of this application, the fourth flow threshold may be the same as or different from the first flow threshold.

[0131] In some embodiments of this application, it is assumed that the first traffic threshold is 5MB, the second traffic threshold is 30MB, and the fourth traffic threshold is 5MB. The electronic device can use the `static long getMobileRxBytes()` function to calculate that the target traffic consumption of the first SIM card between 9:00 and 9:05 is 50MB, and obtain from the first SIM card's operator that the directed traffic consumption of the first SIM card between 9:00 and 9:05 is 53MB, with a remaining directed traffic of 100MB. Therefore, the directed traffic consumption (53MB) is greater than the first traffic threshold (5MB), the remaining directed traffic (100MB) is greater than the second traffic threshold (30MB), and the difference between the directed traffic consumption (53MB) and the target traffic consumption (50MB) (3MB) is less than the fourth traffic threshold (5MB). The electronic device can determine that the target program is using the directed traffic of the first SIM card, and that the remaining directed traffic is sufficient. Therefore, there is no need to switch the traffic type used by the target program; that is, the electronic device can control the target program to continue using the directed traffic of the first SIM card.

[0132] In some embodiments of this application, it is assumed that the first traffic threshold is 3MB, the second traffic threshold is 50MB, and the fourth traffic threshold is 3MB. The electronic device can use the traffic statistics tool Network Stats Manager to calculate that the targeted traffic consumption of the target program through the traffic channel of phone card 1 from 9:00 to 9:05 is 49MB; and obtain from the operator of the first phone card that the targeted traffic consumption of the first phone card from 9:00 to 9:05 is 50MB, with a remaining targeted traffic of 200MB. Therefore, the targeted traffic consumption (50MB) is greater than the first traffic threshold (3MB), the remaining targeted traffic (200MB) is greater than the second traffic threshold (50MB), and the difference (1MB) between the targeted traffic consumption (50MB) and the target traffic consumption (49MB) is less than the fourth traffic threshold (3MB). The electronic device can determine that the traffic type currently being used by the target program is the targeted traffic of the first phone card, and that the remaining targeted traffic is sufficient. Therefore, there is no need to switch the traffic type used by the target program; that is, the electronic device can control the target program to continue using the targeted traffic of the first phone card.

[0133] Step 106: When the directional data consumption is less than or equal to the first data threshold and the remaining directional data is less than the second data threshold, the electronic device controls the target program to continue using the general data of the second phone card.

[0134] In this embodiment of the application, if the targeted traffic consumption is less than or equal to the first traffic threshold and the remaining targeted traffic is less than the second traffic threshold, it indicates that the traffic type used by the target program is not the targeted traffic of the first phone card, but the general traffic of the second phone card, and the remaining targeted traffic of the first phone card is insufficient to support the operation of the target program.

[0135] It is understandable that when the targeted data consumption is less than or equal to the first data threshold and the remaining targeted data is less than the second data threshold, the electronic device does not need to switch the data type used by the target program. That is, the electronic device can control the target program to continue using the general data of the second phone card.

[0136] In some embodiments of this application, it is assumed that the first traffic threshold is 5MB and the second traffic threshold is 30MB. The electronic device can obtain information from the operator of the first phone card that the first phone card's targeted traffic consumption between 9:00 and 9:05 is 3MB, and the remaining targeted traffic is 20MB. Since the targeted traffic consumption (3MB) is less than the first traffic threshold (5MB) and the remaining targeted traffic (20MB) is less than the second traffic threshold (30MB), the electronic device can determine that the traffic type used by the target program is not the targeted traffic of the first phone card, but rather the general traffic of the second phone card. Furthermore, the remaining targeted traffic of the first phone card is insufficient to support the operation of the target program. Therefore, the electronic device does not need to switch the traffic type used by the target program; that is, the electronic device can control the target program to continue using the general traffic of the second phone card.

[0137] In some embodiments of this application, it is assumed that the first traffic threshold is 3MB and the second traffic threshold is 50MB. The electronic device can obtain information from the operator of the first phone card that the first phone card's targeted traffic consumption between 9:00 and 9:05 is 0MB, and the remaining targeted traffic is 20MB. Since the targeted traffic consumption (0MB) is less than the first traffic threshold (3MB) and the remaining targeted traffic (20MB) is less than the second traffic threshold (50MB), the electronic device can determine that the traffic type used by the target program is not the targeted traffic of the first phone card, but rather the general traffic of the second phone card. Furthermore, the remaining targeted traffic of the first phone card is insufficient to support the operation of the target program. Therefore, the electronic device does not need to switch the traffic type used by the target program; that is, the electronic device can control the target program to continue using the general traffic of the second phone card.

[0138] Thus, the electronic device can determine that the target program is using the targeted data traffic of the first SIM card when the targeted data traffic consumption exceeds the first data traffic threshold and the remaining targeted data traffic is greater than or equal to the second data traffic threshold, or when the targeted data traffic consumption exceeds the first data traffic threshold, the remaining targeted data traffic is greater than or equal to the second data traffic threshold, and the difference between the targeted data traffic consumption and the target data traffic consumption is less than or equal to the fourth data traffic threshold. It will then control the target program to continue using the targeted data traffic of the first SIM card. Furthermore, if the targeted data traffic consumption is less than or equal to the first data traffic threshold and the remaining targeted data traffic is less than the second data traffic threshold, it can determine that the target program is using the general data traffic of the second SIM card, and the remaining targeted data traffic of the first SIM card is insufficient to support the operation of the target program. It will then control the target program to continue using the general data traffic of the second SIM card. Therefore, the electronic device can determine whether to switch the data traffic type used by the target program based on the targeted data traffic consumption and the remaining targeted data traffic. If no switch is needed, it can control the target program to continue using the data traffic of the currently used SIM card for data transmission. In this way, the electronic device can complete the determination and switching of the data traffic type without the user's awareness, thereby simplifying the operation process of using targeted data traffic.

[0139] In some embodiments of this application, after step 102 above, the SIM card switching method provided in this application may further include step 107 below.

[0140] Step 107: If the electronic device's directional data consumption of the first SIM card in the second time period is less than or equal to the fifth data threshold, and the data channels of both the first and second SIM cards are open, then the data channel of the first SIM card is closed.

[0141] The second time period refers to any time period during the execution of the target program.

[0142] It is understandable that if the targeted data consumption of the first SIM card in the second time period is less than or equal to the fifth data threshold, it means that the target program stops consuming targeted data, that is, the electronic device stops running the target program. At this time, the electronic device needs to switch the data type used by the target program back to the general data of the second SIM card.

[0143] In some embodiments of this application, the electronic device can close the traffic channel of the first phone card when both the traffic channels of the first phone card and the second phone card are open, so as to set the priority of the traffic channel of the first phone card to be lower than the priority of the traffic channel of the second phone card, so that applications other than the target program can transmit data through the traffic channel of the second phone card.

[0144] For example, assume the first traffic threshold is 20MB. If the electronic device detects that the first SIM card consumes 10MB of targeted traffic between 11:00 and 11:05, then: the targeted traffic consumption (10MB) is less than the fifth traffic threshold (20MB). The electronic device can determine that: the target program has stopped consuming targeted traffic. At this time, the electronic device needs to switch the traffic type used by the target program back to the general traffic of the second SIM card.

[0145] For example, assume the first traffic threshold is 5MB. If the electronic device detects that the first SIM card's targeted traffic consumption is 0MB between 11:00 and 11:01, then: the targeted traffic consumption (0MB) is less than the fifth traffic threshold (5MB). The electronic device can determine that: the target program has stopped consuming targeted traffic. At this time, the electronic device needs to switch the traffic type used by the target program back to the general traffic of the second SIM card.

[0146] In this embodiment of the application, after the electronic device closes the data traffic channel of the first SIM card, it can quickly reopen the data traffic channel of the first SIM card to maintain the data transmission capabilities of both the first and second SIM cards simultaneously.

[0147] In some embodiments of this application, the fifth traffic threshold can be set by the user, can be the default value of the electronic device, or can be determined based on the historical traffic consumption of the target program when it was run in the past.

[0148] In some embodiments of this application, the fifth flow threshold may be the same as or different from the first flow threshold.

[0149] In some embodiments of this application, the second time period may be the same as or different from the first time period described above.

[0150] In this embodiment of the application, after the electronic device switches the traffic type used by the target program to the targeted traffic channel of the first phone card, it can continuously monitor the traffic channels of the first phone card and the second phone card respectively, and interact with the operator of the first phone card to obtain the targeted traffic consumption. If the traffic type used by the target program is not the targeted traffic of the first phone card, the traffic type used by the target program is switched to the targeted traffic of the phone card with targeted traffic. That is, the electronic device can repeat the above steps 101 and 102.

[0151] Thus, since the electronic device can stop running the target program if the targeted data consumption of the first SIM card is less than or equal to the fifth data threshold during the program's execution, meaning the target program no longer consumes the first SIM card's targeted data, the electronic device can switch the data type used by the target program back to the general data type of a SIM card with general data usage by closing the first SIM card's data channel. In this way, after the target program stops consuming targeted data, the electronic device can promptly switch the data type used by the target program to the general data type of another SIM card without the user's awareness, thus simplifying the process of using targeted data.

[0152] The following examples, namely Example 1 and Example 2, illustrate the telephone card switching method provided in this application.

[0153] Example 1: As shown in Figure 2, assume the electronic device includes SIM card 1 and SIM card 2, where SIM card 1 has targeted data traffic and SIM card 2 has general data traffic traffic. The first data traffic threshold is 5MB, the second data traffic threshold is 30MB, the third data traffic threshold is 3MB, and the fifth data traffic threshold is 5MB. This SIM card switching method may include steps 201 to 207 as described below.

[0154] Step 201: During the operation of the target program, the electronic device sends a text message to the operator of the phone card 1 to inquire about the amount of targeted data consumption K1 and the amount of targeted data remaining K2 of the phone card 1 in the first time period.

[0155] Step 202: The electronic device uses its built-in data usage tool to count the general data usage K3 of the phone card 2 during the first time period.

[0156] Step 203: The electronic device can control the target program to continue using the targeted traffic of phone card 1 for data transmission when K1 is greater than 5MB, K2 is greater than or equal to 30MB, and K3 is less than 5MB.

[0157] Step 204: When K1 is less than or equal to 5MB, K2 is greater than or equal to 30MB, and K3 is greater than or equal to 5MB, the electronic device switches the traffic type used by the target program from general traffic of phone card 2 to targeted traffic of phone card 1.

[0158] Step 205: The electronic device determines whether the targeted data consumption K1 of phone card 1 in the second time period is less than or equal to 5MB.

[0159] Step 206: If the electronic device consumes more than 5MB of directed traffic on phone card 1 during the second time period, the target program is controlled to continue using the directed traffic of phone card 1.

[0160] Step 207: If the targeted data consumption K1 of the phone card 1 is less than 5MB during the second time period, the electronic device switches the data type used by the target program back to the general data of the phone card 2.

[0161] Example 2: As shown in Figure 3, assume the electronic device includes SIM card 1 and SIM card 2, where SIM card 1 has targeted data traffic and SIM card 2 has general data traffic traffic. The first data traffic threshold is 10MB, the second data traffic threshold is 50MB, the fourth data traffic threshold is 3MB, and the fifth data traffic threshold is 5MB. This SIM card switching method may include steps 301 to 306 as described below.

[0162] Step 301: During the operation of the target program, the electronic device sends an SMS to the operator of the phone card 1 to query the targeted data consumption K1 and the remaining targeted data K2 of the phone card 1 in the first time period, and uses the data usage tool built into the electronic device to calculate the target data consumption K4 of the phone card 1 in the first time period.

[0163] Step 302: The electronic device can control the target program to continue using the targeted traffic of phone card 1 for data transmission when K1 is greater than 10MB, K2 is greater than or equal to 50MB, and the difference between K1 and K4 is less than or equal to 3MB.

[0164] Step 303: When K1 is less than or equal to 10MB, K2 is greater than or equal to 50MB, and the difference between K1 and K4 is less than or equal to 3MB, the electronic device switches the traffic type used by the target program from general traffic of phone card 2 to targeted traffic of phone card 1.

[0165] Step 304: The electronic device determines whether the directional data consumption K1 of phone card 1 in the second time period is less than or equal to 5MB.

[0166] Step 305: If the electronic device consumes more than 5MB of directed traffic K1 in the second time period of the phone card 1, the target program is controlled to continue using the directed traffic of the phone card 1.

[0167] Step 306: If the targeted data consumption K1 of the SIM card 1 is less than 5MB during the second time period, the electronic device switches the data type used by the target program back to the general data of the SIM card 2.

[0168] This application provides a method for switching phone cards. When an electronic device is running a target program, if the directional data consumption of the first phone card is less than or equal to a first data threshold, it can be determined that the electronic device is not using the data of a phone card with directional data to run the target program; that is, the data type used by the electronic device to run the target program is different from the data type of the phone card with directional data. If the remaining directional data is greater than or equal to a second data threshold, it can be determined that the phone card still has sufficient remaining directional data for the target program to run. Therefore, the electronic device can automatically switch the data type used by the target program from the general data of the second phone card to the directional data of the first phone card. In other words, the electronic device can determine whether the data type used by the target program is the directional data of a phone card with directional data based on the directional data consumption and the remaining directional data. If the data type used by the target program is not the directional data of a phone card with directional data, it will switch the data type used by the target program from the general data of the second phone card to the directional data of the first phone card, without requiring the user to manually switch the data type. Thus, the electronic device can complete the data type switching without the user's awareness, thereby simplifying the process of using directional data.

[0169] The SIM card switching method provided in this application can be executed by a SIM card switching device. This application uses a SIM card switching device executing the SIM card switching method as an example to illustrate the SIM card switching device provided in this application.

[0170] Figure 4 shows a possible structural schematic diagram of the phone card switching device involved in an embodiment of this application. As shown in Figure 4, the phone card switching device 40 may include: an acquisition module 41 and a switching module 42;

[0171] The acquisition module 41 is used to acquire the targeted data consumption and remaining targeted data of the first phone card within a first time period. The first time period is any time period during the execution of the target program, and the target program has the right to use the targeted data of the first phone card. The switching module 42 is used to switch the data type used by the target program from the general data of the second phone card to the targeted data of the first phone card when the targeted data consumption acquired by the acquisition module 41 is less than or equal to a first data threshold and the remaining targeted data acquired by the acquisition module is greater than or equal to a second data threshold. The first phone card is a phone card with targeted data, and the second phone card is a phone card with general data.

[0172] In one possible implementation, the acquisition module 41 is further configured to acquire the general traffic consumption of the second phone card in the first time period before the switching module 42 switches the traffic type used by the target program from the general traffic of the second phone card to the targeted traffic of the first phone card.

[0173] The aforementioned switching module is specifically used to switch the traffic type used by the target program from the general traffic of the second phone card to the targeted traffic of the first phone card when the targeted traffic consumption is less than or equal to the first traffic threshold, the remaining targeted traffic is greater than or equal to the second traffic threshold, and the general traffic consumption is greater than or equal to the third traffic threshold.

[0174] In one possible implementation, the switching module 42 is further configured to, after the acquisition module 41 acquires the directional traffic consumption and directional traffic remaining amount of the first phone card in the first time period, control the target program to continue using the directional traffic of the first phone card if the directional traffic consumption is greater than the first traffic threshold and the directional traffic remaining amount is greater than or equal to the second traffic threshold.

[0175] Alternatively, if the targeted traffic consumption is greater than the first traffic threshold, the remaining targeted traffic is greater than or equal to the second traffic threshold, and the difference between the targeted traffic consumption and the target traffic consumption is less than or equal to the fourth traffic threshold, the target program is controlled to continue using the targeted traffic of the first phone card. The traffic statistics methods for the target traffic consumption and the targeted traffic consumption are different.

[0176] Alternatively, if the targeted data consumption is less than or equal to the first data threshold and the remaining targeted data is less than the second data threshold, the target program can be controlled to continue using the general data of the second SIM card.

[0177] In one possible implementation, the aforementioned switching module 42 is specifically used for:

[0178] With both the first and second SIM cards' data traffic channels enabled, disable the second SIM card's data traffic channel.

[0179] In one possible implementation, the target program's traffic port is bound to the second phone card before the traffic type used by the target program is switched from general traffic of the second phone card to targeted traffic of the first phone card;

[0180] The aforementioned switching module 42 is specifically used to bind the traffic port of the target program to the first phone card, and the traffic type associated with the target program is the same as the traffic type of the first phone card.

[0181] In one possible implementation, the above-mentioned device further includes: a processing module;

[0182] The aforementioned processing module is used to switch the traffic type used by the target program from the general traffic of the second phone card to the targeted traffic of the first phone card after the switching module 42 switches the targeted traffic consumption of the first phone card in the second time period to less than or equal to the fifth traffic threshold, and the traffic channels of both the first and second phone cards are open, and then closes the traffic channel of the first phone card; wherein, the second time period is any time period during the running of the target program.

[0183] This application provides a SIM card switching device. During the execution of a target program, if the directional data consumption of the first SIM card is less than or equal to a first data threshold, it can be determined that the SIM card switching device is not using the data of a SIM card with directional data to run the target program; that is, the data type used by the SIM card switching device to run the target program is different from the data type of a SIM card with directional data. If the remaining directional data is greater than or equal to a second data threshold, it can be determined that the SIM card still has sufficient remaining directional data for the target program to run. Therefore, the SIM card switching device can automatically switch the data type used by the target program from the general data of the second SIM card to the directional data of the first SIM card. In other words, the SIM card switching device can determine whether the data type used by the target program is the directional data of a SIM card with directional data based on the directional data consumption and the remaining directional data. If the data type used by the target program is not the directional data of a SIM card with directional data, it will switch the data type used by the target program from the general data of the second SIM card to the directional data of the first SIM card, without requiring the user to manually switch the data type. This SIM card switching device can switch data types without the user's awareness, thus simplifying the process of using targeted data.

[0184] The SIM card switching device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television set (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the device.

[0185] The SIM card switching device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit it.

[0186] The SIM card switching device provided in this application embodiment can implement the various processes implemented in the method embodiments of Figures 1 and 2, and achieve the same technical effect. To avoid repetition, it will not be described again here.

[0187] In some embodiments of this application, as shown in FIG5, this application also provides an electronic device 500, including a processor 501 and a memory 502. The memory 502 stores a program or instructions that can run on the processor 501. When the program or instructions are executed by the processor 501, they implement the various steps of the above-described telephone card switching method embodiments and can achieve the same technical effect. To avoid repetition, they will not be described again here.

[0188] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.

[0189] Figure 6 is a schematic diagram of the hardware structure of an electronic device that implements an embodiment of this application.

[0190] The electronic device 600 includes, but is not limited to, components such as: radio frequency unit 601, network module 602, audio output unit 603, input unit 604, sensor 605, display unit 606, user input unit 607, interface unit 608, memory 609, and processor 610.

[0191] Those skilled in the art will understand that the electronic device 600 may also include a power supply (such as a battery) for powering various components. The power supply can be logically connected to the processor 610 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The electronic device structure shown in Figure 6 does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.

[0192] The processor 610 is configured to obtain the targeted data consumption and remaining targeted data of the first SIM card within a first time period, wherein the first time period is any time period during the execution of the target program, and the target program has the right to use the targeted data of the first SIM card; and, when the obtained targeted data consumption is less than or equal to a first data threshold and the obtained targeted data remaining is greater than or equal to a second data threshold, to switch the data type used by the target program from the general data of the second SIM card to the targeted data of the first SIM card; wherein the first SIM card is a SIM card with targeted data and the second SIM card is a SIM card with general data.

[0193] In some embodiments of this application, the processor 610 is further configured to obtain the general traffic consumption of the second phone card in a first time period before switching the traffic type used by the target program from general traffic of the second phone card to targeted traffic of the first phone card.

[0194] The aforementioned processor 610 is specifically used for:

[0195] If the targeted traffic consumption is less than or equal to the first traffic threshold, the remaining targeted traffic is greater than or equal to the second traffic threshold, and the general traffic consumption is greater than or equal to the third traffic threshold, the traffic type used by the target program will be switched from the general traffic of the second phone card to the targeted traffic of the first phone card.

[0196] In some embodiments of this application, the processor 610 is further configured to, after obtaining the targeted data consumption and remaining targeted data of the first SIM card within a first time period, control the target program to continue using the targeted data of the first SIM card if the targeted data consumption is greater than a first data threshold and the remaining targeted data is greater than or equal to a second data threshold; or, control the target program to continue using the targeted data of the first SIM card if the targeted data consumption is greater than the first data threshold, the remaining targeted data is greater than or equal to the second data threshold, and the difference between the targeted data consumption and the target data consumption is less than or equal to a fourth data threshold, wherein the data statistics methods for the target data consumption and the targeted data consumption are different; or, control the target program to continue using the general data of the second SIM card if the targeted data consumption is less than or equal to the first data threshold and the remaining targeted data is less than the second data threshold.

[0197] In some embodiments of this application, the processor 610 described above is specifically used for:

[0198] With both the first and second SIM cards' data traffic channels enabled, disable the second SIM card's data traffic channel.

[0199] In some embodiments of this application, the traffic port of the target program is bound to the second phone card before the traffic type used by the target program is switched from the general traffic of the second phone card to the targeted traffic of the first phone card;

[0200] The aforementioned processor 610 is specifically used for:

[0201] Bind the target program's traffic port to the first SIM card, and the traffic type associated with the target program is the same as the traffic type of the first SIM card.

[0202] In some embodiments of this application, the processor 610 is further configured to, after switching the traffic type used by the target program from general traffic of the second phone card to targeted traffic of the first phone card, close the traffic channel of the first phone card when the targeted traffic consumption of the first phone card in the second time period is less than or equal to the fifth traffic threshold and the traffic channels of both the first and second phone cards are open; wherein, the second time period is any time period during the running of the target program.

[0203] This application provides an electronic device. During the execution of a target program, if the directional data consumption of a first SIM card is less than or equal to a first data threshold, it can be determined that the electronic device is not using the data of a SIM card with directional data to run the target program; that is, the data type used by the electronic device to run the target program is different from the data type of the SIM card with directional data. If the remaining directional data is greater than or equal to a second data threshold, it can be determined that the SIM card still has sufficient remaining directional data for the target program to run. Therefore, the electronic device can automatically switch the data type used by the target program from the general data of the second SIM card to the directional data of the first SIM card. In other words, the electronic device can determine whether the data type used by the target program is the directional data of a SIM card with directional data based on the directional data consumption and the remaining directional data. If the data type used by the target program is not the directional data of a SIM card with directional data, it will switch the data type used by the target program from the general data of the second SIM card to the directional data of the first SIM card, without requiring the user to manually switch the data type. Thus, the electronic device can complete the data type switch without the user's awareness, thereby simplifying the operation process of using directional data.

[0204] It should be understood that, in this embodiment, the input unit 604 may include a graphics processing unit (GPU) 6041 and a microphone 6042. The GPU 6041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 606 may include a display panel 6061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 607 includes at least one of a touch panel 6071 and other input devices 6072. The touch panel 6071 is also called a touch screen. The touch panel 6071 may include two parts: a touch detection device and a touch controller. Other input devices 6072 may include, but are not limited to, a physical keyboard, function keys (such as volume control buttons, power buttons, etc.), a trackball, a mouse, and a joystick, which will not be described in detail here.

[0205] The memory 609 can be used to store software programs and various data. The memory 609 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 609 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 609 in this embodiment includes, but is not limited to, these and any other suitable types of memory.

[0206] Processor 610 may include one or more processing units; optionally, processor 610 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 610.

[0207] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described phone card switching method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0208] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0209] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface and the processor are coupled. The processor is used to run programs or instructions to implement the various processes of the above-described phone card switching method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0210] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0211] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the telephone card switching method embodiment described above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0212] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0213] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0214] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. A method for switching phone cards, characterized in that, The method includes: obtaining the targeted data consumption and remaining targeted data of a first SIM card within a first time period, wherein the first time period is any time period during the execution of a target program, and the target program has access to the targeted data of the first SIM card; and, when the targeted data consumption is less than or equal to a first data threshold and the remaining targeted data is greater than or equal to a second data threshold, switching the data type used by the target program from general data of the second SIM card to targeted data of the first SIM card; wherein the first SIM card is a SIM card with targeted data, and the second SIM card is a SIM card with general data.

2. The method according to claim 1, characterized in that, Before switching the data traffic type used by the target program from general data traffic of the second phone card to targeted data traffic of the first phone card, the method further includes: obtaining the general data traffic consumption of the second phone card during the first time period; the step of switching the data traffic used by the target program from general data traffic of the second phone card to targeted data traffic of the first phone card when the targeted data traffic consumption is less than or equal to a first data traffic threshold and the remaining targeted data traffic is greater than or equal to a second data traffic threshold includes: when the targeted data traffic consumption is less than or equal to the first data traffic threshold, the remaining targeted data traffic is greater than or equal to the second data traffic threshold, and the general data traffic consumption is greater than or equal to a third data traffic threshold, switching the data traffic type used by the target program from general data traffic of the second phone card to targeted data traffic of the first phone card.

3. The method according to claim 1 or 2, characterized in that, After obtaining the targeted data consumption and remaining targeted data of the first phone card within a first time period, the method further includes: controlling the target program to continue using the targeted data of the first phone card when the targeted data consumption is greater than the first data threshold and the remaining targeted data is greater than or equal to the second data threshold; or controlling the target program to continue using the targeted data of the first phone card when the targeted data consumption is greater than the first data threshold, the remaining targeted data is greater than or equal to the second data threshold, and the difference between the targeted data consumption and the target data consumption is less than or equal to a fourth data threshold, wherein the data consumption method for the target data consumption is different from that for the targeted data consumption; or controlling the target program to continue using the general data of the second phone card when the targeted data consumption is less than or equal to the first data threshold and the remaining targeted data is less than the second data threshold.

4. The method according to claim 1 or 2, characterized in that, The step of switching the traffic type used by the target program from the general traffic of the second SIM card to the targeted traffic of the first SIM card includes: closing the traffic channel of the second SIM card when both the traffic channels of the first SIM card and the second SIM card are open.

5. The method according to claim 1 or 2, characterized in that, Before switching the traffic type used by the target program from the general traffic of the second phone card to the targeted traffic of the first phone card, the traffic port of the target program is bound to the second phone card; The step of switching the traffic type used by the target program from the general traffic of the second phone card to the targeted traffic of the first phone card includes: binding the traffic port of the target program to the first phone card, wherein the traffic type associated with the target program is the same as the traffic type of the first phone card.

6. The method according to claim 1 or 2, characterized in that, After switching the traffic type used by the target program from general traffic of the second phone card to targeted traffic of the first phone card, the method further includes: closing the traffic channel of the first phone card when the targeted traffic consumption of the first phone card in a second time period is less than or equal to a fifth traffic threshold, and the traffic channels of both the first phone card and the second phone card are open; wherein, the second time period is any time period during the running of the target program.

7. A phone card switching device, characterized in that, The device includes: an acquisition module, configured to acquire the targeted data consumption and remaining targeted data of a first SIM card within a first time period, wherein the first time period is any time period during the execution of a target program, and the target program has access to the targeted data of the first SIM card; and a switching module, configured to switch the data type used by the target program from general data of the second SIM card to targeted data of the first SIM card when the targeted data consumption acquired by the acquisition module is less than or equal to a first data threshold and the remaining targeted data acquired by the acquisition module is greater than or equal to a second data threshold; wherein the first SIM card is a SIM card with targeted data, and the second SIM card is a SIM card with general data.

8. The apparatus according to claim 7, characterized in that, The acquisition module is further configured to acquire the general data consumption of the second phone card during the first time period before the switching module switches the data type used by the target program from the general data of the second phone card to the targeted data of the first phone card; the switching module is specifically configured to: switch the data type used by the target program from the general data of the second phone card to the targeted data of the first phone card when the targeted data consumption is less than or equal to the first data threshold, the remaining targeted data is greater than or equal to the second data threshold, and the general data consumption is greater than or equal to the third data threshold.

9. The apparatus according to claim 7 or 8, characterized in that, The switching module is further configured to, after the acquisition module acquires the targeted data consumption and remaining targeted data of the first SIM card within a first time period, control the target program to continue using the targeted data of the first SIM card when the targeted data consumption is greater than the first data threshold and the remaining targeted data is greater than or equal to the second data threshold; or, control the target program to continue using the targeted data of the first SIM card when the targeted data consumption is greater than the first data threshold, the remaining targeted data is greater than or equal to the second data threshold, and the difference between the targeted data consumption and the target data consumption is less than or equal to a fourth data threshold, wherein the data consumption method for the target data consumption is different from that for the targeted data consumption; or, control the target program to continue using the general data of the second SIM card when the targeted data consumption is less than or equal to the first data threshold and the remaining targeted data is less than the second data threshold.

10. The apparatus according to claim 7 or 8, characterized in that, The switching module is specifically used to: close the traffic channel of the second phone card when both the traffic channels of the first phone card and the second phone card are open.

11. The apparatus according to claim 7 or 8, characterized in that, Before switching the traffic type used by the target program from the general traffic of the second phone card to the targeted traffic of the first phone card, the traffic port of the target program is bound to the second phone card; The switching module is specifically used to: bind the traffic port of the target program to the first SIM card, wherein the traffic type associated with the target program is the same as the traffic type of the first SIM card.

12. The apparatus according to claim 7 or 8, characterized in that, The device further includes a processing module, configured to, after the switching module switches the traffic type used by the target program from general traffic of the second phone card to targeted traffic of the first phone card, close the traffic channel of the first phone card when the targeted traffic consumption of the first phone card in a second time period is less than or equal to a fifth traffic threshold, and the traffic channels of both the first phone card and the second phone card are open; wherein, the second time period is any time period during the running of the target program.

13. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions being executed by the processor to implement the steps of the phone card switching method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Network switching method and device, storage medium and terminal

    CN111343683A

  • SIM card automatic switching method and device and terminal equipment

    CN112312508A