Signal source switching method and related device

By acquiring and matching the position fingerprint and time-consuming time in the fence data, the terminal device can switch signal sources in time, solving the problem of untimely switching of signal sources in the prior art and improving the user experience.

CN115734294BActive Publication Date: 2025-05-30HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111003315.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-30
Publication Date
2025-05-30
Estimated Expiration
2041-08-30

AI Technical Summary

Technical Problem

In the prior art, untimely switching of signal sources leads to stuttering or unavailability of data services, affecting user experience.

Method used

By obtaining fence data, including location fingerprint and time-consuming time, the terminal equipment performs fingerprint matching to predict the signal source switching time and switches the signal source in time to avoid the problem of untimely switching of the signal source.

Benefits of technology

It realizes the accuracy and timeliness of signal source switching, avoids lag or unavailability of data services, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115734294B_ABST
    Figure CN115734294B_ABST
Patent Text Reader

Abstract

The present application discloses a signal source switching method and related devices. The terminal obtains first fence data, where the first fence data includes at least one fence record. The first fence record in the first fence data includes a first location fingerprint and a first duration. The first location fingerprint indicates a location near the weak signal area of the first signal source, and the first duration indicates the duration required from this location to the first weak signal area. The terminal performs fingerprint matching between the location fingerprint of the current location and the location fingerprints of the fence records in the first fence data, and the signal source of the current data service of the terminal is the first signal source. If the current location fingerprint successfully matches the first location fingerprint of the first fence record, then at a moment that is the first switching duration away from the current moment, the signal source of the data service is switched to the second signal source, and the first switching duration is the difference between the first duration and the first preset duration. In this way, the timeliness of signal source switching can be effectively improved, and the user experience can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communications, and in particular, to a signal source switching method and related devices. Background Art

[0002] When operators deploy networks, there are some areas (such as elevators, basements, etc.) where the network deployment is imperfect, and the signal coverage in these areas is poor, resulting in users being unable to normally use data services such as watching videos and listening to music. In addition, there are differences in network deployment between different operators at the same location. For example, the signal coverage of operator A is poor at the same location, while the signal coverage of operator B is good and normal data services can be carried out.

[0003] For a terminal device configured with two Subscriber Identity Module (SIM) cards, if the signal of the primary card is poor and the signal of the secondary card is relatively good, the user can switch the data service of the terminal device to the secondary card. However, this way of switching cards will cause the data service of the terminal device to be likely unavailable before the data service is switched to the secondary card because the primary card is already in a weak signal state. Therefore, the current way of switching cards has the problem of untimely switching, resulting in a poor user experience. Summary of the Invention

[0004] This application provides a signal source switching method and related devices, which can timely switch the signal source of the data service, avoid data service jamming or unavailability caused by untimely signal source switching, and effectively improve the user experience.

[0005] In a first aspect, this application provides a signal source switching method, including: the terminal obtains first fence data, the first fence data includes at least one fence record, the first fence record includes a first location fingerprint and a first time duration, the first location fingerprint is used to represent a location near a first weak signal area of a first signal source, the first time duration is used to indicate the time required to reach the first weak signal area from the location represented by the first location fingerprint, and the first fence record is one of the at least one fence record; the terminal collects the location fingerprint of the current location, and performs fingerprint matching on the collected location fingerprint and the location fingerprints of the fence records in the first fence data, and the signal source of the terminal for the current data service is the first signal source; when the collected second location fingerprint matches the first location fingerprint of the first fence record successfully, at a moment of a first switching duration from the current moment, the terminal switches the signal source of the data service to a second signal source, and the first switching duration is the difference between the first time duration of the first fence record and a first preset duration.

[0006] Implementing the embodiments of the present application, the terminal can obtain multiple fence records. Each fence record includes the location fingerprint of the weak signal area near the first signal source, and the time duration required to reach the weak signal area of the first signal source from the location indicated by the location fingerprint. By fingerprint matching of the location fingerprints in the above fence records, the terminal can determine whether to switch the signal source, and then based on the time duration in the fence records, the terminal can predict the signal source switching time, so as to switch the signal source in time before the terminal enters the weak signal area of the first signal source, avoiding data service jamming or unavailability of the terminal. In this way, the accuracy and timeliness of signal source switching are guaranteed, and thus the user experience is effectively improved.

[0007] In one implementation, the above terminal obtains the first fence data, including: the terminal collects the location fingerprint of the current location; the terminal periodically detects the signal status of the first signal source and the signal status of the second signal source; when it is detected that the signal status of the first signal source is a weak signal and the signal status of the second signal source is a strong signal, the terminal records the current time point as the start time of the weak signal area of the first signal source; when it is detected that the continuous duration of the terminal in the weak signal area of the first signal source reaches a preset threshold, the terminal generates a first initial fence record; wherein, the first initial fence record includes the third location fingerprint collected by the terminal before the start time of the above weak signal area and the second time duration, and the second time duration is the time difference between the collection time of the third location fingerprint and the start time of the above weak signal area; the terminal clusters the multiple initial fence records generated by the terminal based on the location fingerprint, and one fence record in the first fence data is the clustering result of at least one of the multiple initial fence records, and the multiple initial fence records include the first initial fence record.

[0008] Implementing the embodiments of the present application, in the initial stage of the user using the terminal, the terminal can obtain the first fence data by collecting the location fingerprints and the corresponding time durations of the daily usage environment. After obtaining the first fence data, the terminal 100 can predict the signal source switching time based on the first fence data. Since the first fence data is generated based on the actual usage environment of the terminal, the accuracy and timeliness of the signal source switching of the terminal can be ensured.

[0009] In one implementation, after the above terminal obtains the first fence data, it further includes: uploading the first fence data to the server, and other terminals can obtain the first fence data through the server.

[0010] When implementing the embodiments of the present application, after the terminal obtains the first fence data, it can share the first fence data with the server (such as a cloud server) so that other users can also obtain and use the above-mentioned first fence data. In this way, the fence records shared by a large number of users with the server constitute a fence database with a larger data volume. When a user uses a new terminal, the terminal can obtain appropriate fence data from the server without generating the fence data by itself.

[0011] In one implementation, the fence record further includes a physical location, which is used to indicate the location where the terminal is located. The above-mentioned terminal obtains the first fence data, including: the terminal sends a acquisition request to the server, and the acquisition request carries the first physical location where the terminal is currently located; the terminal receives the first fence data sent by the server, and the server stores a fence database including multiple fence records, and the first fence data includes the fence records in the fence database whose physical location is the first physical location.

[0012] When implementing the embodiments of the present application, the fence record further includes a physical location, and the terminal can request the server to obtain the fence record that matches the current physical location. In this way, the terminal can obtain the fence records with the same physical location for fingerprint matching and signal source switching, without performing fingerprint matching on all the fence records stored in the server, greatly reducing the computational amount of fingerprint matching.

[0013] In one implementation, the terminal is configured with a first SIM card and a second SIM card. The first network device corresponding to the first SIM card is used for the terminal to access the first cellular network at the current location, and the second network device corresponding to the second SIM card is used for the terminal to access the second cellular network at the current location; the first signal source is the first network device, and the second signal source is the second network device.

[0014] When implementing the embodiments of the present application, the terminal is configured with a first SIM card and a second SIM card, and the signal source of the data service of the terminal device can be switched from the first network device corresponding to the first SIM card to the second network device corresponding to the second SIM card.

[0015] In one implementation, the terminal is configured with a first SIM card. The first network device corresponding to the first SIM card is used for the terminal to access the cellular network at the current location, and the first access point is used for the terminal to access the wireless local area network at the current location; the first signal source is the first network device, and the second signal source is the first access point; or, the first signal source is the first access point, and the second signal source is the second network device.

[0016] In the implementation of the embodiments of the present application, the terminal is configured with a first SIM card. The terminal can also access the wireless local area network through a first access point. The signal source of the data service of the terminal device can be switched from the first network device corresponding to the first SIM card to the first access point, or can be switched from the first access point to the first network device corresponding to the first SIM card.

[0017] In one implementation, the first access point is used for the terminal to access the first wireless local area network at the current location, and the second access point is used for the terminal to access the second wireless local area network at the current location; the first signal source is the first access point, and the second signal source is the second access point; or, the first signal source is the second access point, and the second signal source is the first access point.

[0018] In the implementation of the embodiments of the present application, the terminal can access the wireless local area network through the first access point, or can also access the wireless local area network through the second access point. The signal source of the data service of the terminal device can be switched from the first access point to the second access point, or can be switched from the second access point to the first access point.

[0019] In one implementation, the above terminal collects the location fingerprint of the current location, including: in response to the detected preset trigger condition, the terminal collects the location fingerprint of the current location once; or, in response to the detected preset trigger condition, the terminal periodically collects the location fingerprint of the current location; the preset trigger condition is that the change value of at least one preset parameter in the location fingerprint within a preset time is greater than a preset value.

[0020] In one implementation, the above terminal periodically detects the signal status of the first signal source and the signal status of the second signal source, including: in response to the detected preset trigger condition, the terminal periodically detects the signal status of the first signal source and the signal status of the second signal source.

[0021] In one implementation, the third location fingerprint is the location fingerprint first collected by the terminal after detecting the preset trigger condition.

[0022] In one implementation, the third location fingerprint is the location fingerprint most recently collected by the terminal before the start time of the above weak signal area.

[0023] In one implementation, the first fence record is the clustering result of at least one of the above multiple initial fence records. The first location fingerprint in the first fence record is determined based on the location fingerprints of each of the at least one initial fence records; the first time-consuming duration in the first fence record is the average value or weighted average value of the time-consuming durations of each of the at least one initial fence records.

[0024] In one implementation, the first preset duration is N times the standard deviation of the duration consumed by each of the at least one initial fence record, where N is a positive integer.

[0025] Implementing the embodiments of the present application associates the first preset duration for early switching with the duration consumed in the initial fence record. The duration consumed is affected by the actual environment and user habits. In this way, the signal source switching time in the current environment can be adaptively predicted.

[0026] In one implementation, the above terminal clusters multiple initial fence records generated by the terminal based on location fingerprints, including: clustering the initial fence records with similar location fingerprints among the multiple initial fence records into one fence record.

[0027] Implementing the embodiments of the present application improves the accuracy of the location fingerprints and the duration consumed in the fence record by clustering the initial fence records with similar location fingerprints, and further improves the accuracy of fingerprint matching and the timeliness of signal source switching during subsequent signal source switching.

[0028] In one implementation, when it is detected that the duration for which the terminal stays in the weak signal area of the first signal source reaches a preset threshold, the terminal generates a first initial fence record, including: when it is detected that the duration for which the terminal stays in the weak signal area of the first signal source reaches a preset threshold, and it is detected that the terminal enters a preset place after the start time of the weak signal area, the terminal generates a first initial fence record, and the preset place includes an elevator.

[0029] Implementing the embodiments of the present application can obtain fence records in special scenarios, and thus can improve the accuracy and timeliness of signal source switching in special scenarios.

[0030] In one implementation, the first signal source is a first network device, and the second signal source is a second network device; the terminal periodically detects the signal status of the first signal source and the signal status of the second signal source, including: the terminal periodically makes a comprehensive judgment on whether the signal status of the first signal source is a weak signal or a strong signal based on one or more of the signal parameters such as the RSRP of the reference signal received from the first network device, the SINR of the signal received from the first network device, the uplink cache duration for sending uplink data services to the first network device, the uplink transmit power for sending uplink data services to the first network device, and whether the preset application being run is stuck; and makes a comprehensive judgment on whether the signal status of the second signal source is a weak signal or a strong signal based on one or more of the signal parameters such as the RSRP of the reference signal received from the second network device and the SINR of the signal received from the second network device.

[0031] In one implementation, the location fingerprint includes WiFi information. The WiFi information includes the MAC address of each WiFi access point scanned by the terminal and the signal parameters of the WiFi signals of each WiFi access point. When the proportion of the MAC addresses that meet the clustering condition in the location fingerprints of the first initial fence record and the second initial fence record is greater than the proportion threshold in the MAC addresses recorded in the location fingerprints of the first initial fence record and / or the second initial fence record, it is determined that the location fingerprints of the first initial fence record and the second initial fence record are similar. The clustering condition is that both the first initial fence record and the second initial fence record include the first MAC address, and the matching degree of the signal parameters of the WiFi signals corresponding to the first MAC address in the first initial fence record and the second initial fence is greater than the matching threshold.

[0032] In a second aspect, the present application provides a terminal, and the terminal includes:

[0033] An acquisition unit, configured to acquire first fence data. The first fence data includes at least one fence record. The first fence record includes a first location fingerprint and a first duration. The first location fingerprint is used to represent a location near the first weak signal area of the first signal source, and the first duration is used to indicate the time required to reach the first weak signal area from the location represented by the first location fingerprint. The first fence record is one of the at least one fence record described above;

[0034] A first collection unit, configured to collect the location fingerprint of the current location;

[0035] A matching unit, configured to perform fingerprint matching on the collected location fingerprint and the location fingerprint of the fence record in the first fence data. The signal source for which the terminal is currently performing data services is the first signal source;

[0036] A switching unit, when the collected second location fingerprint successfully matches the first location fingerprint of the first fence record, at a moment that is the first switching duration away from the current moment, switches the signal source for data services to the second signal source. The first switching duration is the difference between the first duration of the first fence record and the first preset duration.

[0037] In one implementation, the above-mentioned acquisition unit specifically includes: a second acquisition unit for acquiring the location fingerprint of the current location; a detection unit for periodically detecting the signal status of the first signal source and the signal status of the second signal source; a recording unit for recording the current time point as the start time of the weak signal area of the first signal source when it is detected that the signal status of the first signal source is a weak signal and the signal status of the second signal source is a strong signal; a generating unit for generating a first initial fence record when it is detected that the duration of the terminal in the weak signal area of the first signal source reaches a preset threshold; wherein, the first initial fence record includes the third location fingerprint collected by the second acquisition unit before the start time of the above-mentioned weak signal area and the second duration, and the second duration is the time difference between the acquisition time of the third location fingerprint and the start time of the above-mentioned weak signal area; a clustering unit for clustering the multiple initial fence records generated by the generating unit based on the location fingerprint, and one fence record in the first fence data is the clustering result of at least one of the multiple initial fence records, and the multiple initial fence records include the first initial fence record.

[0038] In one implementation, the terminal further includes an upload unit. After the acquisition unit acquires the first fence data, the upload unit is used to upload the first fence data to the server, and other terminals can acquire the first fence data through the server.

[0039] In one implementation, the fence record further includes a physical location, and the physical location is used to indicate the location where the terminal is located. The above-mentioned acquisition unit specifically includes: a sending unit for sending an acquisition request to the server, and the acquisition request carries the first physical location where the terminal is currently located; a receiving unit for receiving the first fence data sent by the server, and the server stores a fence database including multiple fence records, and the first fence data includes the fence records in the fence database whose physical location is the first physical location.

[0040] In one implementation, the terminal is configured with a first SIM card and a second SIM card. The terminal accesses the cellular network through the first network device corresponding to the first SIM card, and the terminal accesses the cellular network through the second network device corresponding to the second SIM card; the first signal source is the first network device, and the second signal source is the second network device.

[0041] In one implementation, the terminal is configured with a first SIM card. The terminal accesses the cellular network through the first network device corresponding to the first SIM card, and the terminal accesses the wireless local area network through the first access point; the first signal source is the first network device, and the second signal source is the first access point; or, the first signal source is the first access point, and the second signal source is the second network device.

[0042] In one implementation, the terminal accesses a first wireless local area network through a first access point, and the terminal accesses a second wireless local area network through a second access point; the first signal source is the first access point, and the second signal source is the second access point; alternatively, the first signal source is the second access point, and the second signal source is the first access point.

[0043] In one implementation, the first acquisition unit and / or the second acquisition unit are specifically configured to: in response to a detected preset trigger condition, acquire a location fingerprint of the current location once; or, in response to a detected preset trigger condition, periodically acquire a location fingerprint of the current location; the preset trigger condition is that the change value of at least one preset parameter in the location fingerprint within a preset time is greater than a preset value.

[0044] In one implementation, the detection unit is specifically configured to periodically detect the signal status of the first signal source and the signal status of the second signal source in response to a detected preset trigger condition.

[0045] In one implementation, the third location fingerprint is the location fingerprint first acquired by the second acquisition unit after detecting the preset trigger condition.

[0046] In one implementation, the third location fingerprint is the location fingerprint most recently acquired by the second acquisition unit before the start time of the weak signal area.

[0047] In one implementation, the first fence record is the clustering result of at least one initial fence record among the multiple initial fence records, and the first location fingerprint in the first fence record is determined based on the location fingerprints of each of the at least one initial fence record; the first duration in the first fence record is the average value or weighted average value of the durations of each of the at least one initial fence record.

[0048] In one implementation, the first preset duration is N times the standard deviation of the durations of each of the at least one initial fence record, where N is a positive integer.

[0049] In one implementation, the clustering unit is specifically configured to cluster the initial fence records with similar location fingerprints among the multiple initial fence records into one fence record.

[0050] In one implementation, the generating unit is specifically configured to generate a first initial fence record when it is detected that the duration for which the terminal stays in the weak signal area of the first signal source reaches a preset threshold and it is detected that the terminal enters a preset place after the start time of the weak signal area, and the preset place includes an elevator.

[0051] In one implementation, the first signal source is the first network device, and the second signal source is the second network device; specifically, the detection unit is configured to periodically make a comprehensive judgment on whether the signal state of the first signal source is a weak signal or a strong signal based on one or more of the following signal parameters: the RSRP of the reference signal received from the first network device, the SINR of the signal received from the first network device, the uplink buffer duration for sending uplink data services to the first network device, the uplink transmission power for sending uplink data services to the first network device, and whether the running preset application is stuck; and make a comprehensive judgment on whether the signal state of the second signal source is a weak signal or a strong signal based on one or more of the following signal parameters: the RSRP of the reference signal received from the second network device, the SINR of the signal received from the second network device, etc.

[0052] In one implementation, the location fingerprint includes WiFi information, and the WiFi information includes the MAC address of each WiFi access point scanned by the terminal and the signal parameters of the WiFi signals of each WiFi access point; when the proportion of the MAC addresses that meet the clustering condition in the location fingerprints of the first initial fence record and the second initial fence record in the MAC addresses recorded in the location fingerprints of the first initial fence record and / or the second initial fence record is greater than the proportion threshold, it is determined that the location fingerprints of the first initial fence record and the second initial fence record are similar; the clustering condition is that both the first initial fence record and the second initial fence record include the first MAC address, and the matching degree of the signal parameters of the WiFi signals corresponding to the first MAC address in the first initial fence record and the second initial fence is greater than the matching threshold.

[0053] In a third aspect, the present application provides a terminal, including one or more processors and one or more memories. The one or more memories are coupled to the one or more processors, and the one or more memories are configured to store computer program code, and the computer program code includes computer instructions. When the one or more processors execute the computer instructions, the terminal executes the signal source switching method in any possible implementation manner of any aspect above.

[0054] In a fourth aspect, an embodiment of the present application provides a computer storage medium, including computer instructions. When the computer instructions run on an electronic device, the communication device is enabled to execute the signal source switching method in any possible implementation manner of any aspect above.

[0055] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product runs on a computer, the computer is enabled to execute the signal source switching method in any possible implementation manner of any aspect above. Description of the Drawings

[0056] Figure 1Schematic diagram of a communication system provided by an embodiment of the present application;

[0057] Figure 2 Flowchart of a fence learning provided by an embodiment of the present application;

[0058] Figure 3 Schematic diagram of a fence learning in an elevator scenario provided by an embodiment of the present application;

[0059] Figure 4 Flowchart of a signal source switching method provided by an embodiment of the present application;

[0060] Figure 5 Schematic diagram of a signal source switching method in an elevator scenario provided by an embodiment of the present application;

[0061] Figure 6 Schematic diagram of the structure of a terminal provided by an embodiment of the present application;

[0062] Figure 7 Schematic diagram of the structure of another terminal provided by an embodiment of the present application;

[0063] Figure 8 Schematic diagram of the structure of a base station provided by an embodiment of the present application. Detailed implementation manners

[0064] Next, the technical solutions in the embodiments of the present application will be clearly and elaborately described with reference to the accompanying drawings. Among them, in the description of the embodiments of the present application, unless otherwise specified, " / " means "or". For example, A / B may represent A or B; "and / or" in the text is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of the present application, "a plurality of" means two or more than two.

[0065] Hereinafter, the terms "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the embodiments of the present application, unless otherwise specified, the meaning of "a plurality of" is two or more.

[0066] First, the communication system 10 involved in the embodiments of the present application will be introduced.

[0067] Figure 1Schematic diagram of a communication system 10 provided by an embodiment of this application. The communication system 10 may include a terminal 100, at least one base station 200, and at least one access point (AP) 300. The terminal 100 is within the coverage of the at least one base station 200 and the at least one access point 300. In the embodiment of this application, the terminal 100 may support accessing the Internet through a cellular network and / or a non-cellular network to achieve data transceiver for data services. The base station 200 has the access capability of a wireless cellular mobile communication network (for ease of description, the wireless cellular mobile communication network may be simply referred to as a cellular network). The terminal 100 may access the cellular network through the base station 200. The access point 300 has the access capability of a non-cellular network. The terminal 100 may access the non-cellular network through the access point 300.

