Positioning method, device and storage medium based on self-defined electronic fence

By constructing a custom electronic fence and utilizing boundary point information and GPS positioning, the problem of unstable signal in existing technologies has been solved, enabling accurate positioning and alerting in irregularly shaped areas in complex terrain.

CN120416769BActive Publication Date: 2026-02-13SHENZHEN PAILEJI TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510794099.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-13
Publication Date
2026-02-13
Estimated Expiration
2045-06-13

AI Technical Summary

Technical Problem

Existing electronic fences suffer from unstable signals in complex terrain, leading to inaccurate location analysis and making it difficult to meet the positioning needs of customized irregular areas.

Method used

By acquiring the data from multiple boundary points, a custom electronic fence is constructed. Using GPS positioning information and boundary point location information, the distance from the moving target to the fence boundary is determined. Based on a preset algorithm, the internal and external positions of the target are judged, thus realizing the customization and accurate positioning of irregularly shaped wireless fences.

Benefits of technology

It can accurately and efficiently determine the relative position of moving targets in complex terrain, provide targeted alerts, and improve the practicality and accuracy of positioning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120416769B_ABST
    Figure CN120416769B_ABST
Patent Text Reader

Abstract

Embodiments of the present application relate to the technical field of electronic fence, and disclose a positioning method and device based on a self-defined electronic fence and a storage medium, the method comprising: acquiring dotting information of a plurality of boundary points; constructing a closed electronic fence according to the dotting information of the plurality of boundary points; acquiring GPS positioning information of a mobile target, determining boundary distances from the mobile target to each boundary of the electronic fence according to the positioning information and position information of the plurality of boundary points, and determining a minimum boundary distance from all the boundary distances; determining an inside-outside position of the mobile target in the electronic fence according to the positioning information, the position information of the plurality of boundary points and a preset inside-outside algorithm; and determining a relative position of the mobile target to the electronic fence according to the minimum boundary distance and the inside-outside position. In the above manner, the embodiments of the present application can self-define a special-shaped wireless fence in a complex terrain, and accurately and efficiently determine the relative position of the mobile target to the self-defined electronic fence.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of electronic fence, and particularly to a positioning method based on a self-defined electronic fence, a device and a storage medium. BACKGROUND

[0002] The earliest fence adopts physical wood, iron and the like to enclose a region to limit the moving target's activity range. With the development of technology, GPS wireless fence, wireless fence through signal transmitter and receiver for wireless signal transmission, wireless fence with coil buried underground for signal transmission and the like appear. However, the GPS wireless fence is a circular region with a set point as the center, which is difficult to meet the complete coverage of complex terrain signals, and the wireless fence with signal transmitter and receiver needs to set more transmitters and receivers, which is easily affected by external environmental factors to cause unstable signals. The wireless fence with coil buried underground is easily affected by physical obstacles and other electronic devices in the same frequency band to cause unstable signals. The unstable signals lead to inaccurate analysis of the position of the moving target relative to the wireless fence, especially in the complex terrain scene, the accuracy and practicability need to be improved. SUMMARY

[0003] In view of the above problems, embodiments of the present application provide a positioning method based on a self-defined electronic fence, a device and a storage medium to solve the problems existing in the prior art.

[0004] According to an aspect of an embodiment of the present application, a positioning method based on a self-defined electronic fence is provided, applied to a positioning device, and the method comprises:

[0005] acquiring dotting information of a plurality of boundary points, wherein the positioning device is worn on a moving target, and the dotting information comprises position information;

[0006] constructing a closed electronic fence according to the dotting information of the plurality of boundary points;

[0007] acquiring GPS positioning information of the moving target, determining boundary distances of the moving target to each boundary of the electronic fence according to the positioning information and the position information of the plurality of boundary points, and determining a minimum boundary distance from all the boundary distances, wherein the boundary is a line segment determined by two adjacent boundary points;

[0008] determining an inside or outside position of the moving target in the electronic fence according to the positioning information, the position information of the plurality of boundary points and a preset boundary inside or outside algorithm;

[0009] determining a relative position of the moving target to the electronic fence according to the minimum boundary distance and the inside or outside position.

[0010] In an alternative way, the GPS positioning information of the mobile target is acquired, the boundary distances of the mobile target to each boundary of the electronic fence are determined according to the positioning information and the position information of the plurality of boundary points, and the minimum boundary distance is determined from all the boundary distances, comprising:

[0011] A plane rectangular coordinate system is established, the positioning point where the mobile target is located and the plurality of boundary points are respectively converted to the plane rectangular coordinate system according to the positioning information and the position information of the plurality of boundary points, and a fence coordinate graph is obtained;

[0012] Based on the fence coordinate graph and a preset boundary distance algorithm, the boundary distances of the positioning point to each boundary in the fence coordinate graph are determined, and the minimum boundary distance is determined from all the boundary distances.

[0013] In an alternative way, based on the fence coordinate graph and a preset boundary distance algorithm, the boundary distances of the positioning point to each boundary in the fence coordinate graph are determined, and the minimum boundary distance is determined from all the boundary distances, comprising:

[0014] For each boundary in the fence coordinate graph, a perpendicular line of the positioning point to the straight line where the boundary is located is determined, and a first intersection point of the perpendicular line and the straight line where the boundary is located is determined;

[0015] It is determined whether the abscissa values of the two boundary points of the boundary are equal;

[0016] If the abscissa values of the two boundary points of the boundary are equal, it is determined whether the ordinate values of the first intersection point are greater than the ordinate values of the two boundary points of the boundary respectively, or whether the ordinate values of the first intersection point are less than the ordinate values of the two boundary points of the boundary respectively;

[0017] If the ordinate values of the first intersection point are greater than the ordinate values of the two boundary points of the boundary respectively, or the ordinate values of the first intersection point are less than the ordinate values of the two boundary points of the boundary respectively, the first minimum distance of the positioning point to the two boundary points of the boundary is acquired as the boundary distance; if the ordinate value of the first intersection point is between the ordinate values of the two boundary points of the boundary, or the ordinate value of the first intersection point is equal to the ordinate value of any one of the two boundary points of the boundary, the distance of the positioning point to the first intersection point is taken as the boundary distance;

[0018] if the abscissa values of the two boundary points of the boundary are not equal, determining whether the abscissa value of the first intersection point is greater than or less than the abscissa value of the two boundary points of the boundary respectively;

[0019] if the abscissa value of the first intersection point is greater than or less than the abscissa value of the two boundary points of the boundary respectively, obtaining a second minimum distance from the positioning point to the two boundary points of the boundary respectively, and taking the second minimum distance as the boundary distance; if the abscissa value of the first intersection point is between the abscissa values of the two boundary points of the boundary or equal to the abscissa value of any one of the two boundary points, taking the distance from the positioning point to the first intersection point as the boundary distance;

[0020] determining the minimum boundary distance from all the boundary distances.

[0021] In an optional manner, the dotting information further comprises a dotting sequence, and the method for determining the position of the mobile target inside or outside the electronic fence according to the positioning information, the position information of the plurality of boundary points and the preset boundary inside-outside algorithm comprises:

[0022] for each boundary in the fence coordinate graph, determining whether the abscissa value of the positioning point is between the abscissa values of the two boundary points of the boundary or equal to the abscissa value of the first boundary point of the two boundary points, wherein the first boundary point is the boundary point in front in the dotting sequence, and the second boundary point is the boundary point behind in the dotting sequence;

[0023] if the abscissa value of the positioning point is between the abscissa values of the two boundary points of the boundary or equal to the abscissa value of the first boundary point of the two boundary points, determining a vertical line passing through the positioning point and perpendicular to the abscissa axis of the fence coordinate graph, and determining a second intersection point of the vertical line and the boundary;

[0024] if the ordinate value of the second intersection point is greater than the ordinate value of the positioning point, determining whether the abscissa value of the positioning point is equal to the abscissa value of the first boundary point of the boundary;

[0025] if the abscissa value of the positioning point is not equal to the abscissa value of the first boundary point of the boundary, outputting an analysis result of the positioning point corresponding to the boundary;

[0026] if the abscissa value of the positioning point is equal to the abscissa value of the first boundary point of the boundary, determining whether the abscissa value of the first boundary point is between the abscissa value of the previous boundary point of the first boundary point and the abscissa value of the second boundary point;

[0027] if the abscissa value of the first boundary point is between the abscissa value of the previous boundary point of the first boundary point and the abscissa value of the second boundary point, outputting the analysis result of the positioning point corresponding to the boundary;

[0028] determining the position of the mobile target inside or outside the electronic fence according to the total number of the analysis results of all the boundaries.

[0029] In an optional manner, the analysis result is 1, and the position of the mobile target inside or outside the electronic fence is determined according to the total number of the analysis results of all the boundaries, comprising:

[0030] if the total number of the analysis results of all the boundaries is odd, the mobile target is inside the electronic fence, and if the total number of the analysis results of all the boundaries is even, the mobile target is outside the electronic fence.

[0031] In an optional manner, the method further comprises:

[0032] performing corresponding level of reminding on the mobile target according to the relative position and the preset reminding mechanism.

[0033] In an optional manner, the performing corresponding level of reminding on the mobile target according to the relative position and the preset reminding mechanism comprises:

[0034] when the mobile target is inside the electronic fence, the minimum boundary distance is greater than a first preset value, and the minimum boundary distance is constantly increasing, or when the mobile target is outside the electronic fence, the minimum boundary distance is less than a second preset value, and the minimum boundary distance is constantly increasing, performing linear reminding on the mobile target, wherein the minimum boundary distance corresponding to the boundary is negative and gradually increases when the mobile target moves from inside the electronic fence to the boundary, the minimum boundary distance corresponding to the boundary is zero when the mobile target is located at the boundary, and the minimum boundary distance corresponding to the boundary is positive and gradually increases when the mobile target moves from the boundary to outside the electronic fence;

[0035] when the mobile target is outside the electronic fence, and the minimum boundary distance is greater than or equal to the second preset value, performing the strongest reminding on the mobile target;

[0036] When the mobile target is located outside the electronic fence, and the minimum boundary distance is greater than or equal to the second preset value for a time greater than a preset time, a minimum-intensity reminder is given to the mobile target.

[0037] In an alternative mode, the method further comprises:

[0038] Receiving dotting information of a plurality of boundary points dotted on a GPS map interface of the positioning device, and storing the dotting information locally.

[0039] According to still another aspect of the embodiments of the present application, a computer device is provided, comprising a processor, a memory, a communication interface and a communication bus, the processor, the memory and the communication interface complete communication with each other through the communication bus; the memory is used to store at least one executable instruction, which causes the processor to execute the method as described above.

[0040] According to still another aspect of the embodiments of the present application, a computer readable storage medium is provided, the storage medium stores at least one executable instruction, which, when running on a computer device, causes the computer device to execute the method as described above.

[0041] The positioning device of the embodiments of the present application first acquires dotting information of a plurality of boundary points, realizes a wireless fence of a self-defined shape according to the dotting information, performs GPS positioning on a mobile target, determines minimum boundary distances of the mobile target to each boundary of the electronic fence according to GPS positioning information and position information of the boundary points of the electronic fence, determines an inside or outside position of the mobile target relative to the electronic fence according to the positioning information, the position information of the boundary points of the electronic fence and a preset boundary inside or outside algorithm, and determines a relative position of the mobile target relative to the electronic fence according to the minimum boundary distances and the inside or outside position. The positioning device can self-define a wireless fence of a special shape in a complex terrain, accurately and efficiently determine a relative position of the mobile target relative to the self-defined electronic fence, has high practicability, and can provide favorable conditions for taking corresponding measures to remind or urge the mobile target to return to the electronic fence.

[0042] The above description is only a summary of the technical solutions of the embodiments of the present application, in order to more clearly understand the technical means of the embodiments of the present application, the embodiments of the present application can be implemented according to the content of the description, and in order to make the above and other purposes, features and advantages of the embodiments of the present application more obvious and easy to understand, the specific embodiments of the present application are described below. BRIEF DESCRIPTION OF DRAWINGS

[0043] The accompanying drawings are included to provide a further understanding of the embodiments of the present application, and are incorporated herein and constitute a part of the detailed description. The embodiments of the present application will be best understood by reference to the accompanying drawings, wherein:

[0044] Figure 1 Fig. 1 shows a structural schematic diagram of a positioning device in a positioning method based on a self-defined electronic fence according to an embodiment of the present application;

[0045] Figure 2 Fig. 2 shows a flowchart of a positioning method based on a self-defined electronic fence according to an embodiment of the present application;

[0046] Figure 3 Fig. 3 shows a schematic diagram of a fence coordinate map and a positioning point in a positioning method based on a self-defined electronic fence according to an embodiment of the present application;

[0047] Figure 4 Fig. 4 shows a structural schematic diagram of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION

[0048] Exemplary embodiments of the present application will be described in detail with reference to the drawings. Although exemplary embodiments of the present application are shown in the drawings, it is understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein.

[0049] Figure 1 Fig. 1 shows a structural schematic diagram of a positioning device according to an embodiment of the present application. As shown in Fig. 1, the positioning device comprises a GPS device and a processing device, and can further comprise a reminding device. The GPS device is used to position a mobile target, and the processing device is used to acquire dotting information of a plurality of boundary points, construct a self-defined electronic fence according to the dotting information, and make a real-time position judgment according to positioning information of the electronic fence and the mobile target. The processing device can also send a signal to the reminding device according to the judgment result, so that the reminding device responds in the form of at least one reminding mode and corresponding reminding intensity, thereby reminding the mobile target. Figure 1

[0050] Fig. 2 shows a flowchart of a positioning method based on a self-defined electronic fence according to an embodiment of the present application. The method comprises the following steps: Figure 2 S10, acquiring dotting information of a plurality of boundary points, wherein the positioning device is worn on a mobile target, and the dotting information comprises position information.

[0051] The mobile target can be a pet or other self-moving target, such as livestock, etc. The dotting information for constructing the electronic fence can be sent to the positioning device by an external device or directly input to the positioning device, or can be obtained by dotting on a GPS map interface of the GPS device. The dotting information comprises position information, and the position information is longitude and latitude. The dotting information also comprises a dotting order, i.e., an order of the dotting boundary points.

[0052]

[0053] ​Preferably, the method further comprises: receiving dotting information of a plurality of boundary points dotted on a GPS map interface of the positioning device, and storing the dotting information locally. Wherein, the GPS device comprises a GPS map interface, and the dotting information can be obtained by dotting on the GPS map interface as needed, and the dotting information is stored locally to construct a self-defined electronic fence. Preferably, when dotting, in order to avoid overlapping of the electronic fence boundaries or subsequent difficulty in determining the inside and outside positions of the electronic fence, the embodiment ensures that the corresponding abscissa value of each boundary point dotted has a unique value. The abscissa value of the boundary point dotted this time is compared with the abscissa value of the boundary point already dotted. If there is a boundary point with the same abscissa value, the abscissa value of the boundary point dotted this time is adjusted, for example, reduced by 10 cm, so that the corresponding abscissa value of each boundary point is not the same. Wherein, after the first boundary point is dotted, a coordinate axis can be established with the first boundary point as the origin, thereby facilitating analysis that the corresponding abscissa value of each boundary point dotted has a unique value.

[0054] The positioning device of the embodiment can dot locally and obtain dotting information from the local, realize offline work, and does not need to be connected to a network, nor does it need to install an APP on a mobile phone or other external terminal and provide related user information.

[0055] S20, constructing a closed electronic fence according to the dotting information of the plurality of boundary points.

[0056] In the embodiment, the plurality of boundary points can construct a closed electronic fence. The user can dot according to actual needs or preferences, and through the dotting method, the electronic fence is no longer a fixed shape area, and a self-defined, fixed shape or non-fixed shape electronic fence can be obtained, which can meet the fence setting of complex terrain and can meet the requirements of the user for special-shaped wireless fences to the greatest extent.

[0057] Optionally, when constructing a closed electronic fence according to the dotting information, each boundary point can be connected in a straight line according to the dotting order, and the start boundary point and the end boundary point in the boundary points are connected in a straight line to obtain the electronic fence.

[0058] Wherein, the boundary points are connected in a straight line according to the dotting order, for example, the boundary point ranked first in the dotting order is connected in a straight line to the boundary point ranked second in the dotting order, the boundary point ranked second in the dotting order is connected in a straight line to the boundary point ranked third in the dotting order, and so on. Finally, the boundary point ranked first in the dotting order and the boundary point ranked last in the dotting order can be connected in a straight line through a predetermined trigger operation, that is, the start boundary point and the end boundary point are connected in a straight line. The predetermined trigger operation can be a double-click operation or a long-press operation of a predetermined key.

[0059] S30, obtaining GPS positioning information of the mobile target, determining boundary distances of the mobile target to each boundary of the electronic fence according to the positioning information and position information of the plurality of boundary points, and determining a minimum boundary distance from all the boundary distances.

[0060] The positioning device of the embodiment can obtain the positioning information of the mobile target by real-time positioning of the mobile target. The positioning information obtained by the GPS device is longitude and latitude, and the position information of the boundary points is also longitude and latitude. The boundary distances of the mobile target to each boundary can be calculated according to the positioning information of the mobile target and the position information of the boundary points. The boundary distance of the mobile target to each boundary is the distance from a point to a line segment, which can be the perpendicular distance from a point to a line segment or the distance from a point to an endpoint of a boundary. After the boundary distances of the mobile target to each boundary are determined, the minimum boundary distance needs to be further determined. The minimum boundary distance is the distance from the mobile target to the boundary at the shortest distance, and thus the minimum boundary distance is the distance from the mobile target to the boundary of the electronic fence.

[0061] In an embodiment, the GPS positioning information of the mobile target is obtained, the boundary distances of the mobile target to each boundary of the electronic fence are determined according to the positioning information and the position information of the plurality of boundary points, and the minimum boundary distance is determined from all the boundary distances, including:

[0062] A plane rectangular coordinate system is established, the positioning point where the mobile target is located and the plurality of boundary points are respectively converted to the plane rectangular coordinate system according to the positioning information and the position information of the plurality of boundary points, and a fence coordinate graph is obtained;

[0063] The boundary distances of the positioning point to each boundary in the fence coordinate graph are determined based on the fence coordinate graph and a preset boundary distance algorithm, and the minimum boundary distance is determined from all the boundary distances.

[0064] The embodiment calculates the boundary distance by establishing a plane rectangular coordinate system. After the plane rectangular coordinate system is established, the positioning point where the mobile target is located and the boundary points can be converted to the plane rectangular coordinate system to obtain a fence coordinate graph, which includes the X-axis, the Y-axis, the fence formed by connecting the boundary points, and the positioning point. Preferably, in order to conveniently calculate the boundary distance, the starting boundary point with the first dotting order is converted to the origin of the plane rectangular coordinate system, and other boundary points and the positioning point are also converted to the plane rectangular coordinate system according to the position information of the boundary points and the positioning information of the positioning point. Of course, the above method of establishing a plane rectangular coordinate system to calculate the boundary distance can not be used, and other suitable coordinate systems can be established and similar methods can be used to calculate the boundary distance, which is not limited here.

[0065] Further, based on the fence coordinate graph and a preset boundary distance algorithm, a boundary distance of the positioning point to each boundary in the fence coordinate graph is determined, and the minimum boundary distance is determined from all the boundary distances, comprising:

[0066] For each boundary in the fence coordinate graph, a perpendicular line of the positioning point to a straight line where the boundary is located is determined, and a first intersection point of the perpendicular line and the straight line where the boundary is located is determined;

[0067] Whether the abscissa values of two boundary points of the boundary are equal is determined;

[0068] If the abscissa values of the two boundary points of the boundary are equal, whether the ordinate values of the first intersection point are respectively greater than the ordinate values of the two boundary points of the boundary or whether the ordinate values of the first intersection point are respectively less than the ordinate values of the two boundary points of the boundary is determined;

[0069] If the ordinate values of the first intersection point are respectively greater than the ordinate values of the two boundary points of the boundary or the ordinate values of the first intersection point are respectively less than the ordinate values of the two boundary points of the boundary, a first distance minimum value of the positioning point to the two boundary points of the boundary is obtained, and the first distance minimum value is taken as the boundary distance; if the ordinate value of the first intersection point is between the ordinate values of the two boundary points of the boundary or the ordinate value of the first intersection point is equal to the ordinate value of any one of the two boundary points of the boundary, a distance of the positioning point to the first intersection point is taken as the boundary distance;

[0070] If the abscissa values of the two boundary points of the boundary are not equal, whether the abscissa values of the first intersection point are respectively greater than the abscissa values of the two boundary points of the boundary or whether the abscissa values of the first intersection point are respectively less than the abscissa values of the two boundary points of the boundary is determined;

[0071] If the abscissa values of the first intersection point are respectively greater than the abscissa values of the two boundary points of the boundary or the abscissa values of the first intersection point are respectively less than the abscissa values of the two boundary points of the boundary, a second distance minimum value of the positioning point to the two boundary points of the boundary is obtained, and the second distance minimum value is taken as the boundary distance; if the abscissa value of the first intersection point is between the abscissa values of the two boundary points of the boundary or the abscissa value of the first intersection point is equal to the abscissa value of any one of the two boundary points of the boundary, a distance of the positioning point to the first intersection point is taken as the boundary distance;

[0072] The minimum boundary distance is determined from all the boundary distances.

[0073] In the embodiment, since the moving target can be moving constantly, the positioning device can calculate the boundary distance of the positioning point to each boundary every predetermined time, and determine the minimum boundary distance from all the boundary distances, for example, the predetermined time is 5 seconds or 10 seconds. The embodiment first determines the perpendicular line of the positioning point to the straight line where the boundary is located, and judges whether the perpendicular line intersects the line segment where the boundary is located or the straight line other than the line segment, if the perpendicular line intersects the line segment where the boundary is located, the distance of the positioning point to the line segment is the minimum boundary distance, otherwise, the minimum boundary distance is the distance of the positioning point to the boundary point with the minimum distance value among the two boundary points of the boundary. The embodiment can efficiently and accurately calculate the boundary distance by the fence coordinate graph and the preset boundary distance algorithm, so as to determine the minimum boundary distance, and realize the accurate judgment of the distance of the moving target to the electronic fence.

[0074] S40, determining the inside or outside position of the moving target to the electronic fence according to the positioning information, the position information of the plurality of boundary points and the preset boundary inside or outside algorithm.

[0075] In the embodiment, after the minimum boundary distance is determined, it cannot be determined whether the moving target is located inside or outside the electronic fence, if the moving target is located inside the electronic fence, the safety risk is low, if the moving target is located outside the electronic fence, the safety risk is high. In view of this, the moving target can be further determined to be located inside or outside the electronic fence, in the process, the relative position relationship between the moving target and each boundary needs to be analyzed in the fence coordinate graph, and the moving target is further determined to be located inside or outside the electronic fence according to the relative position relationship between the moving target and all the boundaries.

[0076] Further, the inside or outside position of the moving target to the electronic fence is determined according to the positioning information, the position information of the plurality of boundary points and the preset boundary inside or outside algorithm, including:

[0077] For each boundary in the fence coordinate graph, it is determined whether the horizontal coordinate value of the positioning point is between the horizontal coordinate values of the two boundary points of the boundary or equal to the horizontal coordinate value of the first boundary point of the two boundary points of the boundary, wherein the first boundary point is the boundary point in front of the point sequence, and the second boundary point is the boundary point behind the point sequence;

[0078] If the horizontal coordinate value of the positioning point is between the horizontal coordinate values of the two boundary points of the boundary or equal to the horizontal coordinate value of the first boundary point of the two boundary points of the boundary, a perpendicular line is determined which passes through the positioning point and is perpendicular to the horizontal coordinate axis of the fence coordinate graph, and a second intersection point of the perpendicular line and the boundary is determined;

[0079] If the vertical coordinate value of the second intersection point is greater than the vertical coordinate value of the positioning point, it is determined whether the horizontal coordinate value of the positioning point is equal to the horizontal coordinate value of the first boundary point of the boundary.

[0080] If the abscissa value of the positioning point is not equal to the abscissa value of the first boundary point of the boundary, output the analysis result of the positioning point corresponding to the boundary;

[0081] If the abscissa value of the positioning point is equal to the abscissa value of the first boundary point of the boundary, determine whether the abscissa value of the first boundary point is between the abscissa value of the previous boundary point of the first boundary point and the abscissa value of the second boundary point;

[0082] If the abscissa value of the first boundary point is between the abscissa value of the previous boundary point of the first boundary point and the abscissa value of the second boundary point, output the analysis result of the positioning point corresponding to the boundary;

[0083] Determine the internal and external positions of the moving target in the electronic fence according to the total number of analysis results of all boundaries.

[0084] Exemplarily, as Figure 3 shown, it is a fence coordinate map obtained for a custom irregular-shaped electronic fence. In this fence coordinate map, the fence is ABCDEFGHIJK. For positioning point 1 (the ray passing through positioning point 1 passes through the boundary point. After the ray passes out of the electronic fence from the inside and then passes into the inside from the outside and then passes out), the boundaries that satisfy the abscissa value of positioning point 1 being between the abscissa values of two boundary points or equal to the abscissa value of the first boundary point of the two boundary points include JK, BC, CD, GH. The vertical line passing through positioning point 1 and perpendicular to the X-axis of the fence coordinate map has corresponding second intersections with the boundaries JK, BC, CD, GH. Among them, the boundaries that satisfy the ordinate value of the second intersection being greater than the ordinate value of fixed point 1 are BC, CD, GH. The boundaries where the abscissa value of positioning point 1 is not equal to the abscissa value of the first boundary point are CD, GH. Output the analysis result of positioning point 1 corresponding to boundary CD and the analysis result of positioning point 1 corresponding to boundary GH; the boundary where the abscissa value of positioning point 1 is equal to the abscissa value of the first boundary point is BC. The abscissa value of the first boundary point B of boundary BC is between the abscissa value of the previous boundary point A of the first boundary point B and the abscissa value of the second boundary point C. Then output the analysis result of positioning point 1 corresponding to boundary BC, and a total of 3 analysis results are output. Among them, if the total number of analysis results is odd, the moving target is inside the electronic fence; if the total number of analysis results is even, the moving target is outside the electronic fence. A total of 3 analysis results are output for positioning point 1. Therefore, it is determined that positioning point 1 is inside the electronic fence.

[0085] Similarly, for the positioning point 2 (the ray passing through the positioning point 2 passes through the boundary point, the ray penetrates from the outside to the inside and penetrates out), the boundaries satisfying the condition that the longitudinal coordinate value of the second intersection point is greater than the longitudinal coordinate value of the positioning point 2 include the boundaries CD, FG, GH, and the boundaries JK and AB do not satisfy the condition. The boundaries whose horizontal coordinate value of the first boundary point is not equal to the horizontal coordinate value of the positioning point 2 are CD and GH, and the analysis results of the boundary CD corresponding to the positioning point 2 and the analysis results of the boundary GH corresponding to the positioning point 2 are output, and the boundary FG, whose horizontal coordinate value of the first boundary point F is not between the horizontal coordinate value of the previous boundary point E of the first boundary point F and the horizontal coordinate value of the second boundary point G, will not output the corresponding analysis results. Therefore, a total of 2 analysis results are output, the total number of analysis results is even, and it is determined that the mobile target is outside the electronic fence. For the positioning point 3, the boundaries satisfying the condition that the longitudinal coordinate value of the second intersection point is greater than the longitudinal coordinate value of the positioning point 3 include the boundaries AB, CD, EF, and GH, and finally the analysis results corresponding to the boundaries AB, CD, and EF will be output, but the boundary GH, whose horizontal coordinate value of the first boundary point G is not between the horizontal coordinate value of the previous boundary point F of the first boundary point G and the horizontal coordinate value of the second boundary point H, will not output the corresponding analysis results. Therefore, a total of 3 analysis results are output, the total number of analysis results is odd, and it is determined that the mobile target is inside the electronic fence. For the positioning point 4, the boundaries satisfying the condition that the longitudinal coordinate value of the second intersection point is greater than the longitudinal coordinate value of the positioning point 4 include the boundaries AB and EF, and the analysis results corresponding to the boundary AB will be output, but the boundary EF does not satisfy the condition. Therefore, a total of 1 analysis result is output, the total number of analysis results is odd, and it is determined that the mobile target is inside the electronic fence.

[0086] For a self-defined irregularly shaped electronic fence, it is difficult to determine the inside and outside positions of the positioning point in the electronic fence. As described above, the positioning points 1, 2, 3, and 4 cannot be accurately determined by the existing method, and the fence coordinate graph and the boundary inside and outside algorithm can efficiently and accurately determine the inside and outside positions of the mobile target in the self-defined electronic fence.

[0087] Further, the analysis result is 1, and the inside and outside positions of the mobile target in the electronic fence are determined according to the total number of analysis results of all boundaries, including: if the total number of analysis results of all boundaries is odd, the mobile target is inside the electronic fence, and if the total number of analysis results of all boundaries is even, the mobile target is outside the electronic fence.

[0088] The embodiment is based on the principle that for a closed figure, if the number of intersection points generated by a ray starting from a point in any direction and the edges of the closed figure is odd, the point is inside the closed figure, and if the number of intersection points is even, the point is outside the closed figure. The inside and outside positions of the positioning points in the electronic fence are determined. For the positioning points 1, 2, 3 and 4, the condition is met and the analysis result 1 is output, and the condition is not met and 0 can be output. Then, the output data is added to obtain a total sum. If the total sum is odd, the mobile target is inside the electronic fence, and if the total sum is even, the mobile target is outside the electronic fence.

[0089] S50, determining the relative position of the mobile target to the electronic fence according to the minimum boundary distance and the inside and outside position.

[0090] The relative position of the embodiment includes the minimum boundary distance and the inside and outside position of the mobile target in the electronic fence. After the relative position of the mobile target is determined, the current position of the mobile target can be accurately monitored and the possible direction of the mobile target can be predicted.

[0091] The positioning device of the embodiment of the application first acquires the dotting information of the plurality of boundary points, realizes the wireless fence of the self-defined shape according to the dotting information, performs GPS positioning on the mobile target by the positioning device, determines the minimum boundary distance of the mobile target to each boundary of the electronic fence according to the GPS positioning information and the position information of the boundary points of the electronic fence, determines the inside and outside position of the mobile target in the electronic fence according to the positioning information, the position information of the boundary points of the electronic fence and the preset boundary inside and outside algorithm, determines the relative position of the mobile target to the electronic fence according to the minimum boundary distance and the inside and outside position, can self-define the special-shaped wireless fence in the complex terrain, accurately and efficiently determines the relative position of the mobile target to the self-defined electronic fence, has high practicability, and can provide favorable conditions for reminding or prompting the mobile target to return to the electronic fence by taking corresponding measures subsequently.

[0092] In an embodiment, on the basis of the above-mentioned embodiment, the method further includes: reminding the mobile target at a corresponding level according to the relative position and a preset reminding mechanism.

[0093] The embodiment reminds the mobile target according to the minimum boundary distance and the position of the mobile target inside or outside the electronic fence. If the mobile target is inside the electronic fence and far from the boundary, no reminder is given. If the mobile target is inside the electronic fence and close to the boundary, a reminder with weak intensity is given. If the mobile target is outside the electronic fence, a reminder with strong intensity is given. The embodiment reminds the mobile target according to the relative position and the preset reminding mechanism, and can remind the mobile target accurately based on the position of the mobile target, and has a strong effect of prompting the mobile target to return to the electronic fence.

[0094] Preferably, reminding the mobile target according to the relative position and the preset reminding mechanism comprises:

[0095] When the mobile target is inside the electronic fence, the minimum boundary distance is greater than a first preset value, and the minimum boundary distance is constantly increasing, or when the mobile target is outside the electronic fence, the minimum boundary distance is less than a second preset value, and the minimum boundary distance is constantly increasing, a linear reminder is given to the mobile target. When the mobile target moves from inside the electronic fence to the boundary, the minimum boundary distance corresponding to the boundary is negative and gradually increases. When the mobile target is at the boundary, the minimum boundary distance corresponding to the boundary is zero. When the mobile target moves from the boundary to outside the electronic fence, the minimum boundary distance corresponding to the boundary is positive and gradually increases.

[0096] When the mobile target is outside the electronic fence, and the minimum boundary distance is greater than or equal to the second preset value, a reminder with the maximum intensity is given to the mobile target.

[0097] When the mobile target is outside the electronic fence, and the minimum boundary distance is greater than or equal to the second preset value for a time greater than a preset time, a reminder with the minimum intensity is given to the mobile target.

[0098] In this embodiment, when the mobile target is located inside the electronic fence, the boundary distance is negative; when the mobile target is located at the boundary, the boundary distance is zero; and when the mobile target is located outside the electronic fence, the boundary distance is positive. Exemplarily, the first preset value is -3 m, and the second preset value is 10 m. When the minimum boundary distance of the mobile target is less than or equal to -3 m, no reminding can be performed; when the minimum boundary distance of the mobile target is between -3 m and 10 m, linear reminding is performed to remind the mobile target to return to the electronic fence or to enter an area of the electronic fence that does not require reminding. The linear reminding refers to that the intensity of the reminding is increased as the minimum boundary distance increases. The reminding device can use one or more of a buzzer, a vibration motor, and an electric shock to perform the reminding. The intensity of the reminding can be described by using a decibel value of the buzzer, a rotation speed of the vibration motor, and a voltage or current value of the electric shock.

[0099] In addition, when the mobile target is located outside the electronic fence and the minimum boundary distance is greater than or equal to the second preset value, the mobile target is far away from the electronic fence, and the most intense reminding is performed on the mobile target to remind the mobile target to return to the electronic fence. When the mobile target is located outside the electronic fence and the minimum boundary distance is greater than or equal to the second preset value for a time greater than a preset time (for example, 1 minute), the protection mode is entered, and the least intense reminding is performed on the mobile target to avoid other accidents of the mobile target due to the too intense reminding.

[0100] In other embodiments, if the minimum boundary distance corresponding to the mobile target gradually decreases from greater than or equal to the second preset value, when the minimum boundary distance is less than the second preset value, linear reminding is still performed on the mobile target, and the intensity of the reminding is decreased as the minimum boundary distance decreases. When the minimum boundary distance corresponding to the mobile target is less than or equal to the first preset value, the reminding is ended. In this embodiment, the mobile target is reminded according to the minimum boundary distance, the inside and outside positions of the mobile target in the electronic fence, and the preset reminding mechanism, and the reminding is targeted and has a strong guiding effect to promote the mobile target to return to the electronic fence.

[0101] Figure 4 A structural schematic diagram of an embodiment of a computer device of the present application is shown, and the embodiment of the present application does not limit the specific implementation of the computer device.

[0102] As shown in Figure 4 the computer device can include a processor 402, a communications interface 404, a memory 406, and a communications bus 408.

[0103] The processor 402, the communication interface 404, and the memory 406 communicate with each other through a communication bus 408. The communication interface 404 is configured to communicate with network elements such as clients or other servers. The processor 402 is configured to execute the program 410, and specifically, execute the steps in the above-described embodiments.

[0104] Specifically, the program 410 can include program codes including computer-executable instructions.

[0105] The processor 402 can be a central processing unit (CPU) or an application-specific integrated circuit (ASIC) or one or more integrated circuits configured to implement embodiments of the present application. The one or more processors included in the computer device can be processors of the same type, such as one or more CPUs, or processors of different types, such as one or more CPUs and one or more ASICs.

[0106] The memory 406 is configured to store the program 410. The memory 406 can include a high-speed RAM memory and can further include a non-volatile memory such as at least one disk memory.

[0107] The program 410 can be specifically invoked by the processor 402 to cause the computer device to perform the following operations:

[0108] Obtain dotting information of a plurality of boundary points, wherein the positioning device is worn on a moving target, and the dotting information includes position information;

[0109] Construct a closed electronic fence according to the dotting information of the plurality of boundary points;

[0110] Obtain GPS positioning information of the moving target, determine boundary distances of the moving target to each boundary of the electronic fence according to the positioning information and the position information of the plurality of boundary points, and determine a minimum boundary distance from all the boundary distances, wherein the boundary is a line segment determined by two adjacent boundary points;

[0111] Determine an inside or outside position of the moving target in the electronic fence according to the positioning information, the position information of the plurality of boundary points, and a preset inside or outside algorithm;

[0112] Determine a relative position of the moving target to the electronic fence according to the minimum boundary distance and the inside or outside position.

[0113] In an alternative, the GPS positioning information of the mobile target is acquired, the boundary distances of the mobile target to each boundary of the electronic fence are determined according to the positioning information and the position information of the plurality of boundary points, the minimum boundary distance is determined from all the boundary distances, and the method comprises:

[0114] A plane rectangular coordinate system is established, the positioning point where the mobile target is located and the plurality of boundary points are respectively converted to the plane rectangular coordinate system according to the positioning information and the position information of the plurality of boundary points, and a fence coordinate graph is obtained;

[0115] The boundary distances of the positioning point to each boundary in the fence coordinate graph are determined based on the fence coordinate graph and a preset boundary distance algorithm, and the minimum boundary distance is determined from all the boundary distances.

[0116] In an alternative, the boundary distances of the positioning point to each boundary in the fence coordinate graph are determined based on the fence coordinate graph and a preset boundary distance algorithm, and the minimum boundary distance is determined from all the boundary distances, and the method comprises:

[0117] For each boundary in the fence coordinate graph, a perpendicular line of the positioning point to a straight line where the boundary is located is determined, and a first intersection point of the perpendicular line and the straight line where the boundary is located is determined;

[0118] Whether the abscissa values of the two boundary points of the boundary are equal is determined;

[0119] If the abscissa values of the two boundary points of the boundary are equal, whether the ordinate values of the first intersection point are respectively greater than the ordinate values of the two boundary points of the boundary or the ordinate values of the first intersection point are respectively less than the ordinate values of the two boundary points of the boundary is determined;

[0120] If the ordinate values of the first intersection point are respectively greater than the ordinate values of the two boundary points of the boundary or the ordinate values of the first intersection point are respectively less than the ordinate values of the two boundary points of the boundary, the first minimum distance of the positioning point to the two boundary points of the boundary is acquired, and the first minimum distance is taken as the boundary distance; if the ordinate value of the first intersection point is between the ordinate values of the two boundary points of the boundary or the ordinate value of the first intersection point is equal to the ordinate value of any one of the two boundary points of the boundary, the distance of the positioning point to the first intersection point is taken as the boundary distance;

[0121] If the abscissa values of the two boundary points of the boundary are not equal, whether the abscissa values of the first intersection point are respectively greater than the abscissa values of the two boundary points of the boundary or the abscissa values of the first intersection point are respectively less than the abscissa values of the two boundary points of the boundary is determined.

[0122] If the abscissa value of the first intersection point is greater than the abscissa value of the two boundary points of the boundary respectively, or the abscissa value of the first intersection point is less than the abscissa value of the two boundary points of the boundary respectively, the second minimum distance from the positioning point to the two boundary points of the boundary is obtained, and the second minimum distance is taken as the boundary distance; if the abscissa value of the first intersection point is between the abscissa value of the two boundary points of the boundary, or the abscissa value of the first intersection point is equal to the abscissa value of any one of the two boundary points of the boundary, the distance from the positioning point to the first intersection point is taken as the boundary distance.

[0123] The minimum boundary distance is determined from all the boundary distances.

[0124] In an optional manner, the dotting information further includes a dotting sequence, and the determining of the position of the mobile target inside or outside the electronic fence according to the positioning information, the position information of the plurality of boundary points and the preset boundary inside-outside algorithm includes:

[0125] For each boundary in the fence coordinate graph, it is determined whether the abscissa value of the positioning point is between the abscissa value of the two boundary points of the boundary or equal to the abscissa value of the first boundary point of the two boundary points of the boundary, wherein the first boundary point is the first boundary point in the dotting sequence, and the second boundary point is the second boundary point in the dotting sequence.

[0126] If the abscissa value of the positioning point is between the abscissa value of the two boundary points of the boundary or equal to the abscissa value of the first boundary point of the two boundary points of the boundary, a vertical line passing through the positioning point and perpendicular to the abscissa axis of the fence coordinate graph is determined, and a second intersection point of the vertical line and the boundary is determined.

[0127] If the ordinate value of the second intersection point is greater than the ordinate value of the positioning point, it is determined whether the abscissa value of the positioning point is equal to the abscissa value of the first boundary point of the boundary.

[0128] If the abscissa value of the positioning point is not equal to the abscissa value of the first boundary point of the boundary, an analysis result of the positioning point corresponding to the boundary is output.

[0129] If the abscissa value of the positioning point is equal to the abscissa value of the first boundary point of the boundary, it is determined whether the abscissa value of the first boundary point is between the abscissa value of the previous boundary point of the first boundary point and the abscissa value of the second boundary point.

[0130] if the abscissa value of the first boundary point is between the abscissa value of the previous boundary point of the first boundary point and the abscissa value of the second boundary point, outputting the analysis result of the positioning point corresponding to the boundary;

[0131] determining the inside or outside of the mobile target in the electronic fence according to the total number of the analysis results of all the boundaries.

[0132] In an alternative way, the analysis result is 1, and the determination of the inside or outside of the mobile target in the electronic fence according to the total number of the analysis results of all the boundaries comprises:

[0133] if the total number of the analysis results of all the boundaries is odd, the mobile target is inside the electronic fence, and if the total number of the analysis results of all the boundaries is even, the mobile target is outside the electronic fence.

[0134] In an alternative way, the method further comprises:

[0135] performing a corresponding level of reminding on the mobile target according to the relative position and a preset reminding mechanism.

[0136] In an alternative way, the performing of a corresponding level of reminding on the mobile target according to the relative position and a preset reminding mechanism comprises:

[0137] when the mobile target is inside the electronic fence, the minimum boundary distance is greater than a first preset value, and the minimum boundary distance is constantly increasing, or when the mobile target is outside the electronic fence, the minimum boundary distance is less than a second preset value, and the minimum boundary distance is constantly increasing, performing linear reminding on the mobile target, wherein the minimum boundary distance corresponding to the boundary is negative and gradually increases when the mobile target moves from inside the electronic fence to the boundary, the minimum boundary distance corresponding to the boundary is zero when the mobile target is located at the boundary, and the minimum boundary distance corresponding to the boundary is positive and gradually increases when the mobile target moves from the boundary to outside the electronic fence;

[0138] when the mobile target is outside the electronic fence, and the minimum boundary distance is greater than or equal to the second preset value, performing the strongest reminding on the mobile target;

[0139] when the mobile target is outside the electronic fence, and the minimum boundary distance greater than or equal to the second preset value lasts for a time greater than a preset time, performing the weakest reminding on the mobile target.

[0140] In an alternative way, the method further comprises:

[0141] Receiving pinning information of a plurality of boundary points pinned on a GPS map interface of the positioning device, and storing the pinning information locally.

[0142] The embodiment of the present application provides a computer readable storage medium, the storage medium stores at least one executable instruction, and the executable instruction enables a computer device to execute any method embodiment described above when the executable instruction runs on the computer device.

[0143] The embodiment of the present application provides a computer program, and the computer program can be invoked by a processor to enable a computer device to execute any method embodiment described above.

[0144] The embodiment of the present application provides a computer program product, and the computer program product comprises a computer program stored on a computer readable storage medium, and the computer program comprises program instructions, and the program instructions enable a computer to execute any method embodiment described above when the program instructions run on the computer.

[0145] The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems can be used with these teachings, or with modifications thereto. The construction and the manner of the implementation of the various elements of the system are apparent from the above description. It is also clear that the embodiments of the present application are not limited to any particular programming language. It will be appreciated that a variety of programming languages can be used to implement the teachings of the present application as described herein, and any references below to specific languages are provided for disclosure of enablement only.

[0146] In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the application can be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.

[0147] Similarly, it is to be understood that the technical features of the embodiments of the present application are sometimes alternately grouped together in a single embodiment, drawing, or description of certain embodiments of the application for the purpose of brevity in the foregoing detailed description. However, none of these aspects of the disclosure should be dealt with as reflecting a necessity that the claimed application require a larger number of features than are explicitly recited in each claim.

[0148] Those skilled in the art can understand that the modules in the computer device in the embodiments can be adaptively changed and arranged in one or more computer devices different from the embodiments. The modules or units or components in the embodiments can be combined into one module or unit or component, and can be divided into multiple sub-modules or sub-units or sub-components. Except that at least some of such features and / or processes or units are mutually exclusive, all combinations of all features disclosed in this specification (including accompanying claims, abstract and drawings) and all processes or units of any methods or computer devices disclosed herein can be adopted. Unless explicitly stated otherwise, each feature disclosed in this specification (including accompanying claims, abstract and drawings) can be replaced by an alternative feature providing the same, equivalent or similar function.

[0149] It should be noted that the above-mentioned embodiments illustrate rather than limit the application, and that one skilled in the art will be able to design many alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word 'comprising' does not exclude the presence of elements or steps other than those listed in a claim. The word 'a' or 'an' preceding an element does not exclude the presence of a plurality of such elements. The application can be implemented by means of both hardware and software, and any combination thereof. In a unit claim, several devices can be listed, even though only one device is needed to provide the result. The use of the word 'at least' followed by a list of one or more items does not exclude additional items not listed. The word 'first','second' and the like, when used in the description or in the claims, do not imply any order. The terms 'first','second', 'third', etc. are used to name things for identification only and do not to check or imply characteristics or properties of the individual referred to. The steps of any methods disclosed herein do not have to be performed in the exact order disclosed, unless explicitly stated.

Claims

