Patent Description:
At present, a dual SIM design has become a routine setting for mobile phones. Existing dual SIM designs are classified into two types: dual SIM dual standby and dual SIM dual active. Dual SIM dual active means that two subscriber identity module (Subscriber Identity Module, SIM) cards are not only standby at the same time, but also can perform service transmission at the same time. For example, a user may watch an online video by using SIM2 while making a call through SIM1 by using a dual SIM dual active function. To implement dual SIM dual active, strictly speaking, two hardware radio frequency circuits are required. The SIM1 and the SIM2 implement simultaneous paging and service transmission through different hardware radio frequency circuits. This is the case in <CIT>.

To simplify a hardware architecture of dual SIM dual active, a virtual dual SIM dual active technology is proposed, that is, partial access of the SIM1 and the SIM2 is performed in a time division manner. For example, both the SIM1 and the SIM2 communicate in a time division duplexing (Time Division Duplexing, TDD) manner. A communication process corresponding to the virtual dual SIM dual active technology is shown in <FIG> (a blank area in <FIG> indicates that a corresponding antenna is in a working state, a shadow part indicates that a corresponding antenna is in an inactive state, and a grid area indicates that a corresponding antenna is in an occupied state). However, it may be learned from <FIG> that, in some slot periods of the SIM1 and the SIM2, transmission is completely interrupted, and communication quality is greatly reduced.

Embodiments of this application aim to provide a dual SIM communication method for a terminal, to resolve a problem that communication quality is reduced because transmission of each of dual SIM cards is interrupted in an even-numbered slot.

To resolve the foregoing technical problem, this application is implemented as follows:.

According to a first aspect, an embodiment of this application provides a dual SIM communication method for a terminal, where dual SIM cards share a main antenna and a diversity antenna, the dual SIM cards include a first SIM card and a second SIM card, and the method includes:.

According to a second aspect, an embodiment of this application provides a dual SIM communication apparatus for a terminal, where dual SIM cards share a main antenna and a diversity antenna, the dual SIM cards include a first SIM card and a second SIM card, and the apparatus includes:.

According to a third aspect, an embodiment of this application provides a terminal. The terminal includes a processor, a memory, and a program or an instruction that is stored in the memory and that can be run on the processor, where when the program or the instruction is executed by the processor, the steps of the method in the first aspect are implemented.

According to a fourth aspect, an embodiment of this application provides a readable storage medium. The readable storage medium stores a program or an instruction, and when the program or the instruction is executed by a processor, the steps of the method in the first aspect are implemented.

According to a fifth aspect, an embodiment of this application provides a chip. The chip includes a processor and a communications interface, the communications interface is coupled to the processor, and the processor is configured to run a program or an instruction to implement the method in the first aspect.

In the embodiments of this application, it is determined whether current slots of dual SIM cards of a terminal are aligned; and in a case that the slots of the dual SIM cards are not aligned, communication is performed in a first manner, where within an uplink slot of a second SIM card, the second SIM card is controlled to transmit a signal by using a main antenna; for an odd-numbered downlink slot of the second SIM card, the second SIM card is controlled to receive a signal by using a diversity antenna within the entire downlink slot, and a first SIM card is controlled to transmit a signal by using the main antenna in a preceding time period within the downlink slot and to receive a signal by using the main antenna in a later time period within the downlink slot; and for an even-numbered downlink slot of the second SIM card, in a preceding time period within the downlink slot, the second SIM card is controlled to receive a signal by using the diversity antenna and the first SIM card is controlled to transmit a signal by using the main antenna, and in a later time period within the downlink slot, the first SIM card is controlled to receive a signal by using the main antenna, where the uplink slot of the second SIM card and a downlink slot of the second SIM card are alternated. In this way, for either the first SIM card or the second SIM card, a signal may be transmitted in each slot period. This avoids transmission interruption between the first SIM card and the second SIM card, thereby greatly improving communication quality.

In the specification and claims of this application, the terms "first", "second", and the like are intended to distinguish between similar objects but do not describe a specific order or sequence. It should be understood that, data used in such a way are interchangeable in proper circumstances, so that the embodiments of this application can be implemented in an order other than the order illustrated or described herein. Objects classified by "first", "second", and the like are usually of a same type, and the number of objects is not limited. For example, there may be one or more first objects. In addition, in the specification and the claims, "and/or" represents at least one of connected objects, and a character "/" generally represents an "or" relationship between associated objects.