[0068] In the embodiment of this application, the above-mentioned cellular network may be any one of the following, for example: Global System of Mobile communication (GSM) system, Code Division Multiple Access (CDMA) system, Wideband Code Division Multiple Access (WCDMA) system, General Packet Radio Service (GPRS), Long Term Evolution (LTE) system, LTE Frequency Division Duplex (FDD) system, LTE Time Division Duplex (TDD), Universal Mobile Telecommunication System (UMTS), Worldwide Interoperability for Microwave Access (WiMAX) communication system, New Radio (NR) system, etc.

[0069] The above-mentioned non-cellular network may be a Wireless Local Area Network (WLAN), a Personal Area Network (PAN) using Bluetooth technology, a ZigBee network, or a network using other non-cellular network technologies. The access point 300 may access the WLAN through Wireless Fidelity (WiFi) technology.

[0070] In some embodiments, the above non-cellular network may be a WLAN formed by one or more access points 300 adopting WiFi technology. Each non-cellular network may support wireless communication in different channels (for example, 14 different channels in the 2.4 GHz band and 60 - 80 different channels in the 5 GHz band). Among them, each access point 300 may be connected to the WLAN through an Ethernet cable and may receive, cache, and transmit data services directed to (or from) the terminal 100. It can be understood that at the same location, the WiFi signal quality of different access points 300 may be different, and the terminal 100 may access the WLAN through the access point 300 with the best signal quality covering the current location. In subsequent embodiments, the above non-cellular network being a WLAN based on WiFi technology is taken as an example for illustration, that is, the access point 300 is a WiFi access point.

[0071] In some embodiments, the terminal 100 is configured with two SIM cards. The two SIM cards (for example, the primary SIM card and the secondary SIM card) may correspond to different operators. The terminal 100 may access the cellular network through the base station 200A of operator A corresponding to the primary SIM card, or may also access the cellular network through the base station 200B of operator B corresponding to the secondary SIM card. There are differences in network deployment between different operators at the same location. For example, at the current location of the terminal 100, the signal coverage of the base station 200A of operator A is poor, but the signal coverage of the base station 200B of operator B is good. The terminal 100 with multiple SIM cards provided in this application has a usage mode of multi-card multi-standby multi-connection or multi-card multi-standby single-connection, that is, multiple SIM cards of the terminal 100 can standby simultaneously.

[0072] It should be noted that in the embodiments of this application, the terminal 100 may not be configured with a SIM card, or may be configured with only one SIM card, or may be configured with two SIM cards. In addition, the terminal 100 may establish a WiFi connection with at most one access point 300, or may establish a WiFi connection with at most N (for example, N is 2) access points 300. The embodiments of this application do not make specific limitations.

[0073] In the embodiments of this application, when the terminal 100 is configured with a SIM card, the available signal sources for the data services of the terminal 100 may include the base station currently corresponding to the configured SIM card. When the terminal 100 establishes a WiFi connection with the access point 300, the available signal sources for the data services of the terminal 100 may include the above access point 300. In some embodiments, the terminal 100 is not currently establishing a WiFi connection with an access point 300, but the terminal 100 has established a WiFi connection with the above access point 300 before, or the above access point 300 can be accessed without a password, then this access point 300 may also be used as an available signal source for the data services of the terminal 100.

[0074] In an embodiment of the present application, when the terminal 100 has at least two available signal sources for data services, and the signal of the first signal source of the current data service of the terminal 100 is poor while the signals of other signal sources (such as the second signal source) are good, the signal source of the data service can be switched to the second signal source.

[0075] The base station 200 involved in the embodiments of the present application includes but is not limited to: evolved Node B (eNB), radio network controller (RNC), Node B (NB), base station controller (BSC), base transceiver station (BTS), home base station (e.g., home evolved NodeB, or home Node B, HNB), baseband unit (BBU), next Generation Node B (gNB) in a 5G NR network, transmission point (TRP or TP), or a network node constituting the gNB or the transmission point, such as a baseband unit (BBU), or a distributed unit (DU), etc. The embodiments of the present application do not limit the specific radio access technology and specific device form adopted by the base station 200.

[0076] The terminal 100 involved in the embodiments of the present application can be a terminal equipped with iOS, Android, Microsoft or other operating systems. The terminal 100 can also be referred to as a user equipment (UE), access terminal, user unit, user station, mobile station, mobile unit, remote station, remote terminal, mobile device, user terminal, terminal device, wireless communication device, user agent or user device. Exemplarily, the terminal 100 can be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, a netbook, as well as a drone, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, a vehicle-mounted device, etc. The embodiments of the present application do not impose special restrictions on the specific type of the terminal 100.

[0077] It should be understood, Figure 1It is only a schematic diagram of the system structure of the communication system provided by the embodiments of the present application. Other devices may also be included in this communication system. For example, a wireless relay device and a wireless backhaul device may also be included ( Figure 1 not shown herein), which is not limited herein.

[0078] It can be understood that during the process of the terminal 100 moving with the user, at the location where the terminal 100 is located, the signal quality of each base station and each access point also changes accordingly. The terminal 100 can switch the signal source based on the signal changes of each base station and each access point received, so as to ensure that no matter where the geographical location of the terminal 100 is, a suitable signal source can be selected to provide data services for the user.

[0079] Embodiments of the present application provide a signal source switching method 1. In the proposed method, the terminal 100 is configured with two SIM cards (i.e., the main SIM card and the secondary SIM card); the terminal 100 monitors the signal status corresponding to the main SIM card for data services in real time; at each new location (such as location 1), the terminal records the current location information and the signal status of the signal source corresponding to the main SIM card. For example, the signal status 1 at location 1, and the signal status 1 is the historical signal status at location 1; when the terminal 100 arrives at location 1 again, when the terminal 100 determines that the signal source corresponding to the main SIM card is in a weak signal state based on the current signal status and / or historical signal status of the signal source corresponding to the main SIM card, it detects the signal status of the signal source corresponding to the secondary SIM card; if the signal source corresponding to the secondary SIM card is in a strong signal state, the signal source for data services is switched to the signal source corresponding to the secondary SIM card. However, in this solution, after detecting that the signal source corresponding to the main SIM card is in a weak signal state, and then determining whether to trigger the switching of the signal source for data services, it will cause the data service to be stuck or unavailable before the data service is switched to the signal source corresponding to the secondary SIM card.

[0080] Embodiments of the present application also provide a signal source switching method. In the proposed method, a fence database can be obtained through fence learning. The fence database includes multiple fence records, and each fence record includes the location fingerprint of the weak signal area near the first signal source, and the time duration required to reach the weak signal area of the first signal source from the location indicated by the location fingerprint; the terminal 100 can determine whether to switch the signal source by fingerprint matching of the location fingerprints in the above fence records, and then predict the signal source switching time based on the time duration in the fence records, so as to switch the signal source in time before the terminal 100 enters the weak signal area of the first signal source, and avoid the data service of the terminal 100 from being stuck or unavailable. Implementing the embodiments of the present application ensures the accuracy and timeliness of signal source switching, and thus effectively improves the user experience.

[0081] Among them, the location fingerprint associates the location in the actual environment with a certain "fingerprint". One location corresponds to a unique location fingerprint, and the location fingerprint can be one-dimensional or multi-dimensional. The location fingerprint can be of various types, and any "location-unique" (helpful for differentiating locations) feature can be used as a location fingerprint.

[0082] In the traditional fingerprint matching and positioning technology based on location fingerprints, manual survey is the basis and prerequisite for positioning. The traditional manual survey method is to pre-mark reference points in the indoor positioning area, and the survey personnel carry professional equipment to the site to carry out professional location measurement and environmental data collection work, so as to obtain the fingerprints of each reference point and build a fingerprint database. When the user uses the terminal 100, the terminal 100 can collect the location fingerprint of the current location, and then match the location fingerprint collected by the terminal 100 with the location fingerprints in the fingerprint database through the terminal 100 or a third-party device (such as a server). The location of the reference point corresponding to the most matching location fingerprint in the fingerprint database can be predicted as the current location of the terminal 100.

[0083] The following describes how to obtain the fence database through fence learning.

[0084] Exemplarily, Figure 2 shows a flowchart of fence learning. As Figure 2 shown, the process of fence learning may include but is not limited to steps S101 to S105. The following specifically describes steps S101 to S105.

[0085] S101. The terminal 100 realizes data services through the first signal source.

[0086] Specifically, the first signal source can cache and transmit data services directed to the terminal 100, and can also receive and cache data services from the terminal 100.

[0087] In some embodiments, the terminal 100 is configured with a primary SIM card. The first signal source can be the base station 200A that establishes a Radio Resource Control (RRC) connection with the terminal 100 through the primary SIM card, and the terminal 100 accesses the cellular network through the base station 200A.

[0088] In some embodiments, the terminal 100 is configured with a primary SIM card and a secondary SIM card, and the primary SIM card and the secondary SIM card correspond to different operators. The first signal source can be the base station 200A that establishes an RRC connection with the terminal 100 through the primary SIM card, or can be the base station 200B that establishes an RRC connection with the terminal 100 through the secondary SIM card, and the terminal 100 can access the cellular network through the base station 200A and the base station 200B respectively.

[0089] In some embodiments, the terminal 100 has established a WiFi connection with the access point 300A. The first signal source can also be the access point 300A, and the terminal 100 accesses the WLAN through the access point 300A.

[0090] S102. The terminal 100 collects the location fingerprint of the current location.

[0091] In some embodiments, the location fingerprint may include one or more of the following: WiFi information, cellular information, geomagnetic information, GPS information, sensor information, etc. Among them, the WiFi information may include one or more of the following: the Media Access Control (MAC) address of each WiFi access point 300 (such as the access point 300A) scanned by the terminal 100, and the received signal strength indication (RSSI) of the WiFi signal of the access point. The cellular information may include one or more of the following: the reference signal receiving power (RSRP) of the reference signal of the base station 200 (such as the base station 200A and / or the base station 200B) received, the SINR of the signal of the base station 200 received, the multipath structure of the signal of the base station 200 received, the round-trip time of the signal between the terminal and the base station 200, the time delay of the signal between the terminal and the base station 200, and the cell identifier (such as CellID) corresponding to the base station 200. The geomagnetic information may include the geomagnetic intensity, and the geomagnetic intensity may be the geomagnetic intensity modulus or the three-axis geomagnetic intensity. The sensor information may include one or more of the following: data collected by a gyroscope sensor, data collected by a gravity sensor, data collected by a direction sensor, etc.

[0092] In some embodiments, after the terminal 100 is powered on, it continuously and periodically collects the location fingerprint of the current location. In some embodiments, in response to the detected preset trigger condition, the terminal 100 collects the location fingerprint of the current location once. In some embodiments, in response to the detected preset trigger condition, the terminal 100 starts to periodically detect the location fingerprint of the current location. In some embodiments, after the terminal 100 is powered on, it periodically detects the location fingerprint of the current location; when the terminal 100 detects the preset trigger condition, it event-triggeringly causes the terminal 100 to collect the location fingerprint of the current location once, and then the terminal 100 continues to periodically collect the location fingerprint of the current location starting from the most recent collection time.