1. A positioning method based on a self-defined electronic fence, applied to a positioning device, characterized in that, The method comprises: acquiring dotting information of a plurality of boundary points, wherein the positioning device is worn on a moving target, and the dotting information comprises position information; constructing a closed electronic fence according to the dotting information of the plurality of boundary points; acquiring GPS positioning information of the moving target, determining boundary distances of the moving target to each boundary of the electronic fence according to the positioning information and the position information of the plurality of boundary points, determining a minimum boundary distance from all the boundary distances, wherein the boundary is a line segment determined by two adjacent boundary points; determining an inside or outside position of the moving target in the electronic fence according to the positioning information, the position information of the plurality of boundary points and a preset boundary inside or outside algorithm; determining a relative position of the moving target to the electronic fence according to the minimum boundary distance and the inside or outside position; the dotting information further comprises a dotting sequence, and the determination of the inside or outside position of the moving target in the electronic fence according to the positioning information, the position information of the plurality of boundary points and the preset boundary inside or outside algorithm comprises: for each boundary in a fence coordinate graph, determining whether the horizontal coordinate value of a positioning point is between the horizontal coordinate values of two boundary points of the boundary or equal to the horizontal coordinate value of a first boundary point of the two boundary points, wherein the first boundary point is the one with a prior dotting sequence, and the second boundary point is the one with a subsequent dotting sequence; if the horizontal coordinate value of the positioning point is between the horizontal coordinate values of the two boundary points of the boundary or equal to the horizontal coordinate value of the first boundary point of the two boundary points, determining a vertical line passing through the positioning point and perpendicular to the horizontal coordinate axis of the fence coordinate graph, and determining a second intersection point of the vertical line and the boundary; if the vertical coordinate value of the second intersection point is greater than the vertical coordinate value of the positioning point, determining whether the horizontal coordinate value of the positioning point is equal to the horizontal coordinate value of the first boundary point of the boundary; if the horizontal coordinate value of the positioning point is not equal to the horizontal coordinate value of the first boundary point of the boundary, outputting an analysis result of the positioning point corresponding to the boundary; if the horizontal coordinate value of the positioning point is equal to the horizontal coordinate value of the first boundary point of the boundary, determining whether the horizontal coordinate value of the first boundary point is between the horizontal coordinate value of a previous boundary point of the first boundary point and the horizontal coordinate value of the second boundary point; if the horizontal coordinate value of the first boundary point is between the horizontal coordinate value of the previous boundary point of the first boundary point and the horizontal coordinate value of the second boundary point, outputting the analysis result of the positioning point corresponding to the boundary; determining the inside or outside position of the moving target in the electronic fence according to the total number of the analysis results of all the boundaries.

2. The method of claim 1, wherein, the acquisition of the GPS positioning information of the moving target, the determination of the boundary distances of the moving target to each boundary of the electronic fence according to the positioning information and the position information of the plurality of boundary points, and the determination of the minimum boundary distance from all the boundary distances comprise: establishing a plane rectangular coordinate system, converting the positioning point and the plurality of boundary points to the plane rectangular coordinate system according to the positioning information and the position information of the plurality of boundary points, and obtaining a fence coordinate graph; determining a boundary distance from the positioning point to each boundary in the fence coordinate graph based on the fence coordinate graph and a preset boundary distance algorithm, and determining the minimum boundary distance from all the boundary distances.

3. The method of claim 2, wherein, The method for determining the boundary distance from the positioning point to each boundary in the fence coordinate graph based on the fence coordinate graph and the preset boundary distance algorithm, and determining the minimum boundary distance from all the boundary distances, comprises: For each boundary in the fence coordinate graph, determining a perpendicular line of the positioning point to a straight line where the boundary is located, and determining a first intersection point of the perpendicular line and the straight line where the boundary is located; determining whether the abscissa values of the two boundary points of the boundary are equal; if the abscissa values of the two boundary points of the boundary are equal, determining whether the ordinate values of the first intersection point are greater than or less than the ordinate values of the two boundary points of the boundary respectively; if the ordinate values of the first intersection point are greater than or less than the ordinate values of the two boundary points of the boundary respectively, obtaining a first minimum distance of the positioning point to the two boundary points of the boundary respectively, and taking the first minimum distance as the boundary distance; if the ordinate value of the first intersection point is between the ordinate values of the two boundary points of the boundary or equal to the ordinate value of any one of the two boundary points, taking a distance of the positioning point to the first intersection point as the boundary distance; if the abscissa values of the two boundary points of the boundary are not equal, determining whether the abscissa values of the first intersection point are greater than or less than the abscissa values of the two boundary points of the boundary respectively; if the abscissa values of the first intersection point are greater than or less than the abscissa values of the two boundary points of the boundary respectively, obtaining a second minimum distance of the positioning point to the two boundary points of the boundary respectively, and taking the second minimum distance as the boundary distance; if the abscissa value of the first intersection point is between the abscissa values of the two boundary points of the boundary or equal to the abscissa value of any one of the two boundary points, taking a distance of the positioning point to the first intersection point as the boundary distance; determining the minimum boundary distance from all the boundary distances.

4. The method of claim 1, wherein, The analysis result is 1, and the method for determining the inside or outside position of the mobile target in the electronic fence according to the total number of the analysis results of all the boundaries comprises: If the sum of the analysis results of all the boundaries is odd, the mobile target is inside the electronic fence, and if the sum of the analysis results of all the boundaries is even, the mobile target is outside the electronic fence.

5. The method of claim 1, wherein, The method further comprises: According to the relative position and a preset reminding mechanism, the mobile target is reminded at a corresponding level.

6. The method of claim 5, wherein, According to the relative position and a preset reminding mechanism, the mobile target is reminded at a corresponding level. When the mobile target is inside the electronic fence, the minimum boundary distance is greater than a first preset value, and the minimum boundary distance is constantly increasing, or when the mobile target is outside the electronic fence, the minimum boundary distance is less than a second preset value, and the minimum boundary distance is constantly increasing, the mobile target is linearly reminded, wherein when the mobile target moves from the inside of the electronic fence to the boundary, the minimum boundary distance corresponding to the boundary is negative and gradually increases, when the mobile target is located at the boundary, the minimum boundary distance corresponding to the boundary is zero, and when the mobile target moves from the boundary to the outside of the electronic fence, the minimum boundary distance corresponding to the boundary is positive and gradually increases. When the mobile target is outside the electronic fence, and the minimum boundary distance is greater than or equal to the second preset value, the mobile target is reminded at the maximum intensity. When the mobile target is outside the electronic fence, and the minimum boundary distance is greater than or equal to the second preset value for a time greater than a preset time, the mobile target is reminded at the minimum intensity.

7. The method of claim 1, wherein, The method further comprises: Receiving dotting information of a plurality of boundary points dotted on a GPS map interface of the positioning device, and storing the dotting information locally.

8. A computer device, comprising: Comprise: A processor, a memory, a communication interface, and a communication bus, the processor, the memory, and the communication interface complete communication with each other through the communication bus; The memory is used to store at least one executable instruction, and the executable instruction causes the processor to execute the method in any one of claims 1-7.

9. A computer-readable storage medium, characterized in that, The storage medium stores at least one executable instruction, and the executable instruction, when running on the computer device, causes the computer device to execute the method in any one of claims 1-7.

Citation Information

Patent Citations

  • Electronic fence detection method and electronic equipment

    CN110599717A

  • Positioning method and device

    CN114814802A