Method, terminal and communication system for generating electronic fence

By generating electronic fences to predict network quality deterioration and switching to cellular network in advance, the communication interruption problem caused by Wi-Fi signal masking is solved and the user experience is improved.

CN116264719BActive Publication Date: 2025-08-08HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111529772.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-14
Publication Date
2025-08-08
Estimated Expiration
2041-12-14

AI Technical Summary

Technical Problem

Within the coverage of Wi-Fi network, when an obstacle is encountered, the signal strength decreases, resulting in communication interruption. The prior art can only switch to the cellular network after the signal difference reaches a certain level, resulting in communication lag or interruption.

Method used

By generating electronic fences, it is predicted that the network quality will become worse, and switch to the cellular network in advance to avoid communication interruptions.

Benefits of technology

It realizes switching in advance before network quality becomes worse, improving user experience and avoiding communication lags.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116264719B_ABST
    Figure CN116264719B_ABST
Patent Text Reader

Abstract

A method, terminal, and communication system for generating an electronic fence. This method calculates an electronic fence for a specific location (e.g., an elevator entrance or a device providing a Wi-Fi network). When a terminal enters or leaves the electronic fence at that location, the terminal can trigger the execution of a specific function. For example, when a terminal determines that it has entered the electronic fence at the elevator entrance, it can switch the connected Wi-Fi network to a cellular network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal and communication technology, and in particular to a method, terminal and communication system for generating an electronic fence. Background Art

[0002] A terminal can connect to an access point (AP) to access the wireless fidelity (Wi-Fi) network corresponding to the access point. At this time, the terminal can establish communication with other terminals through the Wi-Fi network. However, the coverage range of a Wi-Fi network is approximately 50 meters to 200 meters. However, when encountering obstacles within the coverage range, some or all of the Wi-Fi network will be blocked, causing the Wi-Fi signal strength to decrease. For example, when a user enters an elevator, the Wi-Fi network connected to the terminal will be blocked by the elevator, resulting in poor signal quality and signal strength. The terminal cannot communicate normally, for example, it cannot send messages, video playback may be stuck, etc., resulting in a poor user experience. Summary of the Invention

[0003] A method, terminal and communication system for generating an electronic fence.

[0004] In some scenarios, the terminal will only connect to the cellular network and resume normal communication after the Wi-Fi network connection between the terminal and the access point is disconnected to a certain extent. This "after-the-fact remediation" method may cause the terminal to become stuck or unable to communicate for a period of time.

[0005] Compared with the above-mentioned "after-the-fact remedy" method, the "pre-prediction" method can make users unaware of the reduction in network quality, and can inform users that the electronic device predicts that the network quality will deteriorate and process it in advance, thereby obtaining a better user experience. Some embodiments of the present application provide a network switching method that can perform "pre-prediction". Among them, it involves first generating an electronic fence of a stuck area (such as the elevator entrance area is a stuck area). After the user's terminal enters the stuck area again, it matches the electronic fence of the stuck area based on the detected wireless access point signal and other features. If the two match, it can be determined that the terminal has entered the stuck area, and then the network of the terminal can be switched in advance before the network quality is about to deteriorate (such as the network quality will deteriorate when the terminal enters the elevator) (such as: the terminal is in the stuck area of the elevator entrance area, but has not yet entered the elevator).

[0006] In a first aspect, the present application provides a method for generating an electronic fence, which is applied to a communication system, wherein the communication system includes a terminal and a cloud server, and the method includes: the cloud server obtains a wireless network data set, and the wireless network data set includes wireless network data sent by at least one terminal, including first wireless network data; the first wireless network data includes the connected access point connected by the first terminal in the area to be calibrated, the WiFi list detected by the first terminal, and the cell identifier of the cellular cell to which the area to be calibrated belongs where the first terminal is located; the first terminal is the terminal that sends the first wireless network data; the cloud server divides the wireless network data with the same cell identifier and similar WiFi list in the wireless network data set into a group to obtain two or more groups, one group corresponds to a temporary area, and a temporary area includes at least one wireless network data; the cloud server determines the distance characteristics of the access points in the cell corresponding to the two or more temporary areas and the connected access point data, including the distance characteristics of the access points in the cell corresponding to the first temporary area and the connected access point data. connected access point data; the intra-cell access point distance feature corresponding to the first temporary area is the correspondence between different access points included in the WiFi list detected by the terminal and the intra-cell distances in the first temporary area, wherein the intra-cell distances corresponding to different access points are the relative distances between the access points and the first temporary area; the connected access point data corresponding to the first temporary area is the connected access points included in the wireless network data of the first temporary area; the cloud server merges the intra-cell access point distance features of the temporary areas with the same connected access point data to obtain an access point distance feature corresponding to at least one area to be calibrated, including a first access point distance feature corresponding to the first area to be calibrated, the first access point distance feature is the correspondence between different access points included in the WiFi list detected by the terminal and the area distances in the first area to be calibrated, wherein the area distances corresponding to different access points are the relative distances between the access points and the first area to be calibrated; the cloud server determines the access point distance feature corresponding to the first area to be calibrated as the electronic fence of the first area to be calibrated.

[0007] In some embodiments, the wireless network data set includes a large amount of wireless network data. The cloud server uses a large amount of wireless network data to calculate the electronic fences of different areas to be calibrated, which can make the calculation results more accurate. The electronic fences of the areas to be calibrated can be used to represent an area to be calibrated, and the entity's area to be calibrated can be digitized.

[0008] In combination with the content of the first aspect, in some embodiments, after the cloud server merges the access point distance features within the cell of the temporary area with the same connected access point data to obtain the access point distance features corresponding to at least one area to be calibrated, the method further includes: the cloud server uses the connected access points corresponding to the temporary area involved when obtaining the electronic fence of the first area to be calibrated as the connected access point data corresponding to the first area to be calibrated; and the cloud server uses the connected access point data corresponding to the first area to be calibrated to identify the electronic fence of the first area to be calibrated.

[0009] In the above embodiment, the connected access point data can be used to identify the electronic fence of the first area to be marked, and the connected access point data can also be used as data in the electronic fence.

[0010] In combination with the content of the first aspect, in some embodiments, the cloud server divides the wireless network data in the wireless network data set that have the same cell identifier and similar WiFi lists into a group, specifically including: the cloud server groups the wireless network data set based on the cell identifier to obtain two or more groups, one group corresponds to a cell, including a first cell, and the first cell includes at least one wireless network data; for the wireless network data included in the first cell, the cloud server divides the wireless network data with similar WiFi lists into a group.

[0011] In the above embodiment, the cloud service first groups the wireless network data set using the cell identifier, and then performs calculations on each group: a set of wireless network data is further grouped using the similarity of the WiFi list, and then the calculations are performed, which can reduce the amount of calculations and speed up the calculations.

[0012] In combination with the content of the first aspect, in some embodiments, the cloud server determines that two WiFi lists are similar in the following manner: in the two WiFi lists, the ratio of the access points that are the same in the first WiFi list and the second WiFi list to all the access points in the first WiFi list reaches a first similarity threshold.

[0013] In combination with the content of the first aspect, in some embodiments, the cloud server determines that two WiFi lists are similar in the following manner: in the two WiFi lists, the ratio of access points in the first WiFi list that are identical to those in the second WiFi list and whose strength difference is less than a preset strength value to all access points in the first WiFi list reaches a second similarity threshold.

[0014] In combination with the first aspect, in some embodiments, before the cloud server determines the access point distance feature corresponding to the first area to be calibrated as the electronic fence of the first area to be calibrated, the method further includes: the cloud server obtains a connected access point strength data set, the connected access point strength data set includes connected access point strength data sent by at least one terminal, including first connected access point strength data, the first connected access point strength data is a correspondence between the strength of the connected access point and the connected access point, the connected access point strength data set includes the first connected access point, and the first connected access point has a corresponding situation of different strengths; the cloud server determines all strengths corresponding to the same connected access point in the connected access point strength data set, and based on the all strengths , determining a strength threshold corresponding to the same connected access point, and obtaining strength thresholds corresponding to different connected access points; the cloud server matching the different connected access points with the connected access point data corresponding to the first area to be calibrated, and determining all connected access points matching the first area to be calibrated; the cloud server using the corresponding relationship between the strength thresholds corresponding to all connected access points matching the first area to be calibrated and the connected access points as the strength feature of the connected access points corresponding to the first area to be calibrated; the cloud server determining the access point distance feature corresponding to the first area to be calibrated as the electronic fence of the first area to be calibrated, specifically including: the cloud server using the access point distance feature corresponding to the first area to be calibrated and the connected access point strength feature as the electronic fence of the first area to be calibrated.

[0015] In conjunction with the first aspect, in some embodiments, the cloud server determines intra-cell access point distance characteristics and connected access point data corresponding to two or more temporary areas, including the intra-cell access point distance characteristics and connected access point data corresponding to the first temporary area, specifically including: the cloud server determines all different connected access points in the wireless network data included in the first temporary area, and uses the different all connected access points as the connected access point data corresponding to the first temporary area; the cloud server calculates the distances of all access points included in all WiFi lists based on all WiFi lists in the wireless network data included in the first temporary area, where one distance corresponds to one access point, and the same access point may have different corresponding distances; the cloud server determines all distances of the same access point based on the distances of all access points, and determines the average distance of the same access point based on the all distances to obtain the average distances of different access points; the cloud server uses the average distances of the different access points as the intra-cell distances corresponding to the different access points, and obtains the corresponding relationship between the different access points and the intra-cell distances; the cloud server determines the intra-cell access point distance characteristics corresponding to the first temporary area based on the corresponding relationship between the different access points and the intra-cell distances.

[0016] In combination with the content of the first aspect, in some embodiments, the cloud server determines the intra-cell access point distance characteristics corresponding to the first temporary area based on the correspondence between the different access points and the intra-cell distances, specifically including: the cloud server uses the correspondence between the different access points and the intra-cell distances as the intra-cell access point distance characteristics corresponding to the first temporary area.

[0017] In combination with the first aspect, in some embodiments, the cloud server determines, based on the correspondence between the different access points and the intra-cell distances, the intra-cell access point distance feature corresponding to the first temporary area. Specifically, the cloud server determines all access points that meet a condition among the different access points, and uses the correspondence between all access points that meet the condition and the intra-cell distances as the intra-cell access point distance feature corresponding to the first temporary area, where the condition is that the intra-cell distance corresponding to the access point is less than a first distance preset value.

[0018] In combination with the first aspect, in some embodiments, the method further includes: the cloud server determining whether the electronic fence of the first to-be-calibrated area is available; when the qualified WiFi list in all WiFi lists involved in calculating the electronic fence of the first to-be-calibrated area reaches a first threshold, the cloud server determines that the electronic fence of the first to-be-calibrated area is available, wherein the all WiFi lists include the first WiFi list, and a condition for the first WiFi list to be qualified is: among the distances corresponding to all access points in the first WiFi list, the qualified distance is greater than a second threshold, and all access points in the first WiFi list include the first access point, and a condition for the distance corresponding to the first access point to be a qualified distance is: the difference between the distance corresponding to the first access point and the relative distance corresponding to the first access point in the access point distance feature of the electronic fence of the first to-be-calibrated area is less than a preset distance difference; when it is determined that the qualified WiFi list in all WiFi lists corresponding to the electronic fence of the first to-be-calibrated area does not reach the first threshold, the cloud server determines that the electronic fence of the first to-be-calibrated area is unavailable.

[0019] In conjunction with the first aspect, in some embodiments, the method further includes: the cloud server determining a matching threshold parameter for the geo-fence of the first area to be calibrated, the matching threshold parameter being used to determine whether the WiFi list obtained by the terminal matches the geo-fence of the first area to be calibrated, the matching threshold parameter including a qualified access point number threshold and a qualified distance number threshold, the qualified access point number threshold being used to indicate the minimum number of qualified access points among all access points included in the WiFi list obtained by the terminal, the qualified access point being an access point that is identical to an access point included in the access point distance characteristic of the geo-fence of the first area to be calibrated, the qualified distance number threshold being used to indicate the minimum number of qualified distances among all access points included in the WiFi list obtained by the terminal, the distance corresponding to the qualified access point being a qualified distance meaning that the difference between the distance corresponding to the qualified access point and the area distance corresponding to the qualified access point in the access point distance characteristic of the geo-fence of the first area to be calibrated is less than a preset distance difference.

[0020] In combination with the content of the first aspect, in some embodiments, the method also includes: after the terminal is connected to the second access point, the terminal obtains a first electronic fence corresponding to the second access point from the cloud server, and the connected access point data of the first electronic fence includes the second access point; the terminal determines that the strength of the second access point matches the strength threshold corresponding to the second access point, and the strength threshold is the strength threshold corresponding to the second access point included in the access point strength feature of the first electronic fence, and then, the terminal obtains a second WiFi list, and the terminal determines that the second WiFi list matches the first electronic fence based on the matching threshold parameter corresponding to the first electronic fence; the terminal disconnects the connected second access point and switches to the cellular network.

[0021] In the above embodiment, the electronic fence of the area to be calibrated is generated so that the user can determine whether the terminal enters the area to be calibrated. For example, the area to be calibrated can be an elevator entrance. After determining that the terminal has reached the elevator entrance, the first access point of the connection can be disconnected and switched to the cellular network.

[0022] In a second aspect, the present application provides an electronic device, comprising: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute the method described in the first aspect or any one of the embodiments of the first aspect.

[0023] In the above embodiment, the wireless network data set includes a large amount of wireless network data. The cloud server uses a large amount of wireless network data to calculate the electronic fences of different areas to be calibrated, which can make the calculation results more accurate. The electronic fences of the areas to be calibrated can be used to represent an area to be calibrated, and the entity's area to be calibrated can be digitized.

[0024] In a third aspect, an embodiment of the present application provides a chip system, which is applied to an electronic device. The chip system includes one or more processors, which are used to call computer instructions to enable the electronic device to execute the method described in the first aspect or any one of the embodiments of the first aspect.

[0025] In the above embodiment, the wireless network data set includes a large amount of wireless network data. The cloud server uses a large amount of wireless network data to calculate the electronic fences of different areas to be calibrated, which can make the calculation results more accurate. The electronic fences of the areas to be calibrated can be used to represent an area to be calibrated, and the entity's area to be calibrated can be digitized.

[0026] In a fourth aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on an electronic device, enables the electronic device to execute the method described in the first aspect or any one of the embodiments of the first aspect.

[0027] In the above embodiment, the wireless network data set includes a large amount of wireless network data. The cloud server uses a large amount of wireless network data to calculate the electronic fences of different areas to be calibrated, which can make the calculation results more accurate. The electronic fences of the areas to be calibrated can be used to represent an area to be calibrated, and the entity's area to be calibrated can be digitized.

[0028] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium. When the instruction is executed on an electronic device, the electronic device executes the method described in the first aspect or any one of the embodiments of the first aspect.

[0029] In the above embodiment, the wireless network data set includes a large amount of wireless network data. The cloud server uses a large amount of wireless network data to calculate the electronic fences of different areas to be calibrated, which can make the calculation results more accurate. The electronic fences of the areas to be calibrated can be used to represent an area to be calibrated, and the entity's area to be calibrated can be digitized. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1a-Figure 1c A schematic diagram of a scenario in which a terminal switches its access network from a WiFi network to a cellular network;

[0031] Figure 2a This is a diagram of a terminal switching the network it accesses from a WiFi network to a cellular network in an embodiment of the present application;

[0032] Figure 3 A schematic diagram showing the relationship between regions and cells is shown;

[0033] Figure 4 An exemplary schematic diagram showing different terminals acquiring wireless network data in different areas;

[0034] Figure 5 A schematic flow chart of the cloud server generating an electronic fence is shown;

[0035] Figure 6 A schematic flow chart for calculating the intra-cell access point distance characteristics corresponding to any area in any cell is shown;

[0036] Figure 7 FIG1 is a schematic flow chart showing the process of generating an electronic fence by a terminal;

[0037] Figure 8is a schematic diagram of the structure of the communication system provided in an embodiment of the present application;

[0038] Figure 9 It is a schematic diagram of the structure of the terminal provided in an embodiment of the present application. DETAILED DESCRIPTION

[0039] In one solution, when a terminal enters an elevator or moves away from a device providing a Wi-Fi network (such as a router), the signal strength of the connected Wi-Fi network gradually decreases. When it drops to a certain level, the terminal can switch the access network from the Wi-Fi network to the cellular network.

[0040] Figure 1a-Figure 1c A schematic diagram of a scenario in which a terminal switches its access network from a Wi-Fi network to a cellular network.

[0041] Figure 1a-Figure 1c The scenario described is: the user is on the 17th floor, and the terminal is connected to the Wi-Fi network on the 17th floor. Then, the user takes the elevator down from the 17th floor with the terminal in hand. After the elevator door closes, the signal quality of the Wi-Fi network connected to the terminal gradually decreases. When it drops to only one bar, it switches to the cellular network. Among them, when the user is a solid line, it means that the elevator door is not closed. From the elevator entrance (the elevator entrance of a certain floor or the area around the elevator entrance is called the elevator entrance, for example), Figure 1a The elevator entrance shown in the figure may be the elevator door) and the user can be seen in the elevator. When the user is a dotted line, it indicates that the elevator door is closed, and the user cannot be seen in the elevator from the elevator door. Figure 1a-Figure 1c In the figure, the signal strength indicator 101 is used to indicate the signal strength of the Wi-Fi network. The signal strength indicator includes M arcs (M is a positive integer greater than 1, usually 4 or 5). The color of the arc is black, which means that the signal strength of the Wi-Fi network has reached the value corresponding to the arc, and gray means that it has not reached it. The more black arcs there are, the stronger the signal of the Wi-Fi network is. The number of black arcs is also called the number of signal grids. The more signal grids there are, the stronger the signal of the Wi-Fi network is. The signal indicator 101 also includes a network usage indicator 101A. The network usage indicator 101A indicates that the current terminal is using the Wi-Fi network for communication. When the network usage indicator 101A and the signal strength indicator 102 are displayed together, it means that the terminal is using the cellular network for communication. Figure 1a-Figure 1c In the example, the signal strength indicator 102 is used to indicate the signal strength of the cellular network. The indication method thereof can refer to the description of the signal strength indicator 101 and will not be repeated here.

[0042] In another case, Figure 2aIn the scenario shown, the terminal does not switch the connected WiFi network to the cellular network. Instead, after the elevator door is closed, the terminal detects that the strength of the connected access point drops to a preset strength value (please refer to the description of the first preset strength value in step S415 below) before switching.

[0043] like Figure 1a As shown, the user enters the elevator from the elevator door on the 17th floor. At this time, the elevator door is not closed. The time displayed in the user interface 10 is 17:59 (this time is just an example). The signal strength indicator 101 has 3 signal grids. Generally speaking, the terminal can communicate normally at this time. Then, the elevator door closes and the elevator is descending. On the 16th floor, the terminal can display the following Figure 1b The user interface 11.

[0044] like Figure 1b As shown, on the 16th floor, the elevator door is closed, the Wi-Fi network is blocked by the elevator, the time displayed in the user interface 20 is 18:00, and the signal strength indicator 101 has 2 signal grids. At this time, the terminal cannot communicate normally with other terminals, and the terminal can display a prompt message 111. The content of the prompt message 111 is: "Network connection is unavailable, please try again later." Between 17:59 and 18:00, other terminals sent a message to the terminal (not displayed, recorded as message 131. If the communication is normal, the message 131 should be received when the terminal displays 17:59. However, since it is currently in the elevator, the terminal cannot communicate normally, which results in the message 131 being unable to be received. It can only be received when the terminal responds to the communication. It is assumed here that the message 131 is received and displayed at 18:01. The user interface involved at 18:01 can refer to the description of user interface 13 below). However, due to the unavailable network connection, the terminal cannot receive the message at 18:00. In response to the user's operation on the send control 112, the terminal attempts to send message 113 to other terminals. At this time, the elevator continues to descend, and on the 14th floor, the terminal can display the following Figure 1c The user interface 13.

[0045] like Figure 1c As described above, on the 14th floor, the elevator is closed, the Wi-Fi network is blocked by the elevator, and the 14th floor is farther from the 17th floor (compared to the 16th floor), so the Wi-Fi network signal strength is lower. In the user interface 13, the signal strength indicator 101 has only one signal grid. At 18:00, the terminal cannot communicate normally with other terminals, and the message 113 cannot be sent successfully. In the user interface 12, a sending prompt 120 can be displayed to notify the user that the message is being sent. At this time, the signal strength of the Wi-Fi network drops to a certain level, and the terminal can switch to the cellular network for communication.

[0046] In this way, after the terminal enters the elevator, the connected Wi-Fi network will be blocked by the elevator, causing the Wi-Fi network to become poor for a period of time but the Wi-Fi network will not be disconnected, thus affecting communication.

[0047] It should be understood that the above problem may also exist in other similar scenarios. For example, when the terminal is increasingly distant from the device providing the Wi-Fi network until it leaves the coverage area of the Wi-Fi network, the Wi-Fi network it is connected to may deteriorate over a period of time, but the Wi-Fi network may not be disconnected, thereby affecting communication.

[0048] In an embodiment of the present application, an electronic fence at a certain location (such as an elevator entrance or the location of a device providing a Wi-Fi network) can be calculated. When a terminal enters or leaves the electronic fence at that location, the terminal can trigger the execution of a certain function. For example, when the terminal determines that it has entered the electronic fence at the elevator entrance, the connected Wi-Fi network can be switched to a cellular network.

[0049] Figure 2a This is a schematic diagram of a terminal switching the network it accesses from a Wi-Fi network to a cellular network in an embodiment of the present application.

[0050] Figure 2a The scenario described is: the user is on the 17th floor, and the terminal is connected to the Wi-Fi network on the 17th floor. Then, the user takes the elevator from the 17th floor downstairs with the terminal in hand. After the user enters the elevator, before the elevator closes, the Wi-Fi network connected to the terminal has already switched to the cellular network. In the elevator, the terminal can communicate with other terminals through the cellular network. For other descriptions of this scenario, such as the description of the signal indicator, please refer to the aforementioned description of the Figure 1a-Figure 1b The relevant description in will not be repeated here.

[0051] After the user enters the elevator from the elevator entrance on the 17th floor, the user interface displayed on the terminal can refer to the above Figure 1a When the user is near the elevator entrance, the terminal can determine that the user has entered the electronic fence of the elevator entrance. Then, after determining that the user has entered the elevator, the terminal can switch the accessed Wi-Fi network to a cellular network.

[0052] like Figure 2aAs shown, after the user enters the elevator, the terminal will not wait for the Wi-Fi network to drop to 1 bar before switching it to the cellular network. It can switch to the cellular network when the Wi-Fi network drops to 3 bars (generally speaking, it can communicate normally with other terminals at this time). At this time, the terminal can display a signal strength indicator 202, which includes a network usage indicator, indicating that the terminal is using the cellular network for communication at this time. The user interface 20 also displays a prompt message 202, which includes a prompt content: "The current network has been switched to the mobile network (cellular network)", which is used to prompt the user that the current network has been switched. In this way, the terminal can still communicate normally and will not affect the reception and transmission of information. The user interface displayed by the terminal may be user interface 20, and the time displayed in user interface 20 is 17:59. The user interface 20 is a user interface for the terminal to edit information 113. Before the user touches the send control 112, between 17:59 and 18:00, the terminal receives information 131 sent to the terminal by other terminals. After that, the user touches the send control 112, detects the user's operation on the send control 112 (such as a click operation), and the terminal sends the information 113 to the other terminal through the cellular network.

[0053] Compared with the above scenarios Figure 1b-Figure 1c It can be seen that the user can successfully send the message on the 16th floor without having to wait until the 13th floor switches to the cellular mode, and the display order corresponds to the order in which the messages are sent.

[0054] In this way, when the terminal determines that it has entered the electronic fence at the elevator entrance, it can trigger the terminal to switch the connected network from the Wi-Fi network to the cellular network.

[0055] It should be understood that in other similar scenarios, for example, when the terminal is getting farther and farther away from the device providing the Wi-Fi network until it leaves the coverage range of the Wi-Fi network, when the terminal determines that it has left the electronic fence of the location, it will also trigger the network to switch to the cellular network to ensure smooth communication.

[0056] The embodiment of the present application relates to a method for generating an electronic fence and a method for triggering a function. The method for generating an electronic fence can determine the electronic fence of a certain area, and the method for triggering a function can determine whether a terminal enters or leaves the electronic fence of a certain area and trigger the execution of a certain function, such as the aforementioned Figure 2a In the described scenario, when the terminal enters the electronic fence at the elevator entrance, the connected WiFi network can be switched to a cellular network.

[0057] The following describes in detail a method for generating an electronic fence in an embodiment of the present application.

[0058] Fencing uses the characteristics of access points (detected and connected) around an area to create a virtual geographic boundary. When a device enters or leaves the fence, it can trigger certain functions. This area can be the elevator entrance mentioned above, the area where the device providing the Wi-Fi network is located, or other areas.

[0059] The access points around a certain area include access points detected by the terminal around the area and access points connected to. A connected access point refers to an access point that the terminal can not only detect but also connect to around the area. Through the connected access point, the terminal can access the WiFi network corresponding to the access point and communicate with other terminals through the device that provides the WiFi network (such as a router). The connected access point can also be called a connected access point. Detected access points refer to access points corresponding to the WiFi network that the terminal can detect around a certain area, including the connected access point.

[0060] In the embodiment of the present application, for the convenience of description, for an electronic fence of a certain area, the area can also be referred to as an area to be calibrated, and the electronic fence can be referred to as an electronic fence of the area to be calibrated.

[0061] In some embodiments, the features of the access points involved in the electronic fence of the area to be calibrated may include access point distance features and / or connected access point strength features corresponding to the area to be calibrated. Each electronic fence may be associated with a piece of connected access point data, which is used to identify the electronic fence and includes at least one access point, which is an access point that a terminal can connect to within the electronic fence. Any access point corresponds to the electronic fence. The connected access points included in the connected access point strength feature are the same as the connected access points included in the connected access point data, that is, the number of access points and BSSID are the same.

[0062] In other embodiments, the characteristics of the access points included in the electronic fence of the area to be calibrated may include other characteristics in addition to the strength characteristics of the connected access points and the access point distance characteristics corresponding to the area to be calibrated, such as the cell identifier corresponding to the access point, which is not limited in the embodiments of the present application.

[0063] The strength characteristics of connected access points corresponding to the area to be calibrated include a corresponding relationship between a strength threshold of a connected access point and the connected access point in the area to be calibrated, i.e., a corresponding relationship between any connected access point and the strength threshold of the connected access point. The strength threshold of any connected access point can be the range of intensities corresponding to the connected access point within the electronic fence of the area to be calibrated when the terminal connects to the access point. The strength threshold is expressed in different forms depending on the type of the area to be calibrated. For example, it can be expressed as a range, such as the minimum strength - maximum strength corresponding to the connected access point within the electronic fence of the area to be calibrated. It can also be expressed as a single value, such as the minimum strength corresponding to the connected access point within the electronic fence of the area to be calibrated. Other expression methods can be expressed as the maximum strength corresponding to the connected access point within the electronic fence of the area to be calibrated. This is not limited in the embodiments of the present application.

[0064] The strength may be the signal strength received by the connected access point, which may be represented by a received signal strength indication (RSSI).

[0065] The access point distance feature corresponding to the area to be calibrated includes the relative distance between the access points (different access points included in the detected WiFi list) that can be detected by the terminal in the area to be calibrated and the area to be calibrated (hereinafter referred to as the regional distance, which is the result of calculating the distance between the access point and the area to be calibrated, assuming that when the radio wave propagates in free space, its energy is neither absorbed by obstacles nor reflected or scattered). The access point distance feature can be expressed as the corresponding relationship between any access point and the regional distance of the access point relative to the area to be calibrated.

[0066] In an embodiment of the present application, the terminal can use the basic service set identifier (BSSID) of the access point. The BSSID is the media access control (MAC) address of the access point. The BSSID can be used to uniquely identify an access point. The BSSIDs of different access points are different. It should be understood that in addition to the BSSID, there can be other ways of identifying the access point, and the embodiment of the present application is not limited to this.

[0067] Table 1 is a schematic representation of an electronic fence provided in an embodiment of the present application.

[0068] Table 1

[0069]

[0070]

[0071] As shown in Table 1, the electronic fence includes the connected access point strength characteristics and access point distance characteristics corresponding to the area to be calibrated. The connected access point strength characteristics included in the electronic fence are: when leaving the electronic fence of the area to be calibrated, the minimum strength of BSSID1 is -50dBm and the maximum strength is -45dBm, and the minimum strength of BSSID2 is -49dBm and the maximum strength is -42dBm. The access point distance characteristics of the electronic fence are: in the area to be calibrated, the terminal can detect access points including BSSID1, BSSID2, BSSID3, and BSSID4, and their area distances relative to the area to be calibrated are 25.6m, 26.6m, 22.1m, and 27.6m. Here, the electronic fence can be considered to be associated with all connected access points in the connected access point strength data.

[0072] After the electronic fence is determined, one application of the electronic fence is to use the electronic fence to determine whether the terminal enters or leaves the electronic fence, thereby triggering the execution of a certain function.

[0073] For example, one way to determine whether a terminal has entered the electronic fence is as follows: when the terminal is connected to access point A, the connected access point data associated with the electronic fence can be matched through the access point A. If the BSSID of the access point A is the same as an access point in the connected access point data, the access point is considered to correspond to the electronic fence. Then, at time A, the terminal can determine whether the strength B of the connected access point matches the strength characteristic of the connected access point. When the strength characteristic of the connected access point included in the electronic fence is the intensity range corresponding to leaving the electronic fence from the electronic fence of the area to be calibrated (such as the content shown in Table 1), then when the intensity B is within the intensity range corresponding to the access point A, the terminal determines that the intensity B matches the intensity of the access point A. At this time, it can be determined that the terminal has entered the electronic fence.

[0074] It should be understood that the above-mentioned method of determining whether a terminal enters the electronic fence is an exemplary description, and there may be other methods. For details, please refer to the following description of steps S401 to S416.

[0075] In one possible approach, the electronic fence of the area to be calibrated can be calculated by a cloud server and then sent to the terminal. At least one terminal can access an access point around the area to be calibrated, obtain multiple pieces of connected access point strength data and multiple wireless network data, and then upload them to the cloud server. The cloud server can receive the multiple pieces of connected access point strength data and multiple wireless network data obtained by different terminals in different areas, and then process the multiple pieces of connected access point strength data and multiple wireless network data to obtain electronic fences corresponding to different areas, where the different areas include the area to be identified. The way in which any terminal obtains any wireless network data is as follows: at a first moment, the terminal can determine that the terminal has arrived at the area to be calibrated at the first moment (arrived at the area to be calibrated from other areas) by detecting a first event. It can be considered that the terminal is within the electronic fence of the area to be calibrated at the first moment and for a period of time thereafter, and then the wireless network data corresponding to the first moment is obtained. Any terminal can obtain strength data for any connected access point by detecting a second event at a second moment and determining that the terminal has left the area to be calibrated (or left the area to be calibrated for another area). The terminal can then be deemed to be within the geo-fence of the area to be calibrated for a period of time before and including the second moment. The terminal then obtains strength data for the connected access point corresponding to the second time. The detailed process of the cloud server calculating the geo-fence of the area to be calibrated can be found in the description of steps S101-S112 below and is not detailed here.

[0076] In another possible embodiment, the electronic fence of the area to be calibrated can also be calculated by the terminal. The terminal can use multiple pieces of connected access point strength data and multiple wireless network data obtained in different areas, and then process the multiple pieces of connected access point strength data and multiple wireless network data to obtain electronic fences corresponding to different areas, where the different areas include the area to be identified. The method for the terminal to obtain any data (including connected access point data and wireless network data) can refer to the method for the terminal to obtain data described above, and will not be repeated here. The detailed process of the cloud server calculating the electronic fence of the area to be calibrated can be referred to the following description of steps S301 to S310.

[0077] Among them, the first event is used to determine that the terminal has arrived at the area to be calibrated or is in the area to be calibrated (arrived at the area to be calibrated from other areas) at the first moment. When the terminal detects the first event, it can be considered that at the first moment and a certain period of time thereafter, the terminal is within the electronic fence of the area to be calibrated (around the area to be calibrated). At this time (the first moment and a certain period of time thereafter), the wireless network data obtained by the terminal can be used to calculate the electronic fence of the area to be calibrated.

[0078] The second event is used to determine that the terminal leaves the area to be calibrated at the second moment (leaves the area to be calibrated to other areas). When the terminal detects the second event, it can be considered that the terminal is within the electronic fence of the area to be calibrated (around the area to be calibrated) at the second moment and a certain period of time before it. At this time (the second moment and a certain period of time before it), the strength data of the connected access point obtained by the terminal can be used to calculate the electronic fence of the area to be calibrated.

[0079] The first time is a time period after the first moment, that is, the terminal is within the terminal fence of the area to be calibrated at the first moment. The second time is a time period between the second moment and the time period before it. The second time can be the same as or different from the first time. The first time is the time period between the third moment and the first moment. The terminal is within the electronic fence of the area to be calibrated at the third moment. That is, within the first time period, after the terminal enters the electronic fence of the area to be calibrated from outside the electronic fence at the first moment, the terminal has been within the electronic fence of the area to be calibrated. The difference between the third moment and the first moment is a first preset value. The second time is a time period between the fourth moment and the second moment. The terminal is within the electronic fence of the area to be calibrated at the fourth moment. That is, within the second time period, before the terminal leaves the electronic fence of the area to be calibrated from outside the electronic fence at the second moment, the terminal has been within the electronic fence of the area to be calibrated. The difference between the fourth moment and the second moment is a second preset value.

[0080] For the sake of convenience in description, the wireless network data corresponding to the first time may be referred to as qualified wireless network data, and the connected access point strength data corresponding to the second time may be referred to as qualified connected access point strength data.

[0081] The connected access point strength data is the corresponding relationship between the strength of the access point (connected access point) to which the terminal is connected and the connected access point, that is, any strength corresponds to one access point, wherein the connected access point is the access point (access point) to which the terminal is connected around the area to be calibrated. Through the access point, the terminal can connect to the wireless fidelity (WiFi) network corresponding to the access point, and then communicate with the device providing the WiFi network. The device then connects the terminal to the Internet through the access point to which the terminal is connected, so that the terminal can communicate with other terminals. The device can be a router or other device that can provide a wireless network, and the embodiments of the present application are not limited to this. The WiFi network is a wireless network provided by the device, and the WiFi network can be associated with at least one access point of the device, that is, one WiFi network can correspond to at least one access point. A device can have at least one access point, and different access points can be located on different channels or on the same channel. Any access point can provide a bridging function from the terminal to the Internet. When the terminal is connected to any access point of the device, it means that the terminal can access the WiFi network provided by the device through the access point and use the channel where the access point is located for communication.

[0082] The wireless network data may include the access point to which the terminal is connected (connected access point), a WiFi list, and / or the cell identifier of the cellular cell (hereinafter referred to as the cell) to which the terminal is located in the area to be calibrated, and may also include other information such as a timestamp. For an introduction to the wireless network, please refer to the following description and will not be repeated here.

[0083] The WiFi list may include relevant information of all or part of the WiFi networks that the terminal can detect around the area to be identified, and the relevant information of any WiFi includes relevant information of all access points included in the device to which the WiFi belongs.

[0084] In some embodiments, the relevant information of any access point may include a corresponding relationship between the strength of the access point and the access point, and the access point is an access point that can be detected by the terminal.

[0085] The timestamp is the time when the terminal generates the wireless network data, and the timestamp is a certain moment in the first time.

[0086] The cell identity can be described by a combination of a location area code (LAC) and a cell number (cellid), or by other methods, for example, by a location area code (LAC), a cell number (cellid) and the operator to which the cell belongs (common operators include China Unicom, China Mobile and China Telecom).

[0087] The cell identifier is used to uniquely identify a cell. The cell identifier can be described by a combination of a location area code (LAC) and a cell number (cellid). It can also be described in other ways, for example, by a location area code (LAC), a cell number (cellid) and the operator to which the cell belongs (common operators include China Unicom, China Mobile and China Telecom).

[0088] Among them, any cell is the range of signal coverage of a base station. In any cell, the terminal can communicate with the base station using the cellular network. Different operators (such as China Telecom, China Unicom and China Mobile) may deploy base stations in the same area (the area is relatively large, for example, some areas have a coverage radius of up to 500 meters, which may include multiple areas to be calibrated involved in this article). This allows the same area to correspond to at least one cell identifier. Any cell identifier can be the LAC and cellid of the cell covered by the base station deployed by one of the three operators, China Telecom, China Unicom and China Mobile. The operators corresponding to different cells can be the same or different. When generating an electronic fence, different wireless network data can be divided into different cells according to the cell identifier, and then processed subsequently.

[0089] It should be understood that when an area to be calibrated corresponds to multiple cell identifiers, the cell corresponding to the cell identifier in the wireless network data obtained by the terminal in the area to be calibrated can be the range covered by the base station that communicates with the primary user identity module (subscriber identity module, SIM) card used by the terminal, or it can be the range covered by the base station that communicates with the SIM card with the strongest signal strength in the terminal. There can also be other definition methods, which are not limited in the embodiments of the present application.

[0090] It should be understood that when an area corresponds to multiple cell identifiers, the cell corresponding to the cell identifier in the wireless network data obtained by the terminal in the area can be the range covered by the base station that communicates with the primary user identification module (subscriber identity module, SIM) card used by the terminal, or it can be the range covered by the base station that communicates with the SIM card with the strongest signal strength in the terminal. There can also be other definition methods, which are not limited in the embodiments of the present application.

[0091] In summary, when a piece of wireless network data may include a connected access point, a Wi-Fi list, and a cell identifier, the piece of wireless network data may be represented as follows:

[0092] data1=[(bssid1, rssi1=-50dBm), (bssid2, rssi2=-35dBm), (bssid3, rssi3=-50dBm), connectBssid=bssid1, LAC, cellid],

[0093] Among them, data1 represents wireless network data, (bssid1,rssi1=-50dBm), (bssid2,rssi2=-35dBm), (bssid3,rssi3=-50dBm) represents the Wi-Fi list, connectBssid=bssid1 means the connected access point is bssid1, LAC and cellid are used for cell identification. Figure 3 As shown, the area where the elevator entrance is located is the area to be calibrated. Icon 401 in the figure (all gray dots are icon 401) represents certain locations in the area to be calibrated, icon 402 in the figure (all light dots are icon 402) represents other locations in the area to be calibrated, and icon 403 in the figure (all black dots are icon 403) represents other locations in the area to be calibrated. Here, it is assumed that outside the area to be calibrated, the terminal cannot detect the first event, so the terminal cannot obtain wireless network data. When the terminal is at the location of icon 401, the connected access point is access 1, and the terminal can collect wireless network data. The connected access point in the wireless network data is access point 1. When the terminal is at the location of icon 402, the connected access point is access 2. At this time, the terminal can collect wireless network data. The connected access point in the wireless network data is access point 2. When the terminal is at the location of icon 403, the connected access point is access 3, and the terminal cannot collect wireless network data.

[0094] In an embodiment of the present application, the area to be calibrated can be an elevator entrance, or it can be an area where a device providing a WiFi network is located, such as a living room where a router is placed, or it can be other areas, such as an area without a WiFi network. This embodiment of the present application does not limit this.

[0095] The electronic fence of any area is generated using the characteristics of the access points (detected access points and connected access points) around the area (such as access point distance characteristics and connected access point strength characteristics). Therefore, when calculating the electronic fence of any area, the characteristics of the access points in the area can be calculated using data related to the access points obtained around the area (such as connected access point data and wireless network data). According to the relevant content introduced above, the terminal can be determined to be around the area to be calibrated by detecting the first event and the second event, triggering the terminal to obtain data related to the access points.

[0096] Using different first and second events allows the terminal to obtain data related to access points (e.g., data on connected access points and wireless network data) around different types of areas to be calibrated (e.g., elevator entrances are one type, and the area where devices providing WiFi networks are located is another type). This allows the characteristics of access points in different areas to be calibrated to be calculated, thereby enabling the generation of electronic fences. That is, different areas to be calibrated will result in different ways for the terminal to determine that it is around the area to be calibrated, i.e., different first and second events. The following example uses the elevator entrance and the area where devices providing WiFi networks are located as examples for explanation.

[0097] When the area to be calibrated is an elevator entrance, the first event can be set as the terminal exiting the elevator, and the second event can be set as the terminal entering the elevator.

[0098] In one embodiment, the terminal determines that the terminal has exited the elevator by detecting that the acceleration of the terminal changes from vertical acceleration in a certain direction (vertically upward or vertically downward) to horizontal acceleration within a first preset time. In this case, if the terminal detects that the acceleration of the terminal is 5° clockwise in the vertical direction or 5° counterclockwise in the vertical direction, the terminal can determine that the acceleration at this time is vertical acceleration. In another embodiment, if the terminal detects that the acceleration of the terminal is 5° clockwise in the horizontal direction or 5° counterclockwise in the horizontal direction, the terminal can determine that the acceleration at this time is horizontal acceleration. Correspondingly, a method for the terminal to determine that the terminal has entered the elevator can be: detecting that the acceleration of the terminal changes from horizontal acceleration to vertical acceleration within a second preset time. In this case, the method for the terminal to determine that the acceleration is horizontal acceleration and vertical acceleration can refer to the above description and will not be repeated here. In this case, the length of the first preset time and the second preset time can be the same or different. The first preset time and the second preset time can be adjusted according to actual needs. For example, the first preset time can be set to 1s-3s and the second preset time can be set to 2s-5s.

[0099] The terminal may also determine that the terminal has exited the elevator by detecting that the altitude of the area where the terminal is located continues to increase within a third preset time after continuously increasing. Correspondingly, the terminal may also determine that the terminal has entered the elevator by detecting that the altitude of the area where the terminal is located continues to decrease within a fourth preset time. The third preset time and the fourth preset time may be the same or different in length, and the first preset time and the second preset time may be adjusted according to actual needs. For example, the first preset time may be set to 0.5s-1s, and the second preset time may be set to 1s-2s.

[0100] The terminal can also determine whether the terminal is entering or exiting the elevator in other ways. For example, whether the terminal is entering or exiting the elevator can be determined by combining voice detection and motion detection. When it is detected that the terminal has stopped moving, if a voice such as "elevator going down" is detected within the fifth preset time, it can be determined that the terminal has entered the elevator. When a voice such as "elevator door is about to open" is detected, if motion is detected within the sixth preset time, it can be determined that the terminal has exited the elevator.

[0101] It should be understood that in the embodiment of the present application, other methods can be used to determine whether the terminal enters the elevator / terminal exits the elevator, which will not be repeated here. In addition, the aforementioned 5°, 1s-3s, 2s-5s, 0.5s-1s and 1s-2s are examples and can be adjusted according to actual conditions, for example, to 10°, etc. The embodiment of the present application is not limited to this.

[0102] When the area to be calibrated is the area where the device providing the WiFi network is located, for example, the living room where the router is placed.

[0103] In some cases, when the terminal enters the area where the device providing the WiFi network is located from other places, it will connect to the access point corresponding to the WiFi network. The first event can be set as the terminal connecting to the access point. When the terminal leaves the area where the device providing the WiFi network is located, the access point corresponding to the WiFi network will be disconnected. The second event is set as the terminal disconnecting from the access point.

[0104] In other cases, when a terminal enters the area where the device providing the WiFi network is located from elsewhere, it will connect to the access point corresponding to the WiFi network and typically undergo a process of transitioning from a moving state to a stopped state. For example, when the area where the device providing the WiFi network is located is a living room where a router is placed, the user typically opens the door before entering, which causes the terminal to transition from a moving state to a stopped state. In this case, the first event may be set as the terminal being in a moving state, connecting to the access point, and then stopping within a seventh preset time. When the terminal leaves the area where the device providing the WiFi network is located, it typically undergoes a process of transitioning from a moving state. In this case, the second event may be set as the terminal disconnecting from the access point and transitioning to a moving state.

[0105] It should be understood that the above settings of the first event and the second event are merely examples and do not constitute a limitation on the embodiments of the present application. Other settings may be used in other situations, and the present application does not limit this.

[0106] In the embodiment of the present application, the electronic fences of different areas can be calculated by the cloud server or by the terminal.

[0107] The following describes the detailed process of how the cloud server generates an electronic fence.

[0108] Here, the electronic fence includes the access point distance feature and the connected access point strength feature corresponding to the area to be calibrated as an example for detailed description. For other cases, such as the case where the electronic fence only includes the access point distance feature or the connected access point strength feature, please refer to the following description.

[0109] In some embodiments, a cloud server may receive N pieces of wireless network data and Z pieces of connected access point strength data sent by different terminals, and then calculate the electronic fence of the area to be demarcated based on this data. This data (N pieces of wireless network data and Z pieces of connected access point strength data) may be obtained when different terminals connect to different access points in different areas. In this approach, the wireless network data includes connected access points, a WiFi list, and cell identifiers.

[0110] Figure 4 Another exemplary schematic diagram shows different terminals acquiring wireless network data in different areas to be calibrated.

[0111] Figure 4 In FIG, icon 301 indicates that the terminal is connected to an access point (AP). Figure 4As shown, it is assumed that the area to be calibrated is an elevator entrance, which includes various elevator entrances on different floors in different buildings, such as elevator entrance 1 on floor 1, elevator entrance 2 on floor 2, and other elevator entrances on other floors in building 1 shown in the figure. It is also assumed that the main SIM card used by terminal 1 and terminal 2 is a SIM card provided by operator A, and the signal coverage range of the base station deployed by operator A is cell 1 (cell-1). The main SIM card used by terminal 3 and terminal 4 is a SIM card provided by operator B, and the signal coverage range of the base station deployed by operator B is cell 2 (cell-2). It should be understood that the N wireless network data obtained by different terminals are obtained by different terminals around different elevator entrances in different buildings. Building 1 is in both cell 1 and cell 2. The cell identifier included in the wireless network data uploaded by the terminal in building 1 can be the cell identifier of cell 1 or the cell identifier of cell 2. The APs around the elevator entrance 1 include AP1 of device 1 and AP2 of device 2. The APs at the elevator entrance 2 include AP3 and AP4 of device 3. AP1 corresponds to WiFi1 (WiFi1 is provided by device 1, not shown in the figure), AP2 corresponds to WiFi2 (WiFi2 is provided by device 2, not shown in the figure), and AP3 and AP4 correspond to WiFi3 (WiFi3 is provided by device 3, not shown in the figure). After detecting the first event, terminal 1 can obtain wireless network data 1 and upload the wireless network data 1 to the cloud server. The wireless network data 1 may include: BSSID of AP1, WiFi list 1, and cell identifier 1 (cell identifier of cell 1), wherein WiFi list 1 may include relevant information of all or part of the WiFi networks that terminal 1 can detect at the elevator entrance 1 (for example, relevant information of WiFi1 and / or WiFi2). After detecting the first event, terminal 3 can obtain wireless network data 2 and upload the wireless network data 2 to the cloud server. The wireless network data 2 may include: BSSID of AP3, WiFi list 2, cell identifier 2 (cell identifier of cell 2), wherein WiFi list 2 may include relevant information of all or part of the WiFi networks that terminal 1 can detect at elevator entrance 1 (for example, WiFi3 and / or WiFi1 and / or WiFi2). Among them, terminal 1 and terminal 3 can detect the first event at least once within a period of time, obtain at least one qualified wireless network data and transmit it to the terminal. For example, terminal 1 can obtain 20 qualified wireless network data within 14 days and upload them to the cloud server. The process of other terminals obtaining wireless network data and uploading them to the cloud server will not be repeated here. It should be understood that the same terminal can also obtain wireless network data in different areas and upload them to the cloud server.

[0112] Therefore, it can be understood that the N pieces of wireless network data acquired by the cloud server are the result of different terminals acquiring wireless network data in different areas within a period of time and then uploading the data to the cloud server.

[0113] The above is an example of a process in which a cloud server obtains N pieces of wireless network data. The process of obtaining Z pieces of connected access point strength data is similar to this process, except that the terminal obtains qualified connected access point strength data and uploads it to the cloud server only after detecting the second event. This will not be repeated here.

[0114] When the electronic fence of the area to be calibrated includes access point distance characteristics and connected access point strength characteristics corresponding to the area to be calibrated, the cloud server calculates the access point distance characteristics corresponding to the area to be calibrated as follows: the cloud server may first obtain M pieces of wireless network data from different cells based on the N pieces of wireless network data. The M pieces of wireless network data are wireless network data acquired by the terminal in different areas of the cell. Based on the similarity of WiFi lists in the wireless network data of the same area within the M pieces of wireless network data, the cloud server obtains X pieces of wireless network data for different areas of the cell. Using the X pieces of wireless network data for any area in any cell, the connected access point data associated with that area and the corresponding intra-cell access point distance characteristics of that area can be obtained. The intra-cell access point distance characteristics corresponding to areas with the same connected access point data in different cells are then merged to obtain access point distance characteristics corresponding to H different areas, with each area being associated with a different piece of connected access point data.

[0115] Among them, in any cell, the intra-cell access point distance feature corresponding to any area (temporary area) includes the correspondence between the access points detected by the terminal in the temporary area (different access points included in the detected WiFi list) and the intra-cell distance, wherein the intra-cell distance corresponding to different access points is the relative distance between the access point and the first temporary area.

[0116] The process of calculating the strength characteristics of the connected access points corresponding to the area to be calibrated is as follows: the cloud server groups the connected access points based on the Z pieces of connected access point strength data, so that different connected access points correspond to one strength data set, calculates the strength threshold of any connected access point, and obtains the corresponding relationship between the strength thresholds of all connected access points and the connected access point, that is, the strength threshold of the connected access point corresponds to the connected access point, then matches all connected access points with the connected access point data corresponding to any area, determines all connected access points that match the connected access point data corresponding to any area, and uses the corresponding relationship between the strength thresholds of all connected access points that match any area and the connected access points as the strength characteristics of the connected access points corresponding to the area.

[0117] In this way, the access point distance characteristics and connected access point strength characteristics corresponding to any area can be obtained, that is, the electronic fence of the area is obtained.

[0118] Figure 5 A schematic flow chart of the cloud server generating an electronic fence is shown.

[0119] The detailed process of the cloud server generating the electronic fence can refer to the following description of steps S101 to S112:

[0120] It should be understood that sufficient wireless network data can make the calculation of the access point distance characteristics corresponding to any area more accurate. Therefore, the cloud server needs to obtain multiple wireless network data around the area to calculate the access point distance characteristics corresponding to any area. These wireless network data can be obtained by the terminal and other terminals at different times and in different areas, and then uploaded to the cloud server.

[0121] In one possible case, the cloud server can be set to use the wireless network data sent by different terminals within a period of time to calculate the access point distance characteristics. The period of time can be 10 days to 14 days, or other times. It can also be adjusted according to the specific data acquisition situation of the terminal. The embodiment of the present application is not limited to this.

[0122] In another possible case, the cloud service may be configured to calculate the access point distance feature when a certain amount of wireless network data is obtained.

[0123] The detailed process of the cloud server acquiring a piece of wireless network data sent by the terminal and other terminals can refer to the following steps S101 to S102:

[0124] S101 detects the first event, the terminal obtains wireless network data and uploads it to the cloud server;

[0125] The wireless network data may include the access point (connected access point) to which the terminal is connected and the WiFi list. When the terminal detects the first event at the first moment, it can obtain the wireless network data corresponding to the first time. The settings of the first event and the first time may vary depending on the area to be calibrated. For a detailed description of the first event and the first time, please refer to the relevant introduction above and will not be repeated here.

[0126] Among them, the first event is used to determine that the terminal has arrived at the area to be calibrated at the first moment (arrived at the area to be calibrated from other areas). The first time is a time period after the first moment. It can be considered that at the first time, after the terminal entered the electronic fence of the area to be calibrated from outside the electronic fence of the area to be calibrated at the first moment, the terminal has been in the electronic fence of the area to be calibrated. For example, it can be the time from the first moment to the 15th second after the first moment. It should be understood that the 15 seconds is for example only and can also be set to other times, such as 10 seconds or 20 seconds. The embodiments of the present application are not limited to this.