[0093] In the embodiments of the present application, the above preset trigger condition is used to indicate that there is a large change in the wireless signal covered by the environment where the terminal 100 is currently located. In some embodiments, the preset trigger condition is that the change value of at least one preset parameter in the location fingerprint is greater than a preset value.

[0094] In some embodiments, before the preset trigger condition is detected, the terminal 100 has established a WiFi connection with the access point 300A. The preset trigger condition includes one or more of the following: the attenuation value of the RRSI of the signal of the access point 300A received by the terminal 100 within a preset time (for example, 1 s) is greater than a preset value 1; the RRSI of the signal of the access point 300A received by the terminal 100 is less than a preset value 2; when a preset application of the terminal 100 is running in the foreground, the RRSI of the signal of the access point 300A received by the terminal 100 is less than a preset value 2; the attenuation value of the average value of the RSSI of all WiFi signals scanned by the terminal 100 within a preset time (for example, 1 s) is greater than a preset value 1; the average value of the RSSI of all WiFi signals scanned by the terminal 100 is less than a preset value 2. Wherein, the above preset application is an application that needs to perform data services. In some embodiments, when the first signal source of the terminal 100 is the access point 300A, the preset trigger condition may include one or more of the above.

[0095] In some embodiments, the terminal 100 is configured with a SIM card (taking the primary SIM card as an example), and the terminal 100 has currently established an RRC connection with the base station 200A through the primary SIM card. The preset trigger condition includes one or more of the following: the attenuation value of the RSRP of the reference signal of the base station 200A received by the terminal 100 within a preset time (for example, 1 s) is greater than a preset value 3; the RSRP of the reference signal of the base station 200A received by the terminal 100 is less than a preset value 4; the attenuation value of the SINR of the signal of the base station 200A received by the terminal 100 within a preset time (for example, 1 s) is greater than a preset value 5; the SINR of the signal of the base station 200A received by the terminal 100 is less than a preset value 6. In some embodiments, when the first signal source of the terminal 100 is the base station 200A, the preset trigger condition may include one or more of the above.

[0096] S103. The terminal 100 periodically detects the signal status of the first signal source and the signal status of the second signal source; when the signal status of the first signal source is a weak signal and the signal status of the second signal source is a strong signal, record the current time point as the start time of the weak signal area of the first signal source.

[0097] It can be understood that when it is detected that the signal status of the first signal source is a weak signal and the signal status of the second signal source is a strong signal, the current position of the terminal 100 is located at the edge of the weak signal area of the first signal source.

[0098] In some embodiments, the terminal 100 performs step S103 only in response to the detected foregoing preset trigger condition.

[0099] In the embodiments of the present application, there are the following seven situations for the first signal source and the second signal source of the terminal 100.

[0100] Situation 1: The first signal source is the base station 200A corresponding to the main SIM card, and the second signal source is the base station 200B corresponding to the secondary SIM card.

[0101] Situation 2: The first signal source is the base station 200B corresponding to the secondary SIM card, and the second signal source is the base station 200A corresponding to the main SIM card.

[0102] Situation 3: The first signal source is the base station 200A corresponding to the main SIM card, and the second signal source is the WiFi access point 300A.

[0103] Situation 4: The first signal source is the base station 200B corresponding to the secondary SIM card, and the second signal source is the WiFi access point 300A.

[0104] Situation 5: The first signal source is the WiFi access point 300A, and the second signal source is the base station 200A corresponding to the main SIM card.

[0105] Situation 6: The first signal source is the WiFi access point 300A, and the second signal source is the base station 200A corresponding to the secondary SIM card.

[0106] Situation 7: The first signal source is the WiFi access point 300A, and the second signal source is the WiFi access point 300B.

[0107] It should be noted that the access point 300B is an available signal source of the terminal 100, and the terminal 100 is currently in a WiFi connected state or a non-connected state with the access point 300B, which is not specifically limited here. It can be understood that when the terminal 100 is currently in a non-WiFi connected state with the access point 300B, the terminal 100 can also obtain the signal parameters of the access point 300B through active scanning or passive scanning, and then determine the signal state of the access point 300B.

[0108] The embodiments of the present application can perform fence learning for a specific one or several of the above 7 situations. It can be understood that when the terminal 100 is configured with two SIM cards, the terminal 100 can perform fence learning for the above Situation 1 and Situation 2. When the terminal 100 can establish a WiFi connection with the WiFi access point 300A, the terminal 100 can perform fence learning for the above Situation 5, Situation 6, and Situation 7. When the terminal 100 can establish a WiFi connection with both the WiFi access point 300A and the WiFi access point 300B, the terminal 100 can perform fence learning for the above Situation 7.

[0109] In some embodiments, the first signal source is the base station corresponding to the SIM card, such as the base station 200A corresponding to the primary SIM card. The terminal 100 can comprehensively determine whether the signal state of the first signal source is a weak signal or a strong signal based on one or more of the signal parameters such as the RSRP, SINR, uplink cache duration, uplink transmission power, and whether the preset application is stuck of the base station 200A. Among them, the above preset application is an application that is running and needs to execute data services. In one implementation, when the signal parameters of the base station 200A satisfy the decision condition 1, it is determined that the signal state of the first signal source is a weak signal, otherwise it is determined that the signal state of the first signal source is a strong signal. The decision condition 1 may include one or more of the following: the RSRP of the reference signal of the base station 200A received is less than the preset value 7, the SINR of the signal of the base station 200A received is less than the preset value 8, the uplink cache duration for sending uplink data services to the base station 200A is greater than the preset value 9, the uplink transmission power for sending uplink data services to the base station 200A is less than the preset value 10, and the running preset application is stuck.

[0110] In some embodiments, the second signal source is the base station corresponding to the SIM card, such as the base station 200B corresponding to the secondary SIM card. The terminal 100 can comprehensively determine whether the signal state of the second signal source is a weak signal or a strong signal based on one or more of the signal parameters such as the RSRP and SINR of the base station 200B. In one implementation, when the signal parameters of the base station 200B satisfy the decision condition 2, it is determined that the signal state of the second signal source is a weak signal, otherwise it is determined that the signal state of the first signal source is a strong signal. The decision condition 2 may include one or more of the following: the RSRP of the reference signal of the base station 200B received is less than the preset value 11, the SINR of the signal of the base station 200B received is less than the preset value 12.

[0111] In some embodiments, the first signal source (or the second signal source) is a WiFi access point, such as access point 300A. The terminal 100 can comprehensively determine whether the signal state of the first signal source (or the second signal source) is a weak signal or a strong signal based on one or more of the signal parameters such as RSSI and SINR of the WiFi signal from access point 300A. In one implementation, taking the first signal source as an example, when the signal parameters of the above access point 300A meet determination condition 3, it is determined that the signal state of the first signal source is a weak signal; otherwise, it is determined that the signal state of the first signal source is a strong signal. Determination condition 3 includes one or more of the following: the RSSI of the signal of access point 300A received is less than a preset value 13, and the SINR of the signal of access point 300A received is less than a preset value 14.

[0112] Not limited to the determination method of the signal state of the first signal source and the second signal source provided in the above embodiments, the embodiments of the present application can also be determined by other determination methods, which are not specifically limited here.

[0113] In the embodiments of the present application, during the fence learning process, the terminal 100 can switch the signal source according to other signal source switching schemes (such as signal source switching method 1 provided in the embodiments of the present application). In step S103, when it is detected that the signal state of the first signal source is a weak signal and the signal state of the second signal source is a strong signal, the terminal 100 can switch the signal source of the data service to the second signal source.

[0114] S104. When it is detected that the continuous duration of the terminal 100 in the weak signal area of the first signal source reaches a preset threshold, it is determined that the above weak signal area is a valid weak signal area, and an initial fence record 1 is generated and recorded in the database 1; where the initial fence record 1 includes the position fingerprint 1 collected by the terminal 100 and the elapsed time 1. The position fingerprint 1 is the position fingerprint collected by the terminal 100 before the start time of the weak signal area, and the elapsed time 1 is the time difference between the collection time of the position fingerprint 1 and the start time of the weak signal area.

[0115] In the embodiments of the present application, the initial fence record 1 can also be referred to as the first initial fence record, the elapsed time 1 can also be referred to as the second elapsed time, and the position fingerprint 1 can also be referred to as the third position fingerprint.

[0116] It can be understood that if it continues to be detected that the signal state of the first signal source is a weak signal and the signal state of the second signal source is a strong signal, it can be determined that the current position is still within the weak signal area of the first signal source.

[0117] In some embodiments, in step S102, the terminal 100 collects location fingerprints in response to a detected preset trigger condition. Location fingerprint 1 is the location fingerprint first collected by the terminal 100 after detecting the preset trigger condition. In some embodiments, location fingerprint 1 is the location fingerprint most recently collected by the terminal 100 before the start time of the weak signal area.

[0118] In some embodiments, before step S104, the following is further included: The terminal 100 obtains the physical location where the terminal 100 is located at the start time of the weak signal area. The initial fence record 1 further includes the above physical location. In one implementation manner, the physical location can also be recorded in location fingerprint 1 of the initial fence record 1.

[0119] The embodiments of the present application do not specifically limit the manner of obtaining the current physical location of the terminal 100, nor do they specifically limit the accuracy of the above physical location. The above physical location can be the precise positioning of the terminal 100 currently, or the approximate positioning of the terminal 100. In one implementation manner, after confirming the start time of the weak signal area, the terminal 100 matches the most recently collected location fingerprint 2 with the existing location fingerprint database, and the location corresponding to the location fingerprint in the location fingerprint database that matches location fingerprint 2 is the physical location of the terminal 100. It can be understood that the location corresponding to the location fingerprint in the location fingerprint database is a known precise positioning. In one implementation manner, after confirming the start time of the weak signal area, the physical location of the terminal 100 is obtained through GPS positioning, that is, the current longitude and latitude of the terminal 100. In one implementation manner, the terminal 100 is configured with a SIM card, and the cell ID corresponding to the base station that currently establishes an RRC connection with the terminal 100 is obtained, and the physical location of the terminal 100 is represented by this cell ID.

[0120] S105. The terminal 100 clusters the initial fence records in the database 1 based on the location fingerprints in the initial fence record to generate a clustered fence database.

[0121] Among them, a fence record in the fence database (such as fence record 2) is formed by fusing one or more initial fence records in database 1. The location fingerprint in fence record 2 is determined based on the location fingerprints in the above one or more initial fence records, and the elapsed time recorded in fence record 2 is determined by the elapsed times in the above one or more initial fence records. Optionally, the signal parameter 1 in the location fingerprint of fence record 2 is: the average value (or weighted average value) of the signal parameter 1 in the location fingerprints of the above one or more initial fence records; the elapsed time recorded in fence record 2 is the average value (or weighted average value) of the elapsed times in the above one or more initial fence records. Optionally, fence record 2 also records the standard deviation of the elapsed times in the above one or more initial fence records, and this standard deviation is used to predict the signal source switching time during the subsequent signal source switching process.

