WO2016116070A2 - Method and device for determining locational relationship - Google Patents

Method and device for determining locational relationship Download PDF

Info

Publication number
WO2016116070A2
WO2016116070A2 PCT/CN2016/077021 CN2016077021W WO2016116070A2 WO 2016116070 A2 WO2016116070 A2 WO 2016116070A2 CN 2016077021 W CN2016077021 W CN 2016077021W WO 2016116070 A2 WO2016116070 A2 WO 2016116070A2
Authority
WO
WIPO (PCT)
Prior art keywords
determining
boundary
ray
mobile user
geographic location
Prior art date
Application number
PCT/CN2016/077021
Other languages
French (fr)
Chinese (zh)
Other versions
WO2016116070A3 (en
Inventor
张伟
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2016116070A2 publication Critical patent/WO2016116070A2/en
Publication of WO2016116070A3 publication Critical patent/WO2016116070A3/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06MCOUNTING MECHANISMS; COUNTING OF OBJECTS NOT OTHERWISE PROVIDED FOR
    • G06M11/00Counting of objects distributed at random, e.g. on a surface

Definitions

  • This document relates to mobile positioning technology, and more particularly to a method and apparatus for determining a positional relationship.
  • the mobile user data collected by the Passive Data Collector (PDC) system has become more and more important as the application scenarios and fields continue to expand.
  • higher requirements are placed on collecting data itself. For example, the confidence of the data, the applicable range of the data, and so on; obviously, the wider the applicable scenario of the data, the wider the application field of the PDC system, and the more optimistic the development prospect of the PDC system.
  • the related method for determining the location relationship generally includes: the PDC system determines a location relationship between the current geographic location of the mobile user and the circular area according to the current geographic location coordinate information of the mobile user. After the PDC system determines the location relationship, data statistics can be performed (eg, counting the number of mobile users in a geographic area, or counting the number of mobile users entering or leaving a geographic area).
  • the present invention proposes a method and apparatus for determining a positional relationship, which can improve statistical accuracy.
  • a method of determining a positional relationship comprising:
  • the method further includes:
  • Determining a mobile state of the mobile user according to the first location relationship of the mobile user and a second location relationship between a last geographic location and the polygonal region.
  • the step of determining the mobile state of the mobile user according to the first location relationship of the mobile user and the second location relationship between the last geographic location and the polygon region includes:
  • the mobile user Determining that the first location relationship of the mobile user is that the current geographic location of the mobile user is within the polygonal area or the current geographic location of the mobile user is on a boundary of the polygonal area, the mobile user The second positional relationship is that the mobile user's last geographic location is outside the polygonal area, and the moving state of the mobile user is determined to be leaving the polygonal area.
  • the step of determining the mobile state of the mobile user according to the first location relationship of the mobile user and the second location relationship between the last geographic location and the polygon region includes:
  • Determining that the first location relationship of the mobile user is that the current geographic location of the mobile user is outside the polygonal area, and the second location relationship of the mobile user is that the mobile user last time is in the geographic location.
  • the moving location of the mobile user is determined to be entering the polygonal area within the polygon area or the current geographic location of the mobile user on the boundary of the polygonal area.
  • the step of determining, according to the obtained current geographic location coordinate information, the first location relationship between the current geographic location of the mobile user and the polygonal region includes:
  • the step of determining, according to the obtained current geographic location coordinate information, the first location relationship between the current geographic location of the mobile user and the polygonal region includes:
  • the step of determining, according to the obtained current geographic location coordinate information, a first location relationship between a current geographic location of the mobile user and the polygonal region includes:
  • the step of calculating the number of intersections between the determined ray and the boundary of the polygonal region comprises:
  • the step of determining a relationship between the ray and each boundary of the polygon region comprises:
  • the step of determining the relationship between the ray and each boundary of the polygon region include:
  • the determining the relationship between the ray and each boundary of the polygon region further includes:
  • the ray is The ordinate of the end point is smaller than the ordinate of the point on the boundary of the Mth, which is equal to the abscissa of the end point of the ray; or, it is determined that the ordinate of any point other than the end point of the ray is smaller than An ordinate of an end point of the ray, and an abscissa of two end points of the Mth boundary is not equal, and an ordinate of an end point of the ray is greater than an abscissa of an end point of the ray An ordinate of equal points; or, determining that the abscissa of any point other than the endpoint on the ray is smaller than the abscissa of the endpoint of the ray, and the ordinate of the two endpoints of
  • the step of determining, according to the determined relationship, whether there is an intersection between each of the ray and the boundary of the polygon region comprises:
  • the step of determining, according to the determined relationship, whether there is an intersection between each of the ray and the boundary of the polygon region comprises:
  • the step of determining, according to the determined relationship, whether there is an intersection between each of the ray and the boundary of the polygon region comprises:
  • the step of determining, according to the determined relationship, whether there is an intersection between each of the ray and the boundary of the polygon region comprises:
  • the intersection is one of the endpoints of the Mth boundary, and the other endpoint of the Mth boundary
  • the intersection of the Mth boundary and the other boundary with the intersection point is determined, and one of the boundaries has an intersection with the ray. There is no intersection between the other boundary and the ray.
  • the step of determining, according to the determined relationship, whether there is an intersection between each of the ray and the boundary of the polygon region comprises:
  • the step of determining, according to the determined relationship, whether there is an intersection between each of the ray and the boundary of the polygon region comprises:
  • Determining the ray and the Mth piece when it is determined that the relationship between the ray and the Mth boundary of the polygonal area is an intersection, and the intersection point is not any one of the Mth boundary There is an intersection between the boundaries.
  • An apparatus for determining a positional relationship comprising an acquisition module and a first determination module, wherein
  • the acquiring module is configured to: obtain current geographic location coordinate information of the mobile user;
  • the first determining module is configured to: determine, according to the obtained current geographic location coordinate information, a first positional relationship between the current geographic location of the mobile user and the polygonal region.
  • the apparatus further includes a second determining module, wherein
  • the second determining module is configured to determine a mobile state of the mobile user according to the first location relationship of the mobile user and a second location relationship between a last geographic location and the polygonal region.
  • the second determining module is configured to determine a mobile user's mobile state according to the first location relationship of the mobile user and the second location relationship between the last geographic location and the polygon region as follows:
  • the mobile user Determining that the first location relationship of the mobile user is that the current geographic location of the mobile user is within the polygonal area or the current geographic location of the mobile user is on a boundary of the polygonal area, the mobile user The second positional relationship is that the mobile user's last geographic location is outside the polygonal area, and the moving state of the mobile user is determined to be leaving the polygonal area.
  • the second determining module is configured to determine a mobile user's mobile state according to the first location relationship of the mobile user and the second location relationship between the last geographic location and the polygon region as follows:
  • Determining that the first location relationship of the mobile user is that the current geographic location of the mobile user is outside the polygonal area, and the second location relationship of the mobile user is that the mobile user last time is in the geographic location.
  • the moving location of the mobile user is determined to be entering the polygonal area within the polygon area or the current geographic location of the mobile user on the boundary of the polygonal area.
  • the first determining module is configured to determine, according to the obtained current geographic location coordinate information, a first positional relationship between the current geographic location of the mobile user and the polygonal region according to the following manner:
  • the first determining module is configured to determine, according to the obtained current geographic location coordinate information, a first positional relationship between the current geographic location of the mobile user and the polygonal region according to the following manner:
  • the first determining module is configured to determine, according to the obtained current geographic location coordinate information, a first positional relationship between the current geographic location of the mobile user and the polygonal region according to the following manner:
  • the first determining module is configured to calculate the number of intersections between the determined ray and the boundary of the polygonal region as follows:
  • the technical solution of the present invention includes: acquiring current geographic location coordinate information of the mobile user; determining the current geographic location of the mobile user according to the obtained current geographic location coordinate information.
  • the first positional relationship with the polygonal area since the polygonal area can well describe the actual geographical area, the statistical accuracy is improved.
  • FIG. 1 is a flowchart of a method for determining a location relationship according to an embodiment of the present invention
  • 2(a) is a schematic diagram showing the relationship between the boundary of the Mth line of the ray and the polygonal region in the embodiment of the present invention
  • 2(b) is a schematic diagram showing the relationship between the boundary of the Mth line of the ray and the polygon region in the embodiment of the present invention
  • 2(c) is a schematic diagram showing the relationship between the boundary of the Mth line of the ray and the polygonal region in a parallel manner in the embodiment of the present invention
  • 2(d) is a schematic diagram showing the relationship between the boundary of the Mth line of the ray and the polygonal region in the embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of an apparatus for determining a positional relationship according to an embodiment of the present invention
  • FIG. 4 is a schematic structural diagram of a PDC server according to an embodiment of the present invention.
  • FIG. 5 is a flow chart of a specific embodiment of a method for determining a positional relationship according to the present invention.
  • Figure 6 is a schematic diagram of determining a positional relationship
  • FIG. 7 is a flowchart of a method for location trigger service processing according to an embodiment of the present invention.
  • 1 is a ray and 2 is a boundary of a polygonal area.
  • an embodiment of the present invention provides a method for determining a location relationship, including:
  • Step 100 Obtain current geographic location coordinate information of the mobile user.
  • the current geographic location coordinate information of the mobile user may be a coordinate value corresponding to the current geographic location of the mobile user, and the geographic location coordinate value may be a raster coordinate of the British Topographic Survey Bureau 1936 (OSGB36, Ordnance Survey of Great Britain 1936). (The coordinate unit is 10 km (km)), including the abscissa and ordinate.
  • Step 101 Determine, according to the obtained current geographic location coordinate information, a first location relationship between a current geographic location of the mobile user and the polygonal region.
  • the polygon area is determined according to the target area, and the target area is about to count the area of the mobile user entering, leaving, or being in the area, and the polygon area can reflect the shape and size of the target area, such as
  • the points of the polygonal area include at least points at respective corners of the target area.
  • the corresponding polygon area includes at least the points at the four corners of the basketball court, because the points at the four corners of the basketball court can reflect the shape and size of the basketball court, and the basketball court corresponds.
  • the polygonal area may include any of the four lines constituting the basketball court. In short, the more points the polygon area includes, the finer the statistics.
  • This step specifically includes:
  • the first location relationship is determined to be the current geographic location of the mobile user on the boundary of the polygon area.
  • a ray is determined which is the end point of the mobile user and is parallel to the coordinate axis; and the boundary between the determined ray and the polygonal area is calculated.
  • the number of intersections between the two; the number of calculated intersections is determined to be an odd number, and the first positional relationship is determined as the current geographic location of the mobile user in the multilateral Within the shape area.
  • the calculated number of intersection points is an even number, it is determined that the first location relationship is that the current geographic location of the mobile user is outside the polygon area.
  • the coordinate axis can be the X axis or the Y axis.
  • the polygon area can be represented by N points in order, and the N points are connected in order, which is a polygon area.
  • N is an integer greater than or equal to 1.
  • N points can be preset or from the SP terminal.
  • N points can be described by OSGB36 grid coordinates.
  • calculating the number of intersections between the determined ray and the boundary of the polygon region includes:
  • Determining the relationship between the ray and each boundary of the polygon region determining whether there is an intersection between each boundary of the ray and the polygon region according to the determined relationship, and adding the number of boundaries of the intersection with the ray in the polygon region to obtain the ray The number of intersections between the boundary with the polygon area.
  • the relationship between the ray and the boundary of the polygonal region may be separated, intersected, parallel or overlapped.
  • 1 represents a ray
  • 2 represents a polygonal region. The border.
  • determining the relationship between the ray and each boundary of the polygon region includes:
  • the relationship between the strip boundaries is a stack; wherein M is an integer greater than or equal to 1 and less than or equal to N. As shown in Figure 2 (d).
  • the ordinate of any point other than the end point on the ray is larger than the ordinate of the end point of the ray, and the abscissas of the two end points of the Mth boundary are not equal, and the ordinate of the end point of the ray is smaller than the Mth boundary
  • the ordinate of a point equal to the abscissa of the end point of the ray; or, determining that the ordinate of any point other than the end point of the ray is smaller than the ordinate of the end point of the ray, and The abscissas of the two endpoints of the M boundary are not equal, and the ordinate of the endpoint of the ray is greater than the ordinate of the point on the boundary of the Mth, which is equal to the abscissa of the endpoint of the ray; or, the endpoint of the ray is determined
  • the abscissa of any other point is smaller than the abscissa of the end point of the ray, and the ordinates
  • determining whether there is an intersection between each of the rays and the boundary of the polygon region according to the determined relationship includes:
  • the relationship between the ray and the Mth boundary of the polygonal region is a stack, and the end of the ray is not on the Mth boundary, and the two edges adjacent to the Mth boundary are located on both sides of the Mth boundary It is determined that there is an intersection between the boundary of the Mth and the ray, and there is no intersection between the two boundaries adjacent to the boundary of the Mth and the ray.
  • intersection When it is determined that the relationship between the ray and the Mth boundary of the polygon region is intersection, and the intersection is one of the endpoints of the Mth boundary, and the other endpoint of the Mth boundary and the other boundary with the intersection as the endpoint When the other end point is located on both sides of the ray, one of the boundary of the Mth and the other end of the intersection is determined. One of the boundaries has an intersection with the ray, and the other boundary has no intersection with the ray.
  • intersection When it is determined that the relationship between the ray and the Mth boundary of the polygon region is intersection, and the intersection is one of the endpoints of the Mth boundary, and the other endpoint of the Mth boundary and the other boundary with the intersection as the endpoint When the other end point is not located on both sides of the ray, it is determined that there is no intersection between the Mth boundary and the ray, and there is no intersection between the other boundary with the intersection point and the ray.
  • the method also includes:
  • Step 102 Determine a mobile user's mobile state according to the first location relationship of the mobile user and the second location relationship between the last geographic location and the polygon region. Specifically include:
  • the first location relationship of the mobile user is that the current geographic location of the mobile user is within the polygon region or the current geographic location of the mobile user is on the boundary of the polygon region, and the second location relationship of the mobile user is the last geographic location of the mobile user in the polygon. Outside the area, it is determined that the mobile user's moving state is leaving the polygon area.
  • the second location relationship of the mobile user is that the last time the mobile user is in the polygon area or the current geographic location of the mobile user is in the polygon.
  • the boundary of the area is on, it is determined that the moving state of the mobile user is entering the polygon area.
  • an embodiment of the present invention further provides an apparatus for determining a location relationship, including at least:
  • the obtaining module 301 is configured to: obtain current geographic location coordinate information of the mobile user;
  • the first determining module 302 is configured to: determine, according to the obtained current geographic location coordinate information, a first positional relationship between the current geographic location of the mobile user and the polygonal region.
  • the second determining module 303 is configured to determine a mobile user's mobile state according to the first location relationship of the mobile user and the second location relationship between the last geographic location and the polygonal region.
  • the second determining module 303 is specifically configured to:
  • the first location relationship of the mobile user is the current geographic location of the mobile user in the polygon area
  • the current geographic location of the mobile user or the mobile user is on the boundary of the polygonal area
  • the second location relationship of the mobile user is that the mobile user's last geographic location is outside the polygonal area
  • the mobile user's mobile state is determined to be leaving the polygonal area.
  • the second determining module 303 is specifically configured to:
  • the first location relationship of the mobile user is that the current geographic location of the mobile user is outside the polygon region
  • the second location relationship of the mobile user is that the last time the mobile user is in the polygon region or the current geographic location of the mobile user is in the polygon region. On the boundary, it is determined that the mobile user's movement state is entering the polygon area.
  • the first determining module 302 is specifically configured to:
  • the first location relationship is determined to be the current geographic location of the mobile user on the boundary of the polygon area.
  • the first determining module 302 is specifically configured to:
  • the first determining module 302 is specifically configured to:
  • Determining a relationship between each of the rays and the boundary of the polygon region determining whether there is an intersection between each of the rays and the boundary of the polygon region according to the determined relationship; adding the number of boundaries of the intersection with the ray in the polygon region to obtain the ray The number of intersections between the boundary with the polygon area;
  • the calculated number of intersection points is an odd number
  • the first positional relationship is determined to be the current geographic location of the mobile user in the polygon area.
  • the first determining module 302 is further configured to:
  • the calculated number of intersection points is an even number
  • the first location relationship is determined to be that the current geographic location of the mobile user is outside the polygon area.
  • FIG. 4 is a schematic structural diagram of a PDC server according to an embodiment of the present invention.
  • the PDC server is composed of a data collection (DCollect, Data Collect) module and a Mobile Location Protocol (MLP, MLP Service Provider) module, and the DCollect module is mainly responsible for receiving/processing the information from the letter.
  • DCollect Data Collect
  • MLP Mobile Location Protocol
  • MLP Service Provider Mobile Location Protocol
  • Relationship and the second positional relationship between the previous geographic location and the polygonal area, thereby determining the user's moving state (eg, leaving the area, or entering the area); notifying the MSP module when the mobile user is in one of the two moving states
  • the location report can be triggered; the MSP module is mainly responsible for triggering the location report and sending it to the service provider (SP, Service Provide) terminal;
  • the polygon area is described by an ordered series of points, which are connected by the end of the point to be a polygon area, ordered
  • the point is further described by the OSGB36 grid coordinates, the coordinate unit is 10km, and the coordinate origin is left.
  • Angle the method of judging whether any coordinate point is in the polygon area is to make a ray in the horizontal or vertical direction by the point.
  • the first positional relationship or the second The positional relationship is that the current geographic location of the mobile user is in the polygonal area. If the number of intersections of the ray and all the boundaries of the polygonal area is even, the first positional relationship or the second positional relationship is the current geographic location of the mobile user outside the polygonal area. .
  • the function implemented by the apparatus described in FIG. 3 is the function of the DCollect module to determine the first positional relationship and the movement state of the user.
  • a method for determining a positional relationship includes:
  • Step 500 Determine whether the current geographic location of the mobile user is on a certain boundary of the polygon area. If yes, determine that the first location relationship is that the current geographic location of the mobile user is on the boundary of the polygon area; if not, step 501 is performed. .
  • step 502 the initialization M is 1, and the intersection counter is 0.
  • Step 503 Determine whether M is greater than the number N of boundaries of the polygon region. If yes, execute step 511. If not, execute step 504.
  • Figure 6 is a schematic diagram of determining a positional relationship. As shown in FIG. 6, the two endpoints corresponding to the first boundary are P1 and P2, the two endpoints corresponding to the second boundary are P2 and P3, and the two endpoints corresponding to the Nth boundary are Pn and P1.
  • Step 505 Determine a relationship between the ray and the determined line segment.
  • Step 503 When the relationship between the ray and the line segment is separated or parallel, add M to 1 and then perform step 503; when the relationship between the ray and the line segment is intersecting Step 506 is performed; when the relationship between the ray and the line segments is overlapped, step 510 is performed.
  • Step 506 When the intersection between the ray and the line segment is an end point of the line segment, step 507 is performed, otherwise step 509 is performed.
  • the intersection between the ray and the line segment is C(x0,((y2-y1)/(x2-x1))x0), and the point C and the line segment have three kinds of positional relationship, that is, point C and Point P1 coincides, point C coincides with point P2, and point C is between points P1, P2.
  • Step 507 when the other end point of the line segment and the other end point of another boundary with the intersection point as the end point are located on both sides of the ray, step 508 is performed; when the other end point of the line segment and the other boundary with the intersection point as the end point When one end point is not located on both sides of the ray, step M is performed after M is incremented by one.
  • intersection point counter is incremented by one.
  • Step 508 If the intersection point is before the other end point of the line segment, add the intersection counter to 1, and add M to 1 and then perform step 503; if the intersection point is after the other end point of the line segment, then add M to 1 and then perform the step. 503.
  • step 509 the intersection counter is incremented by 1, and M is incremented by 1, and then step 503 is performed.
  • Step 510 If two boundaries adjacent to the line segment are located on both sides of the line segment, add 1 to the intersection counter, and add M to 2, and then perform step 503; if the two boundaries adjacent to the line segment are not located on both sides of the line segment Then, after adding M to 2, step 503 is performed.
  • step 503 is performed; when the line segment P2P3 and the ray are stacked If the points P1 and P4 are distributed on both sides of the ray, the intersection counter is incremented by 1, and after M is incremented by 2, step 503 is performed.
  • Step 511 When the intersection counter is an odd number, the mobile user is in the polygon area; when the intersection counter is an even number, the mobile user is outside the polygon area.
  • a method for location trigger service processing includes:
  • Step 700 The DCollect module parses the signaling message of the mobile user when receiving the signaling message of the mobile user sent by the signaling collection device, and obtains the current geographic location coordinate information of the mobile user.
  • Step 701 The DCollect module determines a first location relationship between the current geographic location of the mobile user and the polygon region, that is, the algorithm of the second embodiment calculates whether the current geographic location of the mobile user is outside the polygon region, the polygon region, or the polygon region. (Also can be in the polygon area).
  • Step 702 The DCollect module combines the last position of the mobile user with the second positional relationship of the polygon area to obtain a moving state of the mobile user: leaving the polygon area or entering the polygon area.
  • Step 703 The DCollect module acquires the SP terminal information associated with the mobile user, and then notifies the MSP module to trigger the user location report to the corresponding SP terminal.
  • Step 704 After receiving the triggering user location report notification message, the MSP module constructs a user location information report (including the user mobile state, the current geographic location information of the user, and the like), and then sends the information to the corresponding SP terminal.
  • a user location information report including the user mobile state, the current geographic location information of the user, and the like
  • the embodiment of the invention also discloses a computer program, comprising program instructions, which when executed by a computer, enable the computer to perform any of the above methods for determining a positional relationship.
  • the embodiment of the invention also discloses a carrier carrying the computer program.
  • all or part of the steps of the above embodiments may also be implemented by using an integrated circuit. These steps may be separately fabricated into individual integrated circuit modules, or multiple modules or steps may be fabricated into a single integrated circuit module. achieve. Thus, the invention is not limited to any specific combination of hardware and software.
  • the devices/function modules/functional units in the above embodiments may be implemented by a general-purpose computing device, which may be centralized on a single computing device or distributed over a network of multiple computing devices.
  • each device/function module/functional unit in the above embodiment When each device/function module/functional unit in the above embodiment is implemented in the form of a software function module and sold or used as a stand-alone product, it can be stored in a computer readable storage medium.
  • the above mentioned computer readable storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
  • the technical solution of the present invention includes: obtaining current geographic location coordinate information of the mobile user; and determining a first location relationship between the current geographic location of the mobile user and the polygonal region according to the obtained current geographic location coordinate information.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Position Fixing By Use Of Radio Waves (AREA)

Abstract

A method and device for determining a locational relationship, comprising: obtaining current geographical location coordinate information of a mobile user; on the basis of the obtained information, determining a first locational relationship between the current geographical location of a mobile user and a polygonal area. In the technical solution of the present invention, use of polygonal areas leads to improved computational accuracy, because such areas better describe actual geographical areas.

Description

一种确定位置关系的方法和装置Method and device for determining positional relationship 技术领域Technical field
本文涉及移动定位技术,尤指一种确定位置关系的方法和装置。This document relates to mobile positioning technology, and more particularly to a method and apparatus for determining a positional relationship.
背景技术Background technique
由被动数据收集(PDC,Passive Data Collector)系统收集到的移动用户数据随着应用场景和领域的不断拓展变得越来越重要,与此同时,也对收集数据本身提出了更高的要求,例如数据的置信度,数据的可适用场景范围等等;显然,数据的适用场景越广泛,那么PDC系统的应用领域也会越广泛,PDC系统的发展前景也越乐观。The mobile user data collected by the Passive Data Collector (PDC) system has become more and more important as the application scenarios and fields continue to expand. At the same time, higher requirements are placed on collecting data itself. For example, the confidence of the data, the applicable range of the data, and so on; obviously, the wider the applicable scenario of the data, the wider the application field of the PDC system, and the more optimistic the development prospect of the PDC system.
相关的确定位置关系的方法大致包括:PDC系统根据移动用户当前的地理位置坐标信息确定移动用户当前的地理位置与圆形区域之间的位置关系。PDC系统确定位置关系后,可以进行数据统计(例如统计某一地理区域内的移动用户的人数,或统计进入或离开某个地理区域的移动用户的人数)。The related method for determining the location relationship generally includes: the PDC system determines a location relationship between the current geographic location of the mobile user and the circular area according to the current geographic location coordinate information of the mobile user. After the PDC system determines the location relationship, data statistics can be performed (eg, counting the number of mobile users in a geographic area, or counting the number of mobile users entering or leaving a geographic area).
相关的确定位置关系的方法中,由于圆形区域往往并不能很好的描述出实际的地理区域,因为实际的地理区域是不规则的,因此在进行数据统计时精度较低,比如在统计进入、离开或正在某个地理区域的移动用户人数时就不会很准确。In the related method of determining the positional relationship, since the circular area often does not describe the actual geographical area well, since the actual geographical area is irregular, the accuracy is low when performing data statistics, such as entering statistics. The number of mobile users who leave or are in a geographic area will not be accurate.
发明内容Summary of the invention
为了解决上述问题,本发明提出了一种确定位置关系的方法和装置,能够提高统计精度。In order to solve the above problems, the present invention proposes a method and apparatus for determining a positional relationship, which can improve statistical accuracy.
为了达到上述目的,采用如下技术方案:In order to achieve the above objectives, the following technical solutions are adopted:
一种确定位置关系的方法,包括:A method of determining a positional relationship, comprising:
获取移动用户当前的地理位置坐标信息;Obtaining current geographic location coordinate information of the mobile user;
根据获得的当前的地理位置坐标信息确定所述移动用户当前的地理位置与多边形区域之间的第一位置关系。 Determining, according to the obtained current geographic location coordinate information, a first positional relationship between the current geographic location of the mobile user and the polygonal region.
可选地,该方法还包括:Optionally, the method further includes:
根据所述移动用户的所述第一位置关系,以及上一次地理位置与所述多边形区域之间的第二位置关系确定所述移动用户的移动状态。Determining a mobile state of the mobile user according to the first location relationship of the mobile user and a second location relationship between a last geographic location and the polygonal region.
可选地,所述根据移动用户的所述第一位置关系,以及上一次地理位置与多边形区域之间的第二位置关系确定移动用户的移动状态的步骤包括:Optionally, the step of determining the mobile state of the mobile user according to the first location relationship of the mobile user and the second location relationship between the last geographic location and the polygon region includes:
判断出所述移动用户的所述第一位置关系为所述移动用户当前的地理位置在所述多边形区域内或所述移动用户当前的地理位置在所述多边形区域的边界上,所述移动用户的所述第二位置关系为所述移动用户上一次地理位置在所述多边形区域外,确定所述移动用户的移动状态为正在离开所述多边形区域。Determining that the first location relationship of the mobile user is that the current geographic location of the mobile user is within the polygonal area or the current geographic location of the mobile user is on a boundary of the polygonal area, the mobile user The second positional relationship is that the mobile user's last geographic location is outside the polygonal area, and the moving state of the mobile user is determined to be leaving the polygonal area.
可选地,所述根据移动用户的所述第一位置关系,以及上一次地理位置与所述多边形区域之间的第二位置关系确定所述移动用户的移动状态的步骤包括:Optionally, the step of determining the mobile state of the mobile user according to the first location relationship of the mobile user and the second location relationship between the last geographic location and the polygon region includes:
判断出所述移动用户的所述第一位置关系为所述移动用户当前的地理位置在所述多边形区域外,所述移动用户的所述第二位置关系为所述移动用户上一次地理位置在所述多边形区域内或所述移动用户当前的地理位置在所述多边形区域的边界上,确定所述移动用户的移动状态为正在进入所述多边形区域。Determining that the first location relationship of the mobile user is that the current geographic location of the mobile user is outside the polygonal area, and the second location relationship of the mobile user is that the mobile user last time is in the geographic location. The moving location of the mobile user is determined to be entering the polygonal area within the polygon area or the current geographic location of the mobile user on the boundary of the polygonal area.
可选地,所述根据获得的当前的地理位置坐标信息确定所述移动用户当前的地理位置与多边形区域之间的第一位置关系的步骤包括:Optionally, the step of determining, according to the obtained current geographic location coordinate information, the first location relationship between the current geographic location of the mobile user and the polygonal region includes:
判断出所述移动用户当前的地理位置在所述多边形区域的某一条边界上,确定所述第一位置关系为所述移动用户当前的地理位置在所述多边形区域的边界上。Determining that the current geographic location of the mobile user is on a certain boundary of the polygonal area, and determining that the first location relationship is that the current geographic location of the mobile user is on a boundary of the polygonal area.
可选地,所述根据获得的当前的地理位置坐标信息确定所述移动用户当前的地理位置与多边形区域之间的第一位置关系的步骤包括:Optionally, the step of determining, according to the obtained current geographic location coordinate information, the first location relationship between the current geographic location of the mobile user and the polygonal region includes:
判断出所述移动用户当前的地理位置不在所述多边形区域的任何一条边界上;Determining that the current geographic location of the mobile user is not at any boundary of the polygonal area;
确定一条以所述移动用户当前的地理位置为端点,且与坐标轴平行的射 线;Determining a shot with the current geographic location of the mobile user as an endpoint and parallel to the coordinate axis line;
计算确定出的射线和所述多边形区域的边界之间的交点的数量;Calculating the number of intersections between the determined ray and the boundary of the polygonal region;
判断出计算得到的交点的数量为奇数,确定所述第一位置关系为所述移动用户当前的地理位置在所述多边形区域内。It is determined that the calculated number of intersection points is an odd number, and determining that the first location relationship is that the current geographic location of the mobile user is within the polygon area.
可选地,所述根据获得的当前的地理位置坐标信息确定移动用户当前的地理位置与多边形区域之间的第一位置关系的步骤包括:Optionally, the step of determining, according to the obtained current geographic location coordinate information, a first location relationship between a current geographic location of the mobile user and the polygonal region includes:
判断出所述移动用户当前的地理位置不在所述多边形区域的任何一条边界上;Determining that the current geographic location of the mobile user is not at any boundary of the polygonal area;
确定一条以所述移动用户当前的地理位置为端点,且与坐标轴平行的射线;Determining a ray whose end point is the current geographic location of the mobile user and parallel to the coordinate axis;
计算确定出的射线和所述多边形区域的边界之间的交点的数量;Calculating the number of intersections between the determined ray and the boundary of the polygonal region;
判断出所述计算得到的交点的数量为偶数,确定所述第一位置关系为所述移动用户当前的地理位置在多边形区域外。It is determined that the calculated number of intersection points is an even number, and determining that the first location relationship is that the current geographic location of the mobile user is outside the polygon area.
可选地,所述计算确定出的射线和所述多边形区域的边界之间的交点的数量的步骤包括:Optionally, the step of calculating the number of intersections between the determined ray and the boundary of the polygonal region comprises:
确定所述射线和所述多边形区域的每一条边界之间的关系;Determining a relationship between the ray and each of the boundaries of the polygonal region;
根据确定出的关系判断所述射线和所述多边形区域的每一条边界之间是否有交点;Determining, according to the determined relationship, whether there is an intersection between the ray and each boundary of the polygonal region;
将所述多边形区域中与所述射线有交点的边界的数量相加得到所述射线和所述多边形区域的边界之间的交点的数量。Adding the number of boundaries of the polygon region that intersect the ray results in the number of intersections between the ray and the boundary of the polygon region.
可选地,所述确定射线和多边形区域的每一条边界之间的关系的步骤包括:Optionally, the step of determining a relationship between the ray and each boundary of the polygon region comprises:
判断出第M条边界的两个端点位于所述射线上;或者,判断出所述第M条边界的其中一个端点位于所述射线上,另一个端点位于所述射线的反向延长线上,确定所述射线和所述多边形区域的第M条边界之间的关系为相叠;其中,M为大于或等于1且小于或等于N的整数。Determining that two endpoints of the Mth boundary are located on the ray; or, determining that one of the endpoints of the Mth boundary is located on the ray, and the other endpoint is located on a reverse extension line of the ray, Determining a relationship between the ray and an Mth boundary of the polygonal region is a stack; wherein M is an integer greater than or equal to 1 and less than or equal to N.
可选地,所述确定射线和多边形区域的每一条边界之间的关系的步骤包 括:Optionally, the step of determining the relationship between the ray and each boundary of the polygon region include:
当判断出所述射线上任意两个点的横坐标相等,且所述第M条边界的两个端点的横坐标相等,且所述第M条边界的端点的横坐标与射线的端点的横坐标不相等;或者,判断出所述射线上任意两个点的纵坐标相等,且所述第M条边界的两个端点的纵坐标相等,且所述第M条边界的端点的纵坐标与所述射线的端点的纵坐标不相等时,确定所述射线和所述多边形区域的第M条边界之间的关系为平行。When it is determined that the abscissas of any two points on the ray are equal, and the abscissas of the two end points of the Mth boundary are equal, and the abscissa of the end point of the Mth boundary and the end of the ray end point The coordinates are not equal; or, it is determined that the ordinates of any two points on the ray are equal, and the ordinates of the two end points of the Mth boundary are equal, and the ordinate of the end point of the Mth boundary is When the ordinates of the end points of the ray are not equal, it is determined that the relationship between the ray and the Mth boundary of the polygonal area is parallel.
可选地,所述确定射线和多边形区域的每一条边界之间的关系还包括:Optionally, the determining the relationship between the ray and each boundary of the polygon region further includes:
当判断出所述射线上除端点之外的其他任意一点的纵坐标大于所述射线的端点的纵坐标,且所述第M条边界的两个端点的横坐标不相等,且所述射线的端点的纵坐标小于所述第M条边界上,与所述射线的端点的横坐标相等的点的纵坐标;或者,判断出所述射线上除端点之外的其他任意一点的纵坐标小于所述射线的端点的纵坐标,且所述第M条边界的两个端点的横坐标不相等,且所述射线的端点的纵坐标大于第M条边界上,与所述射线的端点的横坐标相等的点的纵坐标;或者,判断出所述射线上除端点之外的其他任意一点的横坐标小于所述射线的端点的横坐标,且所述第M条边界的两个端点的纵坐标不相等,且所述射线的端点的横坐标大于所述第M条边界上,与所述射线的端点的纵坐标相等的点的横坐标;或者,判断出所述射线上除端点之外的其他任意一点的横坐标大于所述射线的端点的横坐标,且所述第M条边界的两个端点的纵坐标不相等,且所述射线的端点的横坐标小于所述第M条边界上,与所述射线的端点的纵坐标相等的点的横坐标时,确定所述射线和所述多边形区域的第M条边界之间的关系为相交。When it is determined that the ordinate of any point other than the end point of the ray is greater than the ordinate of the end point of the ray, and the abscissas of the two end points of the Mth boundary are not equal, and the ray is The ordinate of the end point is smaller than the ordinate of the point on the boundary of the Mth, which is equal to the abscissa of the end point of the ray; or, it is determined that the ordinate of any point other than the end point of the ray is smaller than An ordinate of an end point of the ray, and an abscissa of two end points of the Mth boundary is not equal, and an ordinate of an end point of the ray is greater than an abscissa of an end point of the ray An ordinate of equal points; or, determining that the abscissa of any point other than the endpoint on the ray is smaller than the abscissa of the endpoint of the ray, and the ordinate of the two endpoints of the Mth boundary Not equal, and the abscissa of the end point of the ray is greater than the abscissa of the point on the Mth boundary equal to the ordinate of the end point of the ray; or, the ray is determined to be other than the end point Any other point The abscissa is greater than the abscissa of the endpoint of the ray, and the ordinates of the two endpoints of the Mth boundary are not equal, and the abscissa of the endpoint of the ray is smaller than the boundary of the Mth, When the abscissa of the point where the ordinates of the vertices are equal, the relationship between the ray and the Mth boundary of the polygonal region is determined to be the intersection.
可选地,所述根据确定出的关系判断射线和多边形区域的每一条边界之间是否有交点的步骤包括:Optionally, the step of determining, according to the determined relationship, whether there is an intersection between each of the ray and the boundary of the polygon region comprises:
判断出所述射线和所述多边形区域的第M条边界之间的关系为相离或平行时,确定出所述射线和所述多边形区域的第M条边界之间没有交点。When it is determined that the relationship between the ray and the Mth boundary of the polygonal region is separated or parallel, it is determined that there is no intersection between the ray and the Mth boundary of the polygonal region.
可选地,所述根据确定出的关系判断射线和多边形区域的每一条边界之间是否有交点的步骤包括: Optionally, the step of determining, according to the determined relationship, whether there is an intersection between each of the ray and the boundary of the polygon region comprises:
当判断出所述射线和所述多边形区域的第M条边界之间的关系为相叠,且所述射线的端点不在所述第M条边界上,且与所述第M条边界相邻的两条边界位于所述第M条边界的两侧时,确定出所述第M条边界和所述射线之间有交点,与所述第M条边界相邻的两条边界和所述射线之间均没有交点。Determining that a relationship between the ray and an Mth boundary of the polygonal region is overlapping, and an endpoint of the ray is not on the Mth boundary and adjacent to the Mth boundary When two boundaries are located on both sides of the boundary of the Mth strip, it is determined that there is an intersection between the boundary of the Mth strip and the ray, two borders adjacent to the boundary of the Mth strip, and the ray There is no intersection between the two.
可选地,所述根据确定出的关系判断射线和多边形区域的每一条边界之间是否有交点的步骤包括:Optionally, the step of determining, according to the determined relationship, whether there is an intersection between each of the ray and the boundary of the polygon region comprises:
当判断出所述射线和所述多边形区域的第M条边界之间的关系为相叠,且所述射线的端点不在第M条边界上,且与所述第M条边界相邻的两条边界不位于所述第M条边界的两侧时,确定出所述第M条边界以及与所述第M条边界相邻的两条边界和射线之间均没有交点。When it is determined that the relationship between the ray and the Mth boundary of the polygonal region is overlapping, and the end of the ray is not on the Mth boundary, and two adjacent to the Mth boundary When the boundary is not located on both sides of the boundary of the Mth, it is determined that there is no intersection between the Mth boundary and the two boundaries and rays adjacent to the Mth boundary.
可选地,所述根据确定出的关系判断射线和多边形区域的每一条边界之间是否有交点的步骤包括:Optionally, the step of determining, according to the determined relationship, whether there is an intersection between each of the ray and the boundary of the polygon region comprises:
当判断出所述射线和所述多边形区域的第M条边界之间的关系为相交,且交点为所述第M条边界的其中一个端点,且所述第M条边界的另一个端点和以所述交点为端点的另一条边界的另一个端点位于所述射线的两侧时,确定出所述第M条边界和以交点为端点的另一条边界中,其中一条边界与射线之间有交点,另一条边界与射线之间没有交点。When it is determined that the relationship between the ray and the Mth boundary of the polygon region is an intersection, and the intersection is one of the endpoints of the Mth boundary, and the other endpoint of the Mth boundary When the other end point of the other boundary of the endpoint is located on both sides of the ray, the intersection of the Mth boundary and the other boundary with the intersection point is determined, and one of the boundaries has an intersection with the ray. There is no intersection between the other boundary and the ray.
可选地,所述根据确定出的关系判断射线和多边形区域的每一条边界之间是否有交点的步骤包括:Optionally, the step of determining, according to the determined relationship, whether there is an intersection between each of the ray and the boundary of the polygon region comprises:
当判断出所述射线和所述多边形区域的第M条边界之间的关系为相交,且交点为所述第M条边界的其中一个端点,且所述第M条边界的另一个端点和以所述交点为端点的另一条边界的另一个端点不位于射线的两侧时,确定出所述第M条边界与所述射线之间没有交点,以所述交点为端点的另一条边界与所述射线之间没有交点。When it is determined that the relationship between the ray and the Mth boundary of the polygon region is an intersection, and the intersection is one of the endpoints of the Mth boundary, and the other endpoint of the Mth boundary When the other end point of the other boundary of the endpoint is not located on both sides of the ray, it is determined that there is no intersection between the boundary of the Mth and the ray, and the other boundary of the endpoint is the intersection There is no intersection between the rays.
可选地,所述根据确定出的关系判断射线和多边形区域的每一条边界之间是否有交点的步骤包括:Optionally, the step of determining, according to the determined relationship, whether there is an intersection between each of the ray and the boundary of the polygon region comprises:
当判断出所述射线和所述多边形区域的第M条边界之间的关系为相交,且交点不是第M条边界的任何一个端点时,确定出所述射线和所述第M条 边界之间有交点。Determining the ray and the Mth piece when it is determined that the relationship between the ray and the Mth boundary of the polygonal area is an intersection, and the intersection point is not any one of the Mth boundary There is an intersection between the boundaries.
一种确定位置关系的装置,包括获取模块和第一确定模块,其中An apparatus for determining a positional relationship, comprising an acquisition module and a first determination module, wherein
所述获取模块设置成:获取移动用户当前的地理位置坐标信息;The acquiring module is configured to: obtain current geographic location coordinate information of the mobile user;
所述第一确定模块设置成:根据获得的当前的地理位置坐标信息确定所述移动用户当前的地理位置与多边形区域之间的第一位置关系。The first determining module is configured to: determine, according to the obtained current geographic location coordinate information, a first positional relationship between the current geographic location of the mobile user and the polygonal region.
可选地,该装置还包括第二确定模块,其中Optionally, the apparatus further includes a second determining module, wherein
所述第二确定模块,设置成:根据所述移动用户的所述第一位置关系,以及上一次地理位置与所述多边形区域之间的第二位置关系确定所述移动用户的移动状态。The second determining module is configured to determine a mobile state of the mobile user according to the first location relationship of the mobile user and a second location relationship between a last geographic location and the polygonal region.
可选地,所述第二确定模块设置成按照如下方式根据移动用户的所述第一位置关系,以及上一次地理位置与多边形区域之间的第二位置关系确定移动用户的移动状态:Optionally, the second determining module is configured to determine a mobile user's mobile state according to the first location relationship of the mobile user and the second location relationship between the last geographic location and the polygon region as follows:
判断出所述移动用户的所述第一位置关系为所述移动用户当前的地理位置在所述多边形区域内或所述移动用户当前的地理位置在所述多边形区域的边界上,所述移动用户的第二位置关系为所述移动用户上一次地理位置在所述多边形区域外,确定所述移动用户的移动状态为正在离开所述多边形区域。Determining that the first location relationship of the mobile user is that the current geographic location of the mobile user is within the polygonal area or the current geographic location of the mobile user is on a boundary of the polygonal area, the mobile user The second positional relationship is that the mobile user's last geographic location is outside the polygonal area, and the moving state of the mobile user is determined to be leaving the polygonal area.
可选地,所述第二确定模块设置成按照如下方式根据移动用户的所述第一位置关系,以及上一次地理位置与多边形区域之间的第二位置关系确定移动用户的移动状态:Optionally, the second determining module is configured to determine a mobile user's mobile state according to the first location relationship of the mobile user and the second location relationship between the last geographic location and the polygon region as follows:
判断出所述移动用户的所述第一位置关系为所述移动用户当前的地理位置在所述多边形区域外,所述移动用户的所述第二位置关系为所述移动用户上一次地理位置在所述多边形区域内或所述移动用户当前的地理位置在所述多边形区域的边界上,确定所述移动用户的移动状态为正在进入所述多边形区域。Determining that the first location relationship of the mobile user is that the current geographic location of the mobile user is outside the polygonal area, and the second location relationship of the mobile user is that the mobile user last time is in the geographic location. The moving location of the mobile user is determined to be entering the polygonal area within the polygon area or the current geographic location of the mobile user on the boundary of the polygonal area.
可选地,所述第一确定模块设置成按照如下方式根据获得的当前的地理位置坐标信息确定所述移动用户当前的地理位置与多边形区域之间的第一位置关系: Optionally, the first determining module is configured to determine, according to the obtained current geographic location coordinate information, a first positional relationship between the current geographic location of the mobile user and the polygonal region according to the following manner:
判断出所述移动用户当前的地理位置在所述多边形区域的某一条边界上,确定所述第一位置关系为所述移动用户当前的地理位置在所述多边形区域的边界上。Determining that the current geographic location of the mobile user is on a certain boundary of the polygonal area, and determining that the first location relationship is that the current geographic location of the mobile user is on a boundary of the polygonal area.
可选地,所述第一确定模块设置成按照如下方式根据获得的当前的地理位置坐标信息确定所述移动用户当前的地理位置与多边形区域之间的第一位置关系:Optionally, the first determining module is configured to determine, according to the obtained current geographic location coordinate information, a first positional relationship between the current geographic location of the mobile user and the polygonal region according to the following manner:
判断出所述移动用户当前的地理位置不在所述多边形区域的任何一条边界上;确定一条以所述移动用户当前的地理位置为端点,且与坐标轴平行的射线;计算确定出的射线和所述多边形区域的边界之间的交点的数量;判断出计算得到的交点的数量为奇数,确定所述第一位置关系为所述移动用户当前的地理位置在所述多边形区域内。Determining that the current geographic location of the mobile user is not at any boundary of the polygonal area; determining a ray that is the end point of the mobile user and is parallel to the coordinate axis; calculating the determined ray and the location The number of intersections between the boundaries of the polygon region; determining that the calculated number of intersections is an odd number, and determining that the first location relationship is that the current geographic location of the mobile user is within the polygon region.
可选地,所述第一确定模块设置成按照如下方式根据获得的当前的地理位置坐标信息确定所述移动用户当前的地理位置与多边形区域之间的第一位置关系:Optionally, the first determining module is configured to determine, according to the obtained current geographic location coordinate information, a first positional relationship between the current geographic location of the mobile user and the polygonal region according to the following manner:
判断出所述移动用户当前的地理位置不在所述多边形区域的任何一条边界上;确定一条以所述移动用户当前的地理位置为端点,且与坐标轴平行的射线;计算确定出的射线和所述多边形区域的边界之间的交点的数量;判断出所述计算得到的交点的数量为偶数,确定所述第一位置关系为所述移动用户当前的地理位置在多边形区域外。Determining that the current geographic location of the mobile user is not at any boundary of the polygonal area; determining a ray that is the end point of the mobile user and is parallel to the coordinate axis; calculating the determined ray and the location Determining the number of intersections between the boundaries of the polygon region; determining that the calculated number of intersection points is an even number, and determining that the first location relationship is that the current geographic location of the mobile user is outside the polygon region.
可选地,所述第一确定模块设置成按照如下方式计算确定出的射线和所述多边形区域的边界之间的交点的数量:Optionally, the first determining module is configured to calculate the number of intersections between the determined ray and the boundary of the polygonal region as follows:
确定所述射线和所述多边形区域的每一条边界之间的关系;根据确定出的关系判断所述射线和所述多边形区域的每一条边界之间是否有交点;将所述多边形区域中与所述射线有交点的边界的数量相加得到所述射线和所述多边形区域的边界之间的交点的数量。Determining a relationship between the ray and each of the boundaries of the polygonal region; determining whether there is an intersection between the ray and each of the boundaries of the polygonal region according to the determined relationship; The number of boundaries of the ray having intersections is added to obtain the number of intersections between the ray and the boundary of the polygonal region.
与相关技术相比,本发明技术方案包括:获取移动用户当前的地理位置坐标信息;根据获得当前的地理位置坐标信息确定移动用户当前的地理位置 与多边形区域之间的第一位置关系。通过本发明的方案,由于多边形区域能够很好地描述出实际的地理区域,因此提高了统计精度。Compared with the related art, the technical solution of the present invention includes: acquiring current geographic location coordinate information of the mobile user; determining the current geographic location of the mobile user according to the obtained current geographic location coordinate information. The first positional relationship with the polygonal area. With the solution of the present invention, since the polygonal area can well describe the actual geographical area, the statistical accuracy is improved.
附图概述BRIEF abstract
下面对本发明实施例中的附图进行说明,实施例中的附图是用于对本发明的进一步理解,与说明书一起用于解释本发明,并不构成对本发明保护范围的限制。The drawings in the following description of the embodiments of the present invention are intended to illustrate the invention, and are not intended to limit the scope of the invention.
图1为本发明实施例确定位置关系的方法的流程图;1 is a flowchart of a method for determining a location relationship according to an embodiment of the present invention;
图2(a)为本发明实施例射线和多边形区域的第M条边界之间的关系为相离的示意图;2(a) is a schematic diagram showing the relationship between the boundary of the Mth line of the ray and the polygonal region in the embodiment of the present invention;
图2(b)为本发明实施例射线和多边形区域的第M条边界之间的关系为相交的示意图;2(b) is a schematic diagram showing the relationship between the boundary of the Mth line of the ray and the polygon region in the embodiment of the present invention;
图2(c)为本发明实施例射线和多边形区域的第M条边界之间的关系为平行的示意图;2(c) is a schematic diagram showing the relationship between the boundary of the Mth line of the ray and the polygonal region in a parallel manner in the embodiment of the present invention;
图2(d)为本发明实施例射线和多边形区域的第M条边界之间的关系为相叠的示意图;2(d) is a schematic diagram showing the relationship between the boundary of the Mth line of the ray and the polygonal region in the embodiment of the present invention;
图3为本发明实施例确定位置关系的装置的结构组成示意图;3 is a schematic structural diagram of an apparatus for determining a positional relationship according to an embodiment of the present invention;
图4为本发明实施例PDC服务器的结构组成示意图;4 is a schematic structural diagram of a PDC server according to an embodiment of the present invention;
图5为本发明确定位置关系的方法的具体实施例的流程图;5 is a flow chart of a specific embodiment of a method for determining a positional relationship according to the present invention;
图6为确定位置关系的示意图;Figure 6 is a schematic diagram of determining a positional relationship;
图7为本发明实施例位置触发业务处理的方法的流程图;7 is a flowchart of a method for location trigger service processing according to an embodiment of the present invention;
图中,1为射线,2为多边形区域的边界。In the figure, 1 is a ray and 2 is a boundary of a polygonal area.
本发明的较佳实施方式Preferred embodiment of the invention
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。The following is an overview of the topics detailed in this document. This Summary is not intended to limit the scope of the claims.
下面结合附图对本发明作进一步的描述,并不能用来限制本发明的保护 范围。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的各种方式可以相互组合。The present invention is further described below in conjunction with the accompanying drawings and is not intended to limit the protection of the present invention. range. It should be noted that the embodiments in the present application and the various manners in the embodiments may be combined with each other without conflict.
参见图1,本发明实施例提出了一种确定位置关系的方法,包括:Referring to FIG. 1, an embodiment of the present invention provides a method for determining a location relationship, including:
步骤100、获取移动用户当前的地理位置坐标信息。Step 100: Obtain current geographic location coordinate information of the mobile user.
本步骤中,可以在接收到来自信令采集设备的信令数据时,从信令数据中获取移动用户当前的地理位置坐标信息,具体实现属于本领域技术人员的公知常识,并不用于限定本发明的保护范围,这里不再赘述。In this step, when the signaling data from the signaling collection device is received, the current geographic location coordinate information of the mobile user is obtained from the signaling data, and the common knowledge is known to those skilled in the art, and is not used to limit the present disclosure. The scope of protection of the invention will not be described here.
本步骤中,移动用户当前的地理位置坐标信息可以是移动用户当前的地理位置对应的坐标值,该地理位置坐标值可以是英国地形测量局1936(OSGB36,Ordnance Survey of Great Britain 1936)栅格坐标(坐标单位为10千米(km)),包括横坐标和纵坐标。In this step, the current geographic location coordinate information of the mobile user may be a coordinate value corresponding to the current geographic location of the mobile user, and the geographic location coordinate value may be a raster coordinate of the British Topographic Survey Bureau 1936 (OSGB36, Ordnance Survey of Great Britain 1936). (The coordinate unit is 10 km (km)), including the abscissa and ordinate.
步骤101、根据获得的当前的地理位置坐标信息确定移动用户当前的地理位置与多边形区域之间的第一位置关系。Step 101: Determine, according to the obtained current geographic location coordinate information, a first location relationship between a current geographic location of the mobile user and the polygonal region.
可选地,所述多边形区域是根据目标区域来确定的,目标区域即将要统计进入、离开或正处于其中的移动用户的区域,该多边形区域能够体现出该目标区域的形状和大小,如构成该多边形区域的点至少包括处于该目标区域的各个拐角处的点。举例而言,对于一个篮球场来说,其对应的多边形区域至少包括处于篮球场四个拐角处的点,因为篮球场四个拐角处的点能够体现出篮球场的形状和大小,篮球场对应的多边形区域除了包括这四个点以外,还可以包括构成篮球场的四条线中的任意点,总之,多边形区域所包括的点越多,统计越精细。Optionally, the polygon area is determined according to the target area, and the target area is about to count the area of the mobile user entering, leaving, or being in the area, and the polygon area can reflect the shape and size of the target area, such as The points of the polygonal area include at least points at respective corners of the target area. For example, for a basketball court, the corresponding polygon area includes at least the points at the four corners of the basketball court, because the points at the four corners of the basketball court can reflect the shape and size of the basketball court, and the basketball court corresponds. In addition to the four points, the polygonal area may include any of the four lines constituting the basketball court. In short, the more points the polygon area includes, the finer the statistics.
该步骤具体包括:This step specifically includes:
判断出移动用户当前的地理位置在多边形区域的某一条边界上,确定第一位置关系为移动用户当前的地理位置在多边形区域的边界上。It is determined that the current geographic location of the mobile user is on a certain boundary of the polygon area, and the first location relationship is determined to be the current geographic location of the mobile user on the boundary of the polygon area.
当判断出移动用户当前的地理位置不在多边形区域的任何一条边界上时,确定一条以移动用户当前的地理位置为端点,且与坐标轴平行的射线;计算确定出的射线和多边形区域的边界之间的交点的数量;判断出计算得到的交点的数量为奇数,确定第一位置关系为移动用户当前的地理位置在多边 形区域内。而当判断出计算得到的交点的数量为偶数时,确定第一位置关系为移动用户当前的地理位置在多边形区域外。When it is determined that the current geographic location of the mobile user is not on any boundary of the polygonal area, a ray is determined which is the end point of the mobile user and is parallel to the coordinate axis; and the boundary between the determined ray and the polygonal area is calculated. The number of intersections between the two; the number of calculated intersections is determined to be an odd number, and the first positional relationship is determined as the current geographic location of the mobile user in the multilateral Within the shape area. When it is determined that the calculated number of intersection points is an even number, it is determined that the first location relationship is that the current geographic location of the mobile user is outside the polygon area.
其中,坐标轴可以是X轴或Y轴。Among them, the coordinate axis can be the X axis or the Y axis.
本步骤中,多边形区域可以采用有序的N个点来表示,由N个点首尾依次连接即为多边形区域。其中,N为大于或等于1的整数。In this step, the polygon area can be represented by N points in order, and the N points are connected in order, which is a polygon area. Where N is an integer greater than or equal to 1.
这N个点可以预先设置,也可以来自于SP终端。These N points can be preset or from the SP terminal.
其中,N个点可以由OSGB36栅格坐标来描述。Among them, N points can be described by OSGB36 grid coordinates.
其中,计算确定出的射线和多边形区域的边界之间的交点的数量包括:Wherein, calculating the number of intersections between the determined ray and the boundary of the polygon region includes:
确定射线和多边形区域的每一条边界之间的关系,根据确定出的关系判断射线和多边形区域的每一条边界之间是否有交点,将多边形区域中与射线有交点的边界的数量相加得到射线和多边形区域的边界之间的交点的数量。Determining the relationship between the ray and each boundary of the polygon region, determining whether there is an intersection between each boundary of the ray and the polygon region according to the determined relationship, and adding the number of boundaries of the intersection with the ray in the polygon region to obtain the ray The number of intersections between the boundary with the polygon area.
其中,如图2(a)到图2(d)所示,射线和多边形区域的边界之间的关系可以是相离、相交、平行或相叠,图中,1表示射线,2表示多边形区域的边界。Wherein, as shown in FIG. 2(a) to FIG. 2(d), the relationship between the ray and the boundary of the polygonal region may be separated, intersected, parallel or overlapped. In the figure, 1 represents a ray, and 2 represents a polygonal region. The border.
其中,确定射线和多边形区域的每一条边界之间的关系包括:Wherein, determining the relationship between the ray and each boundary of the polygon region includes:
判断出第M条边界的两个端点位于射线上;或者,判断出第M条边界的其中一个端点位于射线上,另一个端点位于射线的反向延长线上,确定射线和多边形区域的第M条边界之间的关系为相叠;其中,M为大于或等于1且小于或等于N的整数。如图2(d)所示。It is determined that the two endpoints of the Mth boundary are located on the ray; or, it is determined that one of the endpoints of the Mth boundary is located on the ray, and the other endpoint is located on the inverse extension line of the ray, and the Mth of the ray and the polygonal region is determined. The relationship between the strip boundaries is a stack; wherein M is an integer greater than or equal to 1 and less than or equal to N. As shown in Figure 2 (d).
判断出射线上任意两个点的横坐标相等,且第M条边界的两个端点的横坐标相等,且第M条边界的端点的横坐标与射线的端点的横坐标不相等;或者,判断出射线上任意两个点的纵坐标相等,且第M条边界的两个端点的纵坐标相等,且第M条边界的端点的纵坐标与射线的端点的纵坐标不相等,确定射线和多边形区域的第M条边界之间的关系为平行。如图2(c)所示。It is determined that the abscissas of any two points on the ray are equal, and the abscissas of the two end points of the Mth boundary are equal, and the abscissa of the end point of the Mth boundary is not equal to the abscissa of the end point of the ray; or, judging The ordinates of any two points on the outgoing ray are equal, and the ordinates of the two endpoints of the Mth boundary are equal, and the ordinate of the endpoint of the Mth boundary is not equal to the ordinate of the endpoint of the ray, determining the ray and the polygon The relationship between the Mth boundaries of the region is parallel. As shown in Figure 2 (c).
判断出射线上除端点之外的其他任意一点的纵坐标大于射线的端点的纵坐标,且第M条边界的两个端点的横坐标不相等,且射线的端点的纵坐标小于第M条边界上,与射线的端点的横坐标相等的点的纵坐标;或者,判断出射线上除端点之外的其他任意一点的纵坐标小于射线的端点的纵坐标,且第 M条边界的两个端点的横坐标不相等,且射线的端点的纵坐标大于第M条边界上,与射线的端点的横坐标相等的点的纵坐标;或者,判断出射线上除端点之外的其他任意一点的横坐标小于射线的端点的横坐标,且第M条边界的两个端点的纵坐标不相等,且射线的端点的横坐标大于第M条边界上,与射线的端点的纵坐标相等的点的横坐标;或者,判断出射线上除端点之外的其他任意一点的横坐标大于射线的端点的横坐标,且第M条边界的两个端点的纵坐标不相等,且射线的端点的横坐标小于第M条边界上,与射线的端点的纵坐标相等的点的横坐标,确定射线和多边形区域的第M条边界之间的关系为相交。如图2(b)所示。It is determined that the ordinate of any point other than the end point on the ray is larger than the ordinate of the end point of the ray, and the abscissas of the two end points of the Mth boundary are not equal, and the ordinate of the end point of the ray is smaller than the Mth boundary The ordinate of a point equal to the abscissa of the end point of the ray; or, determining that the ordinate of any point other than the end point of the ray is smaller than the ordinate of the end point of the ray, and The abscissas of the two endpoints of the M boundary are not equal, and the ordinate of the endpoint of the ray is greater than the ordinate of the point on the boundary of the Mth, which is equal to the abscissa of the endpoint of the ray; or, the endpoint of the ray is determined The abscissa of any other point is smaller than the abscissa of the end point of the ray, and the ordinates of the two endpoints of the Mth boundary are not equal, and the abscissa of the end point of the ray is larger than the boundary of the Mth, with the end of the ray An abscissa of a point having the same ordinate; or, determining that the abscissa of any point other than the end point of the ray is greater than the abscissa of the end point of the ray, and the ordinates of the two end points of the Mth boundary are not equal, and The abscissa of the end point of the ray is smaller than the abscissa of the point on the Mth boundary equal to the ordinate of the end point of the ray, and the relationship between the ray and the Mth boundary of the polygon area is determined to be the intersection. As shown in Figure 2 (b).
属于上述的情况之外的情况,确定射线和多边形区域的第M条边界之间的关系为相离。如图2(a)所示。In the case other than the above case, it is determined that the relationship between the ray and the Mth boundary of the polygonal region is the separation. As shown in Figure 2 (a).
其中,根据确定出的关系判断射线和多边形区域的每一条边界之间是否有交点包括:Wherein, determining whether there is an intersection between each of the rays and the boundary of the polygon region according to the determined relationship includes:
判断出射线和多边形区域的第M条边界之间的关系为相离或平行,确定出射线和多边形区域的第M条边界之间没有交点。It is judged that the relationship between the ray and the Mth boundary of the polygonal region is separated or parallel, and it is determined that there is no intersection between the ray and the Mth boundary of the polygonal region.
判断出射线和多边形区域的第M条边界之间的关系为相叠,且射线的端点不在第M条边界上,且与第M条边界相邻的两条边界位于第M条边界的两侧,确定出第M条边界和射线之间有交点,与第M条边界相邻的两条边界和射线之间均没有交点。It is determined that the relationship between the ray and the Mth boundary of the polygonal region is a stack, and the end of the ray is not on the Mth boundary, and the two edges adjacent to the Mth boundary are located on both sides of the Mth boundary It is determined that there is an intersection between the boundary of the Mth and the ray, and there is no intersection between the two boundaries adjacent to the boundary of the Mth and the ray.
判断出射线和多边形区域的第M条边界之间的关系为相叠,且射线的端点不在第M条边界上,且与第M条边界相邻的两条边界不位于第M条边界的两侧,确定出第M条边界以及与第M条边界相邻的两条边界和射线之间均没有交点。It is determined that the relationship between the ray and the Mth boundary of the polygon region is overlapped, and the endpoint of the ray is not at the boundary of the Mth, and the two boundaries adjacent to the boundary of the Mth are not located at the boundary of the Mth On the side, it is determined that there is no intersection between the boundary of the Mth and the two boundaries adjacent to the boundary of the Mth and the ray.
当判断出射线和多边形区域的第M条边界之间的关系为相交,且交点为第M条边界的其中一个端点,且第M条边界的另一个端点和以交点为端点的另一条边界的另一个端点位于射线的两侧时,确定出第M条边界和以交点为端点的另一条边界中,其中一条边界与射线之间有交点,另一条边界与射线之间没有交点。 When it is determined that the relationship between the ray and the Mth boundary of the polygon region is intersection, and the intersection is one of the endpoints of the Mth boundary, and the other endpoint of the Mth boundary and the other boundary with the intersection as the endpoint When the other end point is located on both sides of the ray, one of the boundary of the Mth and the other end of the intersection is determined. One of the boundaries has an intersection with the ray, and the other boundary has no intersection with the ray.
当判断出射线和多边形区域的第M条边界之间的关系为相交,且交点为第M条边界的其中一个端点,且第M条边界的另一个端点和以交点为端点的另一条边界的另一个端点不位于射线的两侧时,确定出第M条边界与射线之间没有交点,以交点为端点的另一条边界与射线之间没有交点。When it is determined that the relationship between the ray and the Mth boundary of the polygon region is intersection, and the intersection is one of the endpoints of the Mth boundary, and the other endpoint of the Mth boundary and the other boundary with the intersection as the endpoint When the other end point is not located on both sides of the ray, it is determined that there is no intersection between the Mth boundary and the ray, and there is no intersection between the other boundary with the intersection point and the ray.
当判断出射线和多边形区域的第M条边界之间的关系为相交,且交点不是第M条边界的任何一个端点时,确定出射线和第M条边界之间有交点。When it is judged that the relationship between the ray and the Mth boundary of the polygon region is intersection, and the intersection is not any one of the Mth boundary, it is determined that there is an intersection between the ray and the Mth boundary.
该方法还包括:The method also includes:
步骤102、根据移动用户的第一位置关系,以及上一次地理位置与多边形区域之间的第二位置关系确定移动用户的移动状态。具体包括:Step 102: Determine a mobile user's mobile state according to the first location relationship of the mobile user and the second location relationship between the last geographic location and the polygon region. Specifically include:
判断出移动用户的第一位置关系为移动用户当前的地理位置在多边形区域内或移动用户当前的地理位置在多边形区域的边界上,移动用户的第二位置关系为移动用户上一次地理位置在多边形区域外,确定移动用户的移动状态为正在离开多边形区域。Determining that the first location relationship of the mobile user is that the current geographic location of the mobile user is within the polygon region or the current geographic location of the mobile user is on the boundary of the polygon region, and the second location relationship of the mobile user is the last geographic location of the mobile user in the polygon. Outside the area, it is determined that the mobile user's moving state is leaving the polygon area.
而当判断出移动用户的第一位置关系为移动用户当前的地理位置在多边形区域外,移动用户的第二位置关系为移动用户上一次地理位置在多边形区域内或移动用户当前的地理位置在多边形区域的边界上时,确定移动用户的移动状态为正在进入多边形区域。When it is determined that the first location relationship of the mobile user is that the current geographic location of the mobile user is outside the polygon area, the second location relationship of the mobile user is that the last time the mobile user is in the polygon area or the current geographic location of the mobile user is in the polygon. When the boundary of the area is on, it is determined that the moving state of the mobile user is entering the polygon area.
参见图3,本发明实施例还提出了一种确定位置关系的装置,至少包括:Referring to FIG. 3, an embodiment of the present invention further provides an apparatus for determining a location relationship, including at least:
获取模块301,设置成:获取移动用户当前的地理位置坐标信息;The obtaining module 301 is configured to: obtain current geographic location coordinate information of the mobile user;
第一确定模块302,设置成:根据获得当前的地理位置坐标信息确定移动用户当前的地理位置与多边形区域之间的第一位置关系。The first determining module 302 is configured to: determine, according to the obtained current geographic location coordinate information, a first positional relationship between the current geographic location of the mobile user and the polygonal region.
本发明实施例的装置中,还包括:The device of the embodiment of the present invention further includes:
第二确定模块303,设置成:根据移动用户的第一位置关系,以及上一次地理位置与多边形区域之间的第二位置关系确定移动用户的移动状态。The second determining module 303 is configured to determine a mobile user's mobile state according to the first location relationship of the mobile user and the second location relationship between the last geographic location and the polygonal region.
本发明实施例的装置中,第二确定模块303具体设置成:In the apparatus of the embodiment of the present invention, the second determining module 303 is specifically configured to:
判断出移动用户的第一位置关系为移动用户当前的地理位置在多边形区 域内或移动用户当前的地理位置在多边形区域的边界上,移动用户的第二位置关系为移动用户上一次地理位置在多边形区域外,确定移动用户的移动状态为正在离开多边形区域。Determining that the first location relationship of the mobile user is the current geographic location of the mobile user in the polygon area The current geographic location of the mobile user or the mobile user is on the boundary of the polygonal area, and the second location relationship of the mobile user is that the mobile user's last geographic location is outside the polygonal area, and the mobile user's mobile state is determined to be leaving the polygonal area.
本发明实施例的装置中,第二确定模块303具体设置成:In the apparatus of the embodiment of the present invention, the second determining module 303 is specifically configured to:
判断出移动用户的第一位置关系为移动用户当前的地理位置在多边形区域外,移动用户的第二位置关系为移动用户上一次地理位置在多边形区域内或移动用户当前的地理位置在多边形区域的边界上,确定移动用户的移动状态为正在进入多边形区域。Determining that the first location relationship of the mobile user is that the current geographic location of the mobile user is outside the polygon region, and the second location relationship of the mobile user is that the last time the mobile user is in the polygon region or the current geographic location of the mobile user is in the polygon region. On the boundary, it is determined that the mobile user's movement state is entering the polygon area.
本发明实施例的装置中,第一确定模块302具体设置成:In the apparatus of the embodiment of the present invention, the first determining module 302 is specifically configured to:
判断出移动用户当前的地理位置在多边形区域的某一条边界上,确定第一位置关系为移动用户当前的地理位置在多边形区域的边界上。It is determined that the current geographic location of the mobile user is on a certain boundary of the polygon area, and the first location relationship is determined to be the current geographic location of the mobile user on the boundary of the polygon area.
本发明实施例的装置中,第一确定模块302具体设置成:In the apparatus of the embodiment of the present invention, the first determining module 302 is specifically configured to:
判断出移动用户当前的地理位置不在多边形区域的任何一条边界上;确定一条以移动用户当前的地理位置为端点,且与坐标轴平行的射线;计算确定出的射线和多边形区域的边界之间的交点的数量;判断出计算得到的交点的数量为奇数,确定第一位置关系为移动用户当前的地理位置在多边形区域内。Determining that the current geographic location of the mobile user is not at any boundary of the polygon region; determining a ray that is the endpoint of the mobile user's current geographic location and parallel to the coordinate axis; calculating between the determined ray and the boundary of the polygonal region The number of intersection points; determining that the calculated number of intersection points is an odd number, and determining that the first location relationship is the current geographic location of the mobile user in the polygon area.
本发明实施例的装置中,第一确定模块302具体设置成:In the apparatus of the embodiment of the present invention, the first determining module 302 is specifically configured to:
判断出移动用户当前的地理位置不在多边形区域的任何一条边界上;确定一条以移动用户当前的地理位置为端点,且与坐标轴平行的射线;Determining that the current geographic location of the mobile user is not on any boundary of the polygonal area; determining a ray that is the end point of the mobile user and is parallel to the coordinate axis;
确定射线和多边形区域的每一条边界之间的关系;根据确定出的关系判断射线和多边形区域的每一条边界之间是否有交点;将多边形区域中与射线有交点的边界的数量相加得到射线和多边形区域的边界之间的交点的数量;Determining a relationship between each of the rays and the boundary of the polygon region; determining whether there is an intersection between each of the rays and the boundary of the polygon region according to the determined relationship; adding the number of boundaries of the intersection with the ray in the polygon region to obtain the ray The number of intersections between the boundary with the polygon area;
判断出计算得到的交点的数量为奇数,确定第一位置关系为移动用户当前的地理位置在多边形区域内。It is determined that the calculated number of intersection points is an odd number, and the first positional relationship is determined to be the current geographic location of the mobile user in the polygon area.
本发明实施例的装置中,第一确定模块302还设置成:In the apparatus of the embodiment of the present invention, the first determining module 302 is further configured to:
判断出计算得到的交点的数量为偶数,确定第一位置关系为移动用户当前的地理位置在多边形区域外。 It is determined that the calculated number of intersection points is an even number, and the first location relationship is determined to be that the current geographic location of the mobile user is outside the polygon area.
下面通过具体实施例详细说明本发明的方法。The method of the present invention will now be described in detail by way of specific examples.
第一实施例,图4为本发明实施例PDC服务器的结构组成示意图。如图4所示,PDC服务器由数据收集(DCollect,Data Collect)模块和移动定位协议(MLP,Mobile Location Protocol)服务处理(MSP,MLP Service Provider)模块组成,DCollect模块主要负责接收/处理来自信令采集设备的信令数据,比如移动用户的信令数据到来时,会去获取其当前的地理位置坐标信息,联合上一次的地理位置坐标信息,判断当前的地理位置与多边形区域的第一位置关系,和上一次地理位置与多边形区域的第二位置关系,从而确定出用户的移动状态(如正离开区域,或正进入区域);当移动用户处于此两种移动状态之一时,通知MSP模块可以触发位置报告;MSP模块主要负责触发位置报告并发送给服务提供商(SP,Service Provide)终端;多边形区域由有序的一系列点来描述,由点首尾依次连接即为多边形区域,有序点又由OSGB36栅格坐标来描述,坐标单位10km,坐标原点为左下角,判断任意一个坐标点是否在多边形区域里的方法是由该点沿水平或垂直方向作一条射线,若射线与多边形区域的所有边界的交点的数量为奇数,则第一位置关系或第二位置关系为移动用户当前的地理位置在多边形区域内,若射线与多边形区域的所有边界的交点的数量为偶数,则第一位置关系或第二位置关系为移动用户当前的地理位置在多边形区域外。First Embodiment FIG. 4 is a schematic structural diagram of a PDC server according to an embodiment of the present invention. As shown in FIG. 4, the PDC server is composed of a data collection (DCollect, Data Collect) module and a Mobile Location Protocol (MLP, MLP Service Provider) module, and the DCollect module is mainly responsible for receiving/processing the information from the letter. When the signaling data of the collecting device, such as the signaling data of the mobile user, arrives, the current geographic location coordinate information is acquired, and the last geographical location coordinate information is combined to determine the current geographic location and the first location of the polygonal region. Relationship, and the second positional relationship between the previous geographic location and the polygonal area, thereby determining the user's moving state (eg, leaving the area, or entering the area); notifying the MSP module when the mobile user is in one of the two moving states The location report can be triggered; the MSP module is mainly responsible for triggering the location report and sending it to the service provider (SP, Service Provide) terminal; the polygon area is described by an ordered series of points, which are connected by the end of the point to be a polygon area, ordered The point is further described by the OSGB36 grid coordinates, the coordinate unit is 10km, and the coordinate origin is left. Angle, the method of judging whether any coordinate point is in the polygon area is to make a ray in the horizontal or vertical direction by the point. If the number of intersections of the ray and all the boundaries of the polygon area is an odd number, the first positional relationship or the second The positional relationship is that the current geographic location of the mobile user is in the polygonal area. If the number of intersections of the ray and all the boundaries of the polygonal area is even, the first positional relationship or the second positional relationship is the current geographic location of the mobile user outside the polygonal area. .
图3所述的装置所实现的功能即是DCollect模块确定第一位置关系和用户的移动状态的功能。The function implemented by the apparatus described in FIG. 3 is the function of the DCollect module to determine the first positional relationship and the movement state of the user.
第二实施例,参见图5和图6,确定位置关系的方法包括:Second Embodiment, referring to FIG. 5 and FIG. 6, a method for determining a positional relationship includes:
步骤500、判断移动用户当前的地理位置是否在多边形区域的某一条边界上,如果是,则确定第一位置关系为移动用户当前的地理位置在多边形区域的边界上;如果不是,则执行步骤501。Step 500: Determine whether the current geographic location of the mobile user is on a certain boundary of the polygon area. If yes, determine that the first location relationship is that the current geographic location of the mobile user is on the boundary of the polygon area; if not, step 501 is performed. .
步骤501、以移动用户当前的地理位置点P0(x0,y0)为端点,沿Y轴正向作射线x=x0,y≥y0。Step 501: Taking the current geographic location point P0(x0, y0) of the mobile user as an endpoint, and performing a ray x=x0, y≥y0 along the Y-axis.
步骤502、初始化M为1,交点计数器为0。 In step 502, the initialization M is 1, and the intersection counter is 0.
步骤503、判断M是否大于多边形区域的边界的数量N,如果是,则执行步骤511,如果不是,则执行步骤504。Step 503: Determine whether M is greater than the number N of boundaries of the polygon region. If yes, execute step 511. If not, execute step 504.
步骤504、取第M条边界对应的两个端点(如,M=1时,端点分别为P1(x1,y1)、P2(x2,y2)),根据两个端点确定一条线段(如,M=1时,线段为y=((y2-y1)/(x2-x1))x,min(x1,x2)≤x≤max(x1,x2))。Step 504: Take two endpoints corresponding to the boundary of the Mth (for example, when M=1, the endpoints are respectively P1(x1, y1), P2(x2, y2)), and determine a line segment according to the two endpoints (eg, M When =1, the line segment is y=((y2-y1)/(x2-x1))x, min(x1, x2)≤x≤max(x1, x2)).
图6为确定位置关系的示意图。如图6所示,第一条边界对应的两个端点为P1和P2,第二条边界对应的两个端点为P2和P3,第N条边界对应的两个端点为Pn和P1等。Figure 6 is a schematic diagram of determining a positional relationship. As shown in FIG. 6, the two endpoints corresponding to the first boundary are P1 and P2, the two endpoints corresponding to the second boundary are P2 and P3, and the two endpoints corresponding to the Nth boundary are Pn and P1.
步骤505、确定射线和确定出的线段之间的关系,当射线和线段之间的关系为相离或平行时,将M加1后执行步骤503;当射线和线段之间的关系为相交时,执行步骤506;当射线和线段之间的关系为相叠时,执行步骤510。Step 505: Determine a relationship between the ray and the determined line segment. When the relationship between the ray and the line segment is separated or parallel, add M to 1 and then perform step 503; when the relationship between the ray and the line segment is intersecting Step 506 is performed; when the relationship between the ray and the line segments is overlapped, step 510 is performed.
本步骤中,射线和线段之间有4种关系:相叠、平行、相交和相离。例如,当M=1时,若x1=x2=x0且y0≤max(y1,y2),则射线和线段之间的关系为相叠;若x1=x2≠x0,则射线和线段之间的关系为平行,若x1≠x2且y0≤((y2-y1)/(x2-x1))x0,则射线和线段之间的关系为相交;其余则射线和线段之间的关系为相离。In this step, there are four relationships between rays and line segments: overlapping, parallel, intersecting, and separating. For example, when M=1, if x1=x2=x0 and y0≤max(y1,y2), the relationship between the ray and the line segment is overlapped; if x1=x2≠x0, then between the ray and the line segment The relationship is parallel. If x1≠x2 and y0≤((y2-y1)/(x2-x1))x0, the relationship between the ray and the line segment is the intersection; the rest is the relationship between the ray and the line segment.
步骤506、当射线和线段之间的交点为线段的一个端点时,执行步骤507,否则执行步骤509。Step 506: When the intersection between the ray and the line segment is an end point of the line segment, step 507 is performed, otherwise step 509 is performed.
例如,当M=1时,射线和线段之间的交点为C(x0,((y2-y1)/(x2-x1))x0),点C和线段有3种位置关系,即点C与点P1重合、点C与点P2重合、点C在点P1、P2之间。For example, when M=1, the intersection between the ray and the line segment is C(x0,((y2-y1)/(x2-x1))x0), and the point C and the line segment have three kinds of positional relationship, that is, point C and Point P1 coincides, point C coincides with point P2, and point C is between points P1, P2.
步骤507、当线段的另一个端点和以交点为端点的另一条边界的另一个端点位于射线的两侧时,执行步骤508;当线段的另一个端点和以交点为端点的另一条边界的另一个端点不位于射线的两侧时,将M加1后执行步骤503。 Step 507, when the other end point of the line segment and the other end point of another boundary with the intersection point as the end point are located on both sides of the ray, step 508 is performed; when the other end point of the line segment and the other boundary with the intersection point as the end point When one end point is not located on both sides of the ray, step M is performed after M is incremented by one.
例如,当M=1时,如果交点C与点P1重合,那么线段PnP1和射线相交,若点P2和点Pn分布在射线两侧,则相交点计数器加1。For example, when M=1, if the intersection C coincides with the point P1, the line segment PnP1 and the ray intersect, and if the point P2 and the point Pn are distributed on both sides of the ray, the intersection point counter is incremented by one.
如果交点C与P2点重合,那么线段P2P3和射线相交,将M加1后执行 步骤503。If the intersection point C coincides with the point P2, then the line segment P2P3 intersects with the ray, and M is incremented by 1 to execute Step 503.
步骤508、如果交点排在线段的另一个端点之前,则将交点计数器加1,并将M加1后执行步骤503;如果交点排在线段的另一个端点之后,则将M加1后执行步骤503。Step 508: If the intersection point is before the other end point of the line segment, add the intersection counter to 1, and add M to 1 and then perform step 503; if the intersection point is after the other end point of the line segment, then add M to 1 and then perform the step. 503.
步骤509、将交点计数器加1,并将M加1后执行步骤503。In step 509, the intersection counter is incremented by 1, and M is incremented by 1, and then step 503 is performed.
步骤510、如果与线段相邻的两条边界位于线段的两侧,则将交点计数器加1,并将M加2后执行步骤503;如果与线段相邻的两条边界不位于线段的两侧,则将M加2后执行步骤503。Step 510: If two boundaries adjacent to the line segment are located on both sides of the line segment, add 1 to the intersection counter, and add M to 2, and then perform step 503; if the two boundaries adjacent to the line segment are not located on both sides of the line segment Then, after adding M to 2, step 503 is performed.
例如,当线段PnP1和射线相叠时,若点P2和点Pn-1分布在射线两侧,则将交点计数器加1,且将M加2后执行步骤503;当线段P2P3和射线相叠时,若点P1、P4分布在射线两侧,则将交点计数器加1,且将M加2后执行步骤503。For example, when the line segment PnP1 and the ray are stacked, if the point P2 and the point Pn-1 are distributed on both sides of the ray, the intersection counter is incremented by 1, and after M is incremented by 2, step 503 is performed; when the line segment P2P3 and the ray are stacked If the points P1 and P4 are distributed on both sides of the ray, the intersection counter is incremented by 1, and after M is incremented by 2, step 503 is performed.
步骤511、当交点计数器为奇数时,移动用户在多边形区域内;当交点计数器为偶数时,移动用户在多边形区域外。Step 511: When the intersection counter is an odd number, the mobile user is in the polygon area; when the intersection counter is an even number, the mobile user is outside the polygon area.
第三实施例,参见图7,位置触发业务处理的方法包括:Third Embodiment, referring to FIG. 7, a method for location trigger service processing includes:
步骤700、DCollect模块接收信令采集设备发来的移动用户的信令消息时解析移动用户的信令消息获取到移动用户当前的地理位置坐标信息。Step 700: The DCollect module parses the signaling message of the mobile user when receiving the signaling message of the mobile user sent by the signaling collection device, and obtains the current geographic location coordinate information of the mobile user.
步骤701、DCollect模块判断移动用户当前的地理位置和多边形区域的第一位置关系,即利用第二实施例的算法计算得出移动用户当前的地理位置在多边形区域外、多边形区域内还是多边形区域上(也可并为多边形区域内)。Step 701: The DCollect module determines a first location relationship between the current geographic location of the mobile user and the polygon region, that is, the algorithm of the second embodiment calculates whether the current geographic location of the mobile user is outside the polygon region, the polygon region, or the polygon region. (Also can be in the polygon area).
步骤702、DCollect模块联合该移动用户的上一次地理位置和多边形区域的第二位置关系,得出移动用户的移动状态:正离开多边形区域、或正进入多边形区域。Step 702: The DCollect module combines the last position of the mobile user with the second positional relationship of the polygon area to obtain a moving state of the mobile user: leaving the polygon area or entering the polygon area.
步骤703、DCollect模块获取到该移动用户关联的SP终端信息,然后通知MSP模块触发用户位置报告给对应的SP终端。Step 703: The DCollect module acquires the SP terminal information associated with the mobile user, and then notifies the MSP module to trigger the user location report to the corresponding SP terminal.
步骤704、MSP模块收到触发用户位置报告通知消息后,构建用户位置信息报告(包括用户移动状态、用户当前的地理位置信息等信息),然后发送给对应SP终端。 Step 704: After receiving the triggering user location report notification message, the MSP module constructs a user location information report (including the user mobile state, the current geographic location information of the user, and the like), and then sends the information to the corresponding SP terminal.
本发明实施例还公开了一种计算机程序,包括程序指令,当该程序指令被计算机执行时,使得该计算机可执行上述任意的确定位置关系的方法。The embodiment of the invention also discloses a computer program, comprising program instructions, which when executed by a computer, enable the computer to perform any of the above methods for determining a positional relationship.
本发明实施例还公开了一种载有所述的计算机程序的载体。The embodiment of the invention also discloses a carrier carrying the computer program.
在阅读并理解了附图和详细描述后,可以明白其他方面。Other aspects will be apparent upon reading and understanding the drawings and detailed description.
本领域普通技术人员可以理解上述实施例的全部或部分步骤可以使用计算机程序流程来实现,所述计算机程序可以存储于一计算机可读存储介质中,所述计算机程序在相应的硬件平台上(如系统、设备、装置、器件等)执行,在执行时,包括方法实施例的步骤之一或其组合。One of ordinary skill in the art will appreciate that all or a portion of the steps of the above-described embodiments can be implemented using a computer program flow, which can be stored in a computer readable storage medium, such as on a corresponding hardware platform (eg, The system, device, device, device, etc. are executed, and when executed, include one or a combination of the steps of the method embodiments.
可选地,上述实施例的全部或部分步骤也可以使用集成电路来实现,这些步骤可以被分别制作成一个个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。Alternatively, all or part of the steps of the above embodiments may also be implemented by using an integrated circuit. These steps may be separately fabricated into individual integrated circuit modules, or multiple modules or steps may be fabricated into a single integrated circuit module. achieve. Thus, the invention is not limited to any specific combination of hardware and software.
上述实施例中的各装置/功能模块/功能单元可以采用通用的计算装置来实现,它们可以集中在单个的计算装置上,也可以分布在多个计算装置所组成的网络上。The devices/function modules/functional units in the above embodiments may be implemented by a general-purpose computing device, which may be centralized on a single computing device or distributed over a network of multiple computing devices.
上述实施例中的各装置/功能模块/功能单元以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。上述提到的计算机可读取存储介质可以是只读存储器,磁盘或光盘等。When each device/function module/functional unit in the above embodiment is implemented in the form of a software function module and sold or used as a stand-alone product, it can be stored in a computer readable storage medium. The above mentioned computer readable storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求所述的保护范围为准。Variations or substitutions are readily conceivable within the scope of the present invention by those skilled in the art and are within the scope of the present invention. Therefore, the scope of the invention should be determined by the scope of the claims.
工业实用性Industrial applicability
本发明技术方案包括:获取移动用户当前的地理位置坐标信息;根据获得当前的地理位置坐标信息确定移动用户当前的地理位置与多边形区域之间的第一位置关系。通过本发明的方案,由于多边形区域能够很好地描述出实际的地理区域,因此提高了统计精度。因此本发明具有很强的工业实用性。 The technical solution of the present invention includes: obtaining current geographic location coordinate information of the mobile user; and determining a first location relationship between the current geographic location of the mobile user and the polygonal region according to the obtained current geographic location coordinate information. With the solution of the present invention, since the polygonal area can well describe the actual geographical area, the statistical accuracy is improved. Therefore, the present invention has strong industrial applicability.

Claims (25)

  1. 一种确定位置关系的方法,包括:A method of determining a positional relationship, comprising:
    获取移动用户当前的地理位置坐标信息;Obtaining current geographic location coordinate information of the mobile user;
    根据获得的当前的地理位置坐标信息确定所述移动用户当前的地理位置与多边形区域之间的第一位置关系。Determining, according to the obtained current geographic location coordinate information, a first positional relationship between the current geographic location of the mobile user and the polygonal region.
  2. 根据权利要求1所述的确定位置关系的方法,该方法还包括:The method of determining a positional relationship according to claim 1, further comprising:
    根据所述移动用户的所述第一位置关系,以及上一次地理位置与所述多边形区域之间的第二位置关系确定所述移动用户的移动状态。Determining a mobile state of the mobile user according to the first location relationship of the mobile user and a second location relationship between a last geographic location and the polygonal region.
  3. 根据权利要求2所述的确定位置关系的方法,其中,所述根据移动用户的所述第一位置关系,以及上一次地理位置与多边形区域之间的第二位置关系确定移动用户的移动状态的步骤包括:The method of determining a positional relationship according to claim 2, wherein said determining a moving state of the mobile user based on said first positional relationship of the mobile user and a second positional relationship between the last geographic location and the polygonal area The steps include:
    判断出所述移动用户的所述第一位置关系为所述移动用户当前的地理位置在所述多边形区域内或所述移动用户当前的地理位置在所述多边形区域的边界上,所述移动用户的所述第二位置关系为所述移动用户上一次地理位置在所述多边形区域外,确定所述移动用户的移动状态为正在离开所述多边形区域。Determining that the first location relationship of the mobile user is that the current geographic location of the mobile user is within the polygonal area or the current geographic location of the mobile user is on a boundary of the polygonal area, the mobile user The second positional relationship is that the mobile user's last geographic location is outside the polygonal area, and the moving state of the mobile user is determined to be leaving the polygonal area.
  4. 根据权利要求2或3所述的确定位置关系的方法,其中,所述根据移动用户的所述第一位置关系,以及上一次地理位置与所述多边形区域之间的第二位置关系确定所述移动用户的移动状态的步骤包括:The method of determining a positional relationship according to claim 2 or 3, wherein said determining said said first positional relationship according to said mobile user and said second positional relationship between said last geographic location and said polygonal area The steps to move the user's mobile status include:
    判断出所述移动用户的所述第一位置关系为所述移动用户当前的地理位置在所述多边形区域外,所述移动用户的所述第二位置关系为所述移动用户上一次地理位置在所述多边形区域内或所述移动用户当前的地理位置在所述多边形区域的边界上,确定所述移动用户的移动状态为正在进入所述多边形区域。Determining that the first location relationship of the mobile user is that the current geographic location of the mobile user is outside the polygonal area, and the second location relationship of the mobile user is that the mobile user last time is in the geographic location. The moving location of the mobile user is determined to be entering the polygonal area within the polygon area or the current geographic location of the mobile user on the boundary of the polygonal area.
  5. 根据权利要求1或2所述的确定位置关系的方法,其中,所述根据获得的当前的地理位置坐标信息确定所述移动用户当前的地理位置与多边形区域之间的第一位置关系的步骤包括: The method of determining a positional relationship according to claim 1 or 2, wherein the step of determining the first positional relationship between the current geographic location of the mobile user and the polygonal area based on the obtained current geographic location coordinate information comprises :
    判断出所述移动用户当前的地理位置在所述多边形区域的某一条边界上,确定所述第一位置关系为所述移动用户当前的地理位置在所述多边形区域的边界上。Determining that the current geographic location of the mobile user is on a certain boundary of the polygonal area, and determining that the first location relationship is that the current geographic location of the mobile user is on a boundary of the polygonal area.
  6. 根据权利要求1或2所述的确定位置关系的方法,其中,所述根据获得的当前的地理位置坐标信息确定所述移动用户当前的地理位置与多边形区域之间的第一位置关系的步骤包括:The method of determining a positional relationship according to claim 1 or 2, wherein the step of determining the first positional relationship between the current geographic location of the mobile user and the polygonal area based on the obtained current geographic location coordinate information comprises :
    判断出所述移动用户当前的地理位置不在所述多边形区域的任何一条边界上;Determining that the current geographic location of the mobile user is not at any boundary of the polygonal area;
    确定一条以所述移动用户当前的地理位置为端点,且与坐标轴平行的射线;Determining a ray whose end point is the current geographic location of the mobile user and parallel to the coordinate axis;
    计算确定出的射线和所述多边形区域的边界之间的交点的数量;Calculating the number of intersections between the determined ray and the boundary of the polygonal region;
    判断出计算得到的交点的数量为奇数,确定所述第一位置关系为所述移动用户当前的地理位置在所述多边形区域内。It is determined that the calculated number of intersection points is an odd number, and determining that the first location relationship is that the current geographic location of the mobile user is within the polygon area.
  7. 根据权利要求1或2所述的确定位置关系的方法,其中,所述根据获得的当前的地理位置坐标信息确定移动用户当前的地理位置与多边形区域之间的第一位置关系的步骤包括:The method for determining a positional relationship according to claim 1 or 2, wherein the determining the first positional relationship between the current geographic location of the mobile user and the polygonal area based on the obtained current geographic location coordinate information comprises:
    判断出所述移动用户当前的地理位置不在所述多边形区域的任何一条边界上;Determining that the current geographic location of the mobile user is not at any boundary of the polygonal area;
    确定一条以所述移动用户当前的地理位置为端点,且与坐标轴平行的射线;Determining a ray whose end point is the current geographic location of the mobile user and parallel to the coordinate axis;
    计算确定出的射线和所述多边形区域的边界之间的交点的数量;Calculating the number of intersections between the determined ray and the boundary of the polygonal region;
    判断出所述计算得到的交点的数量为偶数,确定所述第一位置关系为所述移动用户当前的地理位置在多边形区域外。It is determined that the calculated number of intersection points is an even number, and determining that the first location relationship is that the current geographic location of the mobile user is outside the polygon area.
  8. 根据权利要求6或7所述的确定位置关系的方法,其中,所述计算确定出的射线和所述多边形区域的边界之间的交点的数量的步骤包括:The method of determining a positional relationship according to claim 6 or 7, wherein said calculating the number of intersections between the determined ray and a boundary of said polygonal region comprises:
    确定所述射线和所述多边形区域的每一条边界之间的关系;Determining a relationship between the ray and each of the boundaries of the polygonal region;
    根据确定出的关系判断所述射线和所述多边形区域的每一条边界之间是 否有交点;Determining, between the ray and each of the boundaries of the polygonal region, based on the determined relationship Whether there is a point of intersection;
    将所述多边形区域中与所述射线有交点的边界的数量相加得到所述射线和所述多边形区域的边界之间的交点的数量。Adding the number of boundaries of the polygon region that intersect the ray results in the number of intersections between the ray and the boundary of the polygon region.
  9. 根据权利要求8所述的确定位置关系的方法,其中,所述确定射线和多边形区域的每一条边界之间的关系的步骤包括:The method of determining a positional relationship according to claim 8, wherein said determining the relationship between the ray and each of the boundaries of the polygonal region comprises:
    判断出第M条边界的两个端点位于所述射线上;或者,判断出所述第M条边界的其中一个端点位于所述射线上,另一个端点位于所述射线的反向延长线上,确定所述射线和所述多边形区域的第M条边界之间的关系为相叠;其中,M为大于或等于1且小于或等于N的整数。Determining that two endpoints of the Mth boundary are located on the ray; or, determining that one of the endpoints of the Mth boundary is located on the ray, and the other endpoint is located on a reverse extension line of the ray, Determining a relationship between the ray and an Mth boundary of the polygonal region is a stack; wherein M is an integer greater than or equal to 1 and less than or equal to N.
  10. 根据权利要求8或9所述的确定位置关系的方法,其中,所述确定射线和多边形区域的每一条边界之间的关系的步骤包括:The method of determining a positional relationship according to claim 8 or 9, wherein said determining the relationship between the ray and each of the boundaries of the polygonal region comprises:
    当判断出所述射线上任意两个点的横坐标相等,且所述第M条边界的两个端点的横坐标相等,且所述第M条边界的端点的横坐标与射线的端点的横坐标不相等;或者,判断出所述射线上任意两个点的纵坐标相等,且所述第M条边界的两个端点的纵坐标相等,且所述第M条边界的端点的纵坐标与所述射线的端点的纵坐标不相等时,确定所述射线和所述多边形区域的第M条边界之间的关系为平行。When it is determined that the abscissas of any two points on the ray are equal, and the abscissas of the two end points of the Mth boundary are equal, and the abscissa of the end point of the Mth boundary and the end of the ray end point The coordinates are not equal; or, it is determined that the ordinates of any two points on the ray are equal, and the ordinates of the two end points of the Mth boundary are equal, and the ordinate of the end point of the Mth boundary is When the ordinates of the end points of the ray are not equal, it is determined that the relationship between the ray and the Mth boundary of the polygonal area is parallel.
  11. 根据权利要求8或9所述的确定位置关系的方法,其中,所述确定射线和多边形区域的每一条边界之间的关系还包括:The method of determining a positional relationship according to claim 8 or 9, wherein the determining the relationship between the ray and each of the boundaries of the polygonal region further comprises:
    当判断出所述射线上除端点之外的其他任意一点的纵坐标大于所述射线的端点的纵坐标,且所述第M条边界的两个端点的横坐标不相等,且所述射线的端点的纵坐标小于所述第M条边界上,与所述射线的端点的横坐标相等的点的纵坐标;或者,判断出所述射线上除端点之外的其他任意一点的纵坐标小于所述射线的端点的纵坐标,且所述第M条边界的两个端点的横坐标不相等,且所述射线的端点的纵坐标大于第M条边界上,与所述射线的端点的横坐标相等的点的纵坐标;或者,判断出所述射线上除端点之外的其他任意一点的横坐标小于所述射线的端点的横坐标,且所述第M条边界的两个端点的纵坐标不相等,且所述射线的端点的横坐标大于所述第M条边界上,与所 述射线的端点的纵坐标相等的点的横坐标;或者,判断出所述射线上除端点之外的其他任意一点的横坐标大于所述射线的端点的横坐标,且所述第M条边界的两个端点的纵坐标不相等,且所述射线的端点的横坐标小于所述第M条边界上,与所述射线的端点的纵坐标相等的点的横坐标时,确定所述射线和所述多边形区域的第M条边界之间的关系为相交。When it is determined that the ordinate of any point other than the end point of the ray is greater than the ordinate of the end point of the ray, and the abscissas of the two end points of the Mth boundary are not equal, and the ray is The ordinate of the end point is smaller than the ordinate of the point on the boundary of the Mth, which is equal to the abscissa of the end point of the ray; or, it is determined that the ordinate of any point other than the end point of the ray is smaller than An ordinate of an end point of the ray, and an abscissa of two end points of the Mth boundary is not equal, and an ordinate of an end point of the ray is greater than an abscissa of an end point of the ray An ordinate of equal points; or, determining that the abscissa of any point other than the endpoint on the ray is smaller than the abscissa of the endpoint of the ray, and the ordinate of the two endpoints of the Mth boundary Not equal, and the abscissa of the end point of the ray is greater than the boundary of the Mth An abscissa of a point at which an ordinate of an end point of the ray is equal; or, determining that an abscissa of any point other than the end point of the ray is greater than an abscissa of an end point of the ray, and the Mth boundary The ordinates of the two endpoints are not equal, and the abscissa of the endpoint of the ray is smaller than the abscissa of the point on the Mth boundary equal to the ordinate of the endpoint of the ray, determining the ray and The relationship between the Mth boundary of the polygonal area is intersection.
  12. 根据权利要求8所述的确定位置关系的方法,其中,所述根据确定出的关系判断射线和多边形区域的每一条边界之间是否有交点的步骤包括:The method of determining a positional relationship according to claim 8, wherein said step of determining whether there is an intersection between each of the rays and the boundary of the polygonal region based on the determined relationship comprises:
    判断出所述射线和所述多边形区域的第M条边界之间的关系为相离或平行时,确定出所述射线和所述多边形区域的第M条边界之间没有交点。When it is determined that the relationship between the ray and the Mth boundary of the polygonal region is separated or parallel, it is determined that there is no intersection between the ray and the Mth boundary of the polygonal region.
  13. 根据权利要求8或12所述的确定位置关系的方法,其中,所述根据确定出的关系判断射线和多边形区域的每一条边界之间是否有交点的步骤包括:The method of determining a positional relationship according to claim 8 or 12, wherein said step of determining whether there is an intersection between each of the rays and the boundary of the polygonal area based on the determined relationship comprises:
    当判断出所述射线和所述多边形区域的第M条边界之间的关系为相叠,且所述射线的端点不在所述第M条边界上,且与所述第M条边界相邻的两条边界位于所述第M条边界的两侧时,确定出所述第M条边界和所述射线之间有交点,与所述第M条边界相邻的两条边界和所述射线之间均没有交点。Determining that a relationship between the ray and an Mth boundary of the polygonal region is overlapping, and an endpoint of the ray is not on the Mth boundary and adjacent to the Mth boundary When two boundaries are located on both sides of the boundary of the Mth strip, it is determined that there is an intersection between the boundary of the Mth strip and the ray, two borders adjacent to the boundary of the Mth strip, and the ray There is no intersection between the two.
  14. 根据权利要求8或12所述的确定位置关系的方法,其中,所述根据确定出的关系判断射线和多边形区域的每一条边界之间是否有交点的步骤包括:The method of determining a positional relationship according to claim 8 or 12, wherein said step of determining whether there is an intersection between each of the rays and the boundary of the polygonal area based on the determined relationship comprises:
    当判断出所述射线和所述多边形区域的第M条边界之间的关系为相叠,且所述射线的端点不在第M条边界上,且与所述第M条边界相邻的两条边界不位于所述第M条边界的两侧时,确定出所述第M条边界以及与所述第M条边界相邻的两条边界和射线之间均没有交点。When it is determined that the relationship between the ray and the Mth boundary of the polygonal region is overlapping, and the end of the ray is not on the Mth boundary, and two adjacent to the Mth boundary When the boundary is not located on both sides of the boundary of the Mth, it is determined that there is no intersection between the Mth boundary and the two boundaries and rays adjacent to the Mth boundary.
  15. 根据权利要求8或12所述的确定位置关系的方法,其中,所述根据确定出的关系判断射线和多边形区域的每一条边界之间是否有交点的步骤包括:The method of determining a positional relationship according to claim 8 or 12, wherein said step of determining whether there is an intersection between each of the rays and the boundary of the polygonal area based on the determined relationship comprises:
    当判断出所述射线和所述多边形区域的第M条边界之间的关系为相交,且交点为所述第M条边界的其中一个端点,且所述第M条边界的另一个端 点和以所述交点为端点的另一条边界的另一个端点位于所述射线的两侧时,确定出所述第M条边界和以交点为端点的另一条边界中,其中一条边界与射线之间有交点,另一条边界与射线之间没有交点。When it is determined that the relationship between the ray and the Mth boundary of the polygonal region is an intersection, and the intersection is one of the endpoints of the Mth boundary, and the other end of the Mth boundary When the point and the other end point of the other boundary with the intersection point are located on both sides of the ray, the boundary of the Mth and the other boundary with the intersection point are determined, one of the boundaries and the ray There is an intersection between the other, and there is no intersection between the other boundary and the ray.
  16. 根据权利要求8或12所述的确定位置关系的方法,其中,所述根据确定出的关系判断射线和多边形区域的每一条边界之间是否有交点的步骤包括:The method of determining a positional relationship according to claim 8 or 12, wherein said step of determining whether there is an intersection between each of the rays and the boundary of the polygonal area based on the determined relationship comprises:
    当判断出所述射线和所述多边形区域的第M条边界之间的关系为相交,且交点为所述第M条边界的其中一个端点,且所述第M条边界的另一个端点和以所述交点为端点的另一条边界的另一个端点不位于射线的两侧时,确定出所述第M条边界与所述射线之间没有交点,以所述交点为端点的另一条边界与所述射线之间没有交点。When it is determined that the relationship between the ray and the Mth boundary of the polygon region is an intersection, and the intersection is one of the endpoints of the Mth boundary, and the other endpoint of the Mth boundary When the other end point of the other boundary of the endpoint is not located on both sides of the ray, it is determined that there is no intersection between the boundary of the Mth and the ray, and the other boundary of the endpoint is the intersection There is no intersection between the rays.
  17. 根据权利要求8或12所述的确定位置关系的方法,其中,所述根据确定出的关系判断射线和多边形区域的每一条边界之间是否有交点的步骤包括:The method of determining a positional relationship according to claim 8 or 12, wherein said step of determining whether there is an intersection between each of the rays and the boundary of the polygonal area based on the determined relationship comprises:
    当判断出所述射线和所述多边形区域的第M条边界之间的关系为相交,且交点不是第M条边界的任何一个端点时,确定出所述射线和所述第M条边界之间有交点。Determining between the ray and the Mth boundary when it is determined that the relationship between the ray and the Mth boundary of the polygonal region is an intersection, and the intersection is not any one of the Mth boundary There are intersections.
  18. 一种确定位置关系的装置,包括获取模块和第一确定模块,其中An apparatus for determining a positional relationship, comprising an acquisition module and a first determination module, wherein
    所述获取模块设置成:获取移动用户当前的地理位置坐标信息;The acquiring module is configured to: obtain current geographic location coordinate information of the mobile user;
    所述第一确定模块设置成:根据获得的当前的地理位置坐标信息确定所述移动用户当前的地理位置与多边形区域之间的第一位置关系。The first determining module is configured to: determine, according to the obtained current geographic location coordinate information, a first positional relationship between the current geographic location of the mobile user and the polygonal region.
  19. 根据权利要求18所述的确定位置关系的装置,该装置还包括第二确定模块,其中The apparatus for determining a positional relationship according to claim 18, the apparatus further comprising a second determining module, wherein
    所述第二确定模块,设置成:根据所述移动用户的所述第一位置关系,以及上一次地理位置与所述多边形区域之间的第二位置关系确定所述移动用户的移动状态。The second determining module is configured to determine a mobile state of the mobile user according to the first location relationship of the mobile user and a second location relationship between a last geographic location and the polygonal region.
  20. 根据权利要求19所述的确定位置关系的装置,其中,所述第二确定模块设置成按照如下方式根据移动用户的所述第一位置关系,以及上一次地 理位置与多边形区域之间的第二位置关系确定移动用户的移动状态:The apparatus for determining a positional relationship according to claim 19, wherein said second determining module is arranged to follow said first positional relationship of the mobile user in accordance with the following manner, and the last time The second positional relationship between the physical location and the polygonal region determines the mobile user's mobile state:
    判断出所述移动用户的所述第一位置关系为所述移动用户当前的地理位置在所述多边形区域内或所述移动用户当前的地理位置在所述多边形区域的边界上,所述移动用户的第二位置关系为所述移动用户上一次地理位置在所述多边形区域外,确定所述移动用户的移动状态为正在离开所述多边形区域。Determining that the first location relationship of the mobile user is that the current geographic location of the mobile user is within the polygonal area or the current geographic location of the mobile user is on a boundary of the polygonal area, the mobile user The second positional relationship is that the mobile user's last geographic location is outside the polygonal area, and the moving state of the mobile user is determined to be leaving the polygonal area.
  21. 根据权利要求19所述的确定位置关系的装置,其中,所述第二确定模块设置成按照如下方式根据移动用户的所述第一位置关系,以及上一次地理位置与多边形区域之间的第二位置关系确定移动用户的移动状态:The apparatus for determining a positional relationship according to claim 19, wherein said second determining module is arranged to follow said first positional relationship of the mobile user and the second between the last geographical position and the polygonal area in the following manner The location relationship determines the mobile user's mobile status:
    判断出所述移动用户的所述第一位置关系为所述移动用户当前的地理位置在所述多边形区域外,所述移动用户的所述第二位置关系为所述移动用户上一次地理位置在所述多边形区域内或所述移动用户当前的地理位置在所述多边形区域的边界上,确定所述移动用户的移动状态为正在进入所述多边形区域。Determining that the first location relationship of the mobile user is that the current geographic location of the mobile user is outside the polygonal area, and the second location relationship of the mobile user is that the mobile user last time is in the geographic location. The moving location of the mobile user is determined to be entering the polygonal area within the polygon area or the current geographic location of the mobile user on the boundary of the polygonal area.
  22. 根据权利要求18或19所述的确定位置关系的装置,其中,所述第一确定模块设置成按照如下方式根据获得的当前的地理位置坐标信息确定所述移动用户当前的地理位置与多边形区域之间的第一位置关系:The apparatus for determining a positional relationship according to claim 18 or 19, wherein the first determining module is configured to determine a current geographic location and a polygonal area of the mobile user according to the obtained current geographic location coordinate information as follows The first positional relationship between:
    判断出所述移动用户当前的地理位置在所述多边形区域的某一条边界上,确定所述第一位置关系为所述移动用户当前的地理位置在所述多边形区域的边界上。Determining that the current geographic location of the mobile user is on a certain boundary of the polygonal area, and determining that the first location relationship is that the current geographic location of the mobile user is on a boundary of the polygonal area.
  23. 根据权利要求18或19所述的确定位置关系的装置,其中,所述第一确定模块设置成按照如下方式根据获得的当前的地理位置坐标信息确定所述移动用户当前的地理位置与多边形区域之间的第一位置关系:The apparatus for determining a positional relationship according to claim 18 or 19, wherein the first determining module is configured to determine a current geographic location and a polygonal area of the mobile user according to the obtained current geographic location coordinate information as follows The first positional relationship between:
    判断出所述移动用户当前的地理位置不在所述多边形区域的任何一条边界上;确定一条以所述移动用户当前的地理位置为端点,且与坐标轴平行的射线;计算确定出的射线和所述多边形区域的边界之间的交点的数量;判断出计算得到的交点的数量为奇数,确定所述第一位置关系为所述移动用户当前的地理位置在所述多边形区域内。Determining that the current geographic location of the mobile user is not at any boundary of the polygonal area; determining a ray that is the end point of the mobile user and is parallel to the coordinate axis; calculating the determined ray and the location The number of intersections between the boundaries of the polygon region; determining that the calculated number of intersections is an odd number, and determining that the first location relationship is that the current geographic location of the mobile user is within the polygon region.
  24. 根据权利要求18或19所述的确定位置关系的装置,其中,所述第 一确定模块设置成按照如下方式根据获得的当前的地理位置坐标信息确定所述移动用户当前的地理位置与多边形区域之间的第一位置关系:The apparatus for determining a positional relationship according to claim 18 or 19, wherein said A determining module is configured to determine, according to the obtained current geographic location coordinate information, a first positional relationship between the current geographic location of the mobile user and the polygonal region according to the following manner:
    判断出所述移动用户当前的地理位置不在所述多边形区域的任何一条边界上;确定一条以所述移动用户当前的地理位置为端点,且与坐标轴平行的射线;计算确定出的射线和所述多边形区域的边界之间的交点的数量;判断出所述计算得到的交点的数量为偶数,确定所述第一位置关系为所述移动用户当前的地理位置在多边形区域外。Determining that the current geographic location of the mobile user is not at any boundary of the polygonal area; determining a ray that is the end point of the mobile user and is parallel to the coordinate axis; calculating the determined ray and the location Determining the number of intersections between the boundaries of the polygon region; determining that the calculated number of intersection points is an even number, and determining that the first location relationship is that the current geographic location of the mobile user is outside the polygon region.
  25. 根据权利要求23或24所述的确定位置关系的装置,其中,所述第一确定模块设置成按照如下方式计算确定出的射线和所述多边形区域的边界之间的交点的数量:The apparatus for determining a positional relationship according to claim 23 or 24, wherein the first determining module is configured to calculate the number of intersections between the determined ray and a boundary of the polygonal area as follows:
    确定所述射线和所述多边形区域的每一条边界之间的关系;根据确定出的关系判断所述射线和所述多边形区域的每一条边界之间是否有交点;将所述多边形区域中与所述射线有交点的边界的数量相加得到所述射线和所述多边形区域的边界之间的交点的数量。 Determining a relationship between the ray and each of the boundaries of the polygonal region; determining whether there is an intersection between the ray and each of the boundaries of the polygonal region according to the determined relationship; The number of boundaries of the ray having intersections is added to obtain the number of intersections between the ray and the boundary of the polygonal region.
PCT/CN2016/077021 2015-01-23 2016-03-22 Method and device for determining locational relationship WO2016116070A2 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510037016.4 2015-01-23
CN201510037016.4A CN105868826A (en) 2015-01-23 2015-01-23 Method and device for determination of position relation

Publications (2)

Publication Number Publication Date
WO2016116070A2 true WO2016116070A2 (en) 2016-07-28
WO2016116070A3 WO2016116070A3 (en) 2016-09-09

Family

ID=56417887

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/077021 WO2016116070A2 (en) 2015-01-23 2016-03-22 Method and device for determining locational relationship

Country Status (2)

Country Link
CN (1) CN105868826A (en)
WO (1) WO2016116070A2 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109936590A (en) * 2017-12-15 2019-06-25 大唐移动通信设备有限公司 Information transferring method and device, computer storage medium, communication system
CN111915665A (en) * 2020-07-21 2020-11-10 中国科学院软件研究所 Method for judging points in polygon by using simplified intersection calculation on computer
CN112650794A (en) * 2020-12-30 2021-04-13 北京嘀嘀无限科技发展有限公司 Position data processing method and device, electronic equipment and storage medium
CN112926123A (en) * 2021-03-17 2021-06-08 杭州品茗安控信息技术股份有限公司 Method, device, equipment and storage medium for determining position relation of building member
US11243086B2 (en) * 2018-07-04 2022-02-08 Apollo Intelligent Driving Technology (Beijing) Co., Ltd. Method, device and apparatus for acquiring map, and computer readable storage medium

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106646552A (en) * 2016-12-30 2017-05-10 重庆多道电子技术有限公司 Data processing device
CN106597503A (en) * 2016-12-30 2017-04-26 重庆多道电子技术有限公司 System determining whether target gets into or gets out of designated region on basis of position data
CN106970396A (en) * 2016-12-30 2017-07-21 重庆多道电子技术有限公司 Determine the method that destination object is efficiently entering designated geographic area
CN106980128A (en) * 2016-12-30 2017-07-25 重庆多道电子技术有限公司 Data processing equipment
CN107705332A (en) * 2017-09-30 2018-02-16 新奥(中国)燃气投资有限公司 The method and device of number of devices in a kind of statistical regions
CN110555086A (en) * 2018-05-15 2019-12-10 中国移动通信集团浙江有限公司 Method and device for attributing resource points in grid
CN109613577B (en) * 2018-12-25 2021-07-09 北京锐安科技有限公司 Position determination method, device, terminal equipment and storage medium
CN110347774A (en) * 2019-07-17 2019-10-18 珠海卓邦科技有限公司 It is a kind of to visualize cut off the water notification method and system
CN111209358A (en) * 2019-12-24 2020-05-29 武汉蜜蜂云科技有限公司 Method and device for counting equipment number in scenic spot area
CN113438597A (en) * 2021-06-21 2021-09-24 深圳市口袋网络科技有限公司 Attendance positioning method and device, electronic equipment and storage medium
CN115164901B (en) * 2022-07-06 2023-04-14 河南工业贸易职业学院 Unmanned aerial vehicle navigation method

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1332580A (en) * 2000-07-11 2002-01-23 张颢 User positioning method via radio internet
US20040183674A1 (en) * 2003-01-31 2004-09-23 Ruvarac Thomas C. Apparatus, system and method for monitoring a location of a portable device
DE102004045010A1 (en) * 2004-09-16 2006-04-06 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. information point
CN1838709A (en) * 2005-03-21 2006-09-27 中兴通讯股份有限公司 GSM intelligent network system charging method and its charging system
CN1867179A (en) * 2005-12-08 2006-11-22 华为技术有限公司 Method for signing user area of mobile user
CN100583166C (en) * 2007-07-09 2010-01-20 北京邮电大学 Work attendance management system based on mobile terminal and realizing method thereof
CN102576065B (en) * 2009-10-12 2014-12-17 瑞典爱立信有限公司 Method and arrangement for improved positioning
CN101986677A (en) * 2010-10-22 2011-03-16 浙江大学 Position related mobile game operation limiting method
CN103347049A (en) * 2013-06-08 2013-10-09 西安云井电子科技有限公司 System and method for automatic adaption starting between positions and application programs based on mobile terminal
KR101493817B1 (en) * 2013-06-14 2015-03-02 현대엠엔소프트 주식회사 Method for map matching of user terminal

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109936590A (en) * 2017-12-15 2019-06-25 大唐移动通信设备有限公司 Information transferring method and device, computer storage medium, communication system
US11243086B2 (en) * 2018-07-04 2022-02-08 Apollo Intelligent Driving Technology (Beijing) Co., Ltd. Method, device and apparatus for acquiring map, and computer readable storage medium
CN111915665A (en) * 2020-07-21 2020-11-10 中国科学院软件研究所 Method for judging points in polygon by using simplified intersection calculation on computer
CN111915665B (en) * 2020-07-21 2022-05-31 中国科学院软件研究所 Method for judging points in polygon by using simplified intersection calculation on computer
CN112650794A (en) * 2020-12-30 2021-04-13 北京嘀嘀无限科技发展有限公司 Position data processing method and device, electronic equipment and storage medium
CN112926123A (en) * 2021-03-17 2021-06-08 杭州品茗安控信息技术股份有限公司 Method, device, equipment and storage medium for determining position relation of building member
CN112926123B (en) * 2021-03-17 2022-09-02 杭州品茗安控信息技术股份有限公司 Method, device, equipment and storage medium for determining position relation of building member

Also Published As

Publication number Publication date
WO2016116070A3 (en) 2016-09-09
CN105868826A (en) 2016-08-17

Similar Documents

Publication Publication Date Title
WO2016116070A2 (en) Method and device for determining locational relationship
CN107070961B (en) Hot spot area determination method and device based on geographic position data
KR101958723B1 (en) Systems and techniques for geofence crossing-based control
JP5425319B2 (en) Area range estimation apparatus and area range estimation method
JP6630389B2 (en) Earthquake alert server and earthquake alert method of earthquake alert server
US20120066614A1 (en) Methods and systems for following crowds
CN110493724A (en) Position monitoring method, device, server and computer readable storage medium
TW201622453A (en) Determining timing for determination of applicable geo-fences
US20150138108A1 (en) Method For Reporting Coordinate Point Of Touch Screen And Mobile Terminal
US8989701B2 (en) Identifying a wireless device of a target user for communication interception based on individual usage pattern(S)
WO2015067154A1 (en) Data processing method and device for counting webpage hits
CN104867402B (en) A kind of method and device thereof and terminal device of offline inverse geocoding
WO2019061988A1 (en) Wireless device-based positioning apparatus, method, and computer-readable storage medium
WO2020206972A1 (en) Map point information processing method and device, and server
CN105869188B (en) The detection method and system of point-to-points side shape position relation
CN110191369A (en) Image interception method, apparatus, equipment and storage medium
CN103596265A (en) Multiple-user indoor positioning method based on voice distance measuring and movement vector
CN105184435A (en) Field staff management method and system
CN114969153A (en) Personnel distribution data determination method and device
US20190222469A1 (en) Stream computing event models
CN110087185A (en) Commercial circle fence generation method, device, equipment and computer readable storage medium
JP6082795B1 (en) Ground information system, ground analysis device, ground information processing method, program
CN110446256B (en) Method and equipment for realizing positioning of base station based on ultra wide band
CN111553291A (en) Pedestrian trajectory generation method, device, equipment and computer storage medium
Liu et al. Coverage analysis for target localization in camera sensor networks

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: 16739817

Country of ref document: EP

Kind code of ref document: A2

NENP Non-entry into the national phase in:

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16739817

Country of ref document: EP

Kind code of ref document: A2