With reference to the accompanying drawings, a dual SIM communication method and apparatus for a terminal, a device, and a storage medium provided in the embodiments of this application are described in detail by using specific embodiments and application scenes.

<FIG> shows a radio frequency circuit of a virtual dual SIM dual active technology. The circuit includes a power amplifier (Power Amplifier, PA), a low noise amplifier (low noise amplifier, LNA), a radio frequency transceiver, a main switch, a diversity switch, a filter, a main antenna, and a diversity antenna. A first SIM card and a second SIM card communicate by using different TDD frequency bands, and the frequency bands corresponding to the first SIM card and the second SIM card share one PA. Transmission by the first SIM card, main receiving by the first SIM card, transmission by the second SIM card, and main receiving by the second SIM card are switched through a single-pole main switch, and diversity receiving by the first SIM card and diversity receiving by the second SIM card are switched through a single-pole diversity switch. On this basis, it may be learned that, at a same moment, only one of transmission by the first SIM card, main receiving by the first SIM card, transmission by the second SIM card, and main receiving by the second SIM card may occur. In addition, at a same moment, only either diversity receiving by the first SIM card or diversity receiving by the second SIM card may occur.

In the embodiments of this application, in the accompanying drawings, SIM1 represents the first SIM card, SIM2 represents the second SIM card, Tx represents transmission, and Rx represents reception. In the accompanying drawings, SIM1 Tx represents main transmission by the first SIM card, SIM2 Tx represents main transmission by the second SIM card, SIM1 Rx1represents main receiving by the first SIM card, SIM2 Rx1 represents main receiving by the second SIM card, SIM1 Rx2 represents diversity receiving by the first SIM card, and SIM2 Rx2 represents diversity receiving by the second SIM card.

As shown in <FIG>, an embodiment of this application provides a dual SIM communication method for a terminal. The method is implemented based on the circuit shown in <FIG> and includes the following S3100 to S3400:.

Determine whether slots of dual SIM cards are aligned.

In this embodiment of this application, one slot period may include an uplink slot and a downlink slot. An uplink slot and a downlink slot of a same SIM card do not overlap each other. The uplink slot or the downlink slot of the SIM card may include an idle time period, and the SIM card does not perform a transmit operation or a receive operation in the idle time period.

In this embodiment of this application, the dual SIM cards mentioned in this embodiment are separately denoted as a first SIM card and a second SIM card. The first SIM card and the second SIM card share a main antenna and a diversity antenna.

In an example, in a case that a start time of an uplink slot of the first SIM card is the same as a start time of an uplink slot of the second SIM card, an end time of the uplink slot of the first SIM card is the same as an end time of the uplink slot of the second SIM card, a start time of a downlink slot of the first SIM card is the same as a start time of a downlink slot of the second SIM card, and an end time of the downlink slot of the first SIM card is the same as an end time of the downlink slot of the second SIM card, it is determined that the slots of the dual SIM cards of the terminal are aligned; otherwise, it is determined that the slots of the dual SIM cards of the terminal are not aligned.

In this embodiment of this application, a standard of a SIM card is determined by a working band of the SIM card, and the standard of the SIM card specifies a communication slot of the SIM card. On this basis, it may be determined, based on a working band of the first SIM card and a working band of the second SIM card, whether the slots of the dual SIM cards are aligned.

In a case that the slots of the dual SIM cards are not aligned, the first SIM card and the second SIM card are controlled to communicate in a first manner. The performing communication in a first manner includes steps S3200 to S3400.

Within an uplink slot of the second SIM card, control the second SIM card to transmit a signal by using the main antenna.

In this embodiment, in the uplink slot of the second SIM card, the second SIM card always transmits a signal by using the main antenna.

Based on the foregoing S3200, it may be learned that a signal may be transmitted in each slot period of the second SIM card, and no transmission interruption exists.

For an odd-numbered downlink slot of the second SIM card, control the second SIM card to receive a signal by using the diversity antenna within the entire odd-numbered downlink slot, and control the first SIM card to transmit a signal by using the main antenna in a preceding time period within the odd-numbered downlink slot and to receive a signal by using the main antenna in a later time period within the odd-numbered downlink slot.

In this embodiment, for the odd-numbered downlink slot of the second SIM card, a signal is received by using the diversity antenna within the entire odd-numbered downlink slot of the second SIM card. On this basis, the odd-numbered downlink slot of the second SIM card is divided into two time periods, which are specifically the preceding time period within the odd-numbered downlink slot and the later time period within the odd-numbered downlink slot. The first SIM card is controlled to transmit a signal by using the main antenna in the preceding time period within the odd-numbered downlink slot of the second SIM card and to receive a signal by using the main antenna in the later time period within the odd-numbered downlink slot of the second SIM card.

It may be learned from the foregoing content that, the second SIM card may receive a signal within the odd-numbered downlink slot of the second SIM card. Further, the odd-numbered downlink slot of the second SIM card corresponds to a part of an even-numbered slot period of the first SIM card. On this basis, with reference to the foregoing S3300, it may be learned that the first SIM card may transmit a signal in the even-numbered slot period of the first SMI card, and no transmission interruption exists. In addition, the first SIM card may receive a signal in the even-numbered slot period of the first SIM card.

For an even-numbered downlink slot of the second SIM card, in a preceding time period within the even-numbered downlink slot, control the second SIM card to receive a signal by using the diversity antenna and control the first SIM card to transmit a signal by using the main antenna, and in a later time period within the even-numbered downlink slot, control the first SIM card to receive a signal by using the main antenna.

In this embodiment, the uplink slot of the second SIM card and a downlink slot of the second SIM card are alternated.

In this embodiment, the even-numbered downlink slot of the second SIM card is divided into two periods, which are respectively the preceding time period within the even-numbered downlink slot and the later time period within the even-numbered downlink slot. In the preceding time period within the even-numbered downlink slot, the second SIM card is controlled to receive a signal by using the diversity antenna. In this case, the main antenna is not occupied. On this basis, in the preceding time period within the even-numbered downlink slot, the first SIM card is controlled to transmit a signal by using the main antenna, and in the later time period within the even-numbered downlink slot, the first SIM card is controlled to receive a signal by using the main antenna.

It may be learned from the foregoing content that, the second SIM card may receive a signal within the even-numbered downlink slot of the second SIM card, Further, the even-numbered downlink slot of the second SIM card corresponds to a part of an odd-numbered slot period of the first SIM card. On this basis, with reference to the foregoing S3400, it may be learned that the first SIM card may transmit a signal in the odd-numbered slot period of the first SIM card, and no transmission interruption exists. In addition, the first SIM card may receive a signal in the odd-numbered slot period of the first SIM card.

That is, the first SIM card can transmit a signal and receive a signal in each slot period of the first SIM card, and the second SIM card can transmit a signal and receive a signal in each slot period of the second SIM card.

In this embodiment of this application, it is determined whether current slots of dual SIM cards of a terminal are aligned; and in a case that the slots of the dual SIM cards are not aligned, communication is performed in a first manner, where within an uplink slot of a second SIM card, the second SIM card is controlled to transmit a signal by using a main antenna; for an odd-numbered downlink slot of the second SIM card, the second SIM card is controlled to receive a signal by using a diversity antenna within the entire downlink slot, and a first SIM card is controlled to transmit a signal by using the main antenna in a preceding time period within the downlink slot and to receive a signal by using the main antenna in a later time period within the downlink slot; and for an even-numbered downlink slot of the second SIM card, in a preceding time period within the downlink slot, the second SIM card is controlled to receive a signal by using the diversity antenna and the first SIM card is controlled to transmit a signal by using the main antenna, and in a later time period within the downlink slot, the first SIM card is controlled to receive a signal by using the main antenna, where the uplink slot of the second SIM card and a downlink slot of the second SIM card are alternated. In this way, for either the first SIM card or the second SIM card, a signal may be transmitted in each slot period. This avoids transmission interruption between the first SIM card and the second SIM card, thereby greatly improving communication quality.

Based on any one of the foregoing embodiments, the performing communication in a first manner may further include step S3500.

For the even-numbered downlink slot of the second SIM card, when the first SIM card receives a signal by using the main antenna, control the first SIM card to simultaneously receive a signal by using the diversity antenna.

In this embodiment, the first SIM card may receive a signal by using both the main antenna and the diversity antenna in a same time period. Based on this, a high-quality received signal can be obtained.