[0127] Here, taking the elevator entrance as an example of the area to be calibrated, the setting method of the first time is exemplified. Since the first time is a period of time after the first moment, the terminal will obtain wireless network data at the first time. The length of the first time can determine the size of the electronic fence of the elevator entrance. The longer the first time is, the farther the terminal can obtain wireless network data from the elevator entrance, and the larger the calculated electronic fence of the elevator entrance is. The shorter the first time is, the smaller the calculated electronic fence of the elevator entrance is. The first time can be set to the aforementioned 15s, 10s, 20s or other times according to actual needs. When the area to be calibrated is other areas, you can refer to the relevant description of the elevator entrance, which will not be repeated here.

[0128] During the first time, the terminal may obtain a WiFi list detected at the first moment in the first time, determine the access point connected at the second moment in the first time as the connected access point, and determine the cell identifier of the cell in which the terminal is located at the third moment in the first time. The first moment in the first time, the second moment in the first time, and the third moment in the first time may be the same or different. For example, the first moment in the first time is the time when the WiFi list is detected within 15 seconds after the first moment, the second moment in the first time is the time when the terminal is connected to the access point within 15 seconds after the first moment, and the third moment in the first time may be pre-set. The terminal may set any second in the first time as the third moment in the first time, for example, the 5th or 10th second after the first moment. This is not limited in the embodiments of the present application.

[0129] In some embodiments, the first moment in the first time can be pre-set, and the terminal can set any second in the first time as the first moment in the first time, for example, setting the 5th second or the 10th second after the first moment as the first moment in the first time. The terminal can trigger a detection of the WiFi list at the first moment in the first time to obtain the WiFi list detected at the first moment in the first time. This process is called active detection.

[0130] In other embodiments, the first moment in the first time period may not be pre-set. The terminal may, after detecting the first event, obtain the detected WiFi list and the time when the WiFi list was detected within the first time period. If the time when the WiFi list was detected is within 15 seconds after the first moment, that is, within the first time period, the detected WiFi list is used as the WiFi list detected at the first moment in the first time period. In this embodiment, the detected WiFi list is obtained when an application or service in the terminal scans for a WLAN network when it needs to use the WLAN network. This process is called passive scanning. The terminal can detect the WiFi list during each scan of the WLAN network (the process of detecting the WiFi list here can be called passive detection) and record the time when the WiFi list was detected. It should be understood that passive scanning can only be implemented when the terminal is set to enable the WLAN scanning function. Only when the terminal is set to enable the WLAN scanning function can the application or service in the terminal scan the WLAN network at any time when it needs to use the WLAN network. The WiFi list can be detected during each scan of the WLAN network and the time when the WiFi list was detected can be recorded. In some cases, after detecting the first event, if the terminal has disabled the WLAN scanning function, the terminal can be set to perform an active detection within the first time period.

[0131] It should be understood that after detecting the first event, the terminal can be configured to acquire wireless network data multiple times within the first period of time, obtain multiple qualified wireless network data, and upload them to the cloud server. Alternatively, the terminal can be configured to stop acquiring wireless network data after acquiring a qualified wireless network, and wait until the next time the first event is detected to acquire wireless network data and upload them to the cloud server.

[0132] S102. Upon detecting the first event, other terminals obtain wireless network data and upload it to the cloud server;

[0133] The process involved in step S102 is the same as the process involved in the aforementioned step S101, and reference may be made to the aforementioned description of step S102.

[0134] It should be understood that there is no particular order in which step S102 and the aforementioned step S101 are executed, and the other terminals may be in the same area to be calibrated as the terminal or may not be in the same area to be calibrated.

[0135] The aforementioned steps S101 and S102 may be repeatedly executed within a period of time. As long as the first event is detected, the terminal and other terminals may obtain wireless network data and upload it to the cloud server.

[0136] Referring to the above content, it can be seen that the cloud server can receive N wireless network data sent by different terminals, and then use the N wireless network data to calculate the access point distance characteristics corresponding to different areas. This process can refer to the following description of steps S103 to S107.

[0137] S103. The cloud server groups the N wireless network data based on the cell identifiers in the data to obtain multiple different groups. Each group corresponds to a different cell. Each cell includes M wireless network data. The value of M corresponding to different cells may be different or the same. The N wireless network data comes from different areas.

[0138] In some embodiments, a cell identifier can be described by a combination of a location area code (LAC) and a cell ID (cell ID). When the cloud server determines that the LAC and cell ID in two wireless network data are the same, it can be determined that the two wireless network data can be grouped together. When the cloud server determines that the LAC or cell ID in the two wireless network data are different, it can be determined that the two wireless network data cannot be grouped together.

[0139] In other embodiments, the cell identifier can be described by a combination of a location area code (LAC), a cell ID (cell ID), and the operator to which the cell belongs (common operators include China Unicom, China Mobile, and China Telecom). When the cloud server determines that the LAC, cell ID, and operator in two wireless network data are the same, it can be determined that the two wireless network data can be grouped together. When the cloud server determines that at least one of the LAC, cell ID, and operator in the two wireless network data is different, it can be determined that the two wireless network data cannot be grouped together.

[0140] The cell identifier is used to group N wireless network data obtained by different terminals in different areas according to the cell. For a detailed description of the cell identifier, please refer to the relevant description thereof, for example, Figure 3 Related description.

[0141] The cloud server groups N pieces of wireless network data by the cell identifiers in the data, and places the wireless network data with the same cell identifier in the same group. Any group corresponds to a different cell, and any cell may include M pieces of wireless network data. The M pieces of wireless network data are obtained by different terminals in one or more areas of the cell, including data related to access points in one or more areas of the cell, which can be used to calculate the access point distance characteristics of one or more areas in the cell.

[0142] It should be understood that the value of M corresponding to different cells may be different or the same.

[0143] S104. For the M wireless network data in any cell, the cloud server groups the M wireless network data into multiple different groups. Each group corresponds to a different area in any cell. Any area includes X wireless network data. The value of X may be different or the same for different areas.

[0144] It should be understood that an area in a different cell may be referred to as a temporary area.

[0145] Refer to the above Figure 4 It can be seen that the same cell can include multiple different areas. For example, when the area to be calibrated is the elevator entrance, Figure 4 The cell 1 shown in FIG. 1 includes elevator entrance 1, elevator entrance 2 and other elevator entrances. The M pieces of wireless network data corresponding to the cell 1 include the wireless network data of the elevator entrance 1, elevator entrance 2 and other elevator entrances.

[0146] In a cell, wireless network data in the same area are similar, but wireless network data in different areas are not similar. The cloud server can group the wireless network data corresponding to different areas in the cell based on the similarity of the M wireless network data.

[0147] In one possible scenario, two wireless network data sets in the same cell are considered similar if: the connected access points in the two wireless network data sets are the same, or the WiFi lists in the two wireless network data sets are similar. As previously mentioned, any WiFi list can include a corresponding relationship between the strength of one or more access points and the access point. The one or more access points are all access points that the terminal can detect in the area to be calibrated. For a detailed description of the WiFi list, please refer to the relevant description above and will not be repeated here.

[0148] The method for determining that two WiFi lists are similar is as follows: in the two WiFi lists, a ratio of the access points in the first WiFi list that are identical to those in the second WiFi list to all the access points in the first WiFi list reaches a first similarity threshold (e.g., 90%), or a ratio of the access points in the first WiFi list that are identical to those in the second WiFi list and whose strength difference is less than a preset strength value (e.g., 1 dBm-5 dBm) to all the access points in the first WiFi list reaches a second similarity threshold (e.g., 90%).

[0149] It should be understood that the term "same access point" refers to the access point having the same BSSID. The aforementioned 90% and 1dBm-5dBm are merely examples and can be adjusted based on actual circumstances. They should not constitute a limitation on the embodiments of this application. In addition to the above-mentioned methods, other methods can also be used to determine that two wireless network data are similar, and this embodiment of the application does not limit this.

[0150] S105. For any area in any cell, the cloud server determines all connected access points corresponding to any area in any cell based on the connected access points in the X wireless network data included in the area, and uses the set of all connected access points as the connected access point data corresponding to the area;

[0151] The connected access point data corresponding to any area is used to identify the geo-fence in that area. Different geo-fences correspond to different connected access point data. This connected access point data includes at least one access point that a terminal can connect to within the geo-fence in that area. Any access point corresponds to the geo-fence in that area. For a detailed description of the connected access point data, please refer to the description of the related content above and will not be repeated here.

[0152] Refer to the above Figure 4 It can be seen that around any area in any cell, the terminal or other terminals can be connected to different access points, and the corresponding connected access point data of the area can include at least one connected access point. For example, when the area to be calibrated is the elevator entrance, around the elevator entrance 1, the access points that the terminal or other terminals can connect to are AP1 and AP2, then the connected access point data corresponding to the elevator entrance 1 can include AP1 and AP2.

[0153] For any area within any cell that includes X pieces of wireless network data, the cloud server can determine all of the different connected access points based on the connected access points in the X pieces of wireless network data, and use this set of all of the different connected access points as the connected access point data corresponding to the area. For example, if any area includes 100 pieces of wireless network data, and the connected access point in 50 pieces of wireless network data is AP1, and the connected access point in the other 50 pieces of wireless network data is AP2, then the connected access point data corresponding to the area includes both AP1 and AP2.

[0154] S106. For any cell, the cloud server calculates the intra-cell access point distance characteristics corresponding to any area in any cell based on the X WiFi lists in the X wireless network data included in any area;

[0155] The intra-cell access point distance feature corresponding to any area (area to be calibrated) in any cell is the relative distance between all access points detectable by the terminal within the cell and around the area to be calibrated and the area to be calibrated (hereinafter referred to as the intra-cell distance, which is calculated when the distance between the access point and the temporary area in any cell is calculated, assuming that when the radio wave propagates in free space, its energy is neither absorbed by obstacles nor reflected or scattered). The access point distance feature corresponding to any area (area to be calibrated) in any cell can be expressed as the corresponding relationship between the intra-cell distance of any access point and the access points in the cell.

[0156] Refer to the above Figure 4 It can be seen that for two different areas in any cell, the terminal or other terminals can detect different access points. The difference is reflected in: the BSSID of the access point that can be detected, or the same access point but different strength, then the calculated distance is different. For example, when the area to be calibrated is the elevator entrance, around the elevator entrance 1, the terminal or other terminal can detect the access points AP1, AP2, AP3 and AP4, etc., around the elevator entrance 2, the terminal or other terminal can detect the access points AP1, AP2, AP3, AP4 and AP5, etc. The same terminal detects different access points around the elevator entrance 1 and around the elevator entrance 2. The difference is reflected in: the BSSID of the access point that can be detected is different, and the same access point, such as AP1, has different strengths in different areas (not shown in the figure).

[0157] In summary, the access point distance feature corresponding to any area can be used to identify the area in any cell.

[0158] Figure 6 A schematic flow chart of calculating the intra-cell access point distance characteristics corresponding to any area in any cell is shown.

[0159] The process of the cloud server calculating the intra-cell access point distance characteristics corresponding to any area in any cell can refer to the following description of steps S201 to S203:

[0160] S201. The cloud server calculates the relative distance (distance value) between all access points in the X WiFi list and the area to be calibrated based on the X wireless network data in any area. The same access point can have multiple distance values.

[0161] The cloud server converts the strengths of all access points in the X WiFi lists into the relative distance between the access point and the area to be calibrated (hereinafter referred to as the distance value). The same access point can have multiple distance values. Since the X WiFi lists correspond to the same area, the same access point may appear multiple times in the X WiFi lists. Therefore, the strengths of multiple access points can correspond to the same access point.

[0162] One possible way to determine the distance value of any access point is to calculate the relative distance between the access point and the area to be calibrated by using the signal attenuation method to calculate the strength corresponding to the access point.

[0163] S202. The cloud server calculates the distance within the cell corresponding to all access points. Any access point corresponds only to a distance within the cell.

[0164] The cloud server calculates the average distance of any access point based on all the distances corresponding to the access point. Each access point corresponds to an average distance, which is used to uniquely represent the distance within the cell of the access point relative to the area to be calibrated in an electronic fence.

[0165] One possible implementation is that the cloud server counts the number of times K1 any access point appears, calculates the sum sum1 of the K1 distance values corresponding to the access point, and then the average distance is sum1 / K1, and the average distance is used as the intra-cell distance of the access point.

[0166] Another possible implementation method is that when a certain access point corresponds to multiple distance values, the distance value greater than the second distance preset value may not be involved in the calculation, and the number K2 of the K1 distance values corresponding to the access point that is less than the second distance value is counted, and the sum sum2 of the K2 distance values is calculated. The average distance of the access point is sum2 / K2, and the average distance is used as the intra-cell distance of the access point.

[0167] It should be understood that the intra-cell distance calculated corresponding to any access point is the relative distance between the access point in a certain cell and the area to be calibrated. In addition to the above-mentioned methods, the method for calculating the intra-cell distance can also be other calculation methods, and the embodiments of the present application are not limited to this.

[0168] S203. The cloud server uses the intra-cell distance between any access point whose intra-cell distance among all access points is less than the first preset distance value and the access point as the access point distance feature of the area.

[0169] Step S203 is optional. It can be considered that when the intra-cell distance of an access point is greater than the first preset distance value, the access point is not within the electronic fence of the area to be calibrated, that is, it is considered that the intra-cell distance corresponding to the access point will cause a large error. The cloud server can then use the correspondence between any access point whose intra-cell distance is less than the first preset distance value among all access points and the intra-cell distance of the access point as the intra-cell access point distance feature corresponding to the area within the cell.

