Electronic fence acquisition method and device, and cloud

By obtaining the location and business type of the terminal device, the target electronic fence that overlaps with the preset business area is screened out, which solves the problem of not being able to obtain electronic fences in advance in the existing technology, achieves the accuracy and flexibility of the electronic fence, and improves the user experience.

CN120751339APending Publication Date: 2025-10-03CHONGQING CHANGAN AUTOMOBILE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511051848.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-29
Publication Date
2025-10-03

AI Technical Summary

Technical Problem

Existing technologies are unable to obtain the corresponding electronic fence in advance according to the current demand scenario to perform corresponding business work.

Method used

By obtaining the location information and current business type of the terminal device, the target radius and overlap rate threshold are determined based on the business type, and the target electronic fences that overlap with the preset business area are screened out from multiple electronic fences, and their identification information is sent to the terminal device.

Benefits of technology

It achieves the accuracy, reliability and flexibility of electronic fences, improves the efficiency of electronic fence selection, meets the diverse needs of users in different business scenarios, and improves user satisfaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120751339A_ABST
    Figure CN120751339A_ABST
Patent Text Reader

Abstract

The invention relates to an electronic fence obtaining method and device, and a cloud, and is applied to the cloud, and the electronic fence obtaining method comprises the steps: obtaining a vehicle position and a current service type sent by a terminal device; based on the current service type and a preset service area with the terminal equipment as the circle center and the radius as the target radius, determining at least one to-be-selected electronic fence having an overlapping part with the preset service area from the plurality of electronic fences; wherein the target radius is a radius corresponding to the current service type, or a preset fixed radius; and on the basis of the preset service area and the overlapping rate of each to-be-selected electronic fence, under the condition that at least one target electronic fence is determined from the at least one to-be-selected electronic fence, identification information of the at least one target electronic fence is sent to the terminal equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of automobile location services, and in particular to a method and device for obtaining an electronic fence, and a cloud. Background Art

[0002] An electronic fence is a virtual boundary created using electronic technology, typically used to monitor and control access to a specific area. An electronic fence consists of a collection of specific locations (GPS coordinates), connected to form a "fence." With the development of IoT technology, electronic fences are widely used in various scenarios, including in the connected vehicle (IoV) sector. Vehicle terminals use electronic fences to limit vehicle range, monitor speed, operating status, and safety.

[0003] The existing method for acquiring electronic fences involves the cloud comparing the location information of a terminal device (such as a terminal device, mobile phone, or shared bicycle) with multiple predefined electronic fences. When the terminal device is determined to be within an electronic fence, the identification information of the electronic fence is sent to the terminal device. However, with the advancement of intelligent technology, users want to obtain the corresponding electronic fence based on the current business type (such as assisted driving, finding a gas station, finding a restaurant, etc.) in advance to perform the corresponding business tasks. Therefore, it is necessary to propose a new method for acquiring electronic fences. Summary of the Invention

[0004] One of the purposes of the present invention is to provide a method for obtaining an electronic fence to solve the problem in the prior art that it is impossible to obtain the corresponding electronic fence in advance according to the current demand scenario to perform corresponding business work; the second purpose is to provide an electronic fence acquisition device; the third purpose is to provide a cloud; the fourth purpose is to provide a computer-readable storage medium; the fifth purpose is to provide a computer program product.

[0005] In order to achieve the above object, the technical solution adopted by the present invention is as follows:

[0006] An embodiment of the present invention provides a method for obtaining an electronic fence, which is applied to the cloud. The method for obtaining an electronic fence includes:

[0007] Obtain the location information and current service type sent by the terminal device;

[0008] Based on the current service type and a preset service area having a target radius and centered at the terminal device, determining at least one candidate electronic fence from a plurality of electronic fences that overlaps with the preset service area; wherein the target radius is a radius corresponding to the current service type or a preset fixed radius;

[0009] Based on the overlap rate between the preset service area and each candidate electronic fence, when at least one target electronic fence is determined from the at least one candidate electronic fence, identification information of the at least one target electronic fence is sent to the terminal device.

[0010] Based on the aforementioned technical approach, multiple first electronic fences matching the current service type of the terminal device are precisely screened from a pre-defined set of electronic fences. Subsequently, based on the terminal device's preset service area, at least one eligible candidate electronic fence is selected from the screened first electronic fences. Based on this, the overlap ratio between the preset service area and the candidate electronic fences is calculated to determine the target electronic fence closest to the terminal device and distribute it to the terminal device. This series of operations effectively ensures the accuracy, reliability, and flexibility of electronic fence distribution.

[0011] Furthermore, based on the current business type and the preset business area with the terminal device as the center and the target radius as the radius, at least one candidate electronic fence that has an overlapping portion with the preset business area is determined from multiple electronic fences, including: determining multiple first electronic fences corresponding to the current business type from the multiple electronic fences; and determining the at least one candidate electronic fence that has an overlapping portion with the preset business area from the multiple first electronic fences.

[0012] The above technical approach selects multiple first electronic fences corresponding to the current service area from multiple electronic fences based on the current service type. This allows for the rapid elimination of electronic fences unrelated to the current service, significantly reducing the number of electronic fences that require analysis. Furthermore, at least one candidate electronic fence that overlaps with the pre-defined service area is selected from the multiple first electronic fences, significantly improving the efficiency of candidate electronic fence selection.

[0013] Furthermore, the method for obtaining the electronic fence includes: obtaining a first correspondence between the business type and the radius; determining the target radius corresponding to the current business type based on the first correspondence; or obtaining the target radius corresponding to the current business type determined based on the first correspondence sent by the terminal device.

[0014] According to the above technical means, the corresponding radius is flexibly set according to the business type. This flexible setting method can meet the diverse needs of users in different business scenarios, thereby improving user satisfaction.

[0015] Furthermore, the method for obtaining the electronic fence also includes: taking the longitude direction and the latitude direction as the marking direction, gridding the preset business area to obtain a first grid division result; gridding each to-be-selected electronic fence to obtain a second grid division result; based on the first grid division result and the second grid division result of each to-be-selected electronic fence, counting the number of grids in the overlapping part of the preset business area and each to-be-selected electronic fence; based on the number of grids in the overlapping part of the preset business area and each to-be-selected electronic fence and the target number of grids, obtaining the overlap rate of the preset business area and each to-be-selected electronic fence; wherein the target number of grids is the number of grids corresponding to the second grid division result of each to-be-selected electronic fence, or the number of grids corresponding to the first grid division result of the preset business area.