Correspondingly, the second SIM card is idle in the later time period within the even-numbered downlink slot of the second SIM card.

Based on any one of the foregoing embodiments, the performing communication in a first manner may further include step S3600.

Within the uplink slot of the second SIM card, control the first SIM card to receive a signal by using the diversity antenna in at least a preceding time period within the uplink slot.

In this embodiment, in the uplink slot of the second SIM card, the diversity antenna is not occupied. In this case, the first SIM card may be controlled to receive a signal by using the diversity antenna in at least the preceding time period within the uplink slot. In this way, duration of receiving a signal by the first SIM card can be prolonged.

Based on the foregoing embodiment shown in S3600, a dual SIM communication process may be shown in <FIG>.

On the basis of any one of the foregoing embodiments, with reference to the communication process shown in <FIG>, one of the first SIM card and the second SIM card of the terminal is in a signal receiving state, and the other of the first SIM card and the second SIM card is in a signal sending state, which may lead to a problem of transmission and reception interference. Especially, when the first SIM card and the second SIM card are in a same frequency, more serious transmission and reception interference may occur. In the case of serious transmission and reception interference, there is a risk of component damage in a radio frequency circuit. To resolve the problem of transmission and reception interference, the dual SIM communication method for a terminal provided in this embodiment of this application further includes the following S3710 to S3740:.

Obtain a transmit power of the terminal and a receive power of the terminal.

In this embodiment of this application, the transmit power of the terminal is a transmit power of a SIM card in a transmit state in the terminal, and the receive power of the terminal is a receive power of a SIM card in a receive state in the terminal.

It should be noted that specific implementation of the foregoing S3710 is: obtaining the transmit power of the terminal and the receive power of the terminal at a same moment.

Calculate a first difference between the transmit power and an antenna isolation threshold.

In this embodiment, the antenna isolation threshold is antenna isolation when a power of a signal transmitted by the main antenna does not greatly affect a signal received by the diversity antenna. A unit of the antenna isolation is dBm.

Calculate a second difference between the first difference and the receive power.

Adjust a communication state of the terminal based on the second difference.

In this embodiment of this application, steps S3710 to S3740 may be performed in a case that the slots of the dual SIM cards are not aligned.

In this embodiment of this application, the foregoing S3740 may be implemented by the following S3741 and S3742:.

In a case that the second difference is greater than an upper limit of a preset range, adjust the terminal to enter a dual SIM dual standby mode.

In this embodiment, in a case that the second difference is greater than the upper limit of the preset range, it indicates that the transmit power of the terminal is far greater than the receive power of the terminal, that is, the terminal has a weak signal, and a SIM card in a transmit state strongly interferes with a SIM card in a receive state. In this case, the terminal is adjusted to be switched to the dual SIM dual standby mode. In this way, a case that one SIM card is in a receive state and the other SIM card is in a transmit state at a same moment is avoided, thereby avoiding transmission and reception interference.

It should be noted that in this embodiment, the preset range may be set based on an experimental simulation or engineering test result.

In a case that the second difference is within the preset range, perform at least one of reducing a modulation order of a SIM card in a receive state in the terminal and reducing a working bandwidth of a SIM card in a transmit state in the terminal.

In this embodiment, in a case that the second difference is within the preset range, it indicates that the transmit power and the receive power of the terminal are basically the same, that is, the terminal has a medium signal strength, and a SIM in a transmit state interferes with a SIM card in a receive state. In this case, at least one of reducing a modulation order of a SIM card in a receive state in the terminal and reducing a working bandwidth of a SIM card in a transmit state in the terminal is performed.

In this embodiment, under a same signal noise ratio (SIGNAL NOISE RATIO, SNR) requirement, if total noise of a narrower working bandwidth is lower, a power of a wanted signal is also lower. Therefore, when the SIM card in a transmit state interferes with the SIM card in a receive state, the working bandwidth of the SIM card in a transmit state may be reduced, to reduce the transmit power, thereby reducing interference to the SIM card in a receive state.

In this embodiment, a larger SNR is required for a higher order modulation scheme to meet a demodulation requirement. Therefore, when the SIM card in a transmit state interferes with the SIM card in a receive state, the modulation order of the SIM card in a receive state in the terminal may be reduced, to meet a receive SNR requirement. In this embodiment of this application, a modulation scheme of the SIM card in a receive state may be quadrature amplitude modulation (Quadrature Amplitude Modulation, QAM), and an adjustment rule may be that a modulation order of the quadrature amplitude modulation is reduced by one level. For example, if a current modulation scheme of the SIM card in a receive state is <NUM> QAM, the modulation scheme is reduced to <NUM> QAM. If the current modulation scheme of the SIM card in a receive state is <NUM> QAM, the modulation scheme is reduced to <NUM> QAM.

Corresponding to the foregoing S3741 and S3742, in a case that the second difference is less than the upper limit of the preset range, it indicates that the transmit power of the terminal is far less than the receive power of the terminal, that is, the terminal is in a strong signal scene, and the SIM in a transmit state does not interfere with the SIM card in a receive state. In this case, the foregoing S3710 is repeatedly performed.

On the basis of any one of the foregoing embodiments, the dual SIM communication method for a terminal provided in this embodiment of this application further includes: in a case that the slots of the dual SIM cards are aligned, performing communication in a second manner.

The performing communication in a second manner may further include the following S3810 and S3820:.

Within a transmit slot, control the first SIM card and the second SIM card to transmit signals by using the main antenna in a time division manner.

Within a receive slot, control the first SIM card and the second SIM card to receive signals by using the main antenna in the time division manner and control the first SIM card and the second SIM card to receive signals by using the diversity antenna in the time division manner.

In this embodiment of this application, corresponding to the foregoing S3200, in a case that a slot of the first SIM card and a slot of the second SIM card are aligned, the entire slot is divided into two parts: a receive slot and a transmit slot, and the transmit slot is before the receive slot.

It should be noted that, in this embodiment, duration corresponding to the transmit slot and the receive slot may be set based on an actual requirement.

In this embodiment, based on the foregoing S3810 and S3820, a dual SIM communication process of the terminal may be shown in <FIG>.

It may be learned from the foregoing content that, in the dual SIM communication method for a terminal provided in this embodiment of this application, in a case that the slots are aligned, the first SIM card and the second SIM card may perform sending and receiving in each slot through the foregoing S3810 and S3820. In this way, a case that transmission of the first SIM card and the second SIM card is completely interrupted in a slot is resolved. In addition, transmission and reception interference caused when the terminal transmits a signal by using a SIM card and receives a signal by using another SIM card at a same moment is avoided.

In addition, in this embodiment, in a case that the first SIM card and the second SIM card are in a same communication frequency band, a transmit path of the first SIM card and a transmit path of the second SIM card may share a same filter, that is, the transmit path of the first SIM card and the transmit path of the second SIM card are a same channel. On this basis, a main switch does not need to be switched. Therefore, in the dual SIM communication method for a terminal provided in this embodiment, switching of the main switch can be further reduced, thereby greatly reducing overheads of a radio frequency circuit.

On the basis of any one of the foregoing embodiments, the dual SIM communication method for a terminal provided in this embodiment of this application further includes: in a case that the slots of the dual SIM cards are aligned, performing communication in a third manner.

The performing communication in a third manner may further include the following S3910 and S3920:.

Within a transmit slot, control the first SIM card and the second SIM card to transmit signals by using the main antenna in a frequency division manner.

Within a receive slot, control the first SIM card and the second SIM card to receive signals by using the main antenna in the frequency division manner and control the first SIM card and the second SIM card to receive signals by using the diversity antenna in the frequency division manner.

In this embodiment, based on the foregoing S3910 and S3920, a dual SIM communication process of the terminal may be shown in <FIG>.

It may be learned from the foregoing content that, in the dual SIM communication method for a terminal provided in this embodiment of this application, in a case that the slots are aligned, the first SIM card and the second SIM card may perform sending and receiving in each slot through the foregoing S3910 and S3920. In this way, a case that transmission of the first SIM card and the second SIM card is completely interrupted in a slot is resolved.

In addition, in this embodiment, in a case that the first SIM card and the second SIM card are in different subbands in a same communication frequency band, for example, the first SIM card is in a Long Term Evolution (Long Term Evolution, LTE) B41 of <NUM> to <NUM>, and the second SIM card is in an LTE B41 of <NUM> to <NUM>, a transmit path of the first SIM card and a transmit path of the second SIM card may share a same filter, that is, the transmit path of the first SIM card and the transmit path of the second SIM card are a same channel. On this basis, a main switch does not need to be switched. Therefore, in the dual SIM communication method for a terminal provided in this embodiment, switching of the main switch can be further reduced, thereby greatly reducing overheads of a radio frequency circuit.

The dual SIM communication method for a terminal provided in the embodiments of this application may be performed by a dual SIM communication apparatus for a terminal, or a control module that is in the dual SIM communication apparatus for a terminal and that is configured to perform and load the foregoing dual SIM communication method. In the embodiments of this application, an example in which the dual SIM communication apparatus for a terminal performs and loads the dual SIM communication method for a terminal is used to describe the dual SIM communication method for a terminal provided in the embodiments of this application.

As shown in <FIG>, an embodiment of this application provides a dual SIM communication apparatus <NUM> for a terminal, where dual SIM cards share a main antenna and a diversity antenna, the dual SIM cards include a first SIM card and a second SIM card, and the apparatus <NUM> includes a determining module <NUM> and a first control module <NUM>.

The determining module <NUM> is configured to determine whether current slots of the dual SIM cards of the terminal are aligned.

The first control module <NUM> is configured to: in a case that the slots of the dual SIM cards are not aligned, control the first SIM card and the second SIM card to communicate in a first manner.

That the first control module <NUM> controls the first SIM card and the second SIM card to communicate in a first manner includes:.

In an embodiment, that the first control module <NUM> controls the first SIM card and the second SIM card to communicate in a first manner further includes: for the even-numbered downlink slot of the second SIM card, when the first SIM card receives a signal by using the main antenna, controlling the first SIM card to simultaneously receive a signal by using the diversity antenna.

In an embodiment, that the first control module <NUM> controls the first SIM card and the second SIM card to communicate in a first manner further includes: within the uplink slot of the second SIM card, controlling the first SIM card to receive a signal by using the diversity antenna within at least a preceding time period within the uplink slot.

In an embodiment, the apparatus <NUM> further includes an obtaining module, a calculation module, and an adjustment module.

The obtaining module is configured to obtain a transmit power of the terminal and a receive power of the terminal.

The calculation module is configured to: calculate a first difference between the transmit power and an antenna isolation threshold, and calculate a second difference between the first difference and the receive power.

The adjustment module is configured to adjust a communication state of the terminal based on the second difference.

In an embodiment, the adjustment module includes a first adjustment submodule and/or a second adjustment submodule.

The first adjustment submodule is configured to: in a case that the second difference is greater than an upper limit of a preset range, adjust the terminal to enter a dual SIM dual standby mode.

The second adjustment submodule is configured to: in a case that the second difference is within the preset range, perform at least one of reducing a modulation order of a SIM card in a receive state in the terminal and reducing a working bandwidth of a SIM card in a transmit state in the terminal.

In an embodiment, the apparatus <NUM> further includes a second control module.

The second control module is configured to: in a case that the slots of the dual SIM cards are aligned, control the first SIM card and the second SIM card to communicate in a second manner.

That the second control module controls the first SIM card and the second SIM card to communicate in a second manner includes:.

In an embodiment, the apparatus <NUM> further includes a third control module.

The third control module is configured to: in a case that the slots of the dual SIM cards are aligned, control the first SIM card and the second SIM card to communicate in a third manner.

That the third control module controls the first SIM card and the second SIM card to communicate in a third manner includes:.

The dual SIM communication apparatus for a terminal in this embodiment of this application may be an apparatus, or may be a component, an integrated circuit, or a chip in a terminal. The apparatus may be a mobile electronic device, or may be a non-mobile electronic device. For example, the mobile electronic device may be a mobile phone, a tablet computer, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook, or a personal digital assistant (personal digital assistant, PDA), and the non-mobile electronic device may be a server. This is not specifically limited in this embodiment of this application.

The dual SIM communication apparatus for a terminal in this embodiment of this application may be an apparatus with an operating system. The operating system may be an Android (Android) operating system, an iOS operating system, or another possible operating system. This is not specifically limited in the embodiments of this application.

The dual SIM communication apparatus for a terminal provided in this embodiment of this application can implement the processes implemented in the dual SIM communication apparatus for a terminal in the method embodiment in <FIG>. To avoid repetition, details are not described herein again.

In this embodiment of this application, a determining module is configured to determine whether current slots of dual SIM cards of a terminal are aligned; and a first control module is configured to: in a case that the slots of the dual SIM cards are not aligned, within an uplink slot of a second SIM card, control the second SIM card to transmit a signal by using a main antenna; for an odd-numbered downlink slot of the second SIM card, control the second SIM card to receive a signal by using a diversity antenna within the entire downlink slot, and control a first SIM card to transmit a signal by using the main antenna in a preceding time period within the downlink slot and to receive a signal by using the main antenna in a later time period within the downlink slot; and for an even-numbered downlink slot of the second SIM card, in a preceding time period within the downlink slot, control the second SIM card to receive a signal by using the diversity antenna and control the first SIM card to transmit a signal by using the main antenna, and in a later time period within the downlink slot, control the first SIM card to receive a signal by using the main antenna, where the uplink slot of the second SIM card and a downlink slot of the second SIM card are alternated. In this way, for either the first SIM card or the second SIM card, a signal may be transmitted in each slot period. This avoids transmission interruption between the first SIM card and the second SIM card, thereby greatly improving communication quality.

Optionally, an embodiment of this application further provides a terminal <NUM>. As shown in <FIG>, the terminal <NUM> includes dual SIM cards, where the dual SIM cards share a main antenna and a diversity antenna, and the dual SIM cards include a first SIM card and a second SIM card. The terminal <NUM> further includes a processor <NUM>, a memory <NUM>, and a program or an instruction that is stored in the memory <NUM> and executable on the processor <NUM>, where when the program or the instruction is executed by the processor <NUM>, the processes of the foregoing dual SIM communication method for a terminal are implemented and a same technical effect can be achieved. To avoid repetition, details are not described herein again.

The electronic device in this embodiment of this application may be a mobile electronic device or a non-mobile electronic device.

<FIG> is a schematic diagram of a hardware structure of a terminal according to an embodiment of this application.

A terminal <NUM> includes but is not limited to components such as a radio frequency unit <NUM>, a network module <NUM>, an audio output unit <NUM>, an input unit <NUM>, a sensor <NUM>, a display unit <NUM>, a user input unit <NUM>, an interface unit <NUM>, a memory <NUM>, and a processor <NUM>.

A person skilled in the art can understand that the terminal <NUM> may further include a power supply (such as a battery) that supplies power to each component. The power supply may be logically connected to the processor <NUM> by using a power supply management system, to implement functions such as charging and discharging management, and power consumption management by using the power supply management system. The terminal structure shown in <FIG> constitutes no limitation on the terminal, and the terminal may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

The processor <NUM> is configured to determine whether current slots of the dual SIM cards of the terminal are aligned; and in a case that the slots of the dual SIM cards are not aligned, control the first SIM card and the second SIM card to communicate in a first manner, where the controlling the first SIM card and the second SIM card to communicate in a first manner includes: within an uplink slot of the second SIM card, controlling the second SIM card to transmit a signal by using the main antenna; for an odd-numbered downlink slot of the second SIM card, controlling the second SIM card to receive a signal by using the diversity antenna within the entire odd-numbered downlink slot, and controlling the first SIM card to transmit a signal by using the main antenna in a preceding time period within the odd-numbered downlink slot and to receive a signal by using the main antenna in a later time period within the odd-numbered downlink slot; and for an even-numbered downlink slot of the second SIM card, in a preceding time period within the even-numbered downlink slot, controlling the second SIM card to receive a signal by using the diversity antenna and controlling the first SIM card to transmit a signal by using the main antenna, and in a later time period within the even-numbered downlink slot, controlling the first SIM card to receive a signal by using the main antenna, where the uplink slot of the second SIM card and a downlink slot of the second SIM card are alternated.

In this embodiment of the application, a processor determines whether current slots of dual SIM cards of a terminal are aligned; and in a case that the slots of the dual SIM cards are not aligned, within an uplink slot of a second SIM card, controls the second SIM card to transmit a signal by using a main antenna; for an odd-numbered downlink slot of the second SIM card, controls the second SIM card to receive a signal by using a diversity antenna within the entire odd-numbered downlink slot, and controls a first SIM card to transmit a signal by using the main antenna in a preceding time period within the downlink slot and to receive a signal by using the main antenna in a later time period within the odd-numbered downlink slot; and for an even-numbered downlink slot of the second SIM card, in a preceding time period within the even-numbered downlink slot, controls the second SIM card to receive a signal by using the diversity antenna and controls the first SIM card to transmit a signal by using the main antenna, and in a later time period within the even-numbered downlink slot, controls the first SIM card to receive a signal by using the main antenna, where the uplink slot of the second SIM card and a downlink slot of the second SIM card are alternated. In this way, for either the first SIM card or the second SIM card, a signal may be transmitted in each slot period. This avoids transmission interruption between the first SIM card and the second SIM card, thereby greatly improving communication quality.

An embodiment of this application further provides a readable storage medium. The readable storage medium stores a program or an instruction, and when the program or the instruction is executed by a processor, the processes of the foregoing embodiment of the dual SIM communication method for a terminal are implemented and a same technical effect can be achieved. To avoid repetition, details are not described herein again.

The processor is a processor in the electronic device in the foregoing embodiment. The readable storage medium includes a computer-readable storage medium, such as a computer read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk, or an optical disc.

An embodiment of this application further provides a chip. The chip includes a processor and a communications interface, the communications interface is coupled to the processor, and the processor is configured to run a program or an instruction to implement the processes of the foregoing embodiment of the dual SIM communication method for a terminal and a same technical effect can be achieved. To avoid repetition, details are not described herein again.

It should be understood that the chip mentioned in this embodiment of this application may also be referred to as a system-level chip, a system chip, a chip system, or an on-chip system chip.

It should be noted that, in this specification, the terms "include", "comprise", or their any other variant is intended to cover a non-exclusive inclusion, so that a process, a method, an article, or an apparatus that includes a list of elements not only includes those elements but also includes other elements which are not expressly listed, or further includes elements inherent to such process, method, article, or apparatus. An element limited by "including a. " does not, without more constraints, preclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element. In addition, it should be noted that the scope of the method and the apparatus in the embodiments of this application is not limited to performing functions in an illustrated or discussed sequence, and may further include performing functions in a basically simultaneous manner or in a reverse sequence according to the functions concerned. For example, the described method may be performed in an order different from that described, and the steps may be added, omitted, or combined. In addition, features described with reference to some examples may be combined in other examples.

Based on the descriptions of the foregoing implementations, a person skilled in the art may clearly understand that the method in the foregoing embodiment may be implemented by software in addition to a necessary universal hardware platform or by hardware only. In most circumstances, the former is a preferred implementation. Based on such an understanding, the technical solutions of this application essentially or the part contributing to the prior art may be implemented in a form of a software product. The computer software product is stored in a storage medium (such as a ROM/RAM, a hard disk, or an optical disc), and includes several instructions for instructing a terminal (which may be mobile phone, a computer, or a server) to perform the methods described in the embodiments of this application.

Claim 1:
A dual SIM communication method for a terminal, characterized in that dual SIM cards share a main antenna and a diversity antenna, the dual SIM cards comprise a first SIM card and a second SIM card, and the method comprises:
determining (S3100) whether slots of the dual SIM cards are aligned; and
in a case that the slots of the dual SIM cards are not aligned, controlling the first SIM card and the second SIM card to communicate in a first manner, wherein
the controlling the first SIM card and the second SIM card to communicate in a first manner comprises:
within an uplink slot of the second SIM card, controlling (S3200) the second SIM card to transmit a signal by using the main antenna;
for an odd-numbered downlink slot of the second SIM card, controlling (S3300) the second SIM card to receive a signal by using the diversity antenna within the entire odd-numbered downlink slot, and controlling (S3300) the first SIM card to transmit a signal by using the main antenna in a preceding time period within the odd-numbered downlink slot and to receive a signal by using the main antenna in a later time period within the odd-numbered downlink slot; and
for an even-numbered downlink slot of the second SIM card, in a preceding time period within the even-numbered downlink slot, controlling (S3400) the second SIM card to receive a signal by using the diversity antenna and controlling the first SIM card to transmit a signal by using the main antenna, and in a later time period within the even-numbered downlink slot, controlling (S3400) the first SIM card to receive a signal by using the main antenna, wherein
the uplink slot of the second SIM card and a downlink slot of the second SIM card are alternated.