[0170] S107. The cloud server merges the intra-cell access point distance features corresponding to the areas with the same connected access point data in different cells to obtain access point distance features corresponding to different areas. Any area is associated with a different connected access point data.

[0171] The access point distance feature corresponding to any area (around the area to be calibrated) is the relative distance between all access points detectable by the terminal around the area to be calibrated and the area to be calibrated (hereinafter referred to as the area distance, which is calculated when the distance between the access point and the area to be calibrated is assumed to be neither absorbed by obstacles nor reflected or scattered when the radio wave propagates in free space). The access point distance feature can be expressed as the corresponding relationship between any access point and the area distance of the access point relative to the area to be calibrated. An example can be referred to the description in Table 1 above, and will not be repeated here.

[0172] In different cells, areas with the same connected access point data refer to areas with the same corresponding connected access point data. The two connected access point data are the same, which means that the number of access points and the BSSID of each access point in the connected access point data of the first area are the same as those of the second area, or the number of access points in the connected access point data of the first area is less than that of the second area, but the BSSID of each access point in the connected access point data of the first area can be found to be the same as the BSSID of each access point in the connected access point data of the second area.

[0173] For the convenience of description, areas having the same connected access point data may be referred to as the same area.

[0174] The cloud server may combine the intra-cell access point distance features corresponding to the same area in different cells based on the intra-cell connected access point data corresponding to any area in different cells to obtain the access point distance features corresponding to the area.

[0175] Among them, the method of merging the intra-cell access point distance features corresponding to the same area in different cells is as follows: for the intra-cell access point distance features corresponding to the same area in different cells, the cloud server counts the number of times K3 of any access point appears, and calculates the sum sum3 of the K3 intra-cell distances corresponding to the access point. The average distance is sum3 / K3, and the regional distance of the access point relative to the area to be calibrated is sum3 / K3.

[0176] If a certain area in a certain cell does not have an intra-cell access point distance feature corresponding to the same area in other cells, the intra-cell access point distance feature corresponding to the area is the access point distance feature corresponding to the area.

[0177] It should be understood that, with reference to the aforementioned Figure 4 It can be seen that since the same area may be located in different cells, for example, elevator entrance 1 and elevator entrance 2 are located in both cell 1 and cell 2, all wireless network data obtained by different terminals in the same area will be divided into different cells in step S103. After steps S104 to S106, the corresponding intra-cell access point distance characteristics and corresponding connected access point data of the same area in different cells are obtained. Then, step S107 can be used to merge them to obtain the access point distance characteristics corresponding to different areas. Any area is associated with different connected access point data.

[0178] In addition to the access point distance feature, the electronic fence of any area may also include the connected access point strength feature. The method for the cloud server to calculate the connected access point strength feature corresponding to any area can refer to the description of steps S108 to S112 below.

[0179] It should be understood that sufficient connected access point strength data can make the calculation of the connected access point strength characteristics corresponding to any area more accurate. The relevant description of this process can be referred to the aforementioned description of obtaining N wireless network data, which will not be repeated here.

[0180] The detailed process of the cloud server acquiring a piece of connected access point strength data sent by the terminal and other terminals may refer to the following steps S108 to S109:

[0181] S108. Upon detecting a second event, the terminal obtains strength data of the connected access point and uploads it to the cloud server;

[0182] The connected access point strength data is a corresponding relationship between the strength of the access point to which the terminal is connected (the connected access point) and the connected access point. When the terminal detects a second event at a second moment, it can obtain wireless network data corresponding to the second time. The second event and second time settings may vary depending on the area to be calibrated. For a detailed description of the second event and second time, please refer to the relevant introduction above and will not be repeated here.

[0183] The second event is used to determine whether the terminal has left the area to be calibrated at the second moment (left the area to be calibrated to go to another area). The second time is the second moment and a time period before it. It can be considered that during the second time, the terminal has been within the electronic fence of the area to be calibrated before leaving the electronic fence of the area to be calibrated at the second moment. For example, it can be the time from the second moment to the 10th second after the second moment. It should be understood that the 10 seconds is for illustration only and can also be set to other times, such as 15 seconds or 20 seconds. This is not limited in the embodiments of the present application. The setting method of the second time can refer to the aforementioned description of the setting method of the first time, and will not be repeated here.

[0184] During the second time, the terminal may determine the strength of the connected access point, and obtain a corresponding relationship between the strength of the connected access point and the connected access point as a piece of connected access point strength data.

[0185] In one possible scenario, the terminal may obtain the strength of connected access points detected within a period of time and the time at which the strength was detected (hereinafter referred to as stored data) and store the data. After detecting a second event, the terminal uses the corresponding relationship between the strength of connected access points that meet a preset condition in the stored data and the connected access points as the connected access point strength data. The preset condition may be that the time at which the strength was detected is within the second period of time. In this way, multiple pieces of connected access point strength data may be obtained, or the time at which the strength was detected is the earliest within the second period of time. In this way, one piece of connected access point strength data may be obtained. The period of time is a recent period of time, and its length may be 5 seconds to 20 seconds. For example, when the period of time is 10 seconds, the terminal always stores the strength of connected access points obtained within the current 10 seconds. It should be understood that the aforementioned 5 seconds to 20 seconds is for example only and can be adjusted as needed. This embodiment of the present application is not limited thereto. In this embodiment, the process of the terminal obtaining the strength of the connected access point and the time when the strength was detected is as follows: when the terminal is connected to a certain access point, it can periodically detect the strength of the access point and adjust the parameters in the network communication, and record the time when the strength was detected. In this process, the terminal can obtain the strength of the connected access point and the time when the strength was detected.

[0186] In another embodiment, the terminal may be configured to obtain the strength of the connected access point and the time when the strength was detected once within a certain period, such as 30 seconds. When a second event is detected, the terminal may determine the strength of the connected access point within the second time period when the strength was detected, and use the corresponding relationship between the strength of the connected access point and the connected access point as the connected access point strength data.

[0187] It should be understood that after detecting the second event, the terminal can be configured to obtain connected access point strength data multiple times within the first period of time, obtain multiple pieces of qualified connected access point strength data, and upload them to the cloud server. Alternatively, after detecting the second event, the terminal can be configured to stop obtaining connected access point strength data after obtaining one piece of qualified connected access point strength data, and wait until the next time the second event is detected to obtain and upload it to the cloud server.

[0188] S109. When a second event is detected, other terminals obtain strength data of the connected access point and upload it to the cloud server;

[0189] The process involved in step S109 is the same as the process involved in the aforementioned step S108, and reference may be made to the aforementioned description of step S108.

[0190] It should be understood that there is no particular order in the execution time of step S109 and the aforementioned steps S108, S101, and S102, and other terminals may be in the same area to be calibrated as the terminal or may not be in the same area to be calibrated.

[0191] The aforementioned steps S108 and S109 may be repeatedly executed within a period of time. As long as the second event is detected, the terminal and other terminals may obtain the strength data of the connected access points and upload it to the cloud server.

[0192] As can be seen from the foregoing, the cloud server can receive Z pieces of connected access point strength data sent by different terminals, and then use the Z pieces of connected access point strength data to calculate the connected access point strength data corresponding to different areas. This process can be referred to the description of steps S110 to S112 below.

[0193] S110. The cloud server calculates the strength threshold of any connected access point based on the Z connected access point strength data, and obtains the corresponding relationship between the strength threshold of all connected access points and the connected access point;

[0194] The strength threshold of any connected access point may be the strength corresponding to the connected access point within the electronic fence of the area to be calibrated when the terminal is connected to the access point. The strength may be represented by a received signal strength indication (RSSI). The strength may be a range, which may be the minimum strength - maximum strength corresponding to the connected access point within the electronic fence of the area to be calibrated, or a value, for example, which may be the minimum strength corresponding to the connected access point within the electronic fence of the area to be calibrated.

[0195] In one possible implementation, the cloud server groups the connected access points based on the Z pieces of connected access point strength data, and groups the connected access point strength data having the same connected access point into a group, i.e., each group corresponds to a different connected access point. The cloud server calculates the strength threshold of the connected access point corresponding to the group using the strengths of the connected access points in all the connected access point strength data in any group, thereby obtaining a corresponding relationship between the strength thresholds of all the connected access points and the connected access points.

[0196] S111. The cloud server matches all connected access points with the connected access point data corresponding to any area, determines all connected access points that match the connected access point data corresponding to any area, and uses the corresponding relationship between the strength threshold of all connected access points matching any area and the connected access points as the connected access point strength feature corresponding to the area, thereby obtaining connected access point strength features corresponding to different areas;

[0197] Matching of the connected access point with the connected access point data corresponding to any area means that the BSSID of the connected access point is the same as the BSSID of a connected access point in the connected access point data.

[0198] Based on the correspondence between the strength thresholds of all connected access points obtained in step S110 and the connected access points, the cloud server can match any connected access point with the connected access point data corresponding to any area. If a match occurs, all connected access points matching the area are determined, and the correspondence between the strength thresholds of all connected access points and the connected access points is used as the connected access point strength feature corresponding to the area. In this way, the cloud server can obtain connected access point strength features corresponding to H areas.

[0199] S112. For any area, the cloud server uses the connected access point strength characteristics and access point distance characteristics corresponding to the area as the electronic fence of the area to identify the area.

[0200] Based on the connected access point strength characteristics corresponding to different areas obtained in step S107 and the connected access point strength characteristics corresponding to different areas obtained in step S111, for any area, the cloud server uses the connected access point strength characteristics and access point distance characteristics corresponding to the area as the geo-fence of the area to identify the area, and uses the connected access point data corresponding to the area as the connected access point data corresponding to the geo-fence of the area to identify the geo-fence.

[0201] It should be understood that the processes involved in the aforementioned steps S101-S112 are applicable when the geo-fence of the area to be calibrated includes the access point distance characteristics and the connected access point strength characteristics corresponding to the area to be calibrated. When the geo-fence of the area to be calibrated includes different characteristics, reference can be made to the aforementioned description and will not be repeated here. For example, when the geo-fence of the area to be calibrated only includes the access point distance characteristics corresponding to the area to be calibrated, the terminal can refer to the aforementioned steps S101-S107 to determine the geo-fences of different areas.

[0202] The following describes the detailed process of the terminal generating an electronic fence.

[0203] The process of generating an electronic fence by a terminal is similar to that of generating an electronic fence by a cloud server. The difference is that the sources of the N wireless network data and Z connected access point strength data involved in calculating the electronic fences in different areas are different. Generally speaking, the terminal will not receive wireless network data and connected access point strength data sent by other terminals. Therefore, the N wireless network data and Z connected access point strength data are obtained by the terminal itself.

[0204] Figure 7 FIG. 4 is a schematic flow chart showing the process of generating an electronic fence by a terminal.

[0205] The process of the terminal generating an electronic fence can refer to the following description of steps S301 to S310:

[0206] S301. The terminal obtains N wireless network data;

[0207] The wireless network data may include the access point to which the terminal is connected (connected access point) and a WiFi list. When the terminal detects the first event at the first moment, it may obtain the wireless network data corresponding to the first moment. The process involved in the terminal obtaining any wireless network data is the same as the process of the terminal obtaining wireless network data in step S101 above. Please refer to the relevant description and will not be repeated here.

[0208] In one possible case, the terminal can be set to use multiple wireless network data obtained within a period of time to calculate the access point distance characteristics. The period of time can be 10 days to 14 days, or other times. It can also be adjusted according to the specific data acquisition situation of the terminal. The embodiment of the present application does not limit this.

[0209] In another possible case, the terminal may be configured to calculate the electronic fence when the amount of wireless network data and connected access point strength data obtained reaches a certain amount.

[0210] S302. The terminal obtains Z connected access point strength data;

[0211] The connected access point strength data is a correspondence between the strength of the access point to which the terminal is connected (the connected access point) and the connected access point. When the terminal detects the second event at the second time, it can obtain wireless network data corresponding to the second time. The process involved in the terminal obtaining the strength data of any connected access point is the same as the process involved in the terminal obtaining the strength data of the connected access point in step S108 above. Please refer to the relevant description and will not be repeated here.

[0212] In one possible case, the terminal can be configured to calculate the strength characteristics of the connected access points using multiple pieces of connected access point strength data acquired within a period of time. The period of time can be 10 to 14 days, or other periods of time. The period of time can be adjusted based on the specific data acquisition situation of the terminal. This embodiment of the present application is not limited thereto.

[0213] In another possible case, the terminal may be configured to calculate the strength characteristics of the connected access points when the amount of strength data of the connected access points obtained reaches a certain amount.

[0214] It should be understood that step S302 only needs to be executed before step S308 described below.

[0215] S303. The terminal groups the cell identifiers in the N wireless network data to obtain multiple different groups. Each group corresponds to a different cell. Each cell includes M wireless network data. The value of M corresponding to different cells may be different or the same. The N wireless network data comes from different areas.

[0216] The detailed process involved in step S303 is similar to that of the aforementioned step S103. Please refer to the aforementioned description of step S103 and will not be repeated here.

[0217] S304. For M wireless network data in any cell, the terminal groups the M wireless network data into multiple different groups. Each group corresponds to a different area in any cell. Any area includes X wireless network data. The value of X in different areas may be different or the same.

[0218] The detailed process involved in step S304 is similar to that of the aforementioned step S104. Please refer to the aforementioned description of step S104 and will not be repeated here.

[0219] S305. For any area in any cell, the terminal determines all connected access points corresponding to any area in any cell based on the connected access points in the X wireless network data included in the area, and uses the set of all connected access points as the connected access point data corresponding to the area;

[0220] The detailed process involved in step S305 is similar to that of the aforementioned step S105. Please refer to the aforementioned description of step S105 and will not be repeated here.

[0221] S306. For any cell, the terminal calculates the intra-cell access point distance characteristics corresponding to any area in any cell based on the X WiFi lists in the X wireless network data included in any area;

[0222] The detailed process involved in step S306 is similar to that of the aforementioned step S106. Please refer to the aforementioned description of step S106 and will not be repeated here.

[0223] S307. The terminal merges the intra-cell access point distance features corresponding to the areas with the same connected access point data in different cells to obtain access point distance features corresponding to different areas. Any area is associated with a different connected access point data.

[0224] The detailed process involved in step S307 is similar to that of the aforementioned step S107. Please refer to the aforementioned description of step S107 and will not be repeated here.

[0225] S308. Based on the Z connected access point strength data, calculate the strength threshold of any connected access point to obtain the corresponding relationship between the strength threshold of all connected access points and the connected access point;

[0226] The detailed process involved in step S308 is similar to that of the aforementioned step S110. Please refer to the aforementioned description of step S110 and will not be repeated here.

[0227] S309. The terminal matches all connected access points with the connected access point data corresponding to any area, determines all connected access points that match the connected access point data corresponding to any area, and uses the corresponding relationship between the strength threshold of all connected access points matching any area and the connected access points as the connected access point strength feature corresponding to the area, thereby obtaining the connected access point strength features corresponding to different areas;

[0228] The detailed process involved in step S309 is similar to that of the aforementioned step S111. Please refer to the aforementioned description of step S111 and will not be repeated here.

[0229] S310. For any area, the terminal uses the connected access point strength characteristics and access point distance characteristics corresponding to the area as the electronic fence of the area to identify the area.

[0230] The detailed process involved in step S310 is similar to that of the aforementioned step S112. Please refer to the aforementioned description of step S112 and will not be repeated here.

[0231] It should be understood that the processes involved in steps S301 through S310 are applicable when the geo-fence of the area to be calibrated includes the access point distance characteristics and the connected access point strength characteristics corresponding to the area to be calibrated. If the geo-fence of the area to be calibrated includes different characteristics, please refer to the previous description and will not be repeated here.

[0232] It should be understood that the letters used to represent multiple data in steps S301-S310, such as N, Z, I, etc., although the same as those in the aforementioned steps S101-S112, may actually be different. Here, the same letters are used to express similar steps just for the convenience of description.

[0233] In some embodiments, after determining the electronic fence of any area, the cloud server or terminal can also verify whether the electronic fence of any area is available. If it is available, the electronic fence of the area is stored; if it is not available, the electronic fence of the area is not stored. The following description is based on the cloud server determining whether the electronic fence of any area is available. The process of the terminal determining whether the electronic fence of any area is available can refer to the following related description.

[0234] The cloud server determines whether the geo-fence in any area is available as follows:

[0235] In one possible implementation, the cloud server may verify whether the electronic fence is available based on all WiFi lists corresponding to the electronic fence of any area, wherein all WiFi lists corresponding to any electronic fence include any WiFi list used to calculate the electronic fence. When the cloud server determines that the qualified WiFi list in all WiFi lists reaches a first threshold, it determines that the electronic fence is available, wherein the condition for any WiFi list in all WiFi lists to be qualified is: among the distances corresponding to all access points in any WiFi list, the qualified distance is greater than a second threshold, and the condition for the distance corresponding to any access point to be a qualified distance is: the difference between the distance corresponding to any access point and the relative distance corresponding to any access point in the access point distance feature of the electronic fence of any area to be calibrated is less than a preset distance difference, wherein the first threshold may be 80% of the above, and the second threshold may be 3 of the above.

[0236] Specifically, assume that there are Q WiFi lists corresponding to any electronic fence, and any WiFi list includes the corresponding relationship between the strength of one or more access points and the access point. Here, assume that among the Q WiFi lists, the i-th WiFi list includes Y i The corresponding relationship between the strength of the access point and the access point. For the i-th WiFi list, it includes Y i The corresponding relationship between the strength of the access point and the access point, then Y i access points, any access point corresponds to the strength of this access point, then there is Y i The strength of each access point is Y i The strength of each access point is converted into the relative distance to the area to be calibrated, and Y i The distance corresponding to the access point, the cloud service can obtain Y based on the i-th WiFi list i access points, and Y i distance, one access point corresponds to one distance, and then the cloud server counts the Y i The number of qualified access points among the access points is denoted as C i , where Y i The judgment condition for any access point to be a qualified access point can be: the access point has the same access point as all the access points included in the access point distance feature of the electronic fence (the access point distance feature is represented by the corresponding relationship between any access point and the area distance of the access point), and then the cloud server counts the C i C corresponding to the access point i The number of qualified distances among the distances is expressed as D i , where C iThe condition for determining whether any distance is a qualified distance can be: the difference between the distance and the area distance of the access point corresponding to the distance is less than a preset distance difference, for example, the preset distance difference can be 5 meters. In this way, for any electronic fence, the cloud server can obtain the number of qualified access points and the number of qualified distances corresponding to any WiFi list in the Q WiFi lists corresponding to the electronic fence, where the number of qualified access points corresponding to the i-th WiFi list is C i , the number of qualified distances is D i If the number of qualified distances corresponding to more than 80% of the WiFi lists in the Q WiFi lists corresponding to any fence determined by the cloud server is greater than 3, the electronic fence can be considered available. If the number of qualified distances corresponding to less than 80% of the WiFi lists in the Q WiFi lists corresponding to any fence determined by the cloud server is greater than 3, the electronic fence can be considered unavailable. If the number of qualified distances corresponding to 80% of the WiFi lists in the Q WiFi lists corresponding to any fence determined by the cloud server is greater than 3, the electronic fence can be considered available or unavailable. Among them, the WiFi list with more than 3 qualified distances is a qualified WiFi list.

[0237] It should be understood that the cloud server can obtain the entire WiFi list corresponding to the electronic fence of any area by: in the process of calculating the electronic fence of any area, the cloud server can store all the WiFi lists used to calculate the electronic fence to obtain the entire WiFi list corresponding to the electronic fence.

[0238] It should also be understood that the aforementioned 80%, 3, and 5 meters are all examples and can be adjusted according to actual conditions.

[0239] In some embodiments, after the cloud server calculates the electronic fences of each area to be calibrated, it stores all the electronic fences in the cloud server. A connected access point data corresponding to any electronic fence may also correspond to a matching threshold parameter.

[0240] The matching threshold parameter corresponding to any electronic fence is used to determine whether the WiFi list obtained by the terminal (hereinafter referred to as the first WiFi list) matches the electronic fence. If it matches, it can be determined that the terminal has entered the electronic fence. If it does not match, it can be determined that the terminal has left the electronic fence.

[0241] The matching threshold parameter includes a qualified access point quantity threshold and a qualified distance quantity threshold. The qualified access point quantity threshold is used to indicate the minimum number of qualified access points (access points identical to any access point included in the access point distance feature of the geo-fence) among all access points included in the first WiFi list. The qualified distance quantity threshold is used to indicate the minimum number of qualified distances (distances where the difference between the area distance of the access point corresponding to the distance and the distance is less than a preset distance difference) among all access points included in the first WiFi list. For descriptions of qualified access points and qualified distances, reference can be made to the relevant descriptions in the aforementioned embodiments and are not repeated here.

[0242] If it is determined that the number of qualified access points among all access points included in the first WiFi list is greater than the qualified access point number threshold, and / or the number of qualified distances corresponding to the qualified access points is greater than the qualified distance number threshold, it is determined that the first WiFi list matches the electronic fence, and it can be determined that the terminal has entered the electronic fence.

[0243] If it is determined that the number of qualified access points among all access points included in the first WiFi list is less than the qualified access point number threshold, or the qualified distances corresponding to the qualified access points are less than the qualified distance number threshold, it is determined that the first WiFi list does not match the electronic fence, and it can be determined that the terminal has left the electronic fence.

[0244] When it is determined that the number of qualified access points among all access points included in the first WiFi list is equal to the qualified access point number threshold, and / or the number of qualified distances corresponding to the qualified access points is equal to the qualified distance number threshold, it is determined that the first WiFi list does not match the electronic fence, and it can be determined that the terminal has entered the electronic fence, or it can be determined that the terminal has left the electronic fence.

[0245] One possible way for the cloud server to calculate the matching threshold parameters corresponding to any electronic fence is: the cloud server can calculate the matching threshold parameters corresponding to the electronic fence based on all WiFi lists corresponding to the electronic fences in any area, wherein all WiFi lists corresponding to any electronic fence include any WiFi list used to calculate the electronic fence.

[0246] Specifically, assuming that there are Q WiFi lists corresponding to any electronic fence, the cloud server can obtain the number of qualified access points and the number of qualified distances corresponding to any WiFi list in the Q WiFi lists corresponding to the electronic fence, where the number of qualified access points corresponding to the i-th WiFi list is C i , the number of qualified distances is D i, the number of Q qualified access points and the number of Q qualified distances can be obtained. The calculation process involved has been described in the previous embodiment and will not be repeated here. The cloud server then sorts the Q qualified access points and the Q qualified distances from smallest to largest. For the sorted Q qualified access points, the 1% is selected as the qualified access point threshold. For the sorted Q qualified distances, the 1% is selected as the qualified distance threshold.

[0247] It should be understood that the 1% mentioned above is a distance description. In practical applications, it can be set as needed, for example, it can also be 2%, 10%, etc., and should not constitute a limitation on the embodiments of the present application.

[0248] It should be understood that in some embodiments, after the terminal calculates the electronic fences of each area to be calibrated, all electronic fences are stored in the terminal. The data of a connected access point corresponding to any electronic fence can also correspond to a matching threshold parameter. The process of the terminal determining the matching threshold of any electronic fence is similar to the process of the aforementioned cloud server determining the matching threshold of any electronic fence, and will not be repeated here.

[0249] In a possible embodiment, if the electronic fence is calculated on a cloud server, after the terminal is connected to an access point, the electronic fence corresponding to the access point can be obtained from the cloud server and then stored locally.

[0250] The terminal may obtain the electronic fence corresponding to the access point from the cloud server in a manner as follows: after the terminal connects to a certain access point, the terminal uses the access point to match the connected access point data corresponding to all electronic fences stored in the cloud server. If one of the connected access point data is the same as the first connection point, the electronic fence corresponding to the connected access point data is determined to be the electronic fence corresponding to the first access point. In some embodiments, the same means that the BSSID of the connected access point is the same as the BSSID of the first connection point. For example, when the BSSID of the first connection point is 6c:16:32:17:3c:95, that is, the same as BSSID1 in the connected access point data corresponding to the electronic fence shown in Table 1, then when the first connection point is 6c:16:32:17:3c:95, the first electronic fence corresponding to the first connection point in the electronic fence shown in Table 1 can be determined.

[0251] If the terminal does not obtain the electronic fence corresponding to the access point from the cloud server, it can be identified that the access point does not have a corresponding electronic fence. When the terminal needs to obtain the corresponding electronic fence based on the access point, if it is determined that the access point has been identified as not having a corresponding electronic fence, no further acquisition is required, and it is directly determined that the first access point does not have a corresponding electronic fence.

[0252] The following introduces an exemplary communication system provided by an embodiment of the present application.

[0253] Figure 8 It is a structural diagram of the communication system provided in an embodiment of the present application.

[0254] like Figure 8 As shown, the communication system may include at least one terminal, such as terminal 101, terminal 102, terminal 103 and other terminals. The communication system also includes a cloud server 104.

[0255] The terminal may be a terminal device equipped with Android, iOS, Microsoft or other operating systems, such as a mobile phone, tablet computer, notebook computer, personal computer, or desktop computer with a touch panel. Figure 8 In the example shown, the terminals 101 and 102 are mobile phones, and the terminal 103 is a laptop computer.

[0256] Terminals such as terminal 101 and terminal 102 can access the WiFi network corresponding to the access point through the connected access point, and then communicate with the device providing the WiFi network (such as a router). The router can route the information sent by terminal 101 and terminal 102 to other terminals to other terminals, so that terminal 101 and terminal 102 can communicate with other terminals.

[0257] Terminals such as terminal 101 and terminal 102 can also obtain wireless network data and connected access point strength data and send them to cloud server 104. The wireless network data and connected access point strength data can be used by cloud server 104 to generate an electronic fence.

[0258] The cloud service 104 may calculate an electronic fence of the area to be calibrated based on the received wireless network data and the strength data of the connected access points. The cloud service 104 may also send the calculated electronic fence to the terminal.

[0259] It should be understood that the matching threshold parameters corresponding to the electronic fence and the connected access point data corresponding to the electronic fence involved in the embodiments of the present application can also be used as parameters in the electronic fence to describe the electronic fence, just like the scannable access point characteristics and the connected access point characteristics. In addition to these parameters, the electronic fence can also include parameters such as the cell identifier to which the area to be calibrated belongs.

[0260] The following first introduces an exemplary terminal provided in an embodiment of the present application.

[0261] Figure 9 It is a schematic diagram of the structure of the terminal provided in an embodiment of the present application.

[0262] The following embodiments are described in detail using a terminal as an example. It should be understood that a terminal may have more or fewer components than those shown in the figures, may combine two or more components, or may have different component configurations. The various components shown in the figures may be implemented in hardware, including one or more signal processing and / or application-specific integrated circuits, software, or a combination of hardware and software.

[0263] The terminal may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0264] It should be understood that the structures illustrated in the embodiments of the present invention do not constitute specific limitations on the terminal. In other embodiments of the present application, the terminal may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0265] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (application processor, access point), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and / or a neural-network processing unit (neural-network processing unit, NPU), etc. Among them, different processing units may be independent devices or integrated into one or more processors.

[0266] In some embodiments, the processor 110 may include one or more interfaces, such as an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, and the like.

[0267] It is understood that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the terminal. In other embodiments of the present application, the terminal may also adopt a different interface connection method from the above embodiment, or a combination of multiple interface connection methods.

[0268] The charging management module 140 is configured to receive charging input from a charger.

[0269] The power management module 141 is used to connect the battery 142 , the charging management module 140 and the processor 110 .

[0270] The wireless communication function of the terminal can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor.

[0271] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals.

[0272] The mobile communication module 150 can provide wireless communication solutions including 2G / 3G / 4G / 5G, etc. applied to the terminal. The mobile communication module 150 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc.

[0273] The modulation and demodulation processor may include a modulator and a demodulator, wherein the modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal.

[0274] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (WiFi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc. applied on the terminal. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0275] The pressure sensor 180A is used to sense pressure signals and convert the pressure signals into electrical signals.

[0276] The gyroscope sensor 180B can be used to determine the motion posture of the terminal. In some embodiments, the angular velocity of the terminal around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of terminal shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the terminal through reverse motion to achieve anti-shake. The gyroscope sensor 180B can also be used for navigation and somatosensory game scenes.

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

[0278] The magnetic sensor 180D includes a Hall sensor, and the terminal can use the magnetic sensor 180D to detect the opening and closing of the flip leather case.

[0279] The accelerometer 180E detects the magnitude of the terminal's acceleration in all directions (generally three axes). When the terminal is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the terminal's posture, enabling applications such as switching between landscape and portrait modes and pedometers.

[0280] The distance sensor 180F is used to measure distance. The terminal can measure distance using infrared or laser.

[0281] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode.

[0282] The ambient light sensor 180L senses ambient light brightness. The terminal can adaptively adjust the brightness of the display screen 194 based on the perceived ambient light. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking photos. The ambient light sensor 180L can also work with the proximity light sensor 180G to detect whether the terminal is in a pocket to prevent accidental touches.

[0283] The fingerprint sensor 180H is used to collect fingerprints.

[0284] The temperature sensor 180J is used to detect temperature. In some embodiments, the terminal uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy.

[0285] The touch sensor 180K is also called a “touch panel.” The touch sensor 180K can be disposed on the display screen 194 . The touch sensor 180K and the display screen 194 form a touch screen, also called a “touch screen.”

[0286] In the embodiment of the present application, the processor 110 can call the computer instructions stored in the internal memory 121 to enable the terminal to execute the method involved in the embodiment of the present application.

[0287] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

[0288] As used in the above embodiments, the term “when…” may be interpreted to mean “if…” or “after…” or “in response to determining…” or “in response to detecting…”, depending on the context. Similarly, the phrases “upon determining…” or “if (stated condition or event) is detected” may be interpreted to mean “if determining…” or “in response to determining…” or “upon detecting (stated condition or event)” or “in response to detecting (stated condition or event)”, depending on the context.

[0289] 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 process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk).

[0290] Those skilled in the art will appreciate that all or part of the process steps in the above-described method embodiments can be implemented by a computer program instructing the relevant hardware. The program can be stored in a computer-readable storage medium, and when executed, the program can include the process steps in the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

Claims

1. A method for generating an electronic fence, applied to a communication system, characterized in that: The communication system includes a terminal and a cloud server, and the method includes: The cloud server obtains a wireless network data set, where the wireless network data set includes wireless network data sent by at least one terminal, including first wireless network data; the first wireless network data includes a connected access point connected by the first terminal in the area to be calibrated, a WiFi list detected by the first terminal, and a cell identifier of a cellular cell in the area to be calibrated where the first terminal is located; the first terminal is the terminal that sends the first wireless network data; The cloud server divides the wireless network data with the same cell identifier and similar WiFi list in the wireless network data set into a group to obtain two or more groups, each group corresponds to a temporary area, and each temporary area includes at least one piece of wireless network data; The cloud server determines intra-cell access point distance characteristics and connected access point data corresponding to two or more temporary areas, including the intra-cell access point distance characteristics and connected access point data corresponding to a first temporary area; the intra-cell access point distance characteristics corresponding to the first temporary area are correspondences between different access points included in a WiFi list detected by the terminal in the first temporary area and intra-cell distances, wherein the intra-cell distances corresponding to different access points are relative distances between the access points and the first temporary area; the connected access point data corresponding to the first temporary area are connected access points included in the wireless network data of each wireless network in the first temporary area; The cloud server merges the access point distance features within the cell of the temporary area having the same connected access point data to obtain an access point distance feature corresponding to at least one area to be calibrated, including a first access point distance feature corresponding to the first area to be calibrated, the first access point distance feature being a correspondence between different access points and area distances included in the WiFi list detected by the terminal in the first area to be calibrated, wherein the area distances corresponding to different access points are the relative distances between the access points and the first area to be calibrated; The cloud server determines the access point distance feature corresponding to the first area to be calibrated as the electronic fence of the first area to be calibrated.

2. The method according to claim 1, characterized in that After the cloud server merges the access point distance features within the temporary area having the same connected access point data to obtain the access point distance feature corresponding to at least one area to be calibrated, the method further includes: The cloud server uses the connected access points corresponding to the temporary area involved in obtaining the electronic fence of the first area to be calibrated as the connected access point data corresponding to the first area to be calibrated; The cloud server identifies the electronic fence of the first area to be calibrated by using the connected access point data corresponding to the first area to be calibrated.

3. The method according to claim 1 or 2, characterized in that The cloud server divides the wireless network data with the same cell identifier and similar WiFi list in the wireless network data set into a group, specifically including: The cloud server groups the wireless network data set based on the cell identifier to obtain two or more groups, where one group corresponds to one cell, including a first cell, and the first cell includes at least one piece of wireless network data; For the wireless network data included in the first cell, the cloud server groups the wireless network data with similar WiFi lists into one group.

4. The method according to claim 3, wherein: The cloud server determines that two WiFi lists are similar in the following manner: in the two WiFi lists, a ratio of the same access points in the first WiFi list and the second WiFi list to all the access points in the first WiFi list reaches a first similarity threshold.

5. The method according to claim 3, wherein: The cloud server determines that the two WiFi lists are similar in the following manner: in the two WiFi lists, a ratio of access points in the first WiFi list that are identical to those in the second WiFi list and whose strength difference is less than a preset strength value to all access points in the first WiFi list reaches a second similarity threshold.

6. The method according to any one of claims 1 to 5, characterized in that Before the cloud server determines the access point distance feature corresponding to the first area to be calibrated as the electronic fence of the first area to be calibrated, the method further includes: The cloud server obtains a connected access point strength data set, where the connected access point strength data set includes connected access point strength data sent by at least one terminal, including first connected access point strength data, where the first connected access point strength data is a correspondence between strengths of connected access points and connected access points, where the connected access point strength data set includes the first connected access point, and where the first connected access point has corresponding strengths of different types; The cloud server determines, in the connected access point strength data set, all strengths corresponding to the same connected access point, and determines, based on the all strengths, a strength threshold corresponding to the same connected access point, to obtain strength thresholds corresponding to different connected access points; The cloud server matches the different connected access points with the connected access point data corresponding to the first area to be calibrated, and determines all connected access points that match the first area to be calibrated; The cloud server uses the corresponding relationship between the strength thresholds corresponding to all connected access points matched to the first area to be calibrated and the connected access points as the connected access point strength feature corresponding to the first area to be calibrated; The cloud server determines, by the access point distance feature corresponding to the first area to be calibrated, as an electronic fence of the first area to be calibrated, specifically including: The cloud server uses the access point distance characteristics and the connected access point strength characteristics corresponding to the first area to be calibrated as an electronic fence of the first area to be calibrated.

7. The method according to any one of claims 1 to 6, characterized in that The cloud server determines intra-cell access point distance characteristics and connected access point data corresponding to two or more temporary areas, including the intra-cell access point distance characteristics and connected access point data corresponding to the first temporary area, specifically including: The cloud server determines all different connected access points in the wireless network data included in the first temporary area, and uses all the different connected access points as the connected access point data corresponding to the first temporary area; The cloud server calculates the distances of all access points included in all WiFi lists based on the wireless network data included in the first temporary area, where one distance corresponds to one access point, and the same access point may correspond to different distances; The cloud server determines, based on the distances of all access points, all distances of the same access point, and determines, based on the all distances, an average distance of the same access point to obtain an average distance of different access points. The cloud server uses the average distance of different access points as the intra-cell distance corresponding to the different access points, and obtains the corresponding relationship between the different access points and the intra-cell distance; The cloud server determines a distance feature of an access point in the cell corresponding to the first temporary area based on the correspondence between the different access points and the distances in the cell.

8. The method according to claim 7, characterized in that The cloud server determines, based on the correspondence between the different access points and the distances within the cell, a distance characteristic of the access point within the cell corresponding to the first temporary area, specifically including: The cloud server uses the correspondence between the different access points and the intra-cell distances as the intra-cell access point distance feature corresponding to the first temporary area.

9. The method according to claim 7, characterized in that The cloud server determines, based on the correspondence between the different access points and the distances within the cell, a distance characteristic of the access point within the cell corresponding to the first temporary area, specifically including: The cloud server determines all access points that meet a condition among the different access points, and uses a correspondence between all the access points that meet the condition and intra-cell distances as an intra-cell access point distance feature corresponding to the first temporary area, where the condition is that the intra-cell distance corresponding to the access point is less than a first distance preset value.

10. The method according to any one of claims 1 to 9, characterized in that The method further comprises: The cloud server determines whether the electronic fence of the first area to be calibrated is available; When, in calculating all WiFi lists involved in the electronic fence of the first to-be-calibrated area, qualified WiFi lists reach a first threshold, the cloud server determines that the electronic fence of the first to-be-calibrated area is available, wherein the all WiFi lists include the first WiFi list, and a condition for the first WiFi list to be qualified is that: among the distances corresponding to all access points in the first WiFi list, a qualified distance is greater than a second threshold, and all access points in the first WiFi list include the first access point, and a condition for the distance corresponding to the first access point to be a qualified distance is that a difference between the distance corresponding to the first access point and a relative distance corresponding to the first access point in a distance feature of an access point of the electronic fence of the first to-be-calibrated area is less than a preset distance difference; When determining and calculating all WiFi lists corresponding to the electronic fence of the first area to be calibrated, if the qualified WiFi list does not reach the first threshold, the cloud server determines that the electronic fence of the first area to be calibrated is unavailable.

11. The method according to any one of claims 1 to 10, characterized in that The method further comprises: The cloud server determines a matching threshold parameter for the geo-fence of the first area to be calibrated. The matching threshold parameter is used to determine whether the WiFi list obtained by the terminal matches the geo-fence of the first area to be calibrated. The matching threshold parameter includes a qualified access point number threshold and a qualified distance number threshold. The qualified access point number threshold is used to indicate a minimum number of qualified access points among all access points included in the WiFi list obtained by the terminal. A qualified access point is an access point in the WiFi list obtained by the terminal that is identical to an access point included in the access point distance feature of the geo-fence of the first area to be calibrated. The qualified distance number threshold is used to indicate a minimum number of qualified distances among all access points in the WiFi list obtained by the terminal. A qualified distance corresponding to a qualified access point means that a difference between the distance corresponding to the qualified access point and the area distance corresponding to the qualified access point in the access point distance feature of the geo-fence of the first area to be calibrated is less than a preset distance difference.

12. The method according to claim 11, characterized in that The method further comprises: After the terminal is connected to the second access point, the terminal obtains a first electronic fence corresponding to the second access point from the cloud server, where the connected access point data of the first electronic fence includes the second access point; The terminal determines, by the terminal, that the strength of the second access point matches a strength threshold corresponding to the second access point, where the strength threshold is a strength threshold corresponding to the second access point included in the access point strength characteristic of the first electronic fence. Then, the terminal obtains a second WiFi list, and determines, based on a matching threshold parameter corresponding to the first electronic fence, that the second WiFi list matches the first electronic fence. The terminal disconnects from the second access point and switches to the cellular network.

13. An electronic device, characterized in that: The electronic device includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute the method described in any one of claims 1-12.

14. A chip system, applied to an electronic device, comprising one or more processors, wherein the processors are configured to call computer instructions so that the electronic device executes the method according to any one of claims 1 to 12.

15. A computer program product comprising instructions, characterized in that When the computer program product is run on an electronic device, the electronic device is enabled to perform the method according to any one of claims 1 to 12.

16. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on an electronic device, the electronic device is caused to execute the method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Selecting wireless access points for geofence monitoring

    CN103563405A

  • Geo-fence updating method, and communication device

    CN111316673A