WO2024027684A1 - 地理围栏检测方法、装置和电子设备 - Google Patents
地理围栏检测方法、装置和电子设备 Download PDFInfo
- Publication number
- WO2024027684A1 WO2024027684A1 PCT/CN2023/110485 CN2023110485W WO2024027684A1 WO 2024027684 A1 WO2024027684 A1 WO 2024027684A1 CN 2023110485 W CN2023110485 W CN 2023110485W WO 2024027684 A1 WO2024027684 A1 WO 2024027684A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- target
- vector
- geofence
- position point
- boundary
- 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.)
- Ceased
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/02—Services making use of location information
- H04W4/021—Services related to particular areas, e.g. point of interest [POI] services, venue services or geofences
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
- G06F16/9537—Spatial or temporal dependent retrieval, e.g. spatiotemporal queries
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/02—Services making use of location information
- H04W4/025—Services making use of location information using location based information parameters
Definitions
- This application belongs to the field of communication technology, and specifically relates to a geofence detection method, device and electronic equipment.
- Geofencing uses a virtual fence to enclose a virtual geographical boundary.
- an electronic device enters or leaves a specific geographical area, or is active within this area, it can receive automatic notifications such as information reminders.
- the real geographic point of interest (POI) boundary is often a closed irregular polygon composed of some discrete location points and their corresponding connections.
- the Crossing Number method is usually used to determine whether a location point is inside a polygonal geofence. The principle is to calculate the number of times a ray starting from point P passes through the polygon boundary. If it is an odd number, then point P is within Inside the polygon, or outside the polygon if it's even.
- this method involves the problem of judging whether the ray intersects with the line segment, that is, it involves the inversion operation of the matrix, and the calculation amount of this operation is relatively large, and it also requires at least two rays starting from point P. Perform operations on all polygon boundaries one by one, which increases the amount of calculation. It can be seen that the geofence detection method in related technologies has a problem of huge calculation amount.
- the purpose of the embodiments of the present application is to provide a geofence detection method, device and electronic equipment, which can solve the problem of huge calculation amount of geofence detection methods in related technologies.
- embodiments of the present application provide a geofence detection method, which method includes:
- the positional relationship between the first position point and the target geofence is determined according to the dot product of the vector formed by connecting the first position point and the target boundary vertex and the target normal vector, wherein the target boundary vertex is the For some or all boundary vertices in the target geofence, the target normal vector is a normal vector perpendicular to the edge vector at the target boundary vertex.
- a geofence detection device including:
- the acquisition module is used to acquire the first position point where the electronic device is currently located
- the first determination module is used to determine each normal vector of the target geographical fence, wherein the target geographical fence is formed by connecting N boundary vertices in a preset order, and the normal vector is perpendicular to the edge vector of the target geographical fence.
- the edge vector is a vector formed by connecting two adjacent boundary vertices of the target geofence, and N is an integer greater than 2;
- the second determination module is used to determine the positional relationship between the first position point and the target geofence according to the dot product of the vector formed by connecting the first position point and the target boundary vertex and the target normal vector, wherein,
- the target boundary vertex is part or all of the boundary vertices in the target geofence, and the target normal vector is a normal vector perpendicular to an edge vector at the target boundary vertex.
- inventions of the present application provide an electronic device.
- the electronic device includes a processor and a memory.
- the memory stores programs or instructions that can be run on the processor.
- the programs or instructions are processed by the processor.
- the processor is executed, the steps of the geofence detection method described in the first aspect are implemented.
- embodiments of the present application provide a readable storage medium that stores programs or instructions. When the programs or instructions are executed by a processor, the geofence detection as described in the first aspect is implemented. Method steps.
- inventions of the present application provide a chip.
- the chip includes a processor and a communication interface.
- the communication interface is coupled to the processor.
- the processor is used to run programs or instructions to implement the first aspect.
- the geofence detection method is used to run programs or instructions to implement the first aspect.
- embodiments of the present application provide a computer program product.
- the computer program product is stored in a storage medium.
- the computer program product is executed by at least one processor to implement the geofence detection method as described in the first aspect.
- the first location point where the electronic device is currently located is obtained; each normal vector of the target geofence is determined respectively, wherein the target geofence is formed by connecting N boundary vertices in a preset order, and the The normal vector is perpendicular to the edge vector of the target geofence, the edge vector is a vector formed by connecting two adjacent boundary vertices of the target geofence, and N is an integer greater than 2; according to the first position point and The dot product of the vector formed by connecting the target boundary vertices and the target normal vector determines the positional relationship between the first position point and the target geofence, wherein the target boundary vertex is part or all of the target geofence.
- the target normal vector is a normal vector perpendicular to the edge vector at the target boundary vertex.
- the vector method is used to detect geofences on electronic devices, avoiding the complex operations involved in the traditional cross number method, and only using four simple arithmetic operations, which can effectively reduce the computational complexity of fence detection and greatly reduce calculations. quantity and improve detection efficiency.
- Figure 1 is a schematic diagram of a polygonal geofence of a POI provided by an embodiment of the present application
- Figure 2 is a schematic diagram of geofence detection using the cross number method in related technologies
- Figure 3 is a schematic diagram of splitting a polygonal geofence into multiple circular fences in the related art
- Figure 4 is one of the flow charts of the geofence detection method provided by the embodiment of the present application.
- Figure 5 is a schematic diagram of the edge vectors and corresponding normal vectors of a polygonal geofence provided by an embodiment of the present application
- Figure 6 is an algorithm flow chart for polygon geofence detection using the vector method provided by the embodiment of the present application.
- Figure 7 is the second flow chart of the geofence detection method provided by the embodiment of the present application.
- Figure 8 is a schematic diagram of the movement direction vector and the corresponding normal dividing the fence area in the polygonal geofence provided by the embodiment of the present application;
- Figure 9 is a schematic diagram of the movement direction vector and normal coordinate rotation provided by the embodiment of the present application.
- Figure 10 is the third flow chart of the geofence detection method provided by the embodiment of the present application.
- Figure 11 is a schematic diagram of the distance of a point in various directions within a polygonal geofence provided by an embodiment of the present application.
- Figure 12 is the fourth flow chart of the geofence detection method provided by the embodiment of the present application.
- Figure 13 is a schematic structural diagram of a geofence detection device provided by an embodiment of the present application.
- Figure 14 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
- Figure 15 is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application.
- first, second, etc. in the description and claims of this application are used to distinguish similar objects and are not used to describe a specific order or sequence. It is to be understood that the terms so used are interchangeable under appropriate circumstances so that the embodiments of the application can be practiced in sequences other than those illustrated or described herein, and that "first,” “second,” etc. are distinguished Objects are usually of one type, and the number of objects is not limited. For example, the first object can be one or multiple.
- “and/or” in the description and claims indicates at least one of the connected objects, and the character “/" generally indicates that the related objects are in an "or” relationship.
- Wireless Fidelity is a wireless LAN access technology and one of the ways for mobile phones and other electronic devices to connect to the network wirelessly;
- AP Access Point
- WiFi Wireless Fidelity
- All WiFi devices must be connected to the AP device to access the Internet.
- wireless routers and gateways are common AP devices, and smartphones can also become AP devices when turning on WiFi hotspots;
- GPS Global Positioning System
- smartphones generally integrate GPS chip modules, which can receive and interpret signals broadcast by GPS satellites to determine their location;
- Point of Interest in geographic information systems, a point of interest represents a geographical unit, such as a shop, a house, a bus stop, etc.
- Geofence detection is an important function integrated in the framework layer of intelligent electronic devices. It is a bridge that converts the underlying geographical location information into the user's space and context. It is used for users' situation awareness, user portraits, important information reminders and other services. Plays an important supporting role.
- An actual polygonal geofence 10 of a shopping mall POI can be shown in Figure 1 .
- the Crossing Number method also known as the parity check method, is mainly used to determine whether a point is inside a polygonal geofence. As shown in Figure 2, it is used to determine whether a ray starting from point P passes through the polygonal geofence boundary. If it is an odd number, it is determined that point P is inside the polygonal geofence; if it is an even number, it is determined that point P is outside the polygonal geofence.
- the amount of calculation is huge:
- the intersection number method involves the problem of judging whether the ray and the line segment intersect, and judging this problem involves the inversion operation of the matrix.
- the amount of calculation of this operation is relatively large, and it also needs to start from point P. At least two starting rays and all boundaries of the polygonal geofence must be calculated one by one, which increases the calculation amount.
- fence detection is basically done on the terminal side, which means that this calculation must also be performed on the terminal side, and the huge amount of calculation will inevitably cause the terminal to Large power consumption overhead;
- intersection number method has limited application in actual polygon geofence detection, and developers need to use optimized alternative algorithms for detection.
- the improved replacement algorithm of the traditional cross number method usually uses the split approximation method to split a complete polygonal geofence into several simple-shaped geofences for approximate replacement, thereby reducing the computational complexity of the geofence detection algorithm.
- a complete polygonal geofence is generated into multiple circular geofences to cover the geographical area defined by the polygonal geofence, and the multiple circular geofences are monitored to detect entry into any describe The current location of the user's device that bounds the circular geofence.
- this application designs a polygonal geofence detection method.
- the vector calculation method is used to determine whether point P is located inside the polygonal geofence.
- the vector method for detecting polygonal geofences avoids the complex operations involved in the traditional intersection number method, and can effectively reduce the computational complexity of fence detection, improve detection efficiency, and reduce equipment power consumption.
- the vector method for polygonal fence detection is calculated and judged strictly according to the real boundary of the polygon, thus avoiding the problem of inconsistency between the fence boundary and the actual polygonal fence boundary during the approximation simulation using a circular fence or a rectangular fence in the split approximation method.
- Figure 4 is a flow chart of a geofence detection method provided by an embodiment of the present application. As shown in Figure 4, the method includes the following steps:
- Step 401 Obtain the first location point where the electronic device is currently located.
- the current location information of the electronic device can be obtained, such as by locating the electronic device.
- the position of the device is to obtain the position point where the electronic device is located at the current moment, that is, the first position point.
- Step 402 Determine each normal vector of the target geofence respectively, wherein the target geofence is formed by connecting N boundary vertices in a preset order, the normal vector is perpendicular to the edge vector of the target geofence, and the edge The vector is a vector formed by connecting two adjacent boundary vertices of the target geofence, and N is an integer greater than 2.
- the above-mentioned target geofence may be a geofence of a certain POI, for example, it may be a geofence of a certain POI near the electronic device.
- the target geofence may be a polygonal geofence, including N boundary vertices, which is a closed polygonal area formed by connecting the N boundary vertices in a certain order.
- the N boundary vertices are P 1 and P respectively.
- the N boundary vertices can be connected in positive order, that is, P 1 is connected to P 2 , P 2 is connected to P 3 ,...P N-1 is connected to PN , and P N is connected to P 1 Connect, or you can also connect the N boundary vertices in reverse order, that is, connect P 1 to PN , connect PN to PN-1 ,...P 3 to P 2 , and connect P 2 to P 1. , thus obtaining a closed polygonal geofence.
- the edge vector of the target geofence may refer to the connection shape of two adjacent boundary vertices of the target geofence.
- two adjacent boundary vertices can be connected in a counterclockwise direction to form an edge vector:
- two adjacent boundary vertices can also be connected in a clockwise direction to form an edge vector.
- Each normal vector of the target geofence may refer to a vector perpendicular to each edge vector of the target geofence, and the direction of each normal vector may be counterclockwise or clockwise to the direction of the corresponding edge vector. Obtained by rotating 90°. Therefore, the above-mentioned determination of each normal vector of the target geofence may be to determine each edge vector of the target geofence, and perform coordinate transformation on each edge vector according to the coordinate transformation formula, thereby obtaining each corresponding normal vector, The coordinate transformation formula is determined based on the rotation angle. For example, if the object is rotated 90° counterclockwise, the angle of rotation is 90°, and if rotated 90° clockwise, the angle of rotation is -90°.
- Step 403 Determine the positional relationship between the first position point and the target geofence according to the dot product of the vector formed by connecting the first position point and the target boundary vertex and the target normal vector, wherein the target boundary vertex is part or all of the boundary vertices in the target geofence, and the target normal vector is a normal vector perpendicular to the edge vector at the target boundary vertex.
- the angle between the target vector formed by connecting the first location point and any boundary vertex in the target geofence and the normal vector corresponding to the edge vector where the boundary vertex is located can be determined.
- the positional relationship between the first position point and the target geofence that is, determining whether the first position point is located inside or outside the target geofence. For example, if the normal vector points to the inside of the target geofence, then The target vector is a vector whose boundary vertex points to the first location point. Then, for the location point located inside the target geographical fence, the angle between the target vector and the normal vector is an acute angle, and the angle between the target vector and the normal vector is an acute angle.
- the angle between the target vector and the normal vector is an obtuse angle; or, if the normal vector points outside the target geofence, the target vector is the boundary vertex pointing to the first position point vector, then for a position point located inside the target geofence, the angle between the target vector and the normal vector is an obtuse angle; for a position point located outside the target geofence, the target vector and the normal vector
- the angle between the normal vectors is an acute angle. In order to determine whether the angle between two vectors is an acute angle, it can be determined based on whether the dot product of the two vectors is greater than 0. If the dot product is greater than 0, it can be determined that the angle between the two vectors is an acute angle, and vice versa.
- the vector formed by connecting the first position point and the target boundary vertex can be determined according to the dot product of the vector formed by connecting the first position point and the target boundary vertex and the target normal vector. Whether the angle between the first position point and the target normal vector is an acute angle, and then combined with the direction of the vector formed by connecting the first position point and the target boundary vertex and the direction of the target normal vector, determine the relationship between the first position point and the The positional relationship of the target geofence, that is, determining whether the first location point is located inside or outside the target geofence.
- the target boundary vertices may include all boundary vertices of the target geofence, or may only include part of the boundary vertices of the target geofence. That is, in one embodiment, the target boundary vertices may be determined according to the first location point and the target geofence. The dot product of the vector formed by connecting each boundary vertex of the target geofence and the target normal vector determines the positional relationship between the first position point and the target geofence.
- the first location point can be The dot product of the vector formed by connecting the target boundary vertex of the target geofence that meets certain conditions (such as the boundary vertex on the same side as the first location point) and the target normal vector determines the relationship between the first location point and Regarding the positional relationship of the target geofence, this embodiment is applicable to the situation where the electronic device has entered the target geofence and subsequently determines whether the electronic device is still inside the target geofence based on real-time positioning.
- the edge vector at the target boundary vertex may refer to an edge vector starting from the target boundary vertex.
- the normal vector points to the interior of the target geofence
- the step 403 includes:
- each edge vector of the target geofence when two adjacent boundary vertices are connected in a counterclockwise direction, each edge vector can be rotated 90° counterclockwise to obtain the corresponding normal vectors, so that each normal vector points to the inside of the target geofence; or, When each edge vector of the target geofence is formed by connecting two adjacent boundary vertices in a clockwise direction, each edge vector can be rotated 90° clockwise to obtain the corresponding normal vectors, so that each normal vector points to the described Inside the target geofence.
- the vector formed by connecting the first location point and the target boundary vertex may be a first vector pointing from the target boundary vertex to the first location point.
- the angle between the first vector and the target normal vector is an acute angle, that is, less than 90°.
- the dot product of the first vector and the target normal vector is greater than 0. If the first vector If the location point is located outside the target geofence, then the angle between the first vector and the target normal vector is an obtuse angle, that is, greater than 90°.
- the dot product of the first vector and the target normal vector is Less than 0.
- the dot product of the first vector and the target normal vector by calculating the dot product of the first vector and the target normal vector and comparing it with 0, it can be determined whether the first location point is located inside or outside the target geofence. , specifically, when the dot product of the first vector and the target normal vector is greater than 0, it can be determined that the first location point is located inside the target geofence. When the dot product of the target normal vector is less than 0, it can be determined that the first location point is located outside the target geofence.
- the electronic device is located at the boundary of the target geofence, that is, the angle between the first vector and the target normal vector is a right angle, which is equal to 90°. , therefore, it can be determined that the first location point is located at the boundary of the target geofence when the dot product of the first vector and the target normal vector is equal to 0.
- the core invention of this application is to use the vector method to detect polygonal geofences.
- the following is a detailed introduction to the algorithm principle of using the vector method to determine whether point P is located inside a polygonal geofence.
- the boundary of the polygonal geofence can be specified in the technical solution of this application
- the vertex array is arranged in a counterclockwise direction; if it is arranged in a clockwise direction, the same function can be achieved through equivalent transformation;
- POI geofence data basically meets the above two conditions.
- edge vector The corresponding normal vector can be recorded as Since the boundary vertex array of the polygonal geofence is arranged in counterclockwise order, the normal vector can be considered It is obtained by rotating 90° counterclockwise based on the coordinate system where the boundary vertex data is located.
- the coordinate transformation formula is:
- (x′, y′) is the coordinate value in the new coordinate system after coordinate rotation, and ⁇ is the rotation angle.
- the edge vectors and corresponding normal vectors of the polygonal geofence can be shown in Figure 5. It can be seen from Figure 5 that the normal vectors corresponding to all the edge vectors of the polygonal geofence point to the inside of the polygonal geofence.
- the dot product can determine whether point P is in the polygon geofence internal.
- the whole process of vector method calculation only uses four simple arithmetic operations and does not involve complex calculation modes, which greatly reduces the amount of calculation and improves the performance of polygonal geofence detection.
- step 401 and before step 403 the method further includes:
- the step 403 includes:
- the first position point is determined based on the dot product of the connecting vector between the first position point and the target boundary vertex and the target normal vector. The location relationship to the target geofence.
- the determination can be made based on the circumscribed rectangle of the polygonal geofence. If the positioning point is outside the circumscribing rectangle, there is no need to detect the polygonal geofence, and it can be directly determined that the positioning point is located outside the polygonal geofence.
- the maximum and minimum values of take the maximum and minimum values of longitude and the maximum and minimum values of latitude, and form the boundary of the circumscribed rectangle based on these four points.
- the positional relationship between the first location point and the circumscribed rectangular area can be determined first, that is, it is determined whether the first location point is located in the circumscribed rectangle. Outside the area, if the first location point is located outside the circumscribed rectangular area, it can be directly determined that the first location point is located outside the target geofence, if the first location point is not located in the circumscribed rectangular area Externally, if the first position point is located inside the circumscribed rectangular area or at the boundary of the circumscribed rectangular area, then the subsequent step 403 can be continued, that is, further based on the connection vector between the first position point and the target boundary vertex. The dot product with the target normal vector determines the positional relationship between the first location point and the target geofence.
- point P For the current location point P, you can first determine whether point P is outside the circumscribed rectangle of the polygonal geofence. If the longitude of point P exceeds the maximum or minimum longitude of the circumscribed rectangle, or the latitude of point P exceeds the circumscribed rectangle. If the maximum or minimum value of the latitude of the rectangle is determined, it can be determined that point P is located outside the polygonal geofence; otherwise, whether point P is outside the polygonal geofence can be determined according to the aforementioned vector method.
- the coordinate system used for the position coordinates of the boundary vertices of the polygonal geofence is a non-geodestic coordinate system such as GCJ02, BD09, etc.
- the coordinates of each boundary vertex of the polygonal geofence need to be transformed. It is the internationally adopted geocentric coordinate system (World Geodetic System - 1984 Coordinate System, WGS84). Because only the WGS84 coordinate system is a linear coordinate system, it meets the prerequisites for polygon geofence detection through the vector method. That is, before generating the bounding rectangle of the polygonal geofence, the step of transforming the coordinates of the boundary vertices of the polygonal geofence can be performed.
- this step is not required.
- converting the GCJ02 or BD09 coordinate system to the WGS84 coordinate system can be done directly through the open source conversion plug-in.
- Step 701 Transform the coordinates of the vertices of the polygonal geofence boundary.
- Step 702 Generate the bounding rectangle of the polygonal geofence.
- Step 703 Determine whether point P is outside the enclosing rectangle.
- step 704 is entered for the next step of determination.
- Step 704 Determine whether point P is outside the polygonal geofence according to the vector method.
- the polygonal geofence detection algorithm can be simplified, the amount of calculation is reduced, the detection efficiency is improved, and the power consumption is reduced.
- the method further includes:
- the electronic device When the electronic device is located inside the target geofence at the first time, store the second location point of the electronic device at the first time, and the first time is the time before the current time. ;
- step 401 and before step 403 the method further includes:
- coordinate transformation is performed on the boundary vertex of the target geofence to obtain the ordinate value of the boundary vertex of the target geofence in a second coordinate system, where the second coordinate system is The coordinate system after rotating the first included angle counterclockwise from the Cartesian coordinate system;
- the target boundary vertex is determined according to the ordinate value of the boundary vertex of the target geofence in the second coordinate system and the ordinate value of the second location point in the second coordinate system, where, The target boundary vertex is located on a first side of a first normal line, the first normal line is perpendicular to the second vector, and the first position point is located on a first side of the first normal line.
- This vector represents the user's movement direction from time t 0 to time t 1 , and can be called a movement direction vector.
- a vector perpendicular to the direction of motion can be drawn through point P (t 0 )
- the straight line L is called the normal of the motion direction vector. Since point P(t 0 ) is inside the polygonal geofence, this normal line L will divide the entire polygonal geofence into two parts. Correspondingly, the vertices on the boundary of the polygonal geofence will also be divided into two parts by this normal line.
- one part of the vertices is located on the same side of the point P(t 1 ), which is called the same-side vertex; the part of the vertex is located on different sides of the point P(t 1 ), which is called the different-side vertex (such as Vertices marked with “ ⁇ ” in Figure 8).
- point P(t 0 ) is already located inside the polygonal geofence, it means that point P(t 0 ) is already located inside the polygonal geofence compared with these vertices on opposite sides, and point P (t 1 ) is farther away from the vertices on the opposite side than point P (t 0 ). From the perspective of these vertices on the opposite side, point P (t 1 ) is more likely to be located inside the polygonal geofence.
- Step 1001 Cache the position point P(t 0 ) located inside the polygonal geofence.
- Step 1002 The electronic device initiates positioning at time t 1 and obtains the positioning position P(t 1 ) at that time.
- the positioning method can be determined according to the specific environment of the target geofence. For example, if the geofence is outdoors, GPS can be used for positioning; if it is an indoor environment, network positioning can be initiated and positioned through WiFi or base station signals.
- Step 1003 Calculate the motion direction vector and the corresponding angle.
- the motion direction vector be The angle between the movement direction vector and the negative half-axis of the y-axis of the Cartesian coordinate system can be calculated as:
- Step 1004 According to the coordinate conversion formula and the included angle ⁇ , perform coordinate transformation on all vertices of the polygonal geofence boundary, and calculate the ordinate value y′ under the new coordinates.
- Step 1005 Calculate the ordinate value y t0 of point P(t 0 ) under the new coordinates. Compare the values of y′ and y t0 . If y′>y t0 , the corresponding vertex is determined to be a vertex on the opposite side; otherwise, the corresponding vertex is determined to be a vertex on the same side.
- Step 1006 Use the vector method to determine whether point P(t 1 ) is located inside the polygonal geofence using vertices on the same side.
- the origin of the second coordinate system is the second position point, and the ordinate value of the second position point in the second coordinate system is 0;
- the step 401 includes:
- the first boundary vertex is determined to be the target boundary vertex, wherein the first boundary vertex is the Any boundary vertex in the target geofence;
- the second position point at the previous moment can be used as the origin of the Cartesian coordinate system, and the Cartesian coordinate system is rotated counterclockwise to obtain the converted second coordinate system, so that the origin of the second coordinate system is the second position point, so the ordinate value of the second position point in the second coordinate system is 0.
- the position point P(t 0 ) at time t 0 can be the origin of the new coordinate system after transformation, so that the ordinate value of P(t 0 ) in the new coordinate system is 0.
- each boundary vertex is When it is the target boundary vertex (that is, whether it is a vertex on the same side), it is only necessary to compare the ordinate value of each boundary vertex in the second coordinate system with 0. Specifically, if a certain boundary vertex is in the If the ordinate value in the second coordinate system is greater than 0, it can be determined that the boundary vertex is a vertex on the opposite side, that is, it is not the target boundary vertex. On the contrary, if the ordinate value of a boundary vertex in the second coordinate system is less than or If equal to 0, it can be determined that the boundary vertex is the vertex on the same side, that is, it is the target boundary vertex.
- the method further includes:
- the second time is the time before the current time
- a spatial environment table is generated, wherein the spatial environment table stores a corresponding relationship between directions and distances.
- M is equal to 360 degrees divided by the preset angle;
- step 401 and before step 403 the method further includes:
- the step 403 includes:
- the distance between the first position point and the target is determined based on the dot product of the connecting vector between the first position point and the target boundary vertex and the target normal vector. Geofence location relationships.
- a user After a user enters a geofence, he or she usually stays for a while and does not leave the geofence immediately. For example, a user is shopping in a shopping mall, and the user has been inside the polygonal geofence corresponding to the shopping mall during the shopping period. If the polygonal geofence detection algorithm is used for each positioning, each detection will consume a lot of time. Large amount of calculation. If the user calls applications such as indoor navigation while shopping, the frequency of positioning will increase, and the amount of calculation and power consumption will increase. Therefore, in this implementation, a simpler algorithm is proposed to cover this scenario.
- the method designed in this embodiment is a method of exchanging space for time. Specifically, the user constructs the spatial environment of the polygonal geofence when entering the polygonal geofence for the first time, so that each time the user is positioned, only A simple calculation is required to determine whether you are still inside the polygonal geofence. Therefore, the core of this implementation is how to construct a spatial environment of polygonal geofences.
- a spatial environment table of the polygonal geofence can be generated, which records the distance of the current point in all direction vectors.
- the angle between two adjacent direction vectors can be set according to actual needs. For example, the angle between two adjacent direction vectors can be set to 15°, then the entire polygonal geofence space can be divided into 24 direction vectors. .
- the spatial environment table of the geofence can be shown in Table 1 below.
- the method further includes:
- the spatial environment table is updated according to the distance change value in each of the M directions.
- the spatial environment table can be updated so that subsequent positioning positions can be based on the updated spatial environment table. Make more accurate judgments.
- Step 1201 Generate a spatial environment table.
- Step 1202 Obtain the positioning position and calculate the modulus and direction of the user's motion direction vector.
- Step 1203 Query the vector interval number in the direction of the motion direction vector from the space environment table.
- Step 1204 Query the distance corresponding to the vector interval number.
- Step 1205 Determine whether the modulus value of the motion direction vector is less than the distance queried in the spatial environment table. If so, directly determine that the point is located inside the polygonal geofence; otherwise, proceed to step 1206.
- Step 1206 Start the vector method to detect polygonal geofences.
- Step 1207 Update the space environment table.
- the geofence detection method in the embodiment of the present application obtains the first location point where the electronic device is currently located; respectively determines each normal vector of the target geofence, wherein the target geofence is connected by N boundary vertices in a preset order Formed, the normal vector is perpendicular to the edge vector of the target geographical fence, the edge vector is a vector formed by connecting two adjacent boundary vertices of the target geographical fence, and N is an integer greater than 2; according to the first The dot product of the vector formed by connecting a position point and the target boundary vertex and the target normal vector determines the positional relationship between the first position point and the target geofence, wherein the target boundary vertex is in the target geofence.
- the target normal vector is a normal vector perpendicular to the edge vector at the target boundary vertex.
- the vector method is used to detect geofences on electronic devices, avoiding the complex operations involved in the traditional cross number method, and only using four simple arithmetic operations, which can effectively reduce the computational complexity of fence detection and greatly reduce calculations. quantity and improve detection efficiency.
- the execution subject may be a geofence detection device.
- the geofence detection method performed by the geofence detection device is used as an example to illustrate the geofence detection device provided by the embodiments of this application.
- FIG 13 is a schematic structural diagram of a geofence detection device provided by an embodiment of the present application.
- the geofence detection device 1300 includes:
- the acquisition module 1301 is used to acquire the first location point where the electronic device is currently located;
- the first determination module 1302 is used to determine each normal vector of the target geographical fence, wherein the target geographical fence is formed by connecting N boundary vertices in a preset order, and the normal vector is the same as the edge vector of the target geographical fence.
- the edge vector is a vector formed by connecting two adjacent boundary vertices of the target geofence, and N is an integer greater than 2;
- the second determination module 1303 is configured to determine the positional relationship between the first position point and the target geofence based on the dot product of the vector formed by connecting the first position point and the target boundary vertex and the target normal vector, where, The target boundary vertex is part or all of the boundary vertices in the target geofence, and the target normal vector is a normal vector perpendicular to an edge vector at the target boundary vertex.
- the geofence detection device 1300 also includes:
- a third determination module configured to determine the circumscribed rectangular area of the target geofence, wherein all boundary vertices of the target geofence are located within the circumscribed rectangular area;
- the fourth determination module is used to determine the positional relationship between the first position point and the circumscribed rectangular area
- the second determination module is configured to determine based on the dot product of the connection vector between the first position point and the target boundary vertex and the target normal vector when it is determined that the first position point is not located outside the circumscribed rectangular area. , determine the positional relationship between the first location point and the target geofence.
- the normal vector points to the interior of the target geofence
- the second determination module 1303 includes:
- a first determination unit configured to determine that the first location point is located inside the target geofence when the dot product of the first vector and the target normal vector is greater than 0, wherein the first vector is A vector from the target boundary vertex pointing to the first position point;
- a second determination unit configured to determine that the first location point is located outside the target geofence when the dot product of the first vector and the target normal vector is less than 0.
- the geofence detection device 1300 also includes:
- a first storage module configured to store the second location point of the electronic device at the first time when the electronic device is located inside the target geofence at the first time, the first The time is the time before the current time;
- the fifth determination module is used to determine the second vector and the first included angle, wherein the second vector is a vector from the second position point to the first position point, and the first included angle is the The angle between the second vector and the -y axis in the Cartesian coordinate system;
- a coordinate conversion module configured to perform coordinate conversion on the boundary vertex of the target geofence according to the first included angle to obtain the ordinate value of the boundary vertex of the target geofence in the second coordinate system, wherein:
- the second coordinate system is a coordinate system obtained by rotating the rectangular coordinate system counterclockwise by the first included angle;
- the sixth determination module is used to determine the ordinate value of the boundary vertex of the target geofence in the second coordinate system and the ordinate value of the second location point in the second coordinate system.
- the target boundary vertex wherein the target boundary vertex is located on a first side of a first normal line, the first normal line is perpendicular to the second vector, and the first position point is located on the first side of the first normal line First side.
- the origin of the second coordinate system is the second position point, and the ordinate value of the second position point in the second coordinate system is 0;
- the sixth determination module includes:
- a third determination unit configured to determine that the first boundary vertex is the target boundary vertex when the ordinate value of the first boundary vertex in the second coordinate system is less than or equal to 0, wherein, The first boundary vertex is any boundary vertex in the target geofence;
- a fourth determination unit configured to determine that the first boundary vertex is not the target boundary vertex when the ordinate value of the first boundary vertex in the second coordinate system is greater than 0.
- the geofence detection device 1300 also includes:
- a second storage module configured to store the third location point of the electronic device at the second time when the electronic device is located inside the target geofence at the second time.
- the time is the time before the current time
- a generation module configured to generate a spatial environment table according to the distances between the third location point and the boundary of the target geofence along the preset M directions, wherein the spatial environment table stores directions and distances.
- the spatial environment table stores directions and distances.
- two adjacent directions among the M directions are separated by a preset angle, and M is equal to 360 degrees divided by the preset angle.
- a seventh determination module used to determine the first distance and the first direction of the first position point relative to the third position point
- a query module used to query the second distance corresponding to the first direction from the spatial environment table
- the second determination module 1303 is configured to determine the first distance based on the dot product of the connection vector between the first position point and the target boundary vertex and the target normal vector when the first distance is greater than the second distance. The positional relationship between a location point and the target geofence.
- the geofence detection device 1300 also includes:
- An eighth determination module configured to determine the angle between the third vector and each of the M directions respectively when it is determined that the first location point is located inside the target geofence, wherein the third vector The vector is a vector from the third position point to the first position point;
- a ninth determination module configured to determine the distance change value in each of the M directions according to the angle between the third vector and each of the M directions and the modulus of the third vector;
- An update module configured to update the spatial environment table according to the distance change value in each of the M directions.
- the geofence detection device 1300 in the embodiment of the present application obtains the first location point where the electronic device is currently located; and determines each normal vector of the target geofence, wherein the target geofence consists of N boundary vertices in a preset order
- the connection is formed, the normal vector is perpendicular to the edge vector of the target geographical fence, the edge vector is a vector formed by connecting two adjacent boundary vertices of the target geographical fence, and N is an integer greater than 2; according to the The dot product of the vector formed by connecting the first position point and the target boundary vertex and the target normal vector determines the positional relationship between the first position point and the target geofence, wherein the target boundary vertex is the target geofence At some or all of the boundary vertices in , the target normal vector is a normal vector perpendicular to the edge vector at the target boundary vertex.
- the vector method is used to detect geofences on electronic devices, avoiding the complex operations involved in the traditional cross number method, and only using four simple arithmetic operations, which can effectively reduce the computational complexity of fence detection and greatly reduce calculations. quantity and improve detection efficiency.
- the geofence detection device in the embodiment of the present application may be an electronic device or a component of the electronic device, such as an integrated circuit or chip.
- the electronic device may be a terminal or other devices other than the terminal.
- the electronic device can be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle-mounted electronic device, a mobile Internet device (MID), or an augmented reality (Augmented Reality, AR)/virtual reality (Virtual Reality, VR) ) equipment, robots, wearable devices, ultra-mobile personal computers (Ultra-Mobile Personal Computer, UMPC), netbooks or personal digital assistants (Personal Digital Assistant, PDA), etc., and can also be servers, network attached storage (Network Attached Storage, NAS), personal computer (Personal Computer, PC), television (Television, TV), teller machine or self-service machine, etc., the embodiments of this application are not specifically limited.
- the geofence detection device in the embodiment of the present application may be a device with an operating system.
- the operating system can be an Android operating system, an ios operating system, or other possible operating systems, which are not specifically limited in the embodiments of this application.
- the geofence detection device provided by the embodiment of the present application can implement various processes implemented by the embodiments of Figures 4 to 12. To avoid duplication, they will not be described again here.
- this embodiment of the present application also provides an electronic device 1400, including a processor 1401 and a memory 1402.
- the memory 1402 stores programs or instructions that can be run on the processor 1401.
- each step of the above geofence detection method embodiment is implemented and the same technical effect can be achieved. To avoid duplication, the details will not be described here.
- the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
- Figure 15 is a schematic diagram of the hardware structure of an electronic device that implements an embodiment of the present application.
- the electronic device 1500 includes but is not limited to: radio frequency unit 1501, network module 1502, audio output unit 1503, input unit 1504, sensor 1505, display unit 1506, user input unit 1507, interface unit 1508, memory 1509, processor 1510, etc. part.
- the electronic device 1500 may also include a power supply (such as a battery) that supplies power to various components.
- the power supply may be logically connected to the processor 1510 through a power management system, thereby managing charging, discharging, and function through the power management system. Consumption management and other functions.
- the structure of the electronic device shown in Figure 15 does not constitute a limitation of the electronic device.
- the electronic device may include more or less components than shown in the figure, or combine certain components, or arrange different components, which will not be described again here. .
- processor 1510 is used for:
- each normal vector of the target geofence is formed by connecting N boundary vertices in a preset order, the normal vector is perpendicular to the edge vector of the target geofence, and the edge vector is The vector formed by connecting two adjacent boundary vertices of the target geofence, N is an integer greater than 2;
- the positional relationship between the first position point and the target geofence is determined according to the dot product of the vector formed by connecting the first position point and the target boundary vertex and the target normal vector, wherein the target boundary vertex is the For some or all boundary vertices in the target geofence, the target normal vector is a normal vector perpendicular to the edge vector at the target boundary vertex.
- processor 1510 is also used to:
- the first position point is determined based on the dot product of the connecting vector between the first position point and the target boundary vertex and the target normal vector. The location relationship to the target geofence.
- the normal vector points to the interior of the target geofence
- Processor 1510 also used for:
- the dot product of the first vector and the target normal vector is greater than 0, it is determined that the first location point is located inside the target geofence, wherein the first vector points from the target boundary vertex to the target geofence. Describe the direction of the first position point quantity;
- processor 1510 is also used to:
- the electronic device When the electronic device is located inside the target geofence at the first time, store the second location point of the electronic device at the first time, and the first time is the time before the current time. ;
- coordinate transformation is performed on the boundary vertex of the target geofence to obtain the ordinate value of the boundary vertex of the target geofence in a second coordinate system, where the second coordinate system is The coordinate system after rotating the first included angle counterclockwise from the Cartesian coordinate system;
- the target boundary vertex is determined according to the ordinate value of the boundary vertex of the target geofence in the second coordinate system and the ordinate value of the second location point in the second coordinate system, where, The target boundary vertex is located on a first side of a first normal line, the first normal line is perpendicular to the second vector, and the first position point is located on a first side of the first normal line.
- the origin of the second coordinate system is the second position point, and the ordinate value of the second position point in the second coordinate system is 0;
- Processor 1510 also used for:
- the first boundary vertex is determined to be the target boundary vertex, wherein the first boundary vertex is the Any boundary vertex in the target geofence;
- processor 1510 is also used to:
- a spatial environment table is generated, wherein the spatial environment table stores a corresponding relationship between directions and distances.
- M is equal to 360 degrees divided by the preset angle;
- the distance between the first position point and the target is determined based on the dot product of the connecting vector between the first position point and the target boundary vertex and the target normal vector. Geofence location relationships.
- processor 1510 is also used to:
- the spatial environment table is updated according to the distance change value in each of the M directions.
- the electronic device in the embodiment of the present application obtains the first position point where the electronic device is currently located; and determines each normal vector of the target geofence, wherein the target geofence is formed by connecting N boundary vertices in a preset order,
- the normal vector is perpendicular to the edge vector of the target geofence, the edge vector is a vector formed by connecting two adjacent boundary vertices of the target geofence, and N is an integer greater than 2; according to the first position
- the dot product of the vector formed by connecting the point and the target boundary vertex and the target normal vector determines the positional relationship between the first position point and the target geofence, wherein the target boundary vertex is part of the target geofence.
- the target normal vector is a normal vector perpendicular to the edge vector at the target boundary vertex.
- the vector method is used to detect geofences on electronic devices, avoiding the complex operations involved in the traditional cross number method, and only using four simple arithmetic operations, which can effectively reduce the computational complexity of fence detection and greatly reduce calculations. quantity and improve detection efficiency.
- the input unit 1504 may include a graphics processor (Graphics Processing Unit, GPU) 15041 and a microphone 15042.
- the graphics processor 15041 is responsible for the image capture device (GPU) in the video capture mode or the image capture mode. Process the image data of still pictures or videos obtained by cameras (such as cameras).
- the display unit 1506 may include a display panel 15061, which may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like.
- the user input unit 1507 includes a touch panel 15071 and at least one of other input devices 15072 .
- Touch panel 15071 also known as touch screen.
- the touch panel 15071 may include two parts: a touch detection device and a touch controller.
- Other input devices 15072 may include but are not limited to physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, and joysticks, which will not be described again here.
- Memory 1509 may be used to store software programs as well as various data.
- the memory 1509 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, Image playback function, etc.) etc.
- memory 1509 may include volatile memory or nonvolatile memory, or memory 1509 may include both volatile and nonvolatile memory.
- the non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), electrically removable memory.
- Volatile memory can be random access memory (Random Access Memory, RAM), static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), synchronous dynamic random access memory (Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDRSDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (Synch link DRAM) , SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DRRAM).
- RAM Random Access Memory
- SRAM static random access memory
- DRAM dynamic random access memory
- synchronous dynamic random access memory Synchronous DRAM, SDRAM
- Double data rate synchronous dynamic random access memory Double Data Rate SDRAM, DDRSDRAM
- Enhanced SDRAM, ESDRAM synchronous link dynamic random access memory
- Synch link DRAM synchronous link dynamic random access memory
- SLDRAM direct memory bus random access memory
- the processor 1510 may include one or more processing units; optionally, the processor 1510 integrates an application processor and a modem processor, where the application processor mainly handles operations related to the operating system, user interface, application programs, etc., Modem processors mainly process wireless communication signals, such as baseband processors. It can be understood that the above modem processor may not be integrated into the processor 1510.
- Embodiments of the present application also provide a readable storage medium.
- Programs or instructions are stored on the readable storage medium.
- the program or instructions are executed by a processor, each process of the above geofence detection method embodiment is implemented, and can achieve The same technical effects are not repeated here to avoid repetition.
- the processor is the processor in the electronic device described in the above embodiment.
- the readable storage medium includes computer readable storage media, such as computer read-only memory ROM, random access memory RAM, magnetic disk or optical disk, etc.
- An embodiment of the present application further provides a chip.
- the chip includes a processor and a communication interface.
- the communication interface is coupled to the processor.
- the processor is used to run programs or instructions to implement the above embodiments of the geofence detection method. Each process can achieve the same technical effect. To avoid repetition, we will not go into details here. It should be understood that the chips mentioned in the embodiments of this application may also be called system-on-chip, system-on-a-chip, system-on-a-chip or system-on-chip, etc.
- Embodiments of the present application provide a computer program product.
- the program product is stored in a storage medium.
- the program product is executed by at least one processor to implement each process of the above geofence detection method embodiment, and can achieve the same technology. The effect will not be described here to avoid repetition.
- the computer software product is stored in a storage medium (such as ROM/RAM, magnetic disc, optical disk), including several instructions to cause a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of this application.
- a storage medium such as ROM/RAM, magnetic disc, optical disk
- a terminal which can be a mobile phone, computer, server, or network device, etc.
- the embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above-mentioned specific implementations. The above-mentioned specific implementations are only illustrative and not restrictive. Those of ordinary skill in the art will inspired by this application, many forms can be made without departing from the purpose of this application and the scope protected by the claims, all of which fall within the protection of this application.
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Position Fixing By Use Of Radio Waves (AREA)
- Mobile Radio Communication Systems (AREA)
- Navigation (AREA)
Abstract
Description
Claims (19)
- 一种地理围栏检测方法,包括:获取电子设备当前所处的第一位置点;分别确定目标地理围栏的各个法向量,其中,所述目标地理围栏由N个边界顶点按预设顺序连接形成,所述法向量与所述目标地理围栏的边向量垂直,所述边向量为所述目标地理围栏的相邻两个边界顶点连接形成的向量,N为大于2的整数;根据所述第一位置点与目标边界顶点连接形成的向量与目标法向量的点积,确定所述第一位置点与所述目标地理围栏的位置关系,其中,所述目标边界顶点为所述目标地理围栏中的部分或全部边界顶点,所述目标法向量为与所述目标边界顶点处的边向量垂直的法向量。
- 根据权利要求1所述的方法,其中,所述获取电子设备当前所处的第一位置点之后,所述根据所述第一位置点与目标边界顶点的连线向量与目标法向量的点积,确定所述第一位置点与所述目标地理围栏的位置关系之前,所述方法还包括:确定所述目标地理围栏的外接矩形区域,其中,所述目标地理围栏的所有边界顶点均位于所述外接矩形区域内;确定所述第一位置点与所述外接矩形区域的位置关系;所述根据所述第一位置点与目标边界顶点的连线向量与目标法向量的点积,确定所述第一位置点与所述目标地理围栏的位置关系,包括:在确定所述第一位置点不位于所述外接矩形区域外部的情况下,根据所述第一位置点与目标边界顶点的连线向量与目标法向量的点积,确定所述第一位置点与所述目标地理围栏的位置关系。
- 根据权利要求1所述的方法,其中,所述法向量指向所述目标地理围栏的内部;所述根据所述第一位置点与目标边界顶点的连线向量与目标法向量的点积,确定所述第一位置点与所述目标地理围栏的位置关系,包括:在第一向量与所述目标法向量的点积大于0的情况下,确定所述第一位置点位于所述目标地理围栏内部,其中,所述第一向量为自所述目标边界顶点指向所述第一位置点的向量;在所述第一向量与所述目标法向量的点积小于0的情况下,确定所述第一位置点位于所述目标地理围栏外部。
- 根据权利要求1至3中任一项所述的方法,其中,所述获取电子设备当前所处的第一位置点之前,所述方法还包括:在所述电子设备于第一时刻位于所述目标地理围栏内部的情况下,存储所述电子设备在所述第一时刻所处的第二位置点,所述第一时刻为当前时刻之前的时刻;所述获取电子设备当前所处的第一位置点之后,所述根据所述第一位置点与目标边界 顶点的连线向量与目标法向量的点积,确定所述第一位置点与所述目标地理围栏的位置关系之前,所述方法还包括:确定第二向量和第一夹角,其中,所述第二向量为自所述第二位置点指向所述第一位置点的向量,所述第一夹角为所述第二向量与直角坐标系中的-y轴的夹角;根据所述第一夹角,对所述目标地理围栏的边界顶点进行坐标转换,得到所述目标地理围栏的边界顶点在第二坐标系下的纵坐标值,其中,所述第二坐标系为所述直角坐标系逆时针旋转所述第一夹角后的坐标系;根据所述目标地理围栏的边界顶点在所述第二坐标系下的纵坐标值与所述第二位置点在所述第二坐标系下的纵坐标值,确定所述目标边界顶点,其中,所述目标边界顶点位于第一法线的第一侧,所述第一法线与所述第二向量垂直,所述第一位置点位于所述第一法线的第一侧。
- 根据权利要求4所述的方法,其中,所述第二坐标系的原点为所述第二位置点,所述第二位置点在所述第二坐标系下的纵坐标值为0;所述根据所述目标地理围栏的边界顶点在所述第二坐标系下的纵坐标值与所述第二位置点在所述第二坐标系下的纵坐标值,确定所述目标边界顶点,包括:在第一边界顶点在所述第二坐标系下的纵坐标值小于或等于0的情况下,确定所述第一边界顶点为所述目标边界顶点,其中,所述第一边界顶点为所述目标地理围栏中的任一边界顶点;在所述第一边界顶点在所述第二坐标系下的纵坐标值大于0的情况下,确定所述第一边界顶点不为所述目标边界顶点。
- 根据权利要求1至3中任一项所述的方法,其中,所述获取电子设备当前所处的第一位置点之前,所述方法还包括:在所述电子设备于第二时刻位于所述目标地理围栏内部的情况下,存储所述电子设备在所述第二时刻所处的第三位置点,所述第二时刻为当前时刻之前的时刻;根据所述第三位置点分别沿预设的M个方向与所述目标地理围栏的边界的距离,生成空间环境表,其中,所述空间环境表中存储有方向与距离的对应关系,所述M个方向中相邻两个方向之间间隔预设角度,M等于360度除以所述预设角度;所述获取电子设备当前所处的第一位置点之后,所述根据所述第一位置点与目标边界顶点的连线向量与目标法向量的点积,确定所述第一位置点与所述目标地理围栏的位置关系之前,所述方法还包括:确定所述第一位置点相对所述第三位置点的第一距离和第一方向;从所述空间环境表中查询所述第一方向对应的第二距离;所述根据所述第一位置点与目标边界顶点的连线向量与目标法向量的点积,确定所述第一位置点与所述目标地理围栏的位置关系,包括:在所述第一距离大于所述第二距离的情况下,根据所述第一位置点与目标边界顶点的 连线向量与目标法向量的点积,确定所述第一位置点与所述目标地理围栏的位置关系。
- 根据权利要求6所述的方法,其中,在确定所述第一位置点位于所述目标地理围栏内部的情况下,所述方法还包括:确定第三向量分别与所述M个方向中各个方向的夹角,其中,所述第三向量为自所述第三位置点指向所述第一位置点的向量;根据所述第三向量分别与所述M个方向中各个方向的夹角和所述第三向量的模值,确定所述M个方向中各个方向的距离改变值;根据所述M个方向中各个方向的距离改变值,更新所述空间环境表。
- 一种地理围栏检测装置,包括:获取模块,用于获取电子设备当前所处的第一位置点;第一确定模块,用于分别确定目标地理围栏的各个法向量,其中,所述目标地理围栏由N个边界顶点按预设顺序连接形成,所述法向量与所述目标地理围栏的边向量垂直,所述边向量为所述目标地理围栏的相邻两个边界顶点连接形成的向量,N为大于2的整数;第二确定模块,用于根据所述第一位置点与目标边界顶点连接形成的向量与目标法向量的点积,确定所述第一位置点与所述目标地理围栏的位置关系,其中,所述目标边界顶点为所述目标地理围栏中的部分或全部边界顶点,所述目标法向量为与所述目标边界顶点处的边向量垂直的法向量。
- 根据权利要求8所述的地理围栏检测装置,其中,所述地理围栏检测装置还包括:第三确定模块,用于确定所述目标地理围栏的外接矩形区域,其中,所述目标地理围栏的所有边界顶点均位于所述外接矩形区域内;第四确定模块,用于确定所述第一位置点与所述外接矩形区域的位置关系;所述第二确定模块用于在确定所述第一位置点不位于所述外接矩形区域外部的情况下,根据所述第一位置点与目标边界顶点的连线向量与目标法向量的点积,确定所述第一位置点与所述目标地理围栏的位置关系。
- 根据权利要求8所述的地理围栏检测装置,其中,所述法向量指向所述目标地理围栏的内部;所述第二确定模块包括:第一确定单元,用于在第一向量与所述目标法向量的点积大于0的情况下,确定所述第一位置点位于所述目标地理围栏内部,其中,所述第一向量为自所述目标边界顶点指向所述第一位置点的向量;第二确定单元,用于在所述第一向量与所述目标法向量的点积小于0的情况下,确定所述第一位置点位于所述目标地理围栏外部。
- 根据权利要求8至10中任一项所述的地理围栏检测装置,其中,所述地理围栏检测装置还包括:第一存储模块,用于在所述电子设备于第一时刻位于所述目标地理围栏内部的情况下, 存储所述电子设备在所述第一时刻所处的第二位置点,所述第一时刻为当前时刻之前的时刻;第五确定模块,用于确定第二向量和第一夹角,其中,所述第二向量为自所述第二位置点指向所述第一位置点的向量,所述第一夹角为所述第二向量与直角坐标系中的-y轴的夹角;坐标转换模块,用于根据所述第一夹角,对所述目标地理围栏的边界顶点进行坐标转换,得到所述目标地理围栏的边界顶点在第二坐标系下的纵坐标值,其中,所述第二坐标系为所述直角坐标系逆时针旋转所述第一夹角后的坐标系;第六确定模块,用于根据所述目标地理围栏的边界顶点在所述第二坐标系下的纵坐标值与所述第二位置点在所述第二坐标系下的纵坐标值,确定所述目标边界顶点,其中,所述目标边界顶点位于第一法线的第一侧,所述第一法线与所述第二向量垂直,所述第一位置点位于所述第一法线的第一侧。
- 根据权利要求11所述的地理围栏检测装置,其中,所述第二坐标系的原点为所述第二位置点,所述第二位置点在所述第二坐标系下的纵坐标值为0;所述第六确定模块包括:第三确定单元,用于在第一边界顶点在所述第二坐标系下的纵坐标值小于或等于0的情况下,确定所述第一边界顶点为所述目标边界顶点,其中,所述第一边界顶点为所述目标地理围栏中的任一边界顶点;第四确定单元,用于在所述第一边界顶点在所述第二坐标系下的纵坐标值大于0的情况下,确定所述第一边界顶点不为所述目标边界顶点。
- 根据权利要求8至10中任一项所述的地理围栏检测装置,其中,所述地理围栏检测装置还包括:第二存储模块,用于在所述电子设备于第二时刻位于所述目标地理围栏内部的情况下,存储所述电子设备在所述第二时刻所处的第三位置点,所述第二时刻为当前时刻之前的时刻;生成模块,用于根据所述第三位置点分别沿预设的M个方向与所述目标地理围栏的边界的距离,生成空间环境表,其中,所述空间环境表中存储有方向与距离的对应关系,所述M个方向中相邻两个方向之间间隔预设角度,M等于360度除以所述预设角度;第七确定模块,用于确定所述第一位置点相对所述第三位置点的第一距离和第一方向;查询模块,用于从所述空间环境表中查询所述第一方向对应的第二距离;所述第二确定模块用于在所述第一距离大于所述第二距离的情况下,根据所述第一位置点与目标边界顶点的连线向量与目标法向量的点积,确定所述第一位置点与所述目标地理围栏的位置关系。
- 根据权利要求13所述的地理围栏检测装置,其中,所述地理围栏检测装置还包括:第八确定模块,用于在确定所述第一位置点位于所述目标地理围栏内部的情况下,确定第三向量分别与所述M个方向中各个方向的夹角,其中,所述第三向量为自所述第三位置点指向所述第一位置点的向量;第九确定模块,用于根据所述第三向量分别与所述M个方向中各个方向的夹角和所述第三向量的模值,确定所述M个方向中各个方向的距离改变值;更新模块,用于根据所述M个方向中各个方向的距离改变值,更新所述空间环境表。
- 一种电子设备,包括处理器和存储器,所述存储器存储可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如权利要求1-7中任一项所述的地理围栏检测方法的步骤。
- 一种电子设备,所述电子设备用于执行如权利要求1-7中任一项所述的地理围栏检测方法。
- 一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如权利要求1-7中任一项所述的地理围栏检测方法的步骤。
- 一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如权利要求1-7中任一项所述的地理围栏检测方法。
- 一种计算机程序产品,所述计算机程序产品被存储在存储介质中,所述计算机程序产品被至少一个处理器执行以实现如权利要求1-7中任一项所述的地理围栏检测方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210931542.5 | 2022-08-04 | ||
| CN202210931542.5A CN115209349B (zh) | 2022-08-04 | 2022-08-04 | 地理围栏检测方法、装置和电子设备 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2024027684A1 true WO2024027684A1 (zh) | 2024-02-08 |
Family
ID=83586069
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2023/110485 Ceased WO2024027684A1 (zh) | 2022-08-04 | 2023-08-01 | 地理围栏检测方法、装置和电子设备 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN115209349B (zh) |
| WO (1) | WO2024027684A1 (zh) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118189974A (zh) * | 2024-05-15 | 2024-06-14 | 合肥综合性国家科学中心人工智能研究院(安徽省人工智能实验室) | 数据处理方法 |
Families Citing this family (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115209349B (zh) * | 2022-08-04 | 2025-02-25 | 维沃移动通信有限公司 | 地理围栏检测方法、装置和电子设备 |
| CN115760899A (zh) * | 2022-11-30 | 2023-03-07 | 广州极飞科技股份有限公司 | 打点方法、装置、电子设备及存储介质 |
| CN116033550B (zh) * | 2022-12-30 | 2026-02-13 | 上海移为通信技术股份有限公司 | 一种定位点位置的判定方法、装置及介质 |
| CN116261101B (zh) * | 2023-01-10 | 2025-12-02 | 浙江大华技术股份有限公司 | 监控设备的位置确定方法、装置、存储介质及电子装置 |
| CN116320986B (zh) * | 2023-03-31 | 2026-03-03 | 维沃移动通信有限公司 | 定位方法、装置及电子设备 |
| CN119782845A (zh) * | 2025-03-06 | 2025-04-08 | 浙江大华技术股份有限公司 | 一种关联信息确定方法、电子设备及存储介质 |
| CN121304303A (zh) * | 2025-12-10 | 2026-01-09 | 泰安市东信智联信息科技有限公司 | 一种共享车辆电子围栏内车辆统计方法及系统 |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108846882A (zh) * | 2018-06-25 | 2018-11-20 | 北京嘀嘀无限科技发展有限公司 | 一种确定点与围栏关系的方法、装置和电子设备 |
| CN113852914A (zh) * | 2021-09-23 | 2021-12-28 | 广东几米星联通讯有限公司 | 待检验点的位置定位方法及定位装置 |
| CN115209349A (zh) * | 2022-08-04 | 2022-10-18 | 维沃移动通信有限公司 | 地理围栏检测方法、装置和电子设备 |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| TWI273442B (en) * | 2005-08-23 | 2007-02-11 | Far Eastone Telecomm Co Ltd | Method for determining a moving object entering a specific geographic zone, and recording medium having software programs for executing the same |
| CN110599717B (zh) * | 2019-07-30 | 2021-07-20 | 华为技术有限公司 | 电子围栏检测方法及电子设备 |
| CN114612665B (zh) * | 2022-03-15 | 2022-10-11 | 北京航空航天大学 | 基于法向量直方图特征的位姿估计及动态车辆检测方法 |
-
2022
- 2022-08-04 CN CN202210931542.5A patent/CN115209349B/zh active Active
-
2023
- 2023-08-01 WO PCT/CN2023/110485 patent/WO2024027684A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108846882A (zh) * | 2018-06-25 | 2018-11-20 | 北京嘀嘀无限科技发展有限公司 | 一种确定点与围栏关系的方法、装置和电子设备 |
| CN110633344A (zh) * | 2018-06-25 | 2019-12-31 | 北京嘀嘀无限科技发展有限公司 | 一种确定点与围栏关系的方法、装置和电子设备 |
| CN113852914A (zh) * | 2021-09-23 | 2021-12-28 | 广东几米星联通讯有限公司 | 待检验点的位置定位方法及定位装置 |
| CN115209349A (zh) * | 2022-08-04 | 2022-10-18 | 维沃移动通信有限公司 | 地理围栏检测方法、装置和电子设备 |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118189974A (zh) * | 2024-05-15 | 2024-06-14 | 合肥综合性国家科学中心人工智能研究院(安徽省人工智能实验室) | 数据处理方法 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN115209349B (zh) | 2025-02-25 |
| CN115209349A (zh) | 2022-10-18 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2024027684A1 (zh) | 地理围栏检测方法、装置和电子设备 | |
| US10083533B2 (en) | Geo-tagging digital images | |
| WO2022227489A1 (zh) | 针对物体的碰撞检测方法、装置、设备和存储介质 | |
| CN110764111A (zh) | 雷达坐标与大地坐标的转换方法、装置、系统及介质 | |
| CN110362242B (zh) | 一种地图展示方法及终端设备 | |
| CN107782322A (zh) | 室内定位方法与系统及其室内地图建立装置 | |
| CN103017767B (zh) | 使用测量位置的准确度测量终端的位置的方法和设备 | |
| CN110706305A (zh) | 地图应用中绘制区域的方法、装置和计算机设备 | |
| WO2015010571A1 (zh) | 目标操作方法、系统及设备 | |
| US9245366B1 (en) | Label placement for complex geographic polygons | |
| WO2023198088A1 (zh) | 机器人的位姿确定方法、装置、机器人以及存储介质 | |
| CN118319188A (zh) | 清洁机器人的重定位方法、清洁机器人和计算机设备 | |
| JP7422222B2 (ja) | 物体に対する衝突検出方法、装置、電子デバイス、記憶媒体およびコンピュータプログラム | |
| US9852542B1 (en) | Methods and apparatus related to georeferenced pose of 3D models | |
| WO2024051639A1 (zh) | 图像处理方法、装置、设备及存储介质和产品 | |
| CN108388636A (zh) | 基于自适应分段最小外接矩形的街景影像检索方法及装置 | |
| CN110493719A (zh) | 基于ble的室内定位方法、装置、计算机设备及存储介质 | |
| CN112465692A (zh) | 图像处理方法、装置、设备及存储介质 | |
| CN117576645B (zh) | 基于bev视角的车位检测方法、装置和计算机设备 | |
| US8867785B2 (en) | Method and apparatus for detecting proximate interface elements | |
| CN116977386B (zh) | 房屋点云数据的处理方法和装置 | |
| CN118885884A (zh) | 有向目标关联方法、装置、电子设备、存储介质和程序产品 | |
| CN118433857A (zh) | 定位方法、装置、计算机设备、可读存储介质和程序产品 | |
| CN114942021A (zh) | 终端定位方法、装置、终端、介质和计算机程序产品 | |
| WO2022089246A1 (zh) | 定位方法及装置 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 23849391 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 23849391 Country of ref document: EP Kind code of ref document: A1 |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 11-07-2025) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 23849391 Country of ref document: EP Kind code of ref document: A1 |