[0122] It should be noted that by clustering multiple initial fence records, the fence of the weak signal area of the above first signal source is generated (i.e., the fence record after clustering), which improves the accuracy of the location fingerprint and the elapsed time in the fence record, and further improves the accuracy of fingerprint matching and the timeliness of signal source switching during the subsequent signal source switching process.

[0123] In some embodiments, the location fingerprint includes WiFi information, and the WiFi information includes the MAC address of each WiFi access point 300 scanned by the terminal 100 and the RSSI of the WiFi signal received from this access point 300. The above terminal 100 clusters the initial fence records in the database based on the location fingerprints in the initial fence records. Specifically, it may include: when the proportion of the MAC addresses that meet clustering condition 1 in the location fingerprints of every two initial fence records (such as initial fence record 1 and initial fence record 2) in the MAC addresses recorded in the location fingerprints of initial fence record 1 and / or initial fence record 2 is greater than the proportion threshold, it is determined that the location fingerprints of the above two initial fence records are similar; all the initial fence records with similar location fingerprints in database 1 are clustered into one fence record. The above clustering condition 1 may include that the MAC addresses are the same and the matching degree of the two WiFi signals corresponding to this MAC address is greater than the matching threshold. Among them, the proportion threshold and the matching threshold are determined according to the actual application environment and are not specifically limited here.

[0124] Exemplarily, the location fingerprints of both initial fence record 1 and initial fence record 2 record MAC address 1, the RSSI of the WiFi signal corresponding to MAC address 1 recorded in the location fingerprint of initial fence record 1 is RSSI 1, and the RSSI of the WiFi signal corresponding to MAC address 1 recorded in the location fingerprint of initial fence record 2 is RSSI 2. In one implementation, the matching degree of the signal parameters of the two WiFi signals corresponding to the above MAC addresses is greater than the matching threshold, which may specifically include: in the location fingerprints of the above two initial fence records, the difference between RSSI 1 and RSSI 2 corresponding to MAC address 1 is greater than the matching threshold; or, the ratio of difference 1 to sum 1 is greater than the matching threshold, and sum 1 is the sum of RSSI 1 and RSSI 2 corresponding to MAC address 1.

[0125] In some embodiments, the location fingerprint in the initial fence record includes the above-mentioned WiFi information. The above-mentioned terminal 100 clusters the initial fence records in the database based on the location fingerprint in the initial fence record, which may specifically include: sorting the RSSI of each WiFi access point contained in the location fingerprint of each initial fence record, selecting the MAC addresses of the first w WiFi access points with the largest RSSI as the MAC feature set of this initial fence record; when the location fingerprints of every two initial fences contain the same MAC feature set, determining that the location fingerprints of the above two initial fence records are similar; clustering all initial fence records with similar location fingerprints in database 1 into one fence record. Among them, the value of w can be determined according to actual conditions and is not specifically limited here.

[0126] Exemplarily, the value of w is 2, and the MAC feature sets of the initial fence record 1 and the initial fence record 2 are both the sets of MAC address 1 and MAC address 2.

[0127] In some embodiments, the location fingerprint includes the above-mentioned WiFi information. The above-mentioned terminal 100 clusters the initial fence records in the database based on the location fingerprint in the initial fence record, which may specifically include: sorting the RSSI of each WiFi access point contained in the location fingerprint of each initial fence record, selecting the MAC address of the WiFi access point with the largest RSSI of the first w as the MAC feature set of this initial fence record; when the location fingerprints of every two initial fence records contain the same MAC feature set, and the matching degree of the WiFi signal corresponding to each MAC address in the MAC feature set is greater than the matching threshold, it is determined that the location fingerprints of the above-mentioned two initial fence records are similar; clustering all initial fence records with similar location fingerprints in database 1 into one fence record.

[0128] In some embodiments, the clustered fence records include the above MAC feature set, which can be used as an index for clustering, so that fingerprint matching during subsequent signal source switching can quickly locate the fence records with the same MAC feature set, without having to perform fingerprint matching on all fence records in the fence database.

[0129] In some embodiments, the initial fence record further includes the physical location of the terminal 100. In step S105, the terminal 100 clusters the initial fence records in the database based on the location fingerprint and the physical location in the initial fence record. In one implementation, based on the location fingerprint in the initial fence record, the initial fence records with the same physical location in the database are clustered. Specifically, reference may be made to the clustering method described in the foregoing embodiments, which will not be elaborated here.

[0130] In some embodiments, fence learning is performed for at least two of the above seven cases of the signal source. The fence database includes fence records for at least two of the above cases. The initial fence record may further include the identifier of the initial signal source (i.e., the first signal source) and / or the identifier of the target signal source (i.e., the second signal source). Herein, the initial signal source is the signal source before the terminal 100 switches the signal source, and the target signal source is the signal source after the terminal 100 switches the signal source. The identifier of the initial signal source can be used during the usage stage of the fence database (i.e., during subsequent signal source switching), so that the terminal 100 can quickly locate the fence records where the initial signal sources are all the first signal source, and then can predict the signal source switching time based on the fence records where the initial signal sources are all the first signal source. The identifier of the second signal source is used to assist the terminal 100 in determining the target signal source after the signal source is switched during the usage stage of the fence database. It can be understood that in some usage environments, the terminal 100 has at least three available signal sources, and there are at least two available signal sources that can be switched during signal source switching.

[0131] In one implementation, the identifier of the initial signal source and the identifier of the target signal source can also be recorded in the location fingerprint of the initial fence record. In one implementation, when the signal source is a base station, the identifier of the signal source can be the Cell ID corresponding to the base station; when the signal source is an access point, the identifier of the signal source can be the MAC address of the access point.

[0132] In some embodiments, the initial fence record further includes the identification of the initial signal source and / or the identification of the target signal source. In step S105, the terminal 100 clusters the initial fence records in the database based on the location fingerprint, the identification of the first signal source, and / or the identification of the second signal source in the initial fence record. In one implementation, based on the location fingerprint in the initial fence record, the initial fence records in the database with the same identification of the first signal source and / or the second signal source are clustered. Specifically, reference may be made to the clustering method described in the foregoing embodiments, which will not be elaborated herein.

[0133] Not limited to the clustering method provided in the foregoing embodiments, the embodiments of the present application may also cluster the initial fence records by other clustering methods.

[0134] In some embodiments, the fence database provided by the embodiments of the present application may be a fence database in a specific scenario. Taking the elevator scenario as an example, S106 may further be included before step S104.

[0135] S106. After detecting the start time of the weak signal area, the terminal 100 identifies whether the user enters the elevator; if it is identified that the user enters the elevator within the preset duration 1, the location fingerprint 1 and the time-consuming duration 1 collected by the terminal 100 are recorded, and step S104 is executed.

[0136] In some embodiments, when the foregoing preset trigger condition is detected, the terminal 100 executes steps S102 and S103, that is, collects the location fingerprint of the current position, and periodically detects the signal status of the first signal source and the signal status of the second signal source. If it is not identified that the user enters the elevator within the preset duration 1, the terminal 100 stops collecting the location fingerprint of the current position, and stops periodically detecting the signal status of the first signal source and the signal status of the second signal source.

[0137] It can be understood that only when it is identified that the user enters the elevator, the terminal 100 will generate an initial fence record based on the location fingerprint 1 and the time-consuming duration 1 of the terminal 100.

[0138] In the embodiments of the present application, the terminal 100 can identify the behaviors of the terminal 100 entering and exiting the elevator. When it is identified that the terminal 100 has the behavior of entering the elevator, it is determined that the user enters the elevator. In some embodiments, the walking state can be identified by an accelerometer; the weightlessness and overweight states in the elevator can be identified by means of detecting acceleration and deceleration through an acceleration sensor and detecting air pressure change through a barometric pressure sensor; by comparing the walking state with the overweight (or weightlessness) state, the terminal 100 can identify the behaviors of entering and exiting the elevator. The embodiments of the present application do not make specific limitations on the identification method of whether to enter the elevator.

[0139] It should be noted that in the embodiments of the present application, the fence database can be generated by the terminal 100 based on the user's daily usage environment after the user uses the terminal 100, and the fence database is associated with the actual environment of the user. It can be understood that in the initial stage of the user using the terminal 100, the initial fence records are recorded and fence learning is performed to obtain the fence database. After obtaining the fence database, the terminal 100 can predict the switching time of the signal source based on the fence database.

[0140] In some embodiments, after obtaining the fence database, the terminal 100 can continue to execute steps S101 to S105 to continue updating the fence database based on the most recent usage environment of the terminal 100. In this way, the fence database can adapt to the actual usage environment of the user and ensure the accuracy and timeliness of signal source switching.

[0141] In some embodiments, after the terminal 100 obtains the fence database, it can share the fence database to a server (such as a cloud server) so that other users can also obtain and use the above fence database. In this way, the fence records shared by a large number of users to the server constitute a fence database with a larger data volume. When a user uses a new terminal, the terminal can obtain the fence database from the server without generating the fence database by itself.

[0142] In another implementation manner, the fence database can also be uniformly obtained by specific service providers sending personnel to carry specific devices (such as the terminal 100) for manual survey in the early stage. The specific service providers can upload the fence database to a server (such as a cloud server). All users who register for the signal source switching service of the above service providers can obtain the above fence database and predict the switching time of the signal source based on the fence database.

[0143] It should be noted that each fence record has a location characteristic. In view of the large number of fence records in the fence database stored in the server, the server can classify the fence records in the fence database according to the physical location and / or the identifier of the initial signal source in the fence records. When the terminal performs signal source switching based on the fence database, the terminal 100 can request the server to obtain the fence records corresponding to the current physical location and / or the identifier of the current signal source. In this way, the terminal can obtain fence records with similar locations for signal source switching, greatly reducing the subsequent computational workload of signal source switching.

[0144] Taking the terminal 100 as a mobile phone as an example below, an exemplary description of fence learning in an elevator scenario is given. Exemplarily, Figure 3 The fence learning process in the elevator scenario is shown.

[0145] See Figure 3, the initial location of the user's mobile phone is at home. WiFi access points are set up in both the user's and neighbor's homes. The user's mobile phone is connected to the home WiFi access point. The user's mobile phone is configured with a main SIM card and a secondary SIM card, and the mobile phone has established RRC connections with the base stations corresponding to the two SIM cards respectively. (S101) The mobile phone realizes data services through the base station 200A corresponding to the main SIM card at home. The user carries the mobile phone and leaves home, walks towards the elevator in the corridor. (S102) When the mobile phone detects that the RSSI attenuation of the connected WiFi signal is greater than the preset value, it collects the location fingerprint 1 of the current location and records the current collection time; the location fingerprint 1 includes the MAC addresses of the WiFi access points set up in the user's and neighbor's homes and the corresponding RSSI of the WiFi signals. When the user carries the mobile phone to the elevator entrance, (S103) based on the signal status of the base stations corresponding to the main SIM card and the secondary SIM card, the mobile phone detects the start time of the weak signal area of the base station 200A corresponding to the main SIM card. After the user carries the mobile phone into the elevator entrance, (S106) the mobile phone recognizes that the user has entered the elevator, records the location fingerprint 1 and the time duration 1, and the time duration 1 is the time difference between the collection time of the location fingerprint 1 and the start time of the above weak signal area. After the user carries the mobile phone and takes the elevator to the basement, (S104) when the mobile phone detects that the duration of the weak signal area of the main SIM card reaches the preset threshold, the mobile phone generates an initial fence record based on the location fingerprint 1 and the time duration 1. After the number of initial fence records obtained by the mobile phone reaches the preset quantity, (S105) the mobile phone clusters the obtained initial fence records to obtain a clustered fence database, realizing the fence learning of the above weak signal area. Specifically, reference can be made to Figure 2 the relevant embodiments, which will not be elaborated here.

[0146] The signal source switching method provided by the embodiments of the present application will be introduced in detail below.

[0147] Exemplarily, Figure 4 shows a flowchart of the signal source switching method. As Figure 4 shown, the signal source switching method may include but is not limited to steps S201 to S205. The following specifically describes steps S201 to S205.

[0148] S201. The terminal 100 obtains first fence data. The first fence data includes at least one fence record in the fence database. The first fence record includes a first location fingerprint and a first time duration. The first location fingerprint is the location fingerprint of the first weak signal area near the signal source. The first time duration is used to indicate the required time from the location indicated by the first location fingerprint to the first weak signal area of the first signal source. The first fence record is one of the at least one fence record.

[0149] In some embodiments, the first fence data includes all fence records in the fence database.

[0150] In some embodiments, the fence record includes a physical location. The specific process for the terminal 100 to obtain the first fence data includes: the terminal 100 obtains the current first physical location; the terminal 100 obtains the first fence data in the fence database, and the first fence data includes all fence records in the fence database where the physical location is the first physical location.

[0151] In some embodiments, the fence record includes the identifier of the initial signal source. The initial signal source of the terminal 100 (i.e., the signal source of the current data service) is the first signal source. The first fence data includes all fence records in the fence database where the identifier of the initial signal source is the identifier of the first signal source.

[0152] In the embodiments of the present application, the first fence data may also be obtained by the terminal 100 from a server (such as a cloud server), and the server stores the fence database.

[0153] In some embodiments, the fence record includes a physical location. The terminal 100 obtains the first fence data, and the specific process includes: the terminal 100 obtains the current first physical location; the terminal 100 sends a fetch request to the server, and the fetch request carries the current first physical location of the terminal; in response to the fetch request sent by the terminal, the server sends the first fence data to the terminal, and the first fence data includes all fence records in the fence database where the physical location is the first physical location.

[0154] In some embodiments, the fence record includes the initial signal source identifier. The initial signal source of the terminal 100 (i.e., the signal source of the current data service) is the first signal source. The terminal 100 obtains the first fence data, and the specific process includes: the terminal 100 sends a fetch request to the server, and the fetch request carries the identifier of the current first signal source of the terminal; in response to the fetch request sent by the terminal, the server sends the first fence data to the terminal, and the first fence data includes all fence records in the fence database where the identifier of the initial signal source is the identifier of the first signal source.

[0155] S202. The terminal 100 collects the location fingerprint of the current location; the signal source for the terminal 100 to perform the data service currently is the first signal source.

[0156] In the embodiments of the present application, the first signal source can receive, cache, and transmit data services directed to the terminal 100, and can also receive, cache, and transmit data services from the terminal 100. If the terminal 100 is configured with a SIM card, the first signal source can be the base station that currently establishes an RRC connection with the terminal 100 through the SIM card; if the terminal 100 establishes a WiFi connection with the access point 300A, the first signal source can also be the access point 300A. Specifically, the signal source of the data service can refer to the relevant embodiments of the foregoing step S101, which will not be elaborated here.

[0157] In the embodiments of the present application, the specific implementation manner of "collecting the location fingerprint of the current location" can refer to the optional embodiments of step S102, and the location fingerprint can also refer to the relevant description of step S102, which will not be elaborated here.

[0158] S203. The terminal 100 performs fingerprint matching on the collected second location fingerprint and the location fingerprint recorded in the first fence.

[0159] In some embodiments, in step S202, after the terminal 100 is powered on, it continuously and periodically collects the location fingerprint of the current location; in step S203, the terminal 100 performs fingerprint matching on each collected location fingerprint (such as the second location fingerprint) and the location fingerprint recorded in the first fence until the fingerprint matching is successful.

[0160] In some embodiments, in step S202, in response to the detected preset trigger condition, the terminal 100 collects the location fingerprint of the current location once; in step S203, the terminal 100 performs fingerprint matching on the location fingerprint collected this time (i.e., the second location fingerprint) and the location fingerprint recorded in the first fence.

[0161] In some embodiments, in step S202, in response to the detected preset trigger condition, the terminal 100 starts to periodically detect the location fingerprint of the current location; in step S203, the terminal 100 performs fingerprint matching on each collected location fingerprint (such as the second location fingerprint) and the location fingerprint recorded in the first fence until the fingerprint matching is successful.

[0162] In some embodiments, in step S202, after the terminal 100 is powered on, it periodically detects the location fingerprint of the current location; when the terminal 100 detects the preset trigger condition, it event-triggeringly causes the terminal 100 to collect the location fingerprint of the current location once, and then, the terminal 100 continues to periodically collect the location fingerprint of the current location starting from the most recent collection time. In step S203, after detecting the preset trigger condition, the terminal 100 performs fingerprint matching on each collected location fingerprint (such as the second location fingerprint) and the location fingerprint recorded in the first fence until the fingerprint matching is successful.

[0163] In the embodiments of the present application, the above preset trigger condition is used to indicate that there is a large change in the wireless signal covered by the environment where the terminal 100 is currently located. In some embodiments, the preset trigger condition is that the change value of at least one preset parameter in the location fingerprint is greater than a preset value. Specifically, the preset trigger condition can refer to the relevant description in step S102, which will not be elaborated here.

[0164] In the embodiments of the present application, the algorithm for fingerprint matching is not specifically limited. Commonly used fingerprint matching algorithms include algorithms such as nearest neighbor (NN), k nearest neighbor (KNN), weighted k nearest neighbor (WKNN), and neural network.

[0165] In some embodiments, the fence record further includes the identifier of the target signal source. The above terminal 100 performs fingerprint matching on the collected second location fingerprint and the location fingerprint of the first fence record, specifically including: determining that the identifier of the target signal source recorded in the first fence record is the identifier of the second signal source; if the available signal sources of the terminal 100 include the second signal source, the terminal 100 performs fingerprint matching on the collected second location fingerprint and the location fingerprint of the first fence record, otherwise, it returns to execute step S202.

[0166] In some embodiments, the first fence data is obtained by the terminal 100 from the server before step S203. The embodiments of the present application do not specifically limit the execution order of S201 and S202.

[0167] S204. When the second location fingerprint matches the location fingerprint of the first fence record successfully, start a timer, and the timing of the timer is the first switching duration, and the first switching duration is the difference between the first time-consuming duration of the first fence record and the first preset duration.

[0168] S205. When the timing of the timer ends, switch the signal source of the data service to the second signal source.

[0169] It can be understood that the terminal 100 switches the signal source in advance by the first preset duration before the end of the first time-consuming duration, so as to avoid data service jamming or unavailability caused by the first signal source entering the weak signal area before switching the signal source.

[0170] In the embodiments of the present application, the first preset duration can be set by the user or can be a default setting. For example, the first preset duration is 1 s. In some embodiments, the first fence record further includes a standard deviation, and the first preset duration is N times the standard deviation, where N is a positive integer, for example, N is 2. The standard deviation can refer to the relevant description in the foregoing embodiments, which will not be elaborated here.

[0171] In the embodiments of the present application, when generating the fence database, each fence record in the fence database may not record the time-consuming duration, but instead record the switching duration. For example, the switching duration recorded in the first fence record is the first switching duration. In step S104, the terminal 100 may directly obtain the first switching duration in the first fence record.

[0172] In some embodiments, the fence record further includes the identifier of the target signal source. The above-mentioned switching the signal source of the data service to the second signal source when the timer finishes timing specifically includes: determining that the identifier of the target signal source recorded in the first fence record is the identifier of the second signal source; if the available signal sources of the terminal 100 include the second signal source, then when the timer finishes timing, switching the signal source of the data service to the second signal source; otherwise, returning to execute step S202.

[0173] The following uses Figure 3 the elevator scenario shown as an example to give an exemplary description of the signal source switching in this scenario.

[0174] Exemplarily, (S201) the mobile phone obtains the fence database through the Figure 3 fence learning process shown. The first fence data includes all fence records in the fence database. As Figure 5 shown, the user's mobile phone is connected to the home WiFi access point. The user's mobile phone is configured with a main SIM card and a secondary SIM card. The mobile phone realizes the data service through the base station 200A corresponding to the main SIM card at home. The user starts from home again and enters the corridor and walks towards the elevator. (S202) The mobile phone detects that the RSSI attenuation of the connected WiFi signal is greater than the preset value, and the mobile phone starts to periodically collect the location fingerprint of the current position. (S203) And perform fingerprint matching on the collected location fingerprint and the location fingerprint of the fence record in the first fence data. (S204) When the collected location fingerprint matches the location fingerprint of the first fence record in the first fence data successfully, start a timer, and the timing duration of the timer is 1 second less than the first time-consuming duration in the first fence record. (S205) When the timer finishes timing, switch the signal source of the data service from the base station 200A corresponding to the main SIM card to the base station 200B corresponding to the secondary SIM card. Specifically, reference can be made to Figure 4 the relevant embodiments, which will not be elaborated here.

[0175] It should be noted that in the embodiments of the present application, the first SIM card may be the aforementioned main SIM card, the first network device corresponding to the first SIM card may be the aforementioned base station 200A, the second SIM card may be the aforementioned secondary SIM card, and the second network device corresponding to the second SIM card may be the aforementioned base station 200B; or, the first SIM card may be the aforementioned secondary SIM card, the first network device corresponding to the first SIM card may be the aforementioned base station 200B, the second SIM card may be the aforementioned main SIM card, and the second network device corresponding to the second SIM card may be the aforementioned base station 200A. The first access point may be the aforementioned access point 300A, and the second access point may be the aforementioned access point 300B; or, the first access point may be the aforementioned access point 300B, and the second access point may be the aforementioned access point 300A.

[0176] The following introduces the functional modules of the terminal 100 involved in the embodiments of the present application.

[0177] In the embodiments of the present application, the functional modules of the terminal 100 may be divided according to the above signal source switching method. For example, each function of the terminal 100 may be divided into respective functional modules, or two or more functions of the terminal 100 may be integrated into one processing module. The above integrated module may be implemented in the form of hardware or in the form of a software function module. It should be noted that the division of modules in the embodiments of the present application is illustrative, merely a logical function division, and there may be other division methods in actual implementation.

[0178] Exemplarily, Figure 6 shows a schematic structural diagram of the terminal 100 involved in the embodiments of the present application. As Figure 6 shown, the terminal 100 includes: an acquisition unit, a first acquisition unit, a matching unit, and a switching unit. Among them,

[0179] The acquisition unit is configured to acquire first fence data, where the first fence data includes at least one fence record, and the first fence record includes a first location fingerprint and a first duration. The first location fingerprint is used to represent a location near the first weak signal area of the first signal source, and the first duration is used to indicate the required duration from the location represented by the first location fingerprint to the first weak signal area. The first fence record is one of the at least one fence record;

[0180] The first acquisition unit is configured to acquire the location fingerprint of the current location;

[0181] The matching unit is configured to perform fingerprint matching on the acquired location fingerprint and the location fingerprint of the fence record in the first fence data, and the signal source for which the terminal currently performs data services is the first signal source;

[0182] A switching unit, when the second location fingerprint collected matches the first location fingerprint recorded in the first fence, at a moment of the first switching duration from the current moment, switches the signal source of the data service to the second signal source, where the first switching duration is the difference between the first duration consumed recorded in the first fence and the first preset duration.

[0183] In some embodiments, the above-mentioned obtaining unit specifically includes: a second collection unit, a detection unit, a recording unit, a generating unit, and a clustering unit. Among them,

[0184] The second collection unit is used to collect the location fingerprint of the current location; the detection unit is used to periodically detect the signal status of the first signal source and the signal status of the second signal source; the recording unit, when detecting that the signal status of the first signal source is a weak signal and the signal status of the second signal source is a strong signal, records the current time point as the start moment of the weak signal area of the first signal source; the generating unit, when detecting that the continuous duration of the terminal in the weak signal area of the first signal source reaches a preset threshold, generates a first initial fence record; where the first initial fence record includes the third location fingerprint collected by the second collection unit before the start moment of the above-mentioned weak signal area and the second duration consumed, and the second duration consumed is the time difference between the collection moment of the third location fingerprint and the start moment of the above-mentioned weak signal area; the clustering unit is used to cluster multiple initial fence records generated by the generating unit based on the location fingerprint, and one fence record in the first fence data is the clustering result of at least one of the multiple initial fence records, and the multiple initial fence records include the first initial fence record.

[0185] In some embodiments, the terminal further includes an uploading unit. After the obtaining unit obtains the first fence data, the uploading unit is used to upload the first fence data to the server, and other terminals can obtain the first fence data through the server.

[0186] In some embodiments, the fence record further includes a physical location, which is used to indicate the location where the terminal is located. The above-mentioned obtaining unit specifically includes: a sending unit, which is used to send a obtaining request to the server, and the obtaining request carries the first physical location where the terminal is currently located; a receiving unit, which is used to receive the first fence data sent by the server. The server stores a fence database including multiple fence records, and the first fence data includes the fence records in the fence database whose physical location is the first physical location.

[0187] In some embodiments, the terminal is configured with a first SIM card and a second SIM card. The first network device corresponding to the first SIM card is used for the terminal to access the first cellular network at the current location, and the second network device corresponding to the second SIM card is used for the terminal to access the second cellular network at the current location; the first signal source is the first network device, and the second signal source is the second network device.

[0188] In some embodiments, the terminal is configured with a first SIM card. The first network device corresponding to the first SIM card is used for the terminal to access the cellular network at the current location, and the first access point is used for the terminal to access the wireless local area network at the current location; the first signal source is the first network device, and the second signal source is the first access point; alternatively, the first signal source is the first access point, and the second signal source is the second network device.

[0189] In some embodiments, the first access point is used for the terminal to access a first wireless local area network at the current location, and the second access point is used for the terminal to access a second wireless local area network at the current location; the first signal source is the first access point, and the second signal source is the second access point; alternatively, the first signal source is the second access point, and the second signal source is the first access point.

[0190] In some embodiments, the above-mentioned first acquisition unit and / or second acquisition unit is specifically configured to: in response to a detected preset trigger condition, acquire the location fingerprint of the current location once; or, in response to a detected preset trigger condition, periodically acquire the location fingerprint of the current location; the preset trigger condition is that the change value of at least one preset parameter in the location fingerprint within a preset time is greater than a preset value.

[0191] In some embodiments, the above-mentioned detection unit is specifically configured to periodically detect the signal status of the first signal source and the signal status of the second signal source in response to a detected preset trigger condition.

[0192] In some embodiments, the third location fingerprint is the location fingerprint first acquired by the second acquisition unit after the preset trigger condition is detected.

[0193] In some embodiments, the third location fingerprint is the location fingerprint most recently acquired by the second acquisition unit before the start time of the above-mentioned weak signal area.

[0194] In some embodiments, the first fence record is the clustering result of at least one initial fence record among the above-mentioned multiple initial fence records. The first location fingerprint in the first fence record is determined based on the location fingerprints of each initial fence record among the above-mentioned at least one initial fence record; the first duration in the first fence record is the average value or weighted average value of the durations of each initial fence record among the above-mentioned at least one initial fence record.

[0195] In some embodiments, the first preset duration is N times the standard deviation of the durations of each initial fence record among the above-mentioned at least one initial fence record, where N is a positive integer.

[0196] In some embodiments, the above-mentioned clustering unit is specifically configured to cluster the initial fence records with similar location fingerprints among the above-mentioned multiple initial fence records into one fence record.

[0197] In some embodiments, the above-mentioned generating unit is specifically configured to generate a first initial fence record when it is detected that the duration of the terminal in the weak signal area of the first signal source reaches a preset threshold and the terminal enters a preset place after the start time of the weak signal area, and the preset place includes an elevator.

[0198] In some embodiments, the first signal source is a first network device, and the second signal source is a second network device; the above-mentioned detecting unit is specifically configured to periodically comprehensively determine whether the signal state of the first signal source is a weak signal or a strong signal based on one or more of the signal parameters such as the RSRP of the reference signal received from the first network device, the SINR of the signal received from the first network device, the uplink cache duration of the uplink data service sent to the first network device, the uplink transmission power of the uplink data service sent to the first network device, and whether the running preset application is stuck; and comprehensively determine whether the signal state of the second signal source is a weak signal or a strong signal based on one or more of the signal parameters such as the RSRP of the reference signal received from the second network device and the SINR of the signal received from the second network device.

[0199] In some embodiments, the location fingerprint includes WiFi information, and the WiFi information includes the MAC address of each WiFi access point scanned by the terminal and the signal parameters of the WiFi signals of each WiFi access point; when the proportion of the MAC addresses that meet the clustering condition in the location fingerprints of the first initial fence record and the second initial fence record in the number of MAC addresses recorded in the location fingerprints of the first initial fence record and / or the second initial fence record is greater than the proportion threshold, it is determined that the location fingerprints of the first initial fence record and the second initial fence record are similar; the clustering condition is that both the first initial fence record and the second initial fence record include the first MAC address, and the matching degree of the signal parameters of the WiFi signals corresponding to the first MAC address in the first initial fence record and the second initial fence is greater than the matching threshold.

[0200] The structure of a terminal 100 provided by an embodiment of the present application will be introduced below.

[0201] Figure 7 An exemplary structure of a terminal 100 provided by an embodiment of the present application is shown.

[0202] As Figure 7 shown, the terminal 100 may include: one or more terminal device processors 101, a memory 102, a communication interface 103, a receiver 105, a transmitter 106, a coupler 107, an antenna 108, and a terminal device interface 109. These components may be connected through a bus 104 or other means, Figure 7 Taking the connection through the bus as an example. Among them:

[0203] The communication interface 103 can be used for the terminal 100 to communicate with other communication devices, such as a base station. Specifically, the base station can be Figure 8 the base station 200 shown. Specifically, the communication interface 103 can be a 5G communication interface or a communication interface of a future new air interface. Not limited to a wireless communication interface, the terminal 100 can also be configured with a wired communication interface 103, such as a local access network (LAN) interface. The transmitter 106 can be used to perform transmission processing on the signals output by the terminal device processor 101. The receiver 105 can be used to perform reception processing on the mobile communication signals received by the antenna 108.

[0204] In some embodiments of the present application, the transmitter 106 and the receiver 105 can be regarded as a wireless modem. In the terminal 100, the number of the transmitter 106 and the receiver 105 can each be one or more. The antenna 108 can be used to convert the electromagnetic energy in the transmission line into electromagnetic waves in free space, or convert the electromagnetic waves in free space into electromagnetic energy in the transmission line. The coupler 107 is used to divide the mobile communication signals received by the antenna 108 into multiple paths and distribute them to multiple receivers 105.

[0205] In addition to Figure 7 the transmitter 106 and the receiver 105 shown, the terminal 100 may further include other communication components, such as a GPS module, a Bluetooth module, a wireless fidelity (Wi-Fi) module, etc. Not limited to wireless communication, the terminal 100 can also be configured with a wired network interface (such as a LAN interface) to support wired communication.

[0206] The terminal 100 may further include an input / output module. The input / output module can be used to implement the interaction between the terminal 100 and other terminal devices / external environments, and may mainly include an audio input / output module, a key input module, and a display, etc. Specifically, the input / output module may further include: a camera, a touch screen, and sensors, etc. Among them, the input / output module communicates with the terminal device processor 101 through the terminal device interface 109.

[0207] The memory 102 is coupled to the terminal device processor 101 and is used to store various software programs and / or multiple sets of instructions. Specifically, the memory 102 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more disk storage devices, flash memory devices, or other non-volatile solid-state storage devices. The memory 102 may store an operating system (hereinafter referred to as the system), such as an embedded operating system like ANDROID, IOS, WINDOWS, or LINUX. The memory 102 may also store a network communication program, which can be used to communicate with one or more additional devices, one or more terminal devices, and one or more network devices.

[0208] In some embodiments of the present application, the memory 102 may be used to store the implementation program of the uplink synchronization method provided by one or more embodiments of the present application on the terminal 100 side. For the implementation of the uplink synchronization method provided by one or more embodiments of the present application, please refer to the above embodiments.

[0209] The terminal device processor 101 may be used to read and execute computer-readable instructions. Specifically, the terminal device processor 101 may be used to call the program stored in the memory 102, such as the implementation program of the uplink synchronization method provided by one or more embodiments of the present application on the terminal 100 side, and execute the instructions included in the program.

[0210] The sensors of the terminal 100 may include a gyroscope sensor, a gravity sensor, a direction sensor, an acceleration sensor, and a barometric pressure sensor. Among them,

[0211] The gyroscope sensor can be used to determine the motion posture of the terminal 100. In some embodiments, the angular velocity of the terminal 100 around three axes (i.e., the x, y, and z axes) can be determined by the gyroscope sensor. The gyroscope sensor can be used for anti-shake shooting. Exemplarily, when the shutter is pressed, the gyroscope sensor detects the shaking angle of the terminal 100, calculates the distance that the lens module needs to compensate according to the angle, and makes the lens offset the shaking of the terminal 100 through reverse movement to achieve anti-shake. The gyroscope sensor can also be used for navigation and somatosensory game scenarios.

[0212] The acceleration sensor can detect the magnitude of the acceleration of the terminal 100 in various directions (generally three axes). When the terminal 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers. The gravity sensor can detect the magnitude and direction of gravity. The direction sensor can detect the moving direction of the terminal 100

[0213] The barometric pressure sensor is used to measure barometric pressure. In some embodiments, the terminal 100 calculates the altitude based on the barometric pressure value measured by the barometric pressure sensor to assist in positioning and navigation.

[0214] It should be noted that Figure 7 the terminal 100 shown is only one implementation manner of the embodiments of the present application. In practical applications, the terminal 100 may further include more or fewer components, which are not limited herein.

[0215] Next, a structure of a base station 200 provided by the embodiments of the present application will be introduced.

[0216] Figure 8 An exemplary structure of a base station 200 provided by the embodiments of the present application is shown.

[0217] As Figure 8 shown, the base station 200 may include: one or more base station processors 201, a memory 202, a communication interface 203, a receiver 205, a transmitter 206, a coupler 207, an antenna 208, and a base station interface 209. These components may be connected through a bus 204 or other means. Figure 8 Taking the connection through the bus as an example. Among them:

[0218] The communication interface 203 can be used for the base station 200 to communicate with other communication devices, such as terminal devices. Specifically, the terminal device can be Figure 7 the terminal 100 shown. Specifically, the communication interface 203 can be a 5G communication interface or a communication interface of a future new air interface. Not limited to a wireless communication interface, the base station 200 can also be configured with a wired communication interface 203, such as a local access network (LAN) interface. The transmitter 206 can be used to perform transmission processing on the signals output by the base station processor 201. The receiver 205 can be used to perform reception processing on the mobile communication signals received by the antenna 208.

[0219] In some embodiments of the present application, the transmitter 206 and the receiver 205 can be regarded as a wireless modem. In the base station 200, the number of the transmitter 206 and the receiver 205 can both be one or more. The antenna 208 can be used to convert the electromagnetic energy in the transmission line into electromagnetic waves in free space, or convert the electromagnetic waves in free space into electromagnetic energy in the transmission line. The coupler 207 is used to divide the mobile communication signals received by the antenna 208 into multiple paths and distribute them to multiple receivers 205.

[0220] The memory 202 is coupled to the base station processor 201 and is used to store various software programs and / or multiple sets of instructions. Specifically, the memory 202 may include high-speed random access memory, and may also include non-volatile memory, such as one or more disk storage devices, flash memory devices, or other non-volatile solid-state storage devices. The memory 202 can store a network communication program, which can be used to communicate with one or more additional devices, one or more terminal devices, and one or more network devices.

[0221] In some embodiments of the present application, the memory 202 can be used to store the implementation program of the uplink synchronization method provided by one or more embodiments of the present application on the base station 200 side. For the implementation of the uplink synchronization method provided by one or more embodiments of the present application, please refer to the above embodiments.

[0222] The base station processor 201 can be used to read and execute computer-readable instructions. Specifically, the base station processor 201 can be used to call the program stored in the memory 202, such as the implementation program of the uplink synchronization method provided by one or more embodiments of the present application on the base station 200 side, and execute the instructions included in the program.

[0223] It should be noted that Figure 8 The shown base station 200 is only one implementation manner of the embodiments of the present application. In practical applications, the base station 200 may further include more or fewer components, which are not limited herein.

[0224] The structure of the access point 300 can be the same as that of the base station 200. For the relevant content of the structure of the access point 300, reference can be made to Figure 8 the relevant text description of the structure of the shown base station 200, which will not be elaborated herein.

[0225] The various embodiments of the present application can be combined arbitrarily to achieve different technical effects.

[0226] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in this application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from a website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line) or wirelessly (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid-state disk (SSD)), etc.

[0227] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware with a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above method embodiments. The foregoing storage media include: various media such as ROM or random access memory RAM, magnetic disks, or optical discs that can store program codes.

[0228] In summary, the above are only embodiments of the technical solutions of the present invention and are not used to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made based on the disclosure of the present invention should be included within the protection scope of the present invention.

Claims

1. A signal source switching method, characterized in that, the method includes: The terminal obtains first fence data, the first fence data includes at least one fence record, the first fence record includes a first location fingerprint and a first time duration, the first location fingerprint is used to represent a location near the first weak signal area of the first signal source, and the first time duration is used to indicate the time required to reach the first weak signal area from the location represented by the first location fingerprint, and the first fence record is one of the at least one fence record; The terminal collects the location fingerprint of the current location, and performs fingerprint matching on the location fingerprint collected with the location fingerprints of the fence records in the first fence data. The signal source for which the terminal is currently performing data services is the first signal source; When the collected second location fingerprint matches the first location fingerprint of the first fence record successfully, at the moment of the first switching duration from the current moment, the terminal switches the signal source for data services to the second signal source, and the first switching duration is the difference between the first time duration of the first fence record and the first preset duration.

2. The method according to claim 1, characterized in that, the terminal obtaining the first fence data includes: The terminal collects the location fingerprint of the current location; The terminal periodically detects the signal state of the first signal source and the signal state of the second signal source; when it is detected that the signal state of the first signal source is a weak signal and the signal state of the second signal source is a strong signal, the current time point is recorded as the start time of the weak signal area of the first signal source; When it is detected that the continuous duration of the terminal in the weak signal area of the first signal source reaches a preset threshold, the terminal generates a first initial fence record; wherein, the first initial fence record includes a third location fingerprint collected by the terminal before the start time of the weak signal area and a second time duration, and the second time duration is the time difference between the collection time of the third location fingerprint and the start time of the weak signal area; The terminal clusters multiple initial fence records generated by the terminal based on the location fingerprint, and one fence record in the first fence data is the clustering result of at least one of the multiple initial fence records, and the multiple initial fence records include the first initial fence record.

3. The method according to claim 2, characterized in that, after the terminal obtains the first fence data, it further includes: Uploading the first fence data to the server, and other terminals can obtain the first fence data through the server.

4. The method according to claim 1, characterized in that, The fence record further includes a physical location, and the physical location is used to indicate the location where the terminal is located. The terminal obtaining the first fence data includes: The terminal sends a request for obtaining to the server, and the request for obtaining carries the first physical location where the terminal is currently located; The terminal receives first fence data sent by the server, where the server stores a fence database including multiple fence records, and the first fence data includes the fence record in the fence database with the physical location being the first physical location.

5. The method according to any one of claims 1 to 4, wherein, the terminal is configured with a first SIM card and a second SIM card. The first network device corresponding to the first SIM card is used for the terminal to access a first cellular network at the current location, and the second network device corresponding to the second SIM card is used for the terminal to access a second cellular network at the current location; the first signal source is the first network device, and the second signal source is the second network device.

6. The method according to any one of claims 1 to 4, wherein, the terminal is configured with a first SIM card. The first network device corresponding to the first SIM card is used for the terminal to access a cellular network at the current location, and a first access point is used for the terminal to access a wireless local area network at the current location; the first signal source is the first network device, and the second signal source is the first access point; or, the first signal source is the first access point, and the second signal source is a second network device.

7. The method according to any one of claims 1 to 4, wherein, a first access point is used for the terminal to access a first wireless local area network at the current location, and a second access point is used for the terminal to access a second wireless local area network at the current location; the first signal source is the first access point, and the second signal source is the second access point; or, the first signal source is the second access point, and the second signal source is the first access point.

8. The method according to claim 2, wherein, the terminal collects a location fingerprint of the current location, including: in response to a detected preset trigger condition, the terminal collects a location fingerprint of the current location once; or, in response to the detected preset trigger condition, the terminal periodically collects a location fingerprint of the current location; the preset trigger condition is that the change value of at least one preset parameter in the location fingerprint within a preset time is greater than a preset value.

9. The method according to claim 8, wherein, the terminal periodically detects the signal status of the first signal source and the signal status of the second signal source, including: in response to the detected preset trigger condition, the terminal periodically detects the signal status of the first signal source and the signal status of the second signal source.

10. The method according to claim 8 or 9, wherein, the third location fingerprint is the location fingerprint first collected by the terminal after the preset trigger condition is detected.

11. The method according to claim 2, wherein, the third location fingerprint is the location fingerprint most recently collected by the terminal before the start time of the weak signal area.

12. The method according to claim 2, wherein, The first fence record is a clustering result of at least one initial fence record among the multiple initial fence records, and the first location fingerprint in the first fence record is determined based on the location fingerprints of each initial fence record among the at least one initial fence record; The first time duration in the first fence record is the average value or weighted average value of the time durations of each initial fence record among the at least one initial fence record.

13. The method according to claim 12, wherein, The first preset duration is N times the standard deviation of the time durations of each initial fence record among the at least one initial fence record, and N is a positive integer.

14. The method according to claim 2, wherein, The terminal clustering the multiple initial fence records generated by the terminal based on the location fingerprints includes: Clustering the initial fence records with similar location fingerprints among the multiple initial fence records into one fence record.

15. The method according to claim 14, wherein, When it is detected that the continuous duration of the terminal in the weak signal area of the first signal source reaches a preset threshold, the terminal generating a first initial fence record includes: When it is detected that the continuous duration of the terminal in the weak signal area of the first signal source reaches a preset threshold, and it is detected that the terminal enters a preset place after the start time of the weak signal area, the terminal generates the first initial fence record, and the preset place includes an elevator.

16. A terminal, wherein, It includes a memory and a processor, the memory and the processor are electrically coupled, the memory is used to store program instructions, and the processor is configured to call all or part of the program instructions stored in the memory and execute the method according to any one of claims 1-15.

17. A computer storage medium, wherein, It includes computer instructions, and when the computer instructions run on an electronic device, the electronic device is enabled to execute the method according to any one of claims 1-15.

18. A computer program product, wherein, When the computer program product runs on a computer, the computer is enabled to execute the method according to any one of claims 1-15.

Citation Information

Patent Citations

  • Electronic fence area monitoring method and device and computer readable storage medium

    CN109862511A

  • SIM card configuration method, terminal and storage medium

    CN110913346A