[0016] According to the above technical means, the preset business area and each candidate electronic fence are grid-divided by grid division, and then the overlap rate of the preset business area and each candidate electronic fence can be quickly obtained based on the grid division result.

[0017] Furthermore, based on the overlap rate between the preset business area and each candidate electronic fence, at least one target electronic fence is determined from the at least one candidate electronic fence, including: based on the overlap rate between the preset business area and each candidate electronic fence, at least one candidate electronic fence corresponding to an overlap rate greater than a target overlap rate threshold is used as at least one target electronic fence; wherein the target overlap rate threshold is the overlap rate threshold corresponding to the current business type, or a pre-set fixed overlap rate threshold.

[0018] Furthermore, the method for obtaining the electronic fence includes: obtaining a second correspondence between the business type and the overlap rate threshold; determining the target overlap rate threshold corresponding to the current business type based on the second correspondence; or obtaining the target overlap rate threshold corresponding to the current business type determined based on the second correspondence sent by the terminal device.

[0019] According to the above technical means, the corresponding overlap rate threshold is flexibly set according to the business type. This flexible setting method can meet the diverse needs of users in different business scenarios, thereby improving user satisfaction.

[0020] Furthermore, based on the overlapping rate between the preset business area and each candidate electronic fence, at least one target electronic fence is determined from the at least one candidate electronic fence, including: sorting the overlapping rate between the preset business area and each candidate electronic fence in order from large to small or from small to large to obtain a sorting result; and taking the candidate electronic fence corresponding to the maximum overlapping rate in the sorting result as the target electronic fence.

[0021] Furthermore, the method for obtaining the electronic fence also includes: determining a bounding box containing the preset business area and the electronic fence to be selected; wherein the bounding box is a regular quadrilateral; randomly generating a large number of points in the bounding box, obtaining a first number of common points between the preset business area and the electronic fence to be selected in the bounding box, and obtaining a second number of points in the bounding box; based on the first number, the second number and the area of ​​the bounding box, obtaining the overlapping area of ​​the preset business area and the electronic fence to be selected; based on the first number, the third number and the overlapping area, obtaining the area of ​​the target area; wherein the third number is the number of points in the preset business area or the number of points in the electronic fence to be selected, and the area of ​​the target area is the area of ​​the preset business area or the area of ​​the electronic fence to be selected; based on the overlapping area and the target area, obtaining the overlap rate of the preset business area and the electronic fence to be selected.

[0022] An embodiment of the present invention provides an electronic fence acquisition device, which is applied to the cloud. The electronic fence acquisition device includes:

[0023] An acquisition unit, used to acquire the vehicle position and current service type sent by the terminal device;

[0024] a processing unit, configured to determine, based on the current service type and a preset service area having the terminal device as a center and a target radius, at least one candidate electronic fence from a plurality of electronic fences that overlaps with the preset service area; wherein the target radius is a radius corresponding to the current service type or a preset fixed radius;

[0025] The processing unit is further configured to send identification information of the at least one target electronic fence to the terminal device when at least one target electronic fence is determined from the at least one candidate electronic fence based on the overlap rate between the preset service area and each candidate electronic fence.

[0026] An embodiment of the present invention provides a cloud, comprising: a processor and a memory configured to store a computer program that can be run on the processor, wherein the processor is configured to execute the steps of the aforementioned method when running the computer program.

[0027] An embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the aforementioned method are implemented.

[0028] An embodiment of the present invention provides a computer program product, including a computer program or instructions, which implements the steps of the above method when executed by a processor.

[0029] Beneficial effects of the present invention:

[0030] (1) The present invention accurately screens out a plurality of first electronic fences that match the business type currently carried out by the terminal device from a plurality of pre-set electronic fences; then, in combination with the preset business area of ​​the terminal device, further selects at least one qualified candidate electronic fence from the screened out plurality of first electronic fences; on this basis, by calculating the overlap rate between the preset business area and the candidate electronic fence, the target electronic fence that is closer to the terminal device is determined and sent to the terminal device; this series of operation processes effectively ensures the accuracy, reliability and flexibility of the electronic fence sending;

[0031] (2) The present invention selects multiple first electronic fences corresponding to the current business area from multiple electronic fences according to the current business type, which can quickly exclude electronic fences that are not related to the current business, greatly reducing the number of electronic fences that need to be analyzed; on this basis, at least one candidate electronic fence that has an overlapping portion with the preset business area is further selected from the multiple first electronic fences, greatly improving the selection efficiency of the candidate electronic fences. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 The flowchart of the method for obtaining an electronic fence in an embodiment of the present invention is shown as follows: Figure 1 ;

[0033] Figure 2 The flowchart of the method for obtaining an electronic fence in an embodiment of the present invention is shown as follows: Figure 2 ;

[0034] Figure 3 The flowchart of the method for obtaining an electronic fence in an embodiment of the present invention is shown as follows: Figure 3 ;

[0035] Figure 4 The flowchart of the method for obtaining an electronic fence in an embodiment of the present invention is shown as follows: Figure 4 ;

[0036] Figure 5 The flowchart of the method for obtaining an electronic fence in an embodiment of the present invention is shown as follows: Figure 5 ;

[0037] Figure 6 The flowchart of the method for obtaining an electronic fence in an embodiment of the present invention is shown as follows: Figure 6 ;

[0038] Figure 7 Schematic diagram of the display of the electronic fence to be selected in the embodiment of the present invention Figure 1 ;

[0039] Figure 8 Schematic diagram of the display of the electronic fence to be selected in the embodiment of the present invention Figure 2 ;

[0040] Figure 9 Schematic diagram of the display of the electronic fence to be selected in the embodiment of the present invention Figure 3 ;

[0041] Figure 10 (a) is a schematic diagram of the grid division results in an embodiment of the present invention Figure 1 ;

[0042] Figure 10 (b) is a schematic diagram of the grid division results in an embodiment of the present invention Figure 2 ;

[0043] Figure 10 (c) is a schematic diagram of the grid division results in an embodiment of the present invention Figure 3 ;

[0044] Figure 11 (a) is a schematic diagram of the grid division results in an embodiment of the present invention Figure 4 ;

[0045] Figure 11 (b) is a schematic diagram of the grid division results in an embodiment of the present invention Figure 5 ;

[0046] Figure 11 (c) is a schematic diagram of the grid division results in an embodiment of the present invention Figure 6 ;

[0047] Figure 12 Schematic diagram of the structure of an electronic fence acquisition device according to an embodiment of the present invention;

[0048] Figure 13 Schematic diagram of the cloud structure in an embodiment of the present invention. DETAILED DESCRIPTION

[0049] In order to enable a more detailed understanding of the features and technical contents of the embodiments of the present invention, the implementation of the embodiments of the present invention is described in detail below with reference to the accompanying drawings. The accompanying drawings are for reference only and are not intended to limit the embodiments of the present invention.

[0050] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention pertains. The terms used herein are for the purpose of describing the present embodiment only and are not intended to limit the present invention.

[0051] In the following description, references to “some embodiments,” “this embodiment,” “this embodiment,” and examples, etc., describe a subset of all possible embodiments, but it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict.

[0052] If similar descriptions of "first / second" appear in the application documents, the following explanation is added. In the following description, the terms "first\second\third" are merely used to distinguish similar objects and do not represent a specific order of the objects. It can be understood that "first\second\third" can be interchanged with the specific order or sequence where permitted, so that the embodiment described herein can be implemented in an order other than that illustrated or described herein.

[0053] In this embodiment, the term "and / or" is merely a description of the association relationship between associated objects, indicating that three relationships may exist. For example, object A and / or object B may represent three situations: object A exists alone, object A and object B exist at the same time, and object B exists alone.

[0054] The embodiment of the present invention provides a method for obtaining an electronic fence. Figure 1 The flowchart of the method for obtaining an electronic fence in an embodiment of the present invention is shown as follows: Figure 1 ,like Figure 1 As shown, the method for obtaining the electronic fence applied to the cloud includes the following steps:

[0055] S101: Acquire location information and current service type sent by the terminal device.

[0056] In the embodiment of the present invention, the terminal device includes but is not limited to a vehicle terminal, a mobile phone, a tablet computer, and a shared bicycle.

[0057] In the embodiment of the present invention, the terminal device has multiple positioning methods, such as obtaining the location information of the terminal device through the Global Positioning System (GPS), Beidou positioning, base station positioning, WIFI positioning, Bluetooth, or from a third-party service.

[0058] In this embodiment of the present invention, if the terminal device is a vehicle terminal, the current service type may be a driving assistance service, a gas station search service, a vehicle speed monitoring service, a vehicle safety monitoring service, etc. If the terminal device is a mobile phone, the current service type may be a gas station search service, a restaurant search service, etc.

[0059] S102: Based on the current business type and a preset business area with the terminal device as the center and a target radius as the radius, determine at least one candidate electronic fence that overlaps with the preset business area from multiple electronic fences; wherein the target radius is the radius corresponding to the current business type, or a pre-set fixed radius.

[0060] In an embodiment of the present invention, based on the current business type and a preset business area with the terminal device as the center and a target radius, at least one selected electronic fence determined from multiple electronic fences has an overlapping part with the preset business area and is an electronic fence corresponding to the current business type.

[0061] For example, if the current service type is assisted driving, the selected electronic fence is the electronic fence corresponding to the assisted driving area. If the current service type is gas station search, the selected electronic fence is the electronic fence corresponding to the gas station area. If the current service type is vehicle speed monitoring, the selected electronic fence is the electronic fence corresponding to the vehicle speed monitoring area.

[0062] In the embodiment of the present invention, the target radius can be set according to the current service type. Different service types can correspond to the same radius or different radii. Alternatively, the target radius is a pre-set radius.

[0063] In the embodiment of the present invention, the target radius may come from a terminal device or from the cloud, without specific limitation.

[0064] S103: Based on the preset service area and the overlap rate of each candidate electronic fence, when at least one target electronic fence is determined from at least one candidate electronic fence, identification information of the at least one target electronic fence is sent to the terminal device.

[0065] In the embodiment of the present invention, the determined target electronic fence can be understood as an electronic fence that is closer to the terminal device.

[0066] In an embodiment of the present invention, after the identification information of at least one target electronic fence is sent to the terminal device, the terminal device displays at least one target electronic fence on the map based on the identification information of at least one target electronic fence, so that the user can flexibly select one of the electronic fences according to his or her own situation and perform corresponding business tasks.

[0067] The identification information of the electronic fence includes the electronic fence area code, fence name, fence identifier (ID), version number, tag, description, status and geographic coordinates of the fence boundary.

[0068] Accordingly, based on the overlap ratio between the preset service area and each candidate electronic fence, if at least one target electronic fence is not determined from at least one candidate electronic fence, no information is sent to the terminal device.

[0069] It should be noted that during the entire process of data transmission between the terminal device and the cloud, the transmitted data is encrypted before being transmitted to ensure the correct transmission of the transmitted data.

[0070] In this embodiment of the present invention, based on the type of service currently being performed by a terminal device, a plurality of pre-defined electronic fences are precisely selected to match the service type. Subsequently, based on the terminal device's preset service area, at least one eligible candidate electronic fence is further selected from the selected plurality of first electronic fences. Based on this, the overlap ratio between the preset service area and the candidate electronic fences is calculated to determine the target electronic fence closest to the terminal device and distribute it to the terminal device. This series of operations effectively ensures the accuracy, reliability, and flexibility of electronic fence distribution.

[0071] In some embodiments of the present invention, determining at least one candidate electronic fence that overlaps with a preset service area from a plurality of electronic fences based on the current service type and a preset service area with the terminal device as the center and a target radius includes the following steps:

[0072] S201: Determine a plurality of first electronic fences corresponding to a current business type from a plurality of electronic fences.

[0073] In the embodiment of the present invention, the service type to which each electronic fence belongs is predefined. Therefore, multiple first electronic fences corresponding to the current service area can be selected from multiple electronic fences according to the current service type.

[0074] Exemplarily, the multiple electronic fences include electronic fences corresponding to multiple assisted driving areas, electronic fences corresponding to multiple gas station areas, electronic fences corresponding to multiple vehicle speed monitoring areas, and electronic fences corresponding to multiple vehicle safety monitoring areas. If the current business type is an assisted driving business, the first electronic fence corresponding to the multiple assisted driving areas is obtained from the multiple electronic fences.

[0075] S202: Determine at least one candidate electronic fence from the plurality of first electronic fences, the fence having an overlapping portion with the preset service area.

[0076] In this embodiment of the present invention, each first electronic fence is gridded using the longitude and latitude directions as the marking directions, and the preset service area is also gridded. All grids after the gridding are then coded or identified. Furthermore, a determination is made as to whether any grids within each first electronic fence overlap with any grids within the preset service area. If so, the first electronic fence is selected as a candidate electronic fence.

[0077] Alternatively, a large number of points are randomly generated in each first electronic fence and the preset service area, and all of the points are coded or identified. Furthermore, it is determined whether any points in each first electronic fence overlap with any points in the preset service area. If so, the first electronic fence is selected as a candidate electronic fence.

[0078] In this embodiment of the present invention, multiple first electronic fences corresponding to the current service area are selected from multiple electronic fences based on the current service type. This allows for the rapid elimination of electronic fences unrelated to the current service, significantly reducing the number of electronic fences that require analysis. Furthermore, at least one candidate electronic fence that overlaps with the preset service area is further selected from the multiple first electronic fences, significantly improving the efficiency of candidate electronic fence selection.

[0079] In some embodiments of the present invention, the method for obtaining an electronic fence includes the following steps:

[0080] S301: Acquire a first correspondence between a service type and a radius.

[0081] S302: Based on the first corresponding relationship, determine the target radius corresponding to the current service type.

[0082] In the embodiment of the present invention, a first correspondence between a service type and a radius is preset and stored in the cloud.

[0083] In the embodiment of the present invention, when the cloud obtains the current service type sent by the terminal device, it determines the target radius corresponding to the current service type based on the first corresponding relationship.

[0084] Alternatively, obtain the target radius corresponding to the current service type determined based on the first corresponding relationship and sent by the terminal device.

[0085] In the embodiment of the present invention, a first correspondence between a service type and a radius is preset and stored in the terminal device.

[0086] In an embodiment of the present invention, the terminal device will send its own location information, current service type, and the target radius of the current service type determined based on the first corresponding relationship to the cloud according to a preset period.

[0087] Different business types may correspond to different radii or the same radius.

[0088] For example, if the current service type is a driving assistance service, the corresponding radius can be set to 1 km. If the current service type is a gas station search service, the corresponding radius can be set to 5 km.

[0089] In the embodiment of the present invention, the corresponding radius is flexibly set according to the business type. This flexible setting method can meet the diverse needs of users in different business scenarios, thereby improving user satisfaction.

[0090] In the embodiment of the present invention, as the service type changes, the corresponding radius may also change, the preset service area may also change, and the selected electronic fence may also change, resulting in the final target electronic fence also changing.

[0091] In some embodiments of the present invention, the method for obtaining an electronic fence further includes the following steps:

[0092] S401: Using the longitude and latitude directions as marking directions, gridding the preset service area to obtain a first gridding result.

[0093] S402: Grid division is performed on each candidate electronic fence to obtain a second grid division result.

[0094] S403: Based on the first grid division result and the second grid division result of each candidate electronic fence, counting the number of grids in the overlapping portion between the preset service area and each candidate electronic fence.

[0095] In an embodiment of the present invention, all grids in the first grid division result and the second grid division result of each candidate electronic fence are encoded or identified so that the same grid has a unique code or identification, and then the number of grids in the preset business area and each candidate electronic fence that have the same code or identification is counted, thereby obtaining the number of grids in the overlapping part of the preset business area and each candidate electronic fence.

[0096] S404: Based on the number of grids in the overlapping part of the preset business area and each electronic fence to be selected and the target number of grids, the overlapping rate of the preset business area and each electronic fence to be selected is obtained; wherein the target number of grids is the number of grids corresponding to the second grid division result of each electronic fence to be selected, or the number of grids corresponding to the first grid division result of the preset business area.

[0097] In this embodiment of the present invention, the overlap ratio between the preset service area and each candidate electronic fence is calculated by calculating the ratio of the number of grid cells in the overlapping portion between the preset service area and each candidate electronic fence to the number of grid cells corresponding to the second grid division result of each candidate electronic fence. Alternatively, the overlap ratio between the preset service area and each candidate electronic fence is calculated by calculating the ratio of the number of grid cells in the overlapping portion between the preset service area and each candidate electronic fence to the number of grid cells corresponding to the first grid division result of the preset service area. The grid cells may be square.

[0098] Alternatively, the overlapping area is obtained based on the number of grids in the overlapping portion of the preset business area and each electronic fence to be selected and the area of ​​one grid. The area of ​​each electronic fence to be selected is obtained based on the number of grids corresponding to the second grid division result of each electronic fence to be selected and the area of ​​one grid. The overlapping rate of the preset business area and each electronic fence to be selected is calculated by calculating the ratio of the overlapping area of ​​the preset business area and each electronic fence to the area of ​​each electronic fence to be selected. Alternatively, the area corresponding to the preset business area is obtained based on the number of grids corresponding to the first grid division result of the preset business area and the area of ​​one grid. The overlapping rate of the preset business area and each electronic fence to be selected is obtained by calculating the ratio of the overlapping area of ​​the preset business area and each electronic fence to the area corresponding to the preset business area.

[0099] Based on this, the preset business area and each candidate electronic fence are grid-divided by a grid division method, and then the overlap rate of the preset business area and each candidate electronic fence can be quickly obtained based on the grid division result.

[0100] In some embodiments of the present invention, determining at least one target electronic fence from the at least one candidate electronic fence based on the overlap rate between the preset service area and each candidate electronic fence includes:

[0101] Based on the overlap rate between the preset business area and each candidate electronic fence, at least one candidate electronic fence corresponding to an overlap rate greater than a target overlap rate threshold is used as at least one target electronic fence; wherein the target overlap rate threshold is the overlap rate threshold corresponding to the current business type, or a pre-set fixed overlap rate threshold.

[0102] In the embodiment of the present invention, at least one candidate electronic fence corresponding to an overlap rate greater than a target overlap rate threshold is considered to be an electronic fence closer to the terminal device. Therefore, the at least one candidate electronic fence is used as at least one target electronic fence.

[0103] In the embodiment of the present invention, the target overlap rate threshold can be set according to the current service type. Different service types can correspond to the same overlap rate threshold or different overlap rate thresholds. Alternatively, the target overlap rate threshold is a pre-set overlap rate threshold.

[0104] In the embodiment of the present invention, the target overlap rate threshold may be obtained from the terminal device or from the cloud, without any specific limitation.

[0105] In some embodiments of the present invention, the method for obtaining the electronic fence includes:

[0106] Obtaining a second correspondence between the service type and the overlap rate threshold;

[0107] Determining a target overlap rate threshold corresponding to the current service type based on the second corresponding relationship;

[0108] In the embodiment of the present invention, a second correspondence between the service type and the overlap rate threshold is preset and stored in the cloud.

[0109] In the embodiment of the present invention, when the cloud obtains the current service type sent by the terminal device, it determines the target overlap rate threshold corresponding to the current service type based on the second corresponding relationship.

[0110] Alternatively, the target overlap rate threshold corresponding to the current service type determined based on the second corresponding relationship and sent by the terminal device is obtained.

[0111] In the embodiment of the present invention, a second correspondence between the service type and the overlap rate threshold is preset and stored in the terminal device.

[0112] In the embodiment of the present invention, the terminal device sends its own location information, current service type, and the target overlap rate threshold of the current service type determined based on the second corresponding relationship to the cloud according to a preset period.

[0113] Different service types may correspond to different overlap rate thresholds or may correspond to the same overlap rate threshold.

[0114] For example, if the current service type is a driving assistance service, the corresponding overlap rate threshold may be set to 100%. If the current service type is a gas station search service, the corresponding overlap rate threshold may be set to 50% to 70%.

[0115] In the embodiment of the present invention, the corresponding overlap rate threshold is flexibly set according to the service type. This flexible setting method can meet the diverse needs of users in different service scenarios, thereby improving user satisfaction.

[0116] In some embodiments of the present invention, determining at least one target electronic fence from the at least one candidate electronic fence based on the overlap rate between the preset service area and each candidate electronic fence includes:

[0117] The overlapping rates of the preset service area and each candidate electronic fence are sorted in order from large to small or from small to large to obtain a sorting result; and the candidate electronic fence corresponding to the maximum overlapping rate in the sorting result is used as the target electronic fence.

[0118] That is, the candidate electronic fence corresponding to the maximum overlap rate is considered to be the electronic fence closest to the terminal device, and therefore is used as the target electronic fence.

[0119] In some embodiments of the present invention, the method for obtaining an electronic fence further includes the following steps:

[0120] S501: Determine a bounding box that includes a preset service area and a to-be-selected electronic fence; wherein the bounding box is a regular quadrilateral.

[0121] The bounding box is a regular quadrilateral, for example, the bounding box is a square or a rectangle.

[0122] The electronic fence to be selected here is any electronic fence among at least one electronic fence to be selected.

[0123] S502: randomly generating a large number of points in the bounding box, obtaining a first number of common points between the preset service area and the selected electronic fence in the bounding box, and obtaining a second number of points in the bounding box.

[0124] S503: Obtaining an overlapping area between the preset service area and the selected electronic fence based on the first number, the second number, and the area of ​​the bounding box.

[0125] In the embodiment of the present invention, the ratio of the first number to the second number is calculated and then multiplied by the area of ​​the bounding box to obtain the overlapping area of ​​the preset service area and the selected electronic fence.

[0126] S504: Based on the first number, the third number and the overlapping area, obtain the target area area; wherein the third number is the number of points in the preset business area or the number of points in the electronic fence to be selected, and the target area area is the area of ​​the preset business area or the area of ​​the electronic fence to be selected.

[0127] In the embodiment of the present invention, the target area can be obtained by dividing the overlapping area by the ratio of the first number to the second number.

[0128] S505: Based on the overlapping area and the target area, an overlapping rate between the preset service area and the selected electronic fence is obtained.

[0129] In the embodiment of the present invention, the overlap rate between the preset service area and the selected electronic fence is obtained based on the ratio of the overlap area to the target area.

[0130] Based on the above embodiment, the embodiment of the present invention specifically provides a method for obtaining an electronic fence. Figure 6 The flowchart of the method for obtaining an electronic fence in an embodiment of the present invention is shown as follows: Figure 6 ,like Figure 6 As shown, the method for obtaining the electronic fence includes the following steps:

[0131] S601: Acquire location information, current service type, target radius corresponding to the current service type, and target overlap rate threshold sent by the terminal device.

[0132] For example, if the current service type is vehicle assisted driving service, the target radius can be set to 1 km and the target overlap rate threshold can be set to 100%. If the current service type is gas station search service, the target radius can be set to 5 km and the target overlap rate threshold can be set to 50% to 70%.

[0133] S602: Determine a plurality of first electronic fences corresponding to the current service type from a plurality of electronic fences.

[0134] S603: Determine at least one candidate electronic fence from the plurality of first electronic fences that overlaps with a preset service area, where the preset service area is an area with the terminal device as the center and a radius equal to the target radius.

[0135] S604: Determine the overlap rate between the preset service area and each of the selected electronic fences.

[0136] One feasible way is to use the grid division tool to divide each selected electronic fence and preset business area drawn by the user into grids, with the line direction being horizontally parallel to the latitude and vertically parallel to the longitude; the division accuracy is the same, and the intersection of the horizontal and vertical lines can form a square area S 正 , the area of ​​each square can be calculated based on the grid accuracy. 圆 With S 围栏 When they intersect, calculate S 正 ∈[S 圆 &S 围栏 ] number, if the number of squares in the intersection area is N 重叠 , and then gradually calculate S 圆 With S 围栏 Overlap area S 重叠 , the intersection area S 重叠 Can be approximated to N 重叠 *S 正 The overlap rate between the preset business area and each selected electronic fence is S 重叠 / S圆 *100%, or S 重叠 / S 围栏 *100%.

[0137] Another feasible approach is to use a tool to randomly generate a large number of points within the preset business area and each candidate electronic fence. A common bounding box is found, each of which completely encompasses the preset business area and each candidate electronic fence. The bounding box can be a rectangle or square, covering the entire area of ​​both figures. The larger the number N of randomly generated points within the bounding box, the more accurate the result, but the greater the computational effort. The random distribution of points can be achieved using a uniform distribution or other methods. For each generated point, determine whether it is simultaneously within the preset business area and each candidate electronic fence. Count the number of points that meet the criteria (i.e., the number of points simultaneously within the preset business area and each candidate electronic fence), denoted as M. The area of ​​the overlapping region is calculated by multiplying the ratio of M to N by the area of ​​the bounding box. Furthermore, the area of ​​the preset business area is calculated by dividing the area of ​​the overlapping region by the ratio of M to P1. The area of ​​the overlapping region is then divided by the area of ​​the preset business area to obtain the corresponding overlap ratio. P1 is the number of points within the preset business area. Alternatively, the area of ​​the candidate electronic fence is obtained by dividing the area of ​​the overlapping region by the ratio of M to P2, and then the area of ​​the overlapping region and the area of ​​the candidate electronic fence are calculated to obtain the corresponding overlap ratio. Where P2 is the number of points within the candidate electronic fence.

[0138] S605: Based on the overlap rate between the preset service area and each candidate electronic fence, if at least one overlap rate greater than a target overlap rate threshold is determined, the corresponding at least one candidate electronic fence is used as at least one target electronic fence.

[0139] S606: Send identification information of at least one target electronic fence to the terminal device.

[0140] For example, taking the terminal device as a vehicle device, as Figure 7 As shown, if the multiple first electronic fences corresponding to the current business type include A 围栏1 、A 围栏2 、A 围栏3 、A 围栏4 、A 围栏5 and A 围栏6 , the vehicle equipment remains at position 1. As the target radius changes, the selected electronic fence will change. Specifically, if the vehicle terminal reports position 1 and target radius R to the cloud for analysis, the selected target electronic fence selected by the cloud is A 围栏1 、A 围栏2 、A 围栏3 、A 围栏4 、A 围栏5 and A围栏6 If the vehicle terminal reports position 1 and target radius R1 to the cloud for analysis, the target electronic fence selected by the cloud is A 围栏2 、A 围栏4 、A 围栏5 and A 围栏 6. If the vehicle terminal reports position 1 and target radius R2 to the cloud for analysis, the target geo-fence selected by the cloud is A 围栏 1. A 围栏2 、A 围栏3 、A 围栏4 、A 围栏5 and A 围栏6 .

[0141] like Figure 8 As shown, if the multiple first electronic fences corresponding to the current business type include A 围栏1 、A 围栏2 、A 围栏3 、A 围栏4 、A 围栏5 and A 围栏6 , the target radius R remains unchanged, and the selected target electronic fence will change as the position of the vehicle device changes. Specifically, if the vehicle terminal reports the position 1 and the target radius R to the cloud for analysis, the target electronic fence selected by the cloud is A 围栏 1. A 围栏2 、A 围栏3 、A 围栏4 、A 围栏5 and A 围栏6 If the vehicle terminal reports position 2 and target radius R to the cloud for analysis, the target electronic fence selected by the cloud is A 围栏1 、A 围栏2 、A 围栏4 If the vehicle terminal reports position 3 and target radius R to the cloud for analysis, the target electronic fence selected by the cloud is A 围栏1 .

[0142] like Figure 9 As shown, if the multiple first electronic fences corresponding to the current business type include A 围栏1 、A 围栏2 、A 围栏3 、A 围栏4 、A 围栏5 and A 围栏6 , the target radius R remains unchanged, and the selected target electronic fence will change as the position of the vehicle device changes. Specifically, if the vehicle terminal reports the position 1 and the target radius R to the cloud for analysis, the target electronic fence selected by the cloud is A 围栏 1. A 围栏4If the vehicle terminal reports position 2 and target radius R to the cloud for analysis, the target electronic fence selected by the cloud is A 围栏1 、A 围栏2 、A 围栏4 、A 围栏5 and A 围栏6 If the vehicle terminal reports position 3 and target radius R to the cloud for analysis, the target electronic fence selected by the cloud is A 围栏2 、A 围栏3 、A 围栏4 、A 围栏5 and A 围栏6 .

[0143] like Figure 10 As shown in (a), the target radius remains unchanged, and before the vehicle position changes, the results of grid division of each candidate electronic fence and preset business area are displayed.

[0144] like Figure 10 As shown in (b), the target radius remains unchanged, and after the vehicle position changes once, the results of grid division of each candidate electronic fence and preset business area are displayed.

[0145] like Figure 10 As shown in (c), the target radius remains unchanged, and after the vehicle position changes again, the results of grid division of each candidate electronic fence and preset business area are displayed.

[0146] like Figure 11 As shown in (a), the vehicle position remains unchanged, and before the target radius changes, the results of grid division of each candidate electronic fence and preset business area are displayed.

[0147] like Figure 11 As shown in (b), the vehicle position remains unchanged, and after the target radius changes once, the results of grid division of each candidate electronic fence and preset business area are displayed.

[0148] like Figure 11 As shown in (c), the vehicle position remains unchanged, and the target radius changes again, and the results of grid division of each candidate electronic fence and preset business area are displayed.

[0149] In this embodiment of the present invention, changes in the vehicle terminal's position and / or target radius directly affect the number of selected e-fences obtained. When the vehicle's position remains unchanged, a smaller target radius results in fewer selected e-fences; a larger target radius results in more selected e-fences. When the target radius remains unchanged, if the vehicle moves away from the selected e-fences, fewer selected e-fences are obtained; if the vehicle moves closer to the selected e-fences, more selected e-fences are obtained.

[0150] Based on the above embodiment, the embodiment of the present invention further provides an electronic fence acquisition device, which is applied to the cloud. Figure 12 FIG. 1 is a schematic diagram showing the structure of the electronic fence acquisition device according to an embodiment of the present invention. Figure 12 As shown, the electronic fence acquisition device 120 includes:

[0151] An acquisition unit 1201 is configured to acquire the vehicle location and current service type sent by the terminal device;

[0152] The processing unit 1202 is configured to determine, based on the current service type and a preset service area having a target radius and centered at the terminal device, at least one candidate electronic fence from a plurality of electronic fences that overlaps with the preset service area; wherein the target radius is a radius corresponding to the current service type or a preset fixed radius;

[0153] The processing unit 1202 is further configured to send identification information of the at least one target electronic fence to the terminal device when at least one target electronic fence is determined from the at least one candidate electronic fence based on the overlap rate between the preset service area and each candidate electronic fence.

[0154] In this embodiment of the present invention, based on the type of service currently being performed by a terminal device, a plurality of pre-defined electronic fences are precisely selected to match the service type. Subsequently, based on the terminal device's preset service area, at least one eligible candidate electronic fence is further selected from the selected plurality of first electronic fences. Based on this, the overlap ratio between the preset service area and the candidate electronic fences is calculated to determine the target electronic fence closest to the terminal device and distribute it to the terminal device. This series of operations effectively ensures the accuracy, reliability, and flexibility of electronic fence distribution.

[0155] In some embodiments of the present invention, the processing unit 1202 is specifically used to determine multiple first electronic fences corresponding to the current business type from the multiple electronic fences; and determine at least one candidate electronic fence that has an overlapping part with the preset business area from the multiple first electronic fences.

[0156] In some embodiments of the present invention, the acquiring unit 1201 is further configured to acquire a first correspondence between a service type and a radius; the processing unit 1202 is further configured to determine a target radius corresponding to the current service type based on the first correspondence;

[0157] Alternatively, the acquisition unit 1201 is further configured to acquire a target radius corresponding to the current service type determined based on the first corresponding relationship and sent by the terminal device.

[0158] In some embodiments of the present invention, the processing unit 1202 is specifically used to use the longitude and latitude directions as the marking directions to grid the preset business area to obtain a first grid division result; grid each to-be-selected electronic fence to obtain a second grid division result; based on the first grid division result and the second grid division result of each to-be-selected electronic fence, count the number of grids in the overlapping part of the preset business area and each to-be-selected electronic fence; based on the number of grids in the overlapping part of the preset business area and each to-be-selected electronic fence and the target number of grids, obtain the overlap rate of the preset business area and each to-be-selected electronic fence; wherein the target number of grids is the number of grids corresponding to the second grid division result of each to-be-selected electronic fence, or the number of grids corresponding to the first grid division result of the preset business area.

[0159] In some embodiments of the present invention, the processing unit 1202 is specifically used to select at least one candidate electronic fence corresponding to an overlap rate greater than a target overlap rate threshold as at least one target electronic fence based on the overlap rate between the preset business area and each candidate electronic fence; wherein the target overlap rate threshold is the overlap rate threshold corresponding to the current business type, or a pre-set fixed overlap rate threshold.

[0160] In some embodiments of the present invention, the acquisition unit 1201 is also used to obtain a second correspondence between the service type and the overlap rate threshold; the processing unit 1202 is also used to determine the target overlap rate threshold corresponding to the current service type based on the second correspondence; or, the acquisition unit 1201 is also used to obtain the target overlap rate threshold corresponding to the current service type determined based on the second correspondence sent by the terminal device.

[0161] In some embodiments of the present invention, the processing unit 1202 is specifically used to sort the overlap rates of the preset business area and each selected electronic fence in order from large to small or from small to large to obtain a sorting result; and take the selected electronic fence corresponding to the maximum overlap rate in the sorting result as the target electronic fence.

[0162] In some embodiments of the present invention, the processing unit 1202 is specifically used to determine a bounding box containing the preset business area and the electronic fence to be selected; wherein the bounding box is a regular quadrilateral; a large number of points are randomly generated in the bounding box, and a first number of common points between the preset business area and the electronic fence to be selected in the bounding box is obtained, and a second number of points in the bounding box is obtained; based on the first number, the second number and the area of ​​the bounding box, the overlapping area of ​​the preset business area and the electronic fence to be selected is obtained; based on the first number, the third number and the overlapping area, the area of ​​the target area is obtained; wherein the third number is the number of points in the preset business area or the number of points in the electronic fence to be selected, and the area of ​​the target area is the area of ​​the preset business area or the area of ​​the electronic fence to be selected; based on the overlapping area and the target area, the overlap rate of the preset business area and the electronic fence to be selected is obtained.

[0163] The embodiment of the present invention also provides another cloud, Figure 13 FIG. 1 is a schematic diagram of the structure of the cloud component in an embodiment of the present invention. Figure 13 As shown, the cloud 130 includes: a processor 1301 and a memory 1302 configured to store a computer program that can be run on the processor;

[0164] The processor 1301 is configured to execute the method steps in the aforementioned embodiment when running a computer program.

[0165] Of course, in actual application, Figure 13 As shown, the various components in the cloud 130 are coupled together through a bus system 1303. It is understood that the bus system 1303 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 1303 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Figure 13 Various buses are labeled as bus system 1303.

[0166] In practical applications, the processor may be at least one of an application-specific integrated circuit (ASIC), a digital signal processing device (DSPD), a programmable logic device (PLD), a field-programmable gate array (FPGA), a controller, a microcontroller, and a microprocessor. It is understood that for different devices, the electronic device used to implement the functions of the processor may also be other, and the embodiments of the present invention do not specifically limit this.

[0167] The above-mentioned memory can be a volatile memory (volatile memory), such as a random-access memory (RAM); or a non-volatile memory (non-volatile memory), such as a read-only memory (ROM), a flash memory, a hard disk (HDD) or a solid-state drive (SSD); or a combination of the above types of memory, and provide instructions and data to the processor.

[0168] In an exemplary embodiment, the present invention further provides a computer-readable storage medium for storing a computer program.

[0169] Optionally, the computer-readable storage medium can be applied to any one of the methods in the embodiments of the present invention, and the computer program enables the computer to execute the corresponding processes implemented by the processor in each method in the embodiments of the present invention. For the sake of brevity, they are not repeated here.

[0170] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0171] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0172] In addition, the functional units in the embodiments of the present invention can all be integrated into one processing module, or each unit can be a separate unit, or two or more units can be integrated into one unit; the above-mentioned integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units. It can be understood by those skilled in the art that all or part of the steps of the above-mentioned method embodiments can be completed by hardware related to program instructions, and the above-mentioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiments; and the above-mentioned storage medium includes various media that can store program codes, such as mobile storage devices, read-only memories (ROMs), random access memories (RAMs), magnetic disks or optical disks.

[0173] The methods disclosed in the several method embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new method embodiments.

[0174] The features disclosed in several product embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new product embodiments.

[0175] The features disclosed in several method or device embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.

[0176] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.

Claims

1. A method for obtaining an electronic fence, characterized in that: Applied to the cloud, the method for obtaining the electronic fence includes: Obtain the location information and current service type sent by the terminal device; Based on the current service type and a preset service area having a target radius and centered at the terminal device, determining at least one candidate electronic fence from a plurality of electronic fences that overlaps with the preset service area; wherein the target radius is a radius corresponding to the current service type or a preset fixed radius; Based on the overlap rate between the preset service area and each candidate electronic fence, when at least one target electronic fence is determined from the at least one candidate electronic fence, identification information of the at least one target electronic fence is sent to the terminal device.

2. The method for obtaining an electronic fence according to claim 1, characterized in that: The determining, based on the current service type and a preset service area with the terminal device as the center and a target radius, at least one candidate electronic fence having an overlapping portion with the preset service area from a plurality of electronic fences includes: Determining a plurality of first electronic fences corresponding to the current business type from the plurality of electronic fences; At least one to-be-selected electronic fence having an overlapping portion with the preset service area is determined from the plurality of first electronic fences.

3. The method for obtaining an electronic fence according to claim 1, characterized in that: The method for obtaining the electronic fence includes: Obtain the first correspondence between business type and radius; Determining a target radius corresponding to the current service type based on the first corresponding relationship; Alternatively, obtain the target radius corresponding to the current service type determined based on the first corresponding relationship and sent by the terminal device.

4. The method for obtaining an electronic fence according to any one of claims 1 to 3, characterized in that: The method for obtaining the electronic fence further includes: Using the longitude and latitude directions as the marking directions, the preset service area is grid-divided to obtain a first grid-division result; Performing grid division on each candidate electronic fence to obtain a second grid division result; Based on the first grid division result and the second grid division result of each candidate electronic fence, counting the number of grids in the overlapping portion between the preset service area and each candidate electronic fence; Based on the number of grids in the overlapping part of the preset business area and each to-be-selected electronic fence and the target number of grids, the overlap rate of the preset business area and each to-be-selected electronic fence is obtained; wherein the target number of grids is the number of grids corresponding to the second grid division result of each to-be-selected electronic fence, or the number of grids corresponding to the first grid division result of the preset business area.

5. The method for obtaining an electronic fence according to any one of claims 1 to 3, characterized in that: The determining of at least one target electronic fence from the at least one candidate electronic fence based on the overlap rate between the preset service area and each candidate electronic fence includes: Based on the overlap rate between the preset business area and each candidate electronic fence, at least one candidate electronic fence corresponding to an overlap rate greater than a target overlap rate threshold is used as at least one target electronic fence; wherein the target overlap rate threshold is the overlap rate threshold corresponding to the current business type, or a pre-set fixed overlap rate threshold.

6. The method for obtaining an electronic fence according to claim 5, characterized in that: The method for obtaining the electronic fence includes: Obtaining a second correspondence between the service type and the overlap rate threshold; Determining a target overlap rate threshold corresponding to the current service type based on the second corresponding relationship; Alternatively, the target overlap rate threshold corresponding to the current service type determined based on the second corresponding relationship and sent by the terminal device is obtained.

7. The method for obtaining an electronic fence according to any one of claims 1 to 3, characterized in that: The determining of at least one target electronic fence from the at least one candidate electronic fence based on the overlap rate between the preset service area and each candidate electronic fence includes: Sorting the overlap rate between the preset service area and each of the selected electronic fences in order from large to small or from small to large to obtain a sorting result; The candidate electronic fence corresponding to the maximum overlap rate in the sorting result is used as the target electronic fence.

8. The method for obtaining an electronic fence according to any one of claims 1 to 3, characterized in that: The method for obtaining the electronic fence further includes: Determine a bounding box containing the preset service area and the to-be-selected electronic fence; wherein the bounding box is a regular quadrilateral; Randomly generating a large number of points within the bounding box, obtaining a first number of common points between the preset service area and the selected electronic fence within the bounding box, and obtaining a second number of points within the bounding box; Obtaining an overlapping area between the preset service area and the selected electronic fence based on the first number, the second number, and the area of ​​the bounding box; Obtaining a target area based on the first number, the third number, and the overlapping area; wherein the third number is the number of points within the preset service area or the number of points within the to-be-selected electronic fence, and the target area is the area of ​​the preset service area or the area of ​​the to-be-selected electronic fence; Based on the overlapping area and the target area, an overlapping rate between the preset service area and the to-be-selected electronic fence is obtained.

9. An electronic fence acquisition device, characterized in that: Applied to the cloud, the electronic fence acquisition device includes: An acquisition unit, used to acquire the vehicle position and current service type sent by the terminal device; a processing unit, configured to determine, based on the current service type and a preset service area having the terminal device as a center and a target radius, at least one candidate electronic fence from a plurality of electronic fences that overlaps with the preset service area; wherein the target radius is a radius corresponding to the current service type or a preset fixed radius; The processing unit is further configured to send identification information of the at least one target electronic fence to the terminal device when at least one target electronic fence is determined from the at least one candidate electronic fence based on the overlap rate between the preset service area and each candidate electronic fence.

10. A cloud, characterized in that: The cloud comprises: a processor and a memory configured to store a computer program capable of running on the processor, Wherein, the processor is configured to execute the steps of the method for obtaining an electronic fence according to any one of claims 1 to 8 when running the computer program.