CN113852914A - Position positioning method and positioning device for point to be inspected - Google Patents

Position positioning method and positioning device for point to be inspected Download PDF

Info

Publication number
CN113852914A
CN113852914A CN202111116150.5A CN202111116150A CN113852914A CN 113852914 A CN113852914 A CN 113852914A CN 202111116150 A CN202111116150 A CN 202111116150A CN 113852914 A CN113852914 A CN 113852914A
Authority
CN
China
Prior art keywords
point
electronic fence
inspected
vertex
judging whether
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111116150.5A
Other languages
Chinese (zh)
Other versions
CN113852914B (en
Inventor
周峰
温明华
刘永军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Jimi Star Link Communication Co ltd
Original Assignee
Guangdong Jimi Star Link Communication Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Jimi Star Link Communication Co ltd filed Critical Guangdong Jimi Star Link Communication Co ltd
Priority to CN202111116150.5A priority Critical patent/CN113852914B/en
Publication of CN113852914A publication Critical patent/CN113852914A/en
Application granted granted Critical
Publication of CN113852914B publication Critical patent/CN113852914B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/02Services making use of location information
    • H04W4/021Services related to particular areas, e.g. point of interest [POI] services, venue services or geofences
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W64/00Locating users or terminals or network equipment for network management purposes, e.g. mobility management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Length-Measuring Devices Using Wave Or Particle Radiation (AREA)

Abstract

The application provides a position positioning method and a positioning device of a point to be detected, wherein the processing method is applied to the positioning device, and the method comprises the following steps: acquiring position parameters of points to be inspected and position parameters of each vertex of the electronic fence; judging whether the point to be inspected is located at a special position of the electronic fence or not according to the position parameters, wherein the special position at least comprises a top point of the electronic fence and an edge of the electronic fence; if the point to be inspected is not located at the special position of the electronic fence, judging whether the point to be inspected is located inside the electronic fence or not by a ray method; determining a relative position between the point to be inspected and the electronic fence. The embodiment of the application can avoid the problem that when the point to be inspected is located at the special position of the electronic fence, the position of the point to be inspected is judged by a ray method, so that a large amount of computing resources are occupied, and the processing efficiency is low, so that the position judgment processing efficiency between the point to be inspected and the electronic fence is improved.

Description

Position positioning method and positioning device for point to be inspected
Technical Field
The present disclosure relates to positioning data processing, and more particularly, to a method and a device for positioning a point to be inspected.
Background
After the 21 st century, with the rapid development of computers and the internet, positioning management systems have been widely used in various fields, including military and civilian use, in which electronic fences are indispensable functions of positioning systems. An electronic fence is understood to be a series of location points drawn on a planar map, all of which are connected to form a closed area, each location point having its own coordinates (longitude and latitude), which are formed by a set of location points entered into a computer, and which are a virtual area. The application of the electronic fence is real-time monitoring of the positioning terminal, the computer can judge the existence relation between the position point and the electronic fence according to the position information of the positioning terminal, and the computer automatically gives an alarm or notifies the item according to the judgment result, so that the monitoring function of the electronic fence is realized. Therefore, a comparison program of the position relationship exists in the computer system, and the position relationship between the point to be inspected and the electronic fence is judged.
At present, algorithms of electronic fence monitoring programs on the market are many, but all the algorithms have many defects. For example, the front-end program performs loop judgment on a large number of position points, so that a large number of judgment loop times are easily caused by some special position points and special scenes, the calculation of the position between the point to be detected and the electronic fence occupies more calculation resources, and the processing efficiency is relatively low.
Disclosure of Invention
The application provides a position positioning method and a positioning device for a point to be detected, which can improve the position judgment processing efficiency between the point to be detected and an electronic fence.
The embodiment of the application discloses a position positioning method of a point to be detected, which is applied to a positioning device, and the method comprises the following steps:
acquiring position parameters of points to be inspected and position parameters of each vertex of the electronic fence;
judging whether the point to be inspected is located at a special position of the electronic fence or not according to the position parameters, wherein the special position at least comprises a top point of the electronic fence and an edge of the electronic fence;
if the point to be inspected is not located at the special position of the electronic fence, judging whether the point to be inspected is located inside the electronic fence or not by a ray method;
determining a relative position between the point to be inspected and the electronic fence.
In one embodiment, the determining whether the point to be inspected is located at a specific position of the electronic fence includes:
matching the position parameters of the points to be checked with the position parameters of each vertex of the electronic fence;
and if the points are matched, the point to be detected is positioned at the top point of the electronic fence.
In an embodiment, the matching the position parameters of the point to be inspected and the position parameters of the vertices of the electronic fence includes:
setting a pointer to point to an initial vertex of the electronic fence, and taking the initial vertex as a current vertex;
judging whether the position parameter of the current vertex is matched with the position parameter of the point to be checked;
if so, the point to be detected is positioned at the top point of the electronic fence;
if not, the pointer takes the next vertex of the electronic fence as the current vertex and matches the next vertex with the point to be checked;
and if the next vertex pointed by the pointer is the current vertex, the point to be checked is not positioned at the vertex of the electronic fence.
In one embodiment, the determining whether the point to be inspected is located at a specific position of the electronic fence includes:
judging whether the position parameter of the point to be checked is positioned on one side of the electronic fence or not based on the vector cross product; or
And judging whether the position parameters of the point to be detected are positioned on one side of the electronic fence or not based on the side length relation between the point to be detected and different vertexes.
In an embodiment, the determining whether the position parameter of the point to be inspected is located on one side of the electronic fence based on the side length relationship between the point to be inspected and different vertices includes:
setting a pointer to point to an initial vertex of the electronic fence, and taking the initial vertex as a current vertex;
calculating the distance between the current vertex and the next vertex as a first distance;
calculating the distance between the point to be detected and the current vertex as a second distance;
calculating the distance between the point to be detected and the next vertex as a third distance;
judging whether the first distance is equal to the sum of the second distance and the third distance;
if so, the point to be detected is positioned on the edge of the electronic fence;
if not, the pointer uses the next vertex as the current vertex, and recalculates and judges the relationship among the first distance, the second distance and the third distance;
and if the next vertex pointed by the pointer is the current vertex, the point to be checked is not positioned on the edge of the electronic fence.
In an embodiment, the determining, by ray method, whether the point to be inspected is located inside the electronic fence includes:
judging whether the ray led out from the point to be inspected passes through the top point of the electronic fence or not by using a ray method; and
and judging whether the ray led out from the point to be inspected passes through the edge of the electronic fence or not by using a ray method.
In an embodiment, the determining, by ray method, whether the point to be inspected is located inside the electronic fence includes:
setting a pointer to point to an initial vertex of the electronic fence, and taking the initial vertex as a current vertex;
judging whether the vertical coordinate of the point to be checked is between the vertical coordinates of the current vertex and the next vertex;
if yes, calculating an abscissa x1 of an intersection point of a straight line y which passes through the point to be checked, y0 and the edge of the current vertex, and judging whether the abscissa x1 is larger than the abscissa of the point to be checked;
if the x1 abscissa is larger than the x abscissa of the point to be inspected, adding 1 to the number of intersection points of the point to be inspected and the edge of the electronic fence;
and judging whether the point to be inspected is positioned in the electronic fence or not according to the number of the intersection points of the point to be inspected and the edge of the electronic fence.
In an embodiment, the determining, by ray method, whether the point to be inspected is located inside the electronic fence includes:
setting a pointer to point to an initial vertex of the electronic fence, and taking the initial vertex as a current vertex;
judging whether the abscissa of the point to be checked is smaller than the abscissa of the current vertex;
if the abscissa of the point to be inspected is smaller than the abscissa of the current vertex, judging whether the ordinate of the point to be inspected is between the ordinates of two vertexes adjacent to the current vertex;
if the vertical coordinate of the point to be inspected is between the vertical coordinates of the two vertexes adjacent to the current vertex, adding 1 to the number of the intersection points of the point to be inspected and the edge of the electronic fence;
and judging whether the point to be inspected is positioned in the electronic fence or not according to the number of the intersection points of the point to be inspected and the edge of the electronic fence.
In one embodiment, the vertex pointed to by the pointer adopts a bidirectional circular linked list structure.
The application also discloses a positioning device, which comprises a processor and a memory, wherein the processor is electrically connected with the memory;
the memory stores a computer program, and the processor executes the position locating method of the point to be detected by calling the computer program stored in the memory.
Therefore, the position positioning method and the positioning device for the point to be inspected in the embodiment of the application judge whether the point to be inspected is located in the special position of the electronic fence or not by using the ray method, and judge whether the point to be inspected is located in the electronic fence or not by using the ray method, so that the problems that when the point to be inspected is located in the special position of the electronic fence, the position of the point to be inspected is judged by using the ray method, a large amount of computing resources are occupied, and the processing efficiency is low can be solved, and the position judgment processing efficiency between the point to be inspected and the electronic fence is improved.
Drawings
Fig. 1 is a flowchart illustrating an implementation of a method for locating a position of a point to be inspected according to an embodiment of the present disclosure.
Fig. 2 is a flowchart illustrating an implementation of determining whether a point to be inspected is located at a vertex of an electronic fence according to an embodiment of the present disclosure.
Fig. 3 is a first application view diagram for determining a location of a point to be inspected according to an embodiment of the present disclosure.
Fig. 4 is a flowchart illustrating an implementation of determining whether a point to be inspected is located on an edge of an electronic fence according to an embodiment of the present disclosure.
Fig. 5 is a diagram of a second application scenario for determining a position of a point to be inspected according to an embodiment of the present application.
Fig. 6 is a flowchart illustrating an implementation of determining whether a point to be inspected is located inside an electronic fence according to an embodiment of the present disclosure.
Fig. 7 is a diagram of a third application scenario for determining a position of a point to be inspected according to the embodiment of the present application.
Fig. 8 is a diagram of a fourth application scenario for determining a position of a point to be inspected according to an embodiment of the present application.
Fig. 9 is a fifth application scenario diagram for determining a position of a point to be inspected according to the embodiment of the present application.
Fig. 10 is a diagram of a sixth application scenario for determining a position of a point to be inspected according to an embodiment of the present application.
Fig. 11 is a seventh application scenario diagram for determining a position of a point to be inspected according to an embodiment of the present application.
Detailed Description
The following detailed description of the preferred embodiments of the present application, taken in conjunction with the accompanying drawings, will make the advantages and features of the present application more readily appreciated by those skilled in the art, and thus will more clearly define the scope of the invention.
Referring to fig. 1, a flow of implementing the method for locating a position of a point to be inspected according to the embodiment of the present application is shown.
As shown in fig. 1, the method for locating the position of the point to be detected can be applied to a locating device, a server, or other devices/apparatuses for locating data processing. The method specifically comprises the following steps.
101. And acquiring the position parameters of the point to be checked and the position parameters of each vertex of the electronic fence.
The position parameters of the point to be detected can be obtained by a positioning device or a server, and the position parameters of each vertex of the electronic fence can be connected by a plurality of position points to form each vertex corresponding to a polygonal closed area.
The position parameters of the point to be inspected and the position parameters of the vertices of the electronic fence can be expressed by coordinates (x, y) in a planar coordinate system.
102. And judging whether the point to be checked is located at a special position of the electronic fence or not according to the position parameters, wherein the special position at least comprises the top point of the electronic fence and the edge of the electronic fence.
Generally, in order to determine the position of the point to be inspected relative to the electronic fence, a ray with a ordinate of 0 is introduced to the point to be inspected by using a ray method, and the relative position of the point to be inspected and the electronic fence is determined by calculating the number of intersection points of the ray and the electronic fence.
However, because the electronic fence has various shapes and there are many types of position relationships between the point to be inspected and the electronic fence, if the conventional ray method is adopted, the point to be inspected is located at a specific position of the electronic fence, and the conventional ray method occupies many computing resources and takes a lot of processing time to eliminate the situation.
In order to improve the processing efficiency and reduce the resource occupation, whether the to-be-inspected point is located at a special position of the electronic fence or not can be judged firstly. Whether the point to be inspected is at a special position or not is additionally judged, so that the problems of excessive occupied resources and low processing efficiency in the judgment process of the position of the point to be inspected by a traditional ray method are solved, and the position judgment processing efficiency between the point to be verified and the electronic fence is improved.
103. And if the point to be inspected is not located at the special position of the electronic fence, judging whether the point to be inspected is located inside the electronic fence or not by using a ray method.
The ray method is a method commonly used for judging the position relationship between a point to be checked and an electronic fence, and judges the relationship between a point and a polygon on the basis of the parity of the number of intersection points of a ray passing through the point and the edge of the polygon electronic fence. The idea of the method is that a horizontal ray is made in the positive direction of the X axis after the point to be inspected is passed through, the number of the intersection points of the ray and all the edges of the polygon is calculated, and if the number of the intersection points is odd, the point to be inspected is in the electronic fence. If the number of intersections is even, then the point to be verified is outside the fence.
104. The relative position between the point to be inspected and the electronic fence is determined.
According to the method, after the point to be inspected is judged to be located at the special position of the electronic fence, the ray method is used for judging whether the point to be inspected is located inside the electronic fence, and the problems that when the point to be inspected is located at the special position of the electronic fence, the ray method is used for judging the position of the point to be inspected, a large amount of computing resources are occupied, and the processing efficiency is low can be solved, so that the position judgment processing efficiency between the point to be inspected and the electronic fence is improved.
Referring to fig. 2-3, an implementation flow of determining whether a point to be inspected is located at a vertex of an electronic fence according to an embodiment of the present application and a first application scenario are shown.
In one embodiment, the determining whether the point to be inspected is located at a specific position of the electronic fence includes: and matching the position parameters of the point to be detected with the position parameters of each vertex of the electronic fence, wherein if the position parameters are matched, the point to be detected is positioned at the vertex of the electronic fence.
By matching the point to be detected with each vertex of the electronic fence, whether the point to be detected is located at the special position of the electronic fence can be judged only by using very small resources, and the situation that whether the point to be detected is located at the vertex of the electronic fence is eliminated without adopting a ray method occupying more resources.
As shown in fig. 2, the matching of the position parameters of the point to be inspected and the position parameters of each vertex of the electronic fence specifically includes:
201. and setting a pointer to point to an initial vertex of the electronic fence, and taking the initial vertex as a current vertex.
Here, the vertex pointed to by the pointer may adopt a bi-directional circular linked list structure. The initial vertex can be one of the vertices of the electronic fence preset based on a certain rule or man, so as to be used for judging the position of the point to be checked.
With reference to fig. 3, the pointer of the application scenario in the figure is P, the point to be detected is a, and the vertices of the electronic fence are V0-V4. When the program performs the step of matching the location parameters of the point to be inspected with the location parameters of the vertices of the fence, P may be pointed to the vertex VO of the fence, where V0 is the initial vertex of the program and is also the current vertex.
202. And judging whether the position parameter of the current vertex is matched with the position parameter of the point to be detected.
In the matching process, the coordinate of the point a to be detected may be compared with the coordinate of the current vertex V0, and whether the coordinate of the point a to be detected is consistent with the current vertex V0 is determined.
If the two points are consistent, the point A to be detected can be determined to be positioned at the top point of the electronic fence.
If the two points are inconsistent, the pointer P takes the next vertex of the electronic fence as the current vertex and matches the point A to be checked.
203. If yes, the point to be detected is located at the top point of the electronic fence.
And after the point to be detected is confirmed to be positioned at the top point of the electronic fence, the position of the point to be detected can be continuously judged without executing a ray method, and the judging process is ended.
204. And if not, the pointer takes the next vertex of the electronic fence as the current vertex and matches with the point to be checked.
The next vertex may be determined according to actual needs, for example, according to a parameter sequence of an X axis or a Y axis of coordinate axes, or according to other rules, which is not limited in this application.
205. And if the next vertex pointed by the pointer is the current vertex, the point to be detected is not positioned at the vertex of the electronic fence.
If the next vertex pointed by the pointer P is the current vertex, it can be said that all vertices have rotated once, and all vertices are not matched with the point a to be detected, and the point a to be detected is not located at the vertex of the electronic fence.
Therefore, before the ray method is executed to judge the position of the point to be inspected, whether the point to be inspected is positioned at the vertex of the electronic fence or not is judged in advance, the problem that resources occupy too much in the process of judging the position of the point to be inspected by the ray method is avoided, the algorithm is simple, and the position judgment efficiency of the point to be inspected is improved.
Referring to fig. 4-5, an implementation flow and a second application scenario for determining whether a point to be inspected is located on an edge of an electronic fence according to an embodiment of the present application are shown.
In one embodiment, the determining whether the point to be inspected is located at a specific position of the electronic fence includes: judging whether the position parameter of the point to be checked is positioned on one side of the electronic fence or not based on the vector cross product; or judging whether the position parameters of the point to be detected are positioned on one side of the electronic fence or not based on the side length relation between the point to be detected and different vertexes.
The vector cross product can effectively judge whether the point to be checked is positioned on the edge of the electronic fence or not through less computing resources.
And for judging the position of the inspection point based on the side length relation between the point to be inspected and different vertexes, whether the point to be inspected is positioned on one side of the electronic fence can be judged by adopting the rule that the sum of two sides of the triangle is larger than the third side.
As shown in fig. 4, the determining whether the position parameter of the point to be inspected is located on one side of the electronic fence based on the side length relationship between the point to be inspected and different vertices includes:
301. and setting a pointer to point to an initial vertex of the electronic fence, and taking the initial vertex as a current vertex.
Here, the vertex pointed to by the pointer may adopt a bi-directional circular linked list structure. The initial vertex can be one of the vertices of the electronic fence preset based on a certain rule or man, so as to be used for judging the position of the point to be checked.
With reference to fig. 5, the pointer of the application scenario in the figure is P, the point to be detected is a, and the vertices of the electronic fence are V0-V4. When the program performs the step of matching the location parameters of the point to be inspected with the location parameters of the vertices of the fence, P may be pointed to the vertex VO of the fence, where V0 is the initial vertex of the program and is also the current vertex.
302. A first distance, a second distance, and a third distance are obtained.
Which comprises the following steps:
and calculating the distance between the current vertex and the next vertex as a first distance. The current vertex is V0 and the next vertex is V1, then the first distance is the distance of S0.
And calculating the distance between the point to be detected and the current vertex as a second distance. The current vertex is V0, the second distance is the distance of S1 between the point a to be inspected and the current vertex V0.
And calculating the distance between the point to be detected and the next vertex as a third distance. The next vertex is V1, and the third distance is the distance of S2 between the point A to be inspected and the next vertex V1.
303. And judging whether the first distance is equal to the sum of the second distance and the third distance.
304. If yes, the point to be detected is located on the edge of the electronic fence.
305. If not, the pointer uses the next vertex as the current vertex, recalculates and judges the relationship among the first distance, the second distance and the third distance.
It is determined whether S0 equals S1+ S2, and if so, the point A to be detected is between the two vertices, and thus the point A to be detected is located on the side of the fence. If S0 is smaller than S1+ S2, it indicates that S0, S1 and S2 form a triangle, that is, the point A to be detected is not located on the side of the electronic fence.
306. And judging whether the current vertex is the initial vertex or not.
If the next vertex pointed by the pointer is the initial vertex after the step 305 is executed, it may be considered that the vertex of the electronic fence pointed by the pointer has been cycled, and if the determination condition that the first distance is equal to the sum of the second distance and the third distance is not met yet, it may be determined that the point to be inspected is not on one side of the electronic fence.
Therefore, by means of a calculation mode that the vector cross product or the sum of two sides of the triangle is larger than the third side, the judgment of the special position can be carried out before the position of the point to be inspected is judged by the ray method, so that whether the point to be inspected is located on the edge of the electronic fence or not is judged in advance, the problem that resources occupy too much in the process of judging the position of the point to be inspected by the ray method is avoided, the algorithm is simple, and the position judgment efficiency of the point to be inspected is improved.
Referring to fig. 6, an implementation flow for determining whether a point to be inspected is located inside an electronic fence according to the present application is shown.
As shown in fig. 6, the determining whether the point to be inspected is located inside the electronic fence includes:
401. and setting the pointer to point to the initial vertex of the electronic fence, and taking the initial vertex as the current vertex.
Here, the vertex pointed to by the pointer may adopt a bi-directional circular linked list structure. The initial vertex can be one of the vertices of the electronic fence preset based on a certain rule or man, so as to be used for judging the position of the point to be checked.
Please refer to fig. 7, which illustrates a third application scenario for determining a position of a point to be inspected according to an embodiment of the present application.
Wherein the vertices of the electronic fence include V0-V3, and the pointer can use the first vertex V0 as the initial vertex. The point to be examined is a (x0, y0), where the ray passing through the point to be examined a is y 0.
402. And judging whether the vertical coordinate of the point to be checked is between the vertical coordinates of the current vertex and the next vertex.
If yes, step 403 is executed to calculate the abscissa x1 of the intersection point of the straight line y passing through the point to be checked, which is y0, and the edge of the current vertex. If not, step 405 is executed to determine whether the abscissa of the check point is smaller than the abscissa of the current vertex.
403. The abscissa x1 of the intersection of the straight line y, y0 passing through the point to be checked and the edge of the current vertex is calculated.
404. It is determined whether the abscissa x1 is greater than the abscissa of the point to be inspected.
If the abscissa x1 of the edge intersection point is greater than the abscissa x0 of the point to be inspected, it may be considered that the straight line y — y0 has an edge intersection point with the electronic fence, at which point 408 may be performed, and the number of edge intersection points of the point to be inspected and the electronic fence is increased by 1, so as to facilitate the counting of the edge intersection points.
405. And judging whether the abscissa of the check point is smaller than the abscissa of the current vertex.
If the ordinate of the point a to be inspected is not between the ordinate of the current vertex and the ordinate of the next vertex, it indicates that the straight line y, y0 of the point a to be inspected does not generate an edge intersection with the electronic fence. If the ordinate of the point a to be inspected is between the ordinate of the current vertex and the ordinate of the next vertex, step 406 is executed to determine whether the ordinate of the point a to be inspected is between the ordinates of two vertices adjacent to the current vertex.
406. And judging whether the vertical coordinate of the point to be checked is between the vertical coordinates of two vertexes adjacent to the current vertex.
If the ordinate of the point A to be inspected is not between the ordinate of the current vertex and the ordinate of the next vertex, and the abscissa of the point A to be inspected is smaller than the abscissa of the current vertex, the ordinate of the point A to be inspected passes through the edge of the electronic fence between the ordinates of the two vertexes adjacent to the current vertex, and if the ordinate does not pass through the edge of the electronic fence, the edge intersection point with the electronic fence does not exist.
407. And adding 1 to the number of intersection points of the points to be detected and the edges of the electronic fence.
The number of the edge intersection points can be counted by a counter, the number of the intersection points of the ray and all the edges of the polygonal electronic fence is calculated, and if the number of the edge intersection points is an odd number, the point to be checked is in the electronic fence. If the number of intersections is even, then the point to be verified is outside the fence.
408. And judging whether the point to be checked is an inflection point.
Specifically, whether the point a to be inspected is an inflection point or not is judged, whether the edge of the current vertex is parallel to the X axis or not and whether the point a to be inspected is in the negative direction of the edge or not can be judged, and the ordinate of the point a to be inspected is between two adjacent vertices of the edge.
If so, the electronic fence can be considered to have an inflection point, and the number of intersection points of the point to be detected and the edge of the electronic fence is added by 1.
409. The pointer is pointed to the next vertex of the electronic fence, and the next vertex is taken as the current vertex.
If the point to be inspected is not the inflection point after the step 408 is executed, the pointer may be switched to the next vertex, so as to perform a loop judgment on the point to be inspected.
410. And judging whether the current vertex is the initial vertex or not.
If the next vertex pointed by the pointer is the initial vertex after the step 409 is executed, and it can be considered that the vertex of the electronic fence pointed by the pointer has been circulated once at this time, it can be determined that the position determination of the point to be inspected is completed.
Therefore, whether the point to be inspected is located on the top point of the electronic fence or not and whether the point to be inspected is located on the edge of the electronic fence or not is judged in advance, and then the ray method is utilized to execute the position judgment algorithm on the point to be inspected, so that the special position occupying more computing resources in the position judgment process of the point to be inspected can be effectively and independently processed, the position judgment process of the point to be inspected is optimized, and the overall processing efficiency of the position judgment process of the point to be inspected is improved.
Referring to fig. 8-11, a plurality of application scenarios for determining a position of a point to be inspected according to an embodiment of the present application are shown.
As shown in fig. 8-9, in one embodiment, it has the following features: the vertical coordinates of two adjacent vertexes passing through the current vertex A are simultaneously larger or smaller than the vertical coordinate of the point P to be checked. Such vertices do not affect the final decision of the program and do not require processing. The algorithm judges that no intersection point exists between the ray and the polygonal electronic fence, 0 is an even number, and the point P to be detected is judged outside the electronic fence.
As shown in FIGS. 10-11, in another embodiment, vertex D in FIG. 10 has the following characteristics: the ordinate of the vertex D is located between the ordinates of two adjacent vertices, such vertices influencing the result of the algorithm. The algorithm normally judges that the number of intersections between the ray of fig. 10 and the fence is 2 (point O on the side of vertex D and AB, respectively), and judges that P is outside the polygon according to the parity characteristic. For the complex fig. 11, the algorithm normally judges that the number of intersections of the ray with the fence should be 3, inside the polygon. For such vertices, the algorithm only counts the intersections of the edges with the vertex as the first vertex.
Therefore, the position positioning method and the positioning device for the point to be inspected in the embodiment of the application judge whether the point to be inspected is located in the special position of the electronic fence or not by using the ray method, and judge whether the point to be inspected is located in the electronic fence or not by using the ray method, so that the problems that when the point to be inspected is located in the special position of the electronic fence, the position of the point to be inspected is judged by using the ray method, a large amount of computing resources are occupied, and the processing efficiency is low can be solved, and the position judgment processing efficiency between the point to be inspected and the electronic fence is improved.
The application discloses a positioning device, which comprises a processor and a memory, wherein the processor is electrically connected with the memory;
the memory 20 stores a computer program, and the processor 10 executes an embodiment of the method for locating a position of a point to be detected according to any one of the above items by calling the computer program stored in the memory 20, for example:
acquiring position parameters of points to be inspected and position parameters of each vertex of the electronic fence; judging whether the point to be checked is located at a special position of the electronic fence or not according to the position parameters, wherein the special position at least comprises the top point of the electronic fence and the edge of the electronic fence; if the point to be inspected is not located at the special position of the electronic fence, judging whether the point to be inspected is located inside the electronic fence or not by using a ray method; the relative position between the point to be inspected and the electronic fence is determined.
The positioning apparatus 100 may be a portable positioning terminal, a mobile phone, a ship/vehicle positioning device or other devices capable of performing corresponding positioning functions. The positioning device 100 may further include functional modules such as a radio frequency transceiver antenna, a power supply, etc. connected to the processor 10 to cooperate with the positioning function. Of course, the type of the functional module may be determined according to the specific application requirement of the positioning apparatus 100, and the application does not limit the kind of the functional module in the positioning apparatus 100.
In one embodiment, the processor 10 is further configured to perform:
matching the position parameters of the points to be checked with the position parameters of each vertex of the electronic fence;
and if the points are matched, the point to be detected is positioned at the top point of the electronic fence.
In one embodiment, the processor 10 is further configured to perform:
setting a pointer to point to an initial vertex of the electronic fence, and taking the initial vertex as a current vertex;
judging whether the position parameter of the current vertex is matched with the position parameter of the point to be checked;
if so, the point to be detected is positioned at the top point of the electronic fence;
if not, the pointer takes the next vertex of the electronic fence as the current vertex and matches the next vertex with the point to be checked;
and if the next vertex pointed by the pointer is the current vertex, the point to be checked is not positioned at the vertex of the electronic fence.
In one embodiment, the processor 10 is further configured to perform:
judging whether the position parameter of the point to be checked is positioned on one side of the electronic fence or not based on the vector cross product; or
And judging whether the position parameters of the point to be detected are positioned on one side of the electronic fence or not based on the side length relation between the point to be detected and different vertexes.
In one embodiment, the processor 10 is further configured to perform:
setting a pointer to point to an initial vertex of the electronic fence, and taking the initial vertex as a current vertex;
calculating the distance between the current vertex and the next vertex as a first distance;
calculating the distance between the point to be detected and the current vertex as a second distance;
calculating the distance between the point to be detected and the next vertex as a third distance;
judging whether the first distance is equal to the sum of the second distance and the third distance;
if so, the point to be detected is positioned on the edge of the electronic fence;
if not, the pointer uses the next vertex as the current vertex, and recalculates and judges the relationship among the first distance, the second distance and the third distance;
and if the next vertex pointed by the pointer is the current vertex, the point to be checked is not positioned on the edge of the electronic fence.
In one embodiment, the processor 10 is further configured to perform:
judging whether the ray led out from the point to be inspected passes through the top point of the electronic fence or not by using a ray method; and
and judging whether the ray led out from the point to be inspected passes through the edge of the electronic fence or not by using a ray method.
In one embodiment, the processor 10 is further configured to perform:
setting a pointer to point to an initial vertex of the electronic fence, and taking the initial vertex as a current vertex;
judging whether the vertical coordinate of the point to be checked is between the vertical coordinates of the current vertex and the next vertex;
if yes, calculating an abscissa x1 of an intersection point of a straight line y which passes through the point to be checked, y0 and the edge of the current vertex, and judging whether the abscissa x1 is larger than the abscissa of the point to be checked;
if the x1 abscissa is larger than the x abscissa of the point to be inspected, adding 1 to the number of intersection points of the point to be inspected and the edge of the electronic fence;
and judging whether the point to be inspected is positioned in the electronic fence or not according to the number of the intersection points of the point to be inspected and the edge of the electronic fence.
In one embodiment, the processor 10 is further configured to perform:
setting a pointer to point to an initial vertex of the electronic fence, and taking the initial vertex as a current vertex;
judging whether the abscissa of the point to be checked is smaller than the abscissa of the current vertex;
if the abscissa of the point to be inspected is smaller than the abscissa of the current vertex, judging whether the ordinate of the point to be inspected is between the ordinates of two vertexes adjacent to the current vertex;
if the vertical coordinate of the point to be inspected is between the vertical coordinates of the two vertexes adjacent to the current vertex, adding 1 to the number of the intersection points of the point to be inspected and the edge of the electronic fence;
and judging whether the point to be inspected is positioned in the electronic fence or not according to the number of the intersection points of the point to be inspected and the edge of the electronic fence.
In one embodiment, the processor 10 is further configured to perform:
and the vertex pointed by the pointer adopts a bidirectional circular linked list structure.
In the embodiment of the present application, the positioning device and the position positioning method for a point to be inspected in the above embodiments belong to the same concept, any method step provided in the embodiment of the position positioning method for a point to be inspected may be run on the positioning device, and a specific implementation process thereof is described in detail in the embodiment of the position positioning method for a point to be inspected, and any combination may be adopted to form an optional embodiment of the present application, which is not described herein again.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a memory, which may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Therefore, the positioning device in the embodiment of the application judges whether the point to be inspected is located in the electronic fence or not by using the ray method after judging whether the point to be inspected is located in the special position of the electronic fence or not, and can avoid the problem that when the point to be inspected is located in the special position of the electronic fence, the position of the point to be inspected is judged by using the ray method, so that a large amount of computing resources are occupied, and the processing efficiency is low, so that the position judgment processing efficiency between the point to be inspected and the electronic fence is improved.
The embodiments of the present application have been described in detail with reference to the drawings, but the present application is not limited to the above embodiments, and various changes can be made without departing from the spirit of the present application within the knowledge of those skilled in the art.

Claims (10)

1. A position locating method of a point to be detected is applied to a locating device and is characterized by comprising the following steps:
acquiring position parameters of points to be inspected and position parameters of each vertex of the electronic fence;
judging whether the point to be inspected is located at a special position of the electronic fence or not according to the position parameters, wherein the special position at least comprises a top point of the electronic fence and an edge of the electronic fence;
if the point to be inspected is not located at the special position of the electronic fence, judging whether the point to be inspected is located inside the electronic fence or not by a ray method;
determining a relative position between the point to be inspected and the electronic fence.
2. The method of claim 1, wherein the determining whether the point to be inspected is located at a specific position of the electronic fence comprises:
matching the position parameters of the points to be checked with the position parameters of each vertex of the electronic fence;
and if the points are matched, the point to be detected is positioned at the top point of the electronic fence.
3. The method according to claim 2, wherein said matching the position parameters of the point to be inspected with the position parameters of the vertices of the electronic fence comprises:
setting a pointer to point to an initial vertex of the electronic fence, and taking the initial vertex as a current vertex;
judging whether the position parameter of the current vertex is matched with the position parameter of the point to be checked;
if so, the point to be detected is positioned at the top point of the electronic fence;
if not, the pointer takes the next vertex of the electronic fence as the current vertex and matches the next vertex with the point to be checked;
and if the next vertex pointed by the pointer is the current vertex, the point to be checked is not positioned at the vertex of the electronic fence.
4. The method of claim 1, wherein the determining whether the point to be inspected is located at a specific position of the electronic fence comprises:
judging whether the position parameter of the point to be checked is positioned on one side of the electronic fence or not based on the vector cross product; or
And judging whether the position parameters of the point to be detected are positioned on one side of the electronic fence or not based on the side length relation between the point to be detected and different vertexes.
5. The method of claim 4, wherein the determining whether the position parameter of the point to be inspected is located on one side of the electronic fence based on the side length relationship between the point to be inspected and different vertices comprises:
setting a pointer to point to an initial vertex of the electronic fence, and taking the initial vertex as a current vertex;
calculating the distance between the current vertex and the next vertex as a first distance;
calculating the distance between the point to be detected and the current vertex as a second distance;
calculating the distance between the point to be detected and the next vertex as a third distance;
judging whether the first distance is equal to the sum of the second distance and the third distance;
if so, the point to be detected is positioned on the edge of the electronic fence;
if not, the pointer uses the next vertex as the current vertex, and recalculates and judges the relationship among the first distance, the second distance and the third distance;
and if the next vertex pointed by the pointer is the current vertex, the point to be checked is not positioned on the edge of the electronic fence.
6. The method of claim 1, wherein the determining whether the point to be inspected is located inside the electronic fence by ray method comprises:
judging whether the ray led out from the point to be inspected passes through the top point of the electronic fence or not by using a ray method; and
and judging whether the ray led out from the point to be inspected passes through the edge of the electronic fence or not by using a ray method.
7. The method of claim 1, wherein the determining whether the point to be inspected is located inside the electronic fence by ray method comprises:
setting a pointer to point to an initial vertex of the electronic fence, and taking the initial vertex as a current vertex;
judging whether the vertical coordinate of the point to be checked is between the vertical coordinates of the current vertex and the next vertex;
if yes, calculating an abscissa x1 of an intersection point of a straight line y which passes through the point to be checked, y0 and the edge of the current vertex, and judging whether the abscissa x1 is larger than the abscissa of the point to be checked;
if the x1 abscissa is larger than the x abscissa of the point to be inspected, adding 1 to the number of intersection points of the point to be inspected and the edge of the electronic fence;
and judging whether the point to be inspected is positioned in the electronic fence or not according to the number of the intersection points of the point to be inspected and the edge of the electronic fence.
8. The method of claim 1, wherein the determining whether the point to be inspected is located inside the electronic fence by ray method comprises:
setting a pointer to point to an initial vertex of the electronic fence, and taking the initial vertex as a current vertex;
judging whether the abscissa of the point to be checked is smaller than the abscissa of the current vertex;
if the abscissa of the point to be inspected is smaller than the abscissa of the current vertex, judging whether the ordinate of the point to be inspected is between the ordinates of two vertexes adjacent to the current vertex;
if the vertical coordinate of the point to be inspected is between the vertical coordinates of the two vertexes adjacent to the current vertex, adding 1 to the number of the intersection points of the point to be inspected and the edge of the electronic fence;
and judging whether the point to be inspected is positioned in the electronic fence or not according to the number of the intersection points of the point to be inspected and the edge of the electronic fence.
9. The method according to claim 3, 5, 7 or 8, wherein the vertex pointed by the pointer adopts a bi-directional circular linked list structure.
10. The positioning device is characterized by comprising a processor and a memory, wherein the processor is electrically connected with the memory;
the memory stores a computer program, and the processor executes the method for locating the position of the point to be detected according to any one of claims 1 to 9 by calling the computer program stored in the memory.
CN202111116150.5A 2021-09-23 2021-09-23 Position positioning method and positioning device for point to be inspected Active CN113852914B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111116150.5A CN113852914B (en) 2021-09-23 2021-09-23 Position positioning method and positioning device for point to be inspected

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111116150.5A CN113852914B (en) 2021-09-23 2021-09-23 Position positioning method and positioning device for point to be inspected

Publications (2)

Publication Number Publication Date
CN113852914A true CN113852914A (en) 2021-12-28
CN113852914B CN113852914B (en) 2023-12-15

Family

ID=78978964

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111116150.5A Active CN113852914B (en) 2021-09-23 2021-09-23 Position positioning method and positioning device for point to be inspected

Country Status (1)

Country Link
CN (1) CN113852914B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024027684A1 (en) * 2022-08-04 2024-02-08 维沃移动通信有限公司 Geofence detection method and apparatus and electronic device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102360509A (en) * 2011-10-19 2012-02-22 浙江大学 Method for judging space position relation of point and polygon by using maximum slope ray algorithm
WO2016078404A1 (en) * 2014-11-19 2016-05-26 中兴通讯股份有限公司 Terminal management method, apparatus and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102360509A (en) * 2011-10-19 2012-02-22 浙江大学 Method for judging space position relation of point and polygon by using maximum slope ray algorithm
WO2016078404A1 (en) * 2014-11-19 2016-05-26 中兴通讯股份有限公司 Terminal management method, apparatus and system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
刘民士;王春;: "射线法判断点与多边形内外关系的改进算法", 滁州学院学报 *
谢东岑;梁晓龙;张佳强;付其喜;张凯;: "无人机地理围栏越界探测算法改进与分析", 航空工程进展 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024027684A1 (en) * 2022-08-04 2024-02-08 维沃移动通信有限公司 Geofence detection method and apparatus and electronic device

Also Published As

Publication number Publication date
CN113852914B (en) 2023-12-15

Similar Documents

Publication Publication Date Title
CN111144426B (en) Sorting method, sorting device, sorting equipment and storage medium
Uchida et al. Fast and accurate template matching using pixel rearrangement on the GPU
US10627446B2 (en) Importance sampling method for multiple failure regions
CN112085056B (en) Target detection model generation method, device, equipment and storage medium
CN109961107B (en) Training method and device for target detection model, electronic equipment and storage medium
CN113852914B (en) Position positioning method and positioning device for point to be inspected
CN111401143A (en) Pedestrian tracking system and method
CN110020598A (en) A kind of method and device based on foreign matter on deep learning detection electric pole
CN113506293A (en) Image processing method, device, equipment and storage medium
CN115909009A (en) Image recognition method, image recognition device, storage medium and electronic equipment
CN112200644B (en) Method and device for identifying fraudulent user, computer equipment and storage medium
CN115689947A (en) Image sharpening method, system, electronic device and storage medium
CN116152816A (en) Method and device for identifying closed area, electronic equipment and storage medium
CN115481268A (en) Parallel line wall data identification method, device, equipment and storage medium
CN113963028A (en) Collision detection method and device, computer equipment and storage medium
CN111765892B (en) Positioning method, positioning device, electronic equipment and computer readable storage medium
CN114359222A (en) Method for detecting arbitrary polygon target, electronic device and storage medium
CN113657317A (en) Cargo position identification method and system, electronic equipment and storage medium
CN113453142A (en) Vehicle electronic fence monitoring system and method based on T-BOX edge calculation
CN114355234A (en) Intelligent quality detection method and system for power module
CN111723847A (en) Method, system, terminal device and storage medium for calculating similarity between graphs
CN115063619B (en) Cost aggregation method and system based on binocular stereo matching algorithm
CN115841571B (en) Object display image direction recognition method, device, electronic device, and storage medium
CN117553808B (en) Deep learning-based robot positioning navigation method, device, equipment and medium
CN114494792B (en) Target detection method, device and equipment based on single stage and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant