Internal and external antenna switching method, system and device, storage medium and product

Through the combination of directional coupler, RF power detector and voltage comparator, automatic switching of internal and external antennas is achieved, solving the problems of manual operation in the prior art and limitations of signal strength, and improving communication quality and switching efficiency .

CN119298951APending Publication Date: 2025-01-10SHANDONG YOU INTERNET OF THINGS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411350135.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

The existing internal and external antenna switching technology is based on manual operation or simple signal strength comparison, which is inconvenient to operate and cannot accurately reflect the actual reception effect of the antenna, resulting in a decrease in communication quality.

Method used

Using a combination of directional coupler, RF power detector and voltage comparator, through power separation, voltage signal conversion and comparison, the antenna corresponding to the lower voltage value is automatically selected for RF signal switching to ensure that the best antenna is selected.

Benefits of technology

Automatic and efficient switching of internal and external antennas is realized, switching efficiency and communication quality are improved, user operations are simplified, and communication interruptions and power consumption caused by poor signal are reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119298951A_ABST
    Figure CN119298951A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of wireless communication, in particular to an internal and external antenna switching method, system and device, a storage medium and a product. The method comprises the following steps: respectively carrying out power separation on an external antenna and a built-in antenna based on a directional coupler to obtain first reflection power and second reflection power; performing voltage signal conversion on the first reflection power and the second reflection power based on a radio frequency power detector to obtain a first voltage signal and a second voltage signal; comparing the first voltage signal with the second voltage signal based on a voltage comparator; and taking the antenna corresponding to the lower voltage value in the first voltage signal and the second voltage signal as a target antenna, and switching the radio frequency signal to the target antenna. According to the method, the switching process is based on accurate power detection and voltage comparison, so that the optimal antenna can be selected, and the switching efficiency of the internal antenna and the external antenna is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of wireless communication technology, and in particular to a method, system, device, storage medium and product for switching internal and external antennas. Background Art

[0002] With the rapid development of wireless communication technology, mobile communication devices such as smartphones, tablets and other terminal devices have higher and higher requirements for antenna performance. In order to achieve better communication effects, modern mobile terminals are usually equipped with built-in antennas and external antennas to adapt to different usage scenarios. Most of the existing antenna switching technologies are based on manual switching or simple signal strength comparison. The manual switching method requires the user to manually choose to use the built-in or external antenna according to the environment or signal strength. The operation is inconvenient and it is easy to cause a decrease in communication quality due to subjective misjudgment. The simple signal strength comparison method has certain limitations. For example, it may not accurately reflect the actual reception effect of the antenna, thereby affecting the communication quality. Therefore, how to improve the switching efficiency of internal and external antennas has become a technical problem that needs to be solved urgently. Summary of the invention

[0003] The main purpose of the present application is to provide a method, system, device, storage medium and product for switching internal and external antennas, aiming to solve the technical problem of how to improve the switching efficiency of internal and external antennas.

[0004] To achieve the above object, the present application provides a method for switching an internal and external antenna. The internal and external antenna switching system includes a directional coupler, a radio frequency power detector, and a voltage comparator. The method includes:

[0005] Based on the directional coupler, power separation is performed on the external antenna and the internal antenna respectively to obtain a first reflected power and a second reflected power;

[0006] Based on the radio frequency power detector, converting the first reflected power and the second reflected power into voltage signals respectively to obtain a first voltage signal and a second voltage signal;

[0007] Based on the voltage comparator, comparing the first voltage signal with the second voltage signal;

[0008] An antenna corresponding to a lower voltage value between the first voltage signal and the second voltage signal is used as a target antenna, and a radio frequency signal is switched to the target antenna.

[0009] In one embodiment, the method further comprises:

[0010] Get user input control instructions;

[0011] Determining whether there is an antenna forced selection command in the user input control instruction;

[0012] If so, determine the target antenna according to the antenna forced selection command.

[0013] In one embodiment, the internal and external antenna switching system further includes a radio frequency switching switch, and the step of using the antenna corresponding to the lower voltage value of the first voltage signal and the second voltage signal as the target antenna and switching the radio frequency signal to the target antenna includes:

[0014] taking an antenna corresponding to a lower voltage value between the first voltage signal and the second voltage signal as a target antenna;

[0015] Based on the target antenna, generating a radio frequency signal switching instruction;

[0016] Based on the radio frequency signal switching instruction, controlling the radio frequency switching switch to switch the radio frequency signal path;

[0017] Based on the switched radio frequency signal path, the radio frequency signal is switched to the target antenna.

[0018] In one embodiment, after the step of switching the radio frequency signal to the target antenna based on the switched radio frequency signal path, the step further includes:

[0019] Performing real-time monitoring on the working status of the target antenna;

[0020] Determining the communication quality level of the target antenna according to the real-time monitoring result;

[0021] Determining whether the communication quality level exceeds a preset communication quality standard;

[0022] If so, a verification completion signal is issued.

[0023] In one embodiment, the directional coupler includes a first directional coupler and a second directional coupler, the first directional coupler is connected to the radio frequency communication path of the external antenna, and the second directional coupler is connected to the radio frequency communication path of the internal antenna, and the steps of performing power separation on the external antenna and the internal antenna based on the directional coupler to obtain the first reflected power and the second reflected power include:

[0024] When the radio frequency signal is transmitted to the external antenna through the main transmission line of the first directional coupler, the coupling line of the first directional coupler is controlled to obtain the radio frequency power reflected back by the external antenna to obtain the first reflected power;

[0025] When the radio frequency signal is transmitted to the built-in antenna through the main transmission line of the second directional coupler, the coupling line of the second directional coupler is controlled to obtain the radio frequency power reflected back by the built-in antenna to obtain the second reflected power.

[0026] In one embodiment, the RF power detector includes a first RF power detector and a second RF power detector, the first RF power detector is connected to the RF communication path of the external antenna, and the second RF power detector is connected to the RF communication path of the internal antenna, and the steps of converting the first reflected power and the second reflected power into voltage signals based on the RF power detector to obtain the first voltage signal and the second voltage signal include:

[0027] Based on the detection circuit in the first radio frequency power detector, converting the first reflected power into a first DC voltage signal;

[0028] Preprocessing the first DC voltage signal to obtain the first voltage signal, wherein the preprocessing includes rectification and filtering;

[0029] Based on the detection circuit in the second radio frequency power detector, converting the second reflected power into a second DC voltage signal;

[0030] The second DC voltage signal is preprocessed to obtain the second voltage signal.

[0031] In addition, to achieve the above purpose, the present application also proposes an internal and external antenna switching system, the internal and external antenna switching system comprising:

[0032] A power separation module, used for performing power separation on the external antenna and the internal antenna respectively based on the directional coupler to obtain a first reflected power and a second reflected power;

[0033] A voltage conversion module, configured to convert the first reflected power and the second reflected power into voltage signals based on the radio frequency power detector to obtain a first voltage signal and a second voltage signal;

[0034] a voltage comparison module, configured to compare the first voltage signal with the second voltage signal based on the voltage comparator;

[0035] A switching module is used to use the antenna corresponding to the lower voltage value of the first voltage signal and the second voltage signal as the target antenna, and switch the radio frequency signal to the target antenna.

[0036] In addition, to achieve the above-mentioned purpose, the present application also proposes an internal and external antenna switching device, which includes: a memory, a processor, and an internal and external antenna switching program stored in the memory and executable on the processor, and the internal and external antenna switching program is configured to implement the steps of the internal and external antenna switching method described above.

[0037] In addition, to achieve the above objectives, the present application also proposes a storage medium, on which an internal and external antenna switching program is stored, and when the internal and external antenna switching program is executed by a processor, the steps of the internal and external antenna switching method described above are implemented.

[0038] In addition, to achieve the above-mentioned purpose, the present application also proposes a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of the internal and external antenna switching method as described above are implemented.

[0039] This application is based on a directional coupler to separate the power of an external antenna and a built-in antenna, respectively, to obtain a first reflected power and a second reflected power; based on an RF power detector, the first reflected power and the second reflected power are converted into voltage signals, respectively, to obtain a first voltage signal and a second voltage signal; based on a voltage comparator, the first voltage signal is compared with the second voltage signal; the antenna corresponding to the lower voltage value of the first voltage signal and the second voltage signal is used as the target antenna, and the RF signal is switched to the target antenna. This application realizes automatic and efficient switching between built-in antennas and external antennas through the combined application of directional couplers, RF power detectors and voltage comparators. Since the switching process is based on precise power detection and voltage comparison, it can ensure that the best antenna is selected, thereby improving the switching efficiency of internal and external antennas. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 This is a flow chart of the first embodiment of the internal and external antenna switching method of the present application;

[0041] Figure 2 This is a schematic diagram of a sub-process in the second embodiment of the internal and external antenna switching method of the present application;

[0042] Figure 3 This is a schematic diagram of a sub-process in the third embodiment of the internal and external antenna switching method of the present application;

[0043] Figure 4 This is a hardware schematic diagram of an embodiment of the internal and external antenna switching method of the present application;

[0044] Figure 5 This is a schematic diagram of the module structure of the internal and external antenna switching system in the embodiment of the present application;

[0045] Figure 6Schematic diagram of the device structure of the hardware operating environment involved in the internal and external antenna switching method in the embodiment of the present application.

[0046] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0047] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0048] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0049] It should be noted that with the rapid development of wireless communication technology, mobile communication devices such as smart phones, tablet computers and other terminal devices have higher and higher requirements for antenna performance. In order to achieve better communication effects, modern mobile terminals are usually equipped with built-in antennas and external antennas to adapt to different usage scenarios. Most of the existing antenna switching technologies are based on manual switching or simple signal strength comparison. The manual switching method requires the user to manually choose to use the built-in or external antenna according to the environment or signal strength. The operation is inconvenient and it is easy to cause a decrease in communication quality due to subjective misjudgment. The simple signal strength comparison method has certain limitations. For example, it may not accurately reflect the actual reception effect of the antenna, thereby affecting the communication quality. Therefore, how to improve the switching efficiency of internal and external antennas has become a technical problem that needs to be solved urgently.

[0050] The main solution of the present application is: based on a directional coupler, the present application performs power separation on an external antenna and an internal antenna respectively to obtain a first reflected power and a second reflected power; based on an RF power detector, the first reflected power and the second reflected power are converted into voltage signals respectively to obtain a first voltage signal and a second voltage signal; based on a voltage comparator, the first voltage signal is compared with the second voltage signal; the antenna corresponding to the lower voltage value between the first voltage signal and the second voltage signal is used as the target antenna, and the RF signal is switched to the target antenna.

[0051] This application realizes automatic and efficient switching between internal and external antennas through the combined application of directional couplers, RF power detectors, and voltage comparators. Since the switching process is based on accurate power detection and voltage comparison, it can ensure that the best antenna is selected, thereby improving the switching efficiency of internal and external antennas.

[0052] It should be noted that the execution subject of the method of this embodiment can be a computing service device with data processing, network communication and program running functions, or it can be the above-mentioned internal and external antenna switching device with the same or similar functions. This embodiment and the following embodiments will be described by taking the internal and external antenna switching device as an example.

[0053] Based on this, the first embodiment of the internal and external antenna switching method of the present application is proposed, please refer to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the internal and external antenna switching method of the present application.

[0054] In this embodiment, the method is used for an internal and external antenna switching system, the internal and external antenna switching system includes a directional coupler, a radio frequency power detector and a voltage comparator, and the internal and external antenna switching method includes the following steps:

[0055] S1: Based on the directional coupler, power separation is performed on the external antenna and the internal antenna respectively to obtain a first reflected power and a second reflected power;

[0056] It should be noted that a directional coupler is a passive device used to separate or guide signals in a radio frequency signal transmission system. It can extract a portion of the power from the transmission line in order to measure or monitor the characteristics of the signal without interfering with the transmission of the main signal. An external antenna refers to an antenna installed outside the device, which is usually used to enhance the signal reception or transmission performance of the device. Due to its superior location, an external antenna is usually able to receive stronger or more stable signals. An internal antenna refers to an antenna installed inside the device. The advantages of an internal antenna are that it is compact and not easily damaged, but its signal reception ability may be affected by the device housing or other internal components. Reflected power refers to the power of part of the signal reflected back when the radio frequency signal is transmitted to the antenna due to the impedance mismatch between the antenna and the transmission line. The higher the reflected power, the worse the antenna matching and the lower the signal transmission efficiency.

[0057] Specifically, the RF signal is sent to the directional coupler through the transmission line. As a separation device, the directional coupler directs the signal to the external antenna and the internal antenna respectively. When the RF signal reaches the directional coupler, the device separates a portion of the signal energy and transmits it to the external antenna and the internal antenna respectively through the coupling port. Since the impedance of the antenna may not match the impedance of the transmission line, part of the signal will be reflected back. The directional coupler can measure and separate the power of the reflected signal and divide it into two parts: one part comes from the external antenna (i.e., the first reflected power), and the other part comes from the internal antenna (i.e., the second reflected power).

[0058] By using a directional coupler, the reflected power of the external antenna and the internal antenna can be accurately separated and detected. The directional coupler can effectively separate the reflected power into two parts, so that the reflection performance of different antennas can be analyzed separately. This precise separation helps to evaluate the antenna performance in the subsequent steps. In the process of separating the reflected power, the directional coupler can ensure that the transmission of the main signal is not interfered. This means that while the power detection is being performed, it will not have a negative impact on the normal RF signal transmission, thereby ensuring the normal operation of the communication system. By separating the reflected power of the external antenna and the internal antenna respectively, the system can independently evaluate the performance of each antenna. This provides accurate data support for the subsequent antenna selection based on reflected power, thereby improving the accuracy of antenna selection and ultimately achieving better communication quality. The power separation step based on the directional coupler not only ensures the accurate measurement of the reflected power of different antennas, but also ensures the stability of the system signal transmission, laying the foundation for efficient and accurate antenna switching.

[0059] S2: Based on the RF power detector, convert the first reflected power and the second reflected power into voltage signals respectively to obtain a first voltage signal and a second voltage signal;

[0060] It should be noted that the RF power detector is a device used to detect the power of RF signals. It can convert the power of RF signals into corresponding voltage signals, which is convenient for subsequent signal processing and analysis. The first reflected power refers to the RF power reflected from the external antenna. Since the external antenna may not completely match the impedance of the transmission line, some reflected power will be generated. The second reflected power refers to the RF power reflected from the internal antenna, which is also a reflected signal caused by the impedance mismatch between the internal antenna and the transmission line. Voltage signal conversion refers to converting the power value of the RF signal into a corresponding voltage signal for subsequent signal processing or comparison. This conversion is usually achieved by an RF power detector. Corresponding to the voltage values ​​after the reflected power of the external antenna and the internal antenna is converted. The first voltage signal corresponds to the first reflected power, and the second voltage signal corresponds to the second reflected power.

[0061] Specifically, the first reflected power (the reflected power from the external antenna) and the second reflected power (the reflected power from the built-in antenna) are respectively used as input signals and enter the RF power detector. The RF power detector detects and converts the input RF signal into a corresponding DC voltage signal based on the power of the input RF signal. This process involves rectification, smoothing, and possible amplification of the RF signal so that the output voltage signal can accurately reflect the magnitude of the input power. After being processed by the RF power detector, the first reflected power is converted into a first voltage signal, and the second reflected power is converted into a second voltage signal. These two voltage signals will respectively represent the magnitude of the reflected power of the external antenna and the built-in antenna, and serve as inputs for subsequent voltage comparisons.

[0062] By converting the power of the RF signal into a voltage signal, complex RF power data can be made more intuitive and easier to process. The voltage signal is easier to compare, measure and control in subsequent electronic circuits. After the reflected power is converted into a voltage signal, the antenna performance can be compared more accurately. The voltage signal can be measured and compared by high-precision electronic equipment to ensure that the signal reflecting the antenna performance has sufficient accuracy. The voltage signal is easy to process in the electronic circuit, so this step helps to realize the automatic processing of the system. By using the RF power detector to convert the reflected power signal into a voltage signal, the system can be more easily integrated into the automatic antenna switching mechanism to improve the overall operating efficiency. The RF power detector can adapt to RF signals of different frequencies and power ranges, which means that this step can adapt to a variety of communication scenarios and different types of antenna systems, and has high application flexibility. In summary, the conversion of the first reflected power and the second reflected power into a voltage signal based on the RF power detector not only provides accurate voltage signal input for subsequent antenna selection, but also provides technical support for realizing automatic and efficient antenna switching, thereby improving the performance and user experience of wireless communication equipment.

[0063] S3: Based on the voltage comparator, compare the first voltage signal with the second voltage signal;

[0064] It should be noted that a voltage comparator is an electronic device used to compare the magnitudes of two input voltages. The voltage comparator outputs a signal indicating which input voltage is higher or lower. In the present application, the voltage comparator is used to compare the voltage signals converted from the reflected powers of the two antennas to determine which antenna has better signal characteristics. The first voltage signal is a voltage signal obtained by converting the reflected power of the external antenna through an RF power detector, indicating the magnitude of the reflected power of the external antenna. The second voltage signal is a voltage signal obtained by converting the reflected power of the internal antenna through an RF power detector, indicating the magnitude of the reflected power of the internal antenna.

[0065] Specifically, the first voltage signal (from the external antenna) and the second voltage signal (from the built-in antenna) are respectively input to the two input terminals of the voltage comparator. The voltage comparator compares the two input voltage signals in real time. The comparator detects which signal has a higher or lower voltage, thereby determining the corresponding reflected power. Based on the comparison result, the voltage comparator outputs a signal indicating which voltage is lower. Since a lower voltage corresponds to a lower reflected power, it means that the impedance match between the antenna and the transmission line is better, so the signal reception or transmission performance of the antenna is better.

[0066] Through the comparison function of the voltage comparator, the system can automatically determine which antenna has lower reflected power, that is, better signal matching. This automated evaluation avoids human intervention and improves the automation level of the system. The voltage comparator can detect the difference between the two voltage signals very accurately, so the antenna with better signal performance can be accurately selected. This selection process is based on an objective comparison of reflected power, which can effectively improve the accuracy of antenna switching. The voltage comparator usually has a very fast response time, which can complete the voltage comparison and output the result at the millisecond or even microsecond level. Therefore, this step can achieve real-time response of antenna switching and reduce communication delays or interruptions caused by poor signals. Using a voltage comparator for signal comparison can simplify system design. Compared with complex signal processing algorithms, the hardware implementation of the voltage comparator is simpler and more reliable, reducing the complexity of the system and improving stability. The voltage comparator generally has low power consumption, which is particularly important for applications that are sensitive to battery life, such as mobile devices. The low-power comparison process helps to extend the battery life of the device while ensuring the normal operation of the antenna switching function. In summary, based on the step of comparing the first voltage signal with the second voltage signal by a voltage comparator, effective evaluation and selection of antenna performance is achieved through automatic, accurate and real-time voltage signal comparison, which ultimately provides important technical support for achieving efficient antenna switching and helps to improve the communication quality and user experience of wireless communication equipment.

[0067] S4: The antenna corresponding to the lower voltage value between the first voltage signal and the second voltage signal is used as the target antenna, and the radio frequency signal is switched to the target antenna.

[0068] It should be noted that the target antenna is the antenna selected for receiving or transmitting the RF signal based on the antenna corresponding to the lower voltage after comparing the two voltage signals. The target antenna is usually the antenna with better signal performance. RF signal switching refers to switching the RF signal from the currently used antenna to the target antenna in the system to optimize the reception or transmission quality of the signal. This switching is usually achieved through an electronic switch or other RF components. When comparing the first voltage signal with the second voltage signal, the lower voltage value corresponds to the antenna with less reflected power. Less reflected power usually means that the impedance match between the antenna and the transmission line is better and the signal transmission efficiency is higher.

[0069] Specifically, in the previous step, the voltage comparator has output a comparison result indicating which voltage signal is lower. Based on this result, the system determines which antenna corresponds to a lower reflected power. The antenna corresponding to the lower voltage value is selected as the target antenna. This means that the system determines that the antenna has better impedance matching and better signal transmission performance, and is therefore more suitable for the current communication task. The system switches the RF signal from the current antenna to the target antenna through an RF switch or related circuit. After switching, all transmitted and received RF signals will be carried out through the target antenna, thereby optimizing the communication quality.

[0070] By selecting the antenna corresponding to the lower voltage value as the target antenna, the system can effectively reduce the reflected power and ensure the use of the antenna with the best impedance matching. This directly improves the transmission efficiency of the signal, reduces signal loss, and optimizes the communication quality. This step realizes the full automation of antenna selection and RF signal switching, avoiding the need for human intervention. This automated operation enables the system to respond to changes in the signal environment in real time and dynamically adjust the use of antennas, so as to maintain good communication effects in different usage scenarios. By switching antennas based on objective data of reflected power, the system can reduce communication interruptions or signal weakening caused by selecting the wrong antenna, and improve the stability and reliability of the overall system. Users do not need to manually select antennas, and the system can automatically select the best antenna for them to ensure that they can obtain high-quality communication services in various environments. This not only simplifies user operations, but also improves the intelligence level of the device. Through an efficient antenna switching mechanism, the system can quickly switch to a better-performing antenna when the signal is weak, thereby avoiding high-power operations (such as signal retransmission, searching for stronger signals, etc.) caused by long-term poor signals, thereby extending the battery life of the device. By switching to an antenna with better impedance matching, the interference of reflected signals caused by mismatched antennas can be reduced, making the system more stable and the communication more reliable. In summary, the step of selecting the antenna corresponding to the lower voltage value of the first voltage signal and the second voltage signal as the target antenna and switching the RF signal to the target antenna improves the signal quality, system stability and user experience of the wireless communication device through automated antenna selection and RF signal switching, and has the additional advantages of reducing power consumption and interference.

[0071] This embodiment is based on a directional coupler to separate the power of the external antenna and the internal antenna respectively, and obtain the first reflected power and the second reflected power; based on the RF power detector, the first reflected power and the second reflected power are converted into voltage signals respectively to obtain the first voltage signal and the second voltage signal; based on the voltage comparator, the first voltage signal is compared with the second voltage signal; the antenna corresponding to the lower voltage value of the first voltage signal and the second voltage signal is used as the target antenna, and the RF signal is switched to the target antenna. This embodiment realizes automatic and efficient switching of the internal antenna and the external antenna through the combined application of a directional coupler, an RF power detector and a voltage comparator. Since the switching process is based on accurate power detection and voltage comparison, it can ensure that the best antenna is selected, thereby improving the switching efficiency of the internal and external antennas.

[0072] Based on the above first embodiment, a second embodiment of the internal and external antenna switching method of the present application is proposed. Figure 2 , Figure 2 This is a schematic diagram of a sub-process in the second embodiment of the internal and external antenna switching method of the present application.

[0073] like Figure 2 As shown, in this embodiment, the internal and external antenna switching system further includes a radio frequency switching switch, and step S4 includes:

[0074] S41: taking an antenna corresponding to a lower voltage value between the first voltage signal and the second voltage signal as a target antenna;

[0075] S42: generating a radio frequency signal switching instruction based on the target antenna;

[0076] S43: Based on the RF signal switching instruction, control the RF switching switch to switch the RF signal path;

[0077] S44: Based on the switched RF signal path, switch the RF signal to the target antenna.

[0078] It should be noted that the RF signal switching instruction is a control signal generated based on the target antenna and used to instruct the RF signal switching switch to switch the RF signal path to the target antenna. The RF switching switch is an electronic switching device used to switch the transmission path of the RF signal between different antennas. By controlling the switch, the RF signal can be directed to the specified antenna. The RF signal path is the path that the RF signal passes through during the transmission process, including the entire transmission path from the signal source to the antenna. By switching the RF signal path, the antenna to which the RF signal is ultimately transmitted can be changed.

[0079] Specifically, in the previous step, the system has determined that the antenna corresponding to the lower voltage value is the target antenna by comparing the first voltage signal and the second voltage signal. Based on the selected target antenna, the system generates a radio frequency signal switching instruction. This instruction is used to control the radio frequency switching switch so that the radio frequency signal can be switched to the target antenna. The instruction is usually an electrical signal or a control signal generated by a logic circuit.

[0080] Furthermore, the RF signal switching instruction is sent to the RF switching switch. After receiving the instruction, the RF switching switch changes the transmission path of the RF signal and switches the path originally leading to other antennas to the target antenna. Based on the operation of the RF switching switch, the RF signal path is reconfigured and the RF signal is directed to the target antenna. This switching process ensures that the RF signal is transmitted through the antenna with better performance. The switched RF signal path transmits the RF signal to the target antenna, and the target antenna receives or transmits the RF signal, ensuring the stability of communication and the quality of the signal.

[0081] By generating RF signal switching instructions and controlling the RF switch, the system can automatically perform antenna switching operations. This automation reduces the complexity of manual operations and improves the efficiency and accuracy of antenna switching. By selecting the target antenna corresponding to the lower voltage value and switching the RF signal to the antenna, the system can ensure that the best performing antenna is used for signal transmission, thereby improving the quality and stability of communication. The RF switch can quickly respond to the RF signal switching instruction and immediately adjust the transmission path of the RF signal. This fast response capability helps to quickly adjust the antenna selection when the signal environment changes, maintaining the high quality and continuity of communication. By controlling the RF signal switching path with reliable hardware, the system can operate stably in various usage scenarios, reducing communication interruptions or quality degradation caused by poor signals, and enhancing the overall reliability of the system. The automated RF signal switching mechanism can reduce unnecessary signal transmission and processing operations, thereby reducing the power consumption of the system and extending the battery life of the device, which is especially suitable for mobile devices and other power-sensitive applications. Users can achieve the best selection and switching of antennas without manual intervention in the system, simplifying the use of the device and improving the overall user experience. By generating RF signal switching instructions based on the target antenna and controlling the steps of switching the RF signal path through the RF switching switch, efficient and automated RF signal switching is achieved, which improves the communication quality, response speed and reliability of the system, while optimizing the user experience and power consumption performance.

[0082] Based on the above first embodiment, in this embodiment, after step S44, the following is further included:

[0083] S44a: monitoring the working status of the target antenna in real time;

[0084] S44b: Determine the communication quality level of the target antenna according to the real-time monitoring result;

[0085] S44c: Determine whether the communication quality level exceeds a preset communication quality standard;

[0086] S44d: If yes, send a verification completion signal.

[0087] It should be noted that the working status refers to the real-time performance of the antenna during the process of receiving or transmitting radio frequency signals, including parameters such as signal strength, reflected power, and signal-to-noise ratio. The communication quality level is an indicator for evaluating the performance of the antenna based on the working status of the target antenna, usually including a comprehensive evaluation of parameters such as signal strength, stability, and bit error rate. The preset communication quality standard is a reference value or threshold value pre-set in the system for judging the communication quality. If the communication quality level of the target antenna exceeds this standard, it is considered that the communication quality has met the requirements. The verification completion signal is an indication signal indicating that the communication quality of the target antenna has passed the system evaluation and meets or exceeds the preset standard, and the antenna can continue to work stably.

[0088] Specifically, after the target antenna is switched, the system will start real-time monitoring of the antenna's working status. The monitoring content may include multiple parameters such as the strength of the antenna's received signal, reflected power, bit error rate, signal-to-noise ratio, etc. Based on the monitoring results, the system will comprehensively evaluate the various parameters of the target antenna to determine its current communication quality level. The communication quality level is usually a comprehensive score or level used to indicate the performance of the current antenna.

[0089] Furthermore, the system compares the determined communication quality level with the preset communication quality standard. If the communication quality level of the target antenna exceeds or meets the preset standard, the communication performance of the antenna is considered to be up to standard. When it is determined that the communication quality level meets or exceeds the preset standard, the system will issue a verification completion signal. This signal indicates that the performance of the current antenna has passed the evaluation and can be stably used for the next communication operation.

[0090] Through real-time monitoring of the target antenna and communication quality evaluation, the system can dynamically adjust and optimize the communication quality. It ensures that the antenna can transmit signals in the best state under various conditions, thereby improving the overall communication effect. By monitoring the working status of the antenna in real time, the system can promptly detect and respond to any problems that may affect the communication quality. If it is found that the performance of the target antenna does not meet the preset standards, the system can take further measures (such as switching antennas or adjusting signal parameters) to ensure the reliability and stability of communication. By issuing a verification completion signal, the system can automatically judge and confirm the performance of the antenna, reducing manual intervention. This intelligent control mechanism improves the automation level of the system and ensures that the device can adapt to different usage environments and maintain efficient operation. Users can enjoy continuously optimized communication quality without intervention. This real-time monitoring and automatic adjustment function enables the device to provide high-quality communication services in various scenarios, thereby improving user satisfaction and experience. By ensuring that the communication quality of the target antenna meets the standards, the system can avoid unnecessary waste of resources and power consumption, such as avoiding repeated transmission and signal search operations due to poor signals, thereby extending the battery life of the device. Real-time monitoring and dynamic adjustment of communication quality levels can effectively reduce communication interruptions or quality degradation caused by antenna performance fluctuations or environmental changes, and ensure the continued stability of communications. In summary, the steps of real-time monitoring of the working status of the target antenna, evaluating the communication quality level, judging whether it meets the standards, and sending a verification completion signal improve the quality, stability, and user experience of the wireless communication system through dynamic optimization, intelligent control, and automated adjustment, while also having the additional advantages of energy saving and resource optimization.

[0091] This embodiment is based on a directional coupler to separate the power of the external antenna and the internal antenna respectively, and obtain the first reflected power and the second reflected power; based on the RF power detector, the first reflected power and the second reflected power are converted into voltage signals respectively to obtain the first voltage signal and the second voltage signal; based on the voltage comparator, the first voltage signal is compared with the second voltage signal; the antenna corresponding to the lower voltage value of the first voltage signal and the second voltage signal is used as the target antenna, and the RF signal is switched to the target antenna. This embodiment realizes automatic and efficient switching of the internal antenna and the external antenna through the combined application of a directional coupler, an RF power detector and a voltage comparator. Since the switching process is based on accurate power detection and voltage comparison, it can ensure that the best antenna is selected, thereby improving the switching efficiency of the internal and external antennas.

[0092] Based on the above second embodiment, a third embodiment of the internal and external antenna switching method of the present application is proposed. Figure 3 , Figure 3 This is a schematic diagram of a sub-process in the third embodiment of the internal and external antenna switching method of the present application.

[0093] In this embodiment, the directional coupler includes a first directional coupler and a second directional coupler, the first directional coupler is connected to the radio frequency communication path of the external antenna, and the second directional coupler is connected to the radio frequency communication path of the internal antenna, and step S1 includes:

[0094] S11: when a radio frequency signal is transmitted to the external antenna through the main transmission line of the first directional coupler, controlling the coupling line of the first directional coupler to obtain the radio frequency power reflected back by the external antenna to obtain the first reflected power;

[0095] S12: When the radio frequency signal is transmitted to the built-in antenna through the main transmission line of the second directional coupler, the coupling line of the second directional coupler is controlled to obtain the radio frequency power reflected back by the built-in antenna to obtain the second reflected power.

[0096] It should be noted that the first directional coupler is a device used to separate part of the signal power in the RF signal transmission path. It can extract the reflected RF power from the main transmission line for analysis and measurement. This directional coupler is connected to an external antenna. The second directional coupler is similar to the first directional coupler, except that it is connected to a built-in antenna to obtain the reflected power of the built-in antenna. The main transmission line refers to the main transmission path of the RF signal in the antenna system. In the directional coupler, the RF signal is transmitted to the antenna through the main transmission line. The coupling line is a branch path in the directional coupler, which is used to couple out a part of the signal from the main transmission line, usually the reflected RF power, for measurement or further processing. The reflected power is when the RF signal is transmitted to the antenna, part of the signal is reflected back due to impedance mismatch. The coupling line of the directional coupler can detect and obtain these reflected powers.

[0097] Specifically, the RF signal is transmitted to the external antenna through the main transmission line of the first directional coupler. The coupling line of the first directional coupler plays a key role in this process. When the RF signal reaches the external antenna, if there is an impedance mismatch between the antenna and the transmission line, some reflected power will be generated. The coupling line of the first directional coupler couples these reflected signals from the main transmission line, detects and obtains the reflected power of the external antenna, and obtains the first reflected power.

[0098] Further, similar to the process of the external antenna, the RF signal is transmitted to the internal antenna through the main transmission line of the second directional coupler. The coupling line of the second directional coupler couples the signal reflected from the internal antenna from the main transmission line. The signal obtained through the coupling line is used to detect the reflected power of the internal antenna, thereby obtaining the second reflected power.

[0099] By obtaining the reflected power of the external antenna and the internal antenna through the coupling lines of the first directional coupler and the second directional coupler, respectively, the reflection performance of different antennas can be accurately measured. Since the reflected power directly affects the matching degree of the antenna and the signal transmission quality, this accurate detection helps to select the best antenna. By obtaining the reflected power of the external antenna and the internal antenna respectively, the performance of each antenna can be evaluated independently. This evaluation is objective and can provide the system with accurate antenna performance data to support subsequent antenna selection and switching decisions. The directional coupler obtains the reflected power through the coupling line without affecting the transmission of the RF signal on the main transmission line. This method can ensure that the normal transmission of the signal is not interfered with while obtaining the reflected power, thereby ensuring the communication quality. By obtaining and monitoring the reflected power of different antennas in real time, the system can dynamically manage the use of the antenna. When the reflected power of a certain antenna is high, the system can switch to an antenna with lower reflected power to optimize the communication quality. By accurately obtaining the reflected power, the system can promptly detect and respond to changes in antenna performance, thereby improving the stability and reliability of the communication system and reducing communication interruptions or quality degradation caused by antenna problems. This method is not only applicable to a single internal and external antenna system, but can also be extended to a multi-antenna system. By obtaining the reflected power of each antenna separately, the optimal antenna configuration can be selected to adapt to different usage scenarios. In summary, when the RF signal is transmitted to the antenna through the main transmission line of the directional coupler, the step of controlling the coupling line to obtain the reflected power realizes dynamic antenna management and optimization by accurately and independently detecting the antenna reflection performance, thereby improving the quality and stability of the communication system.

[0100] Based on the above second embodiment, in this embodiment, step S12 includes:

[0101] SA: Get user input control instructions;

[0102] SB: Determine whether there is an antenna forced selection command in the user input control instruction;

[0103] SC: If yes, determine the target antenna according to the antenna forced selection command.

[0104] It should be noted that user input control instructions refer to control commands input by users through device interfaces (such as touch screens, buttons, voice commands, etc.) to operate or adjust the system. In this scenario, these instructions may involve operations such as antenna selection and signal adjustment. Antenna forced selection command is a specific command among user input control instructions, which explicitly instructs the system to select a specific antenna (such as an external antenna or an internal antenna) without relying on automatic detection or judgment by the system.

[0105] Specifically, the system monitors the user's input interface, such as a touch screen, physical buttons, or voice commands, to obtain control instructions input by the user. The instruction may contain control requirements for various functions of the system. The system parses the obtained user input control instructions to determine whether they contain an antenna forced selection command. This step may involve keyword matching or pattern recognition of the instructions. If the instruction contains an antenna forced selection command, the system will recognize the command and prepare for subsequent operations. When an antenna forced selection command is detected, the system directly determines the target antenna according to the content specified in the command. For example, if the command specifies "select an external antenna", the system will immediately set the external antenna as the target antenna without automatic detection or evaluation. This forced selection skips the system's automatic antenna evaluation process, and the user directly determines the selection of the target antenna.

[0106] By supporting the antenna forced selection command, the system provides users with greater operational flexibility. Users can directly specify the target antenna according to actual needs, avoiding the situation where the system's automatic selection may be inconsistent with the user's intention. In certain specific scenarios (for example, when the user knows that the location of a certain antenna is more suitable for the current environment), the antenna forced selection command allows the user to actively intervene in the system's antenna selection process to meet specific communication needs. When the user uses the antenna forced selection command, the system does not need to perform steps such as reflected power detection and comparison, and can more quickly determine the target antenna and switch the RF signal path, thereby improving the response speed. Providing the option of antenna forced selection can enhance the user experience, especially in certain scenarios that require precise control. For example, users can quickly switch to an external antenna in poor signal conditions to ensure the stability of communication. Allowing users to force the selection of antennas makes the system's operation more in line with the user's intentions and expectations, reducing the inconvenience or misoperation that may be caused by inaccurate automatic selection of the system. In multi-antenna systems or advanced communication devices, users may have more complex operating requirements. By providing antenna forced selection commands, the system can better support these advanced functions and adapt to the needs of complex operating modes. In summary, the steps of obtaining user input control instructions, judging whether there is an antenna forced selection command and determining the target antenna according to the command provide the system with the flexibility and rapid response capability of user active control, improve the accuracy of system operation and user experience, and provide effective support for meeting the needs of specific application scenarios.

[0107] Based on the above second embodiment, in this embodiment, the RF power detector includes a first RF power detector and a second RF power detector, the first RF power detector is connected to the RF communication path of the external antenna, and the second RF power detector is connected to the RF communication path of the internal antenna, and step S2 includes:

[0108] S21: converting the first reflected power into a first DC voltage signal based on a detection circuit in the first radio frequency power detector;

[0109] S22: preprocessing the first DC voltage signal to obtain the first voltage signal, wherein the preprocessing includes rectification and filtering;

[0110] S23: converting the second reflected power into a second DC voltage signal based on a detection circuit in the second RF power detector;

[0111] S24: performing the preprocessing on the second DC voltage signal to obtain the second voltage signal.

[0112] It should be noted that the first RF power detector is an electronic device used to convert the RF power signal reflected back by the external antenna into a DC voltage signal. It usually contains a detection circuit to complete this signal conversion. The detection circuit is a key component in the RF power detector, which is used to extract power information from the RF signal and convert it into a corresponding DC voltage signal. The detection process involves rectifying the waveform of the RF signal and extracting the envelope or average value therefrom. The first reflected power refers to the power of the RF signal reflected back by the external antenna, which is converted into a first DC voltage signal after being detected by the first RF power detector. The DC voltage signal is a voltage signal obtained after the RF power signal is converted by the detection circuit. It reflects the power of the RF signal and is expressed in the form of DC voltage. Preprocessing is to further process the initially acquired DC voltage signal to extract effective signal features. Preprocessing usually includes rectification and filtering, the purpose of which is to remove unnecessary noise and fluctuations and obtain a smooth and stable voltage signal. Rectification is a step in preprocessing, in which the AC component is removed by a rectifier device, and only the DC component or the positive half-cycle signal is retained. This helps to extract the effective components of the RF signal. Filtering is a process used in preprocessing to remove high-frequency noise or unstable components in the signal. A smoother DC signal can be obtained through the filter, thereby improving the accuracy and stability of the signal. The second RF power detector has a similar function to the first RF power detector, but it is used to process the reflected power signal of the built-in antenna. The second reflected power is the RF signal power reflected back by the built-in antenna, which is converted into a second DC voltage signal by the detection circuit of the second RF power detector.

[0113] Specifically, the RF signal is reflected from the external antenna and received by the detection circuit of the first RF power detector. The detection circuit converts the first reflected power signal into a corresponding first DC voltage signal through rectification and other processing. This step mainly converts the waveform of the RF signal into a DC signal to facilitate subsequent voltage signal processing. The preprocessing process first rectifies the DC voltage signal to remove the AC component or half-wave rectify the signal to retain the effective DC component. The rectified signal is then filtered to remove noise and unstable components in the signal to obtain a smooth first voltage signal. This signal is more stable and accurate, and is suitable for subsequent antenna performance evaluation and comparison.

[0114] Further, similar to the external antenna, the RF signal reflected back by the internal antenna is received by the detection circuit of the second RF power detector. The detection circuit converts the second reflected power signal into a second DC voltage signal in preparation for the subsequent preprocessing steps. The second DC voltage signal is rectified to convert it into a pure DC component or a positive half-cycle signal. Next, the signal is filtered to remove noise and obtain a smooth second voltage signal. The final signal is also stable and accurate, which is convenient for comparison and analysis.

[0115] The RF reflected power signal is converted into a DC voltage signal through the detection circuit of the RF power detector. This conversion method allows complex RF signals to be processed and analyzed in a simpler and more intuitive form (voltage signal). The preprocessing step includes rectification and filtering, which effectively removes the noise and unstable components in the signal, and the resulting voltage signal is smoother and more stable. This improves the quality of the signal and makes subsequent antenna selection and comparison more reliable. The preprocessed voltage signal more accurately reflects the reflected power performance of the antenna. Therefore, when the system selects and evaluates antennas based on these signals, it can more accurately determine which antenna has better performance. Through the detection circuit and preprocessing steps, the system converts and simplifies complex RF signals into DC voltage signals and further optimizes the stability of the signal. This simplifies the signal processing process and makes system design and implementation simpler. Through fast and effective signal conversion and preprocessing, the system can obtain key information for antenna selection more quickly, thereby improving the overall response speed and adapting to rapidly changing communication environments. The RF power detector and preprocessing steps can adapt to different antenna systems and RF environments, have strong adaptability and versatility, and are suitable for a variety of wireless communication devices. In summary, based on the operation steps of the RF power detector and preprocessing, through precise RF signal conversion and optimized signal processing, the signal quality, response speed and antenna selection accuracy of the system are improved, the signal processing process is simplified, and the stability and compatibility of the system are enhanced.

[0116] In one embodiment, for a TDD or TDMA system, since transmission and reception are not simultaneous, in the receiving state, a portion of the power entering the system low noise amplifier from the antenna end through the SAW filter can also be separated by a directional coupler. When the system is in the receiving state, the power strength received by the two antennas can also be compared to dynamically select the antenna.

[0117] This embodiment is based on a directional coupler to separate the power of the external antenna and the internal antenna respectively, and obtain the first reflected power and the second reflected power; based on the RF power detector, the first reflected power and the second reflected power are converted into voltage signals respectively to obtain the first voltage signal and the second voltage signal; based on the voltage comparator, the first voltage signal is compared with the second voltage signal; the antenna corresponding to the lower voltage value of the first voltage signal and the second voltage signal is used as the target antenna, and the RF signal is switched to the target antenna. This embodiment realizes automatic and efficient switching of the internal antenna and the external antenna through the combined application of a directional coupler, an RF power detector and a voltage comparator. Since the switching process is based on accurate power detection and voltage comparison, it can ensure that the best antenna is selected, thereby improving the switching efficiency of the internal and external antennas.

[0118] For example, in order to help understand the technical concept or technical principle of the internal and external antenna switching method of the above embodiment, please refer to Figure 4 , Figure 4 This is a hardware schematic diagram of an embodiment of the internal and external antenna switching method of the present application.

[0119] like Figure 4 As shown in the figure, three RF switches are added to the traditional RF link to switch the RF path. The RF switch is controlled by the program to switch the RF link and select whether to connect the built-in antenna or the external antenna. When the device is started, if the customer chooses to use the built-in antenna or the external antenna by force, it will switch to the specified antenna according to the customer configuration. Otherwise, the RF switch will be connected to the power divider, and the power divider will divide the power generated by the previous RF power amplifier equally. A directional coupler is added between each double-pole single-throw RF switch and the antenna. When there is no antenna connected or the current antenna is not in good working condition, a large amount of power is reflected back and can be transmitted to the RF power detector by the coupling end of the directional coupler. When a well-matched external antenna is connected, the power is radiated into the space through the external antenna, and only a small amount of power is reflected back. At this time, the power transmitted by the directional coupler to the RF power detector will be significantly reduced, that is, the voltage output by the RF power detector becomes lower. The voltage comparator compares the voltage size of the two antenna directional couplers separated and the power detector converted, and can judge the working status of the current antennas, and feedback the solution to the main control, and the program can automatically adjust the antenna selection strategy.

[0120] The present application also provides an internal and external antenna switching system. Figure 5 , Figure 5 This is a schematic diagram of the module structure of the internal and external antenna switching system of the embodiment of the present application, and the internal and external antenna switching system includes:

[0121] A power separation module 501 is used to perform power separation on the external antenna and the internal antenna respectively based on the directional coupler to obtain a first reflected power and a second reflected power;

[0122] A voltage conversion module 502 is used to convert the first reflected power and the second reflected power into voltage signals based on the radio frequency power detector to obtain a first voltage signal and a second voltage signal;

[0123] A voltage comparison module 503, configured to compare the first voltage signal with the second voltage signal based on the voltage comparator;

[0124] The switching module 504 is configured to use an antenna corresponding to a lower voltage value between the first voltage signal and the second voltage signal as a target antenna, and switch the radio frequency signal to the target antenna.

[0125] The internal and external antenna switching system provided in the embodiment of the present application adopts the internal and external antenna switching method in the above embodiment, which can solve the technical problem of how to improve the switching efficiency of the internal and external antennas. Compared with the prior art, the beneficial effects of the internal and external antenna switching system provided in the embodiment of the present application are the same as the beneficial effects of the internal and external antenna switching method provided in the above embodiment, and other technical features of the internal and external antenna switching system are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0126] The present application provides an internal and external antenna switching device, which includes: at least one processor; and a memory that is communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the internal and external antenna switching method in the above-mentioned embodiment.

[0127] Reference below Figure 6, which shows a schematic diagram of the structure of an internal and external antenna switching device suitable for implementing the embodiment of the present application. The internal and external antenna switching device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The internal and external antenna switching device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0128] like Figure 6 As shown, the internal and external antenna switching device may include a processing system 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage system 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the internal and external antenna switching device are also stored. The processing system 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input system 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output system 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage system 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication system 1009. The communication system 1009 can allow the internal and external antenna switching device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an internal and external antenna switching device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0129] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication system, or installed from a storage system 1003, or installed from a ROM 1002. When the computer program is executed by the processing system 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0130] The internal and external antenna switching device provided by the present application adopts the internal and external antenna switching method in the above embodiment, which can solve the technical problem of how to improve the switching efficiency of the internal and external antennas. Compared with the prior art, the beneficial effects of the internal and external antenna switching device provided by the present application are the same as the beneficial effects of the internal and external antenna switching method provided by the above embodiment, and the other technical features in the internal and external antenna switching device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0131] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0132] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0133] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the internal and external antenna switching method in the above-mentioned embodiment.

[0134] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0135] The computer-readable storage medium may be included in the internal / external antenna switching device; or may exist independently without being assembled into the internal / external antenna switching device.

[0136] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the internal and external antenna switching device, the internal and external antenna switching device: based on the directional coupler, the external antenna and the internal antenna are separated from each other to obtain the first reflected power and the second reflected power; based on the radio frequency power detector, the first reflected power and the second reflected power are converted into voltage signals to obtain the first voltage signal and the second voltage signal; based on the voltage comparator, the first voltage signal is compared with the second voltage signal; the antenna corresponding to the lower voltage value of the first voltage signal and the second voltage signal is used as the target antenna, and the radio frequency signal is switched to the target antenna. The computer program code for performing the operation of the present application can be written in one or more programming languages ​​or a combination thereof, and the programming languages ​​include object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" language or similar programming languages. The program code can be executed completely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or it can be connected to an external computer (for example, through the Internet using an Internet service provider).

[0137] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0138] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0139] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned internal and external antenna switching method, and can solve the technical problem of how to improve the switching efficiency of the internal and external antennas. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the internal and external antenna switching method provided in the above-mentioned embodiment, and will not be repeated here.

[0140] An embodiment of the present application provides a computer program product, including a computer program, which implements the steps of the internal and external antenna switching method as described above when the computer program is executed by a processor.

[0141] The computer program product provided in this application can solve the technical problem of how to improve the switching efficiency of internal and external antennas. Compared with the prior art, the beneficial effects of the computer program product provided in the embodiment of this application are the same as the beneficial effects of the internal and external antenna switching method provided in the above embodiment, which will not be repeated here.

[0142] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent processing scope of the present application.

Claims

1. A method for switching an internal and external antenna, used in an internal and external antenna switching system, characterized in that: The internal and external antenna switching system includes a directional coupler, a radio frequency power detector and a voltage comparator, and the method includes: Based on the directional coupler, power separation is performed on the external antenna and the internal antenna respectively to obtain a first reflected power and a second reflected power; Based on the radio frequency power detector, converting the first reflected power and the second reflected power into voltage signals respectively to obtain a first voltage signal and a second voltage signal; Based on the voltage comparator, comparing the first voltage signal with the second voltage signal; An antenna corresponding to a lower voltage value between the first voltage signal and the second voltage signal is used as a target antenna, and a radio frequency signal is switched to the target antenna.

2. The method according to claim 1, characterized in that The method further comprises: Get user input control instructions; Determining whether there is an antenna forced selection command in the user input control instruction; If so, determine the target antenna according to the antenna forced selection command.

3. The method according to claim 1, characterized in that The internal and external antenna switching system further includes a radio frequency switching switch, and the step of using the antenna corresponding to the lower voltage value of the first voltage signal and the second voltage signal as the target antenna and switching the radio frequency signal to the target antenna includes: taking an antenna corresponding to a lower voltage value between the first voltage signal and the second voltage signal as a target antenna; Based on the target antenna, generating a radio frequency signal switching instruction; Based on the radio frequency signal switching instruction, controlling the radio frequency switching switch to switch the radio frequency signal path; Based on the switched radio frequency signal path, the radio frequency signal is switched to the target antenna.

4. The method according to claim 3, characterized in that After the step of switching the radio frequency signal to the target antenna based on the switched radio frequency signal path, the method further includes: Performing real-time monitoring on the working status of the target antenna; Determining the communication quality level of the target antenna according to the real-time monitoring result; Determining whether the communication quality level exceeds a preset communication quality standard; If so, a verification completion signal is issued.

5. The method according to claim 1, characterized in that The directional coupler includes a first directional coupler and a second directional coupler, the first directional coupler is connected to the radio frequency communication path of the external antenna, and the second directional coupler is connected to the radio frequency communication path of the internal antenna. The steps of performing power separation on the external antenna and the internal antenna based on the directional coupler to obtain the first reflected power and the second reflected power include: When the radio frequency signal is transmitted to the external antenna through the main transmission line of the first directional coupler, the coupling line of the first directional coupler is controlled to obtain the radio frequency power reflected back by the external antenna to obtain the first reflected power; When the radio frequency signal is transmitted to the built-in antenna through the main transmission line of the second directional coupler, the coupling line of the second directional coupler is controlled to obtain the radio frequency power reflected back by the built-in antenna to obtain the second reflected power.

6. The method according to claim 1, characterized in that The RF power detector includes a first RF power detector and a second RF power detector, the first RF power detector is connected to the RF communication path of the external antenna, and the second RF power detector is connected to the RF communication path of the internal antenna. The steps of converting the first reflected power and the second reflected power into voltage signals based on the RF power detector to obtain the first voltage signal and the second voltage signal include: Based on the detection circuit in the first radio frequency power detector, converting the first reflected power into a first direct current voltage signal; Preprocessing the first DC voltage signal to obtain the first voltage signal, wherein the preprocessing includes rectification and filtering; Based on the detection circuit in the second radio frequency power detector, converting the second reflected power into a second DC voltage signal; The second DC voltage signal is preprocessed to obtain the second voltage signal.

7. An internal and external antenna switching system, characterized in that: The system comprises: A power separation module, used for performing power separation on the external antenna and the internal antenna respectively based on the directional coupler to obtain a first reflected power and a second reflected power; A voltage conversion module, configured to convert the first reflected power and the second reflected power into voltage signals based on the radio frequency power detector to obtain a first voltage signal and a second voltage signal; a voltage comparison module, configured to compare the first voltage signal with the second voltage signal based on the voltage comparator; A switching module is used to use the antenna corresponding to the lower voltage value of the first voltage signal and the second voltage signal as the target antenna, and switch the radio frequency signal to the target antenna.

8. A computer device, characterized in that: The device comprises: a memory, a processor, and an internal / external antenna switching program stored in the memory and executable on the processor, wherein the internal / external antenna switching program is configured to implement the steps of the internal / external antenna switching method according to any one of claims 1 to 6.

9. A storage medium, characterized in that: The storage medium stores an internal / external antenna switching program, and when the internal / external antenna switching program is executed by the processor, the steps of the internal / external antenna switching method according to any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the internal and external antenna switching method according to any one of claims 1 to 6 are implemented.