CN110569445B - Neighbor detection method in social network based on position - Google Patents
Neighbor detection method in social network based on position Download PDFInfo
- Publication number
- CN110569445B CN110569445B CN201910808171.XA CN201910808171A CN110569445B CN 110569445 B CN110569445 B CN 110569445B CN 201910808171 A CN201910808171 A CN 201910808171A CN 110569445 B CN110569445 B CN 110569445B
- Authority
- CN
- China
- Prior art keywords
- vertex
- convex polygon
- point
- user
- equal
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
- G06F16/9536—Search customisation based on social or collaborative filtering
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
- G06F16/9537—Spatial or temporal dependent retrieval, e.g. spatiotemporal queries
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q50/00—Systems or methods specially adapted for specific business sectors, e.g. utilities or tourism
- G06Q50/01—Social networking
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Abstract
The invention discloses a neighbor detection method in a social network based on a position, which is an important problem in the social network service based on the position. The neighbor detection allows the user to select a specific geometric range on the map and then ask if his friends are within this range. In order to efficiently realize neighbor detection in a social network, the method comprises the steps of firstly abstracting a geometric range selected by a user into a convex polygon, abstracting the position of a friend of the user into a point, then extracting four characteristic vertexes of the convex polygon, dividing the convex polygon according to the four characteristic vertexes, judging which partition a given point falls in, and calling a judging condition corresponding to the partition to judge the position relation between the given point and the convex polygon, so that a result is finally obtained. The method can obtain the position relationship of the point and the convex polygon only by judging the point and the edge once, thereby efficiently solving the problem of neighbor detection in the social network.
Description
Technical Field
The invention belongs to the technical field of social networks, relates to a neighbor detection method in a social network, and particularly relates to a method for neighbor detection by utilizing a position relationship between points and convex polygons in a position-based social network service.
Background
With the popularity of location-aware mobile terminals and the popularity of social applications, location-based social networking services (lbs) have brought great convenience to people's lives. Among them, the neighbor detection service is a typical application of LBS. The neighbor detection allows the user to select a specific geometric range on the map and then ask if his friends are within this range. The geometric range selected by the user is generally abstracted into a convex polygon, the positions of friends of the user are abstracted into a point, and the problem of neighbor detection is solved by judging the position relation between the point and the convex polygon.
The current methods for judging the points and the convex polygons are as follows: the azimuth of the point is calculated (document 1), the ray method (document 2), the angle method (document 3), the area method (document 4), and the like. In the azimuth method of the calculation point, the azimuth of each side of the point and the convex polygon needs to be judged; in the angle method, the angle between the point and each side of the convex polygon needs to be calculated; in the area method, the position problem of the point and the convex polygon is required to be converted into the triangular area problem, and then the triangular area problem is solved, so that the method has the problem of low calculation efficiency. In the ray method, a ray is led out through a given point, the number of intersection points of the ray and the convex polygon is calculated, if the number of intersection points is odd, the coordinate point is inside the convex polygon, otherwise, the coordinate point is outside the convex polygon. But this method has the potential for erroneous decisions when a given point is located on the edge of a convex polygon. Therefore, how to efficiently implement neighbor detection in a social network remains a matter of research.
[1]F.Feito,J.C.Torres,and A.Orientation,simplicity,and inclusion test for planar polygons[J].Comput.Graph.,1995,19(4):595–600.
[2]GALETZKA M,GLAUNER P O.A simple and correct even-odd algorithm for the point-in-polygon problem for complex polygons[OL].In:Proceedings of the12th International Joint Conference on Computer Vision,Imaging and Computer Graphics Theory and Applications(VISIGRAPP 2017).Porto,Portugal,2017:175-178.
[3]HORMANN K,AGATHOS A.The point in polygon problem for arbitrary polygons[J].Computational Geometry,2001,20(3):131-144.
[4] Chen Zhenhua, li Shundong, huang Qiong, dong Ligong, chen Wei. Two new solutions to the problem of secure location determination [ J ]. Computer science report, 2018,41 (2): 336-348.
Disclosure of Invention
In order to solve the problems, the invention provides a method for performing neighbor detection by utilizing the position relation between points and convex polygons in a position-based social network service.
The technical scheme adopted by the invention is as follows: a neighbor detection method in a social network based on position, which assumes that the geometric range designated by a user is a convex polygon L with n vertexes, and is numbered anticlockwise from the vertex with the largest ordinate in sequence, and is assumed to be { P } 1 ,P 2 ,…,P n And the coordinates thereof are (x) i ,y i ) I=1, 2, …, n, and represents the location of the user's friend as a point P (x p ,y p ) Judging the position relationship between the point P and the convex polygon L, namely judging whether the point P is positioned outside or inside the convex polygon L; the point P being located inside the convex polygon L includes the case where the point P is on the edge of the convex polygon L; if point P is outside of convex polygon L, then it is indicated that the user's friends are not within the user-specified geometric range; if the point P is located inside the convex polygon L, then the friends of the user are indicated to be located within the geometric range specified by the user;
characterized in that the method comprises the steps of:
step 1: finding out four characteristic vertexes of the convex polygon L: uppermost vertex, leftmost vertex, lowermost vertex and rightmost vertex; the uppermost vertex is denoted as P 1 Let the leftmost vertex be denoted P l The lowest vertex is denoted as P d The rightmost vertex is denoted as P r Then l is more than or equal to 1 and less than or equal to d is more than or equal to r and less than or equal to n;
step 2: judging the position relation between a given point P and the convex polygon L;
step 3: if the point P is inside the convex polygon L, returning that the friend of the user is located in the geometric range designated by the user; if point P is outside of convex polygon L, then the friend returning to the user is not within the user-specified geometric range.
Preferably, the specific implementation of the step 2 comprises the following sub-steps:
step 2.1: if y p <y d Or y p >y 1 Or x p <x l Or x p >x r Then given point P (x p ,y p ) Bit positionOutside the convex polygon L, the flow is ended;
otherwise, enter step 2.2;
step 2.2: if x p ≤x 1 And y is p ≥y l I.e. at a given point P (x p ,y p ) At the uppermost point P 1 Left and leftmost vertex P l At this time, the judgment process I is executed, and the present process ends;
otherwise, enter step 2.3;
the specific implementation of the judging process I comprises the following substeps:
step 2.2.1: at the vertex { P 1 ,P 2 ,…,P l Finding two adjacent vertices P i And P i+1 So that x is i ≤x≤x i+1 Wherein i is more than or equal to 1 and less than or equal to l-1;
step 2.2.2: calculated vertex P i And P i+1 Is denoted by the symbol f 1 (x) Representing the straight line;
step 2.2.3: if y p ≤f 1 (x p ) Then given point P (x p ,y p ) Located inside the convex polygon L, otherwise given point P (x p ,y p ) Is positioned outside the convex polygon L;
step 2.3: if x p ≤x d And y is p <y l I.e. at a given point P (x p ,y p ) At the lowest vertex P d Left and leftmost vertex P l At this time, the judgment process II is executed, and the present process is ended;
otherwise, enter step 2.4;
the specific implementation of the judging process II comprises the following sub-steps:
step 2.3.1: at the vertex { P l ,P l+1 ,P l+2 ,…,P d Finding two adjacent vertices P i And P i+1 So that x is i+1 ≤x≤x i Wherein l-1 is less than or equal to i and less than or equal to d;
step 2.3.2: calculated vertex P i And P i+1 Is denoted by the symbol f 2 (x) Representing the straight line;
step 2.3.3: if y p ≥f 2 (x p ) Then given point P (x p ,y p ) Located inside the convex polygon L, otherwise given point P (x p ,y p ) Is positioned outside the convex polygon L;
step 2.4: if x p >x d And y is p <y r I.e. at a given point P (x p ,y p ) At the lowest vertex P d Right and rightmost vertices P r At this time, the judgment process III is executed, and the present process ends;
otherwise, enter step 2.5;
the specific implementation of the judging process III comprises the following substeps:
step 2.4.1: at the vertex { P d ,P d+1 ,P d+2 ,…,P r Finding two adjacent vertices P i And P i+1 So that x is i ≤x≤x i+1 Wherein d is equal to or more than i is equal to or less than r-1;
step 2.4.2: calculated vertex P i And P i+1 Is denoted by the symbol f 3 (x) Representing the straight line;
step 2.4.3: if y p ≥f 3 (x p ) Then given point P (x p ,y p ) Located inside the convex polygon L, otherwise given point P (x p ,y p ) Is positioned outside the convex polygon L;
step 2.5: if x p >x 1 And y is p ≥y r I.e. at a given point P (x p ,y p ) At the uppermost point P 1 Right and rightmost vertices P r At this time, the judgment process IV is executed, and the present process ends;
the specific implementation of the judging process IV comprises the following sub-steps:
step 2.5.1: if x 1 ≤x≤x n Then select vertex P n And P 1 Otherwise at the vertex { P ] r ,P r+1 ,P r+2 ,…,P n Finding two adjacent vertices P i And P i+1 So that x is i+1 ≤x≤x i Wherein r-1 is less than or equal to i is less than or equal to n;
step 2.5.2: if the selected vertex is P n And P 1 Then calculate the vertex P n And P 1 Or else calculate the vertex P i And P i+1 Is denoted by the symbol f 4 (x) Representing the calculated straight line;
step 2.5.3: if y p ≤f 4 (x p ) Then given point P (x p ,y p ) Located inside the convex polygon L, otherwise given point P (x p ,y p ) Is located outside the convex polygon L.
Aiming at the problems of low calculation cost and low efficiency of the existing method, the invention discloses a neighbor detection method in a social network based on a position; the method comprises the steps of firstly abstracting a geometric range selected by a user into a convex polygon, abstracting the positions of friends of the user into a point, then extracting four characteristic vertexes of the convex polygon, dividing the convex polygon according to the four characteristic vertexes, and providing a position judging process of points in each partition and the convex polygon; and finally, judging which partition the given point falls in according to the coordinates of the given point, and then executing a corresponding position judging process to finally obtain a solution of the problem. In the method provided by the invention, the given point does not need to carry out position judgment with all sides of the convex polygon and does not need to carry out problem conversion, so that the calculation cost is greatly reduced.
Drawings
Fig. 1: given the convex polygon of the embodiments of the present invention;
fig. 2: the given convex polygon division schematic diagram of the embodiment of the invention;
fig. 3: the method of the embodiment of the invention is a flow chart;
fig. 4: schematic diagrams of the positional relationship between a first point and a given convex polygon in the embodiment of the invention;
fig. 5: schematic diagrams of the positional relationship between the second point and a given convex polygon in the embodiment of the invention;
fig. 6: schematic diagram of the positional relationship between the third point and a given convex polygon;
fig. 7: schematic diagram of the positional relationship between the fourth point and a given convex polygon;
fig. 8: schematic diagram of the positional relationship between the fifth point and a given convex polygon;
fig. 9: schematic diagrams of the positional relationship between a sixth point and a given convex polygon in the embodiment of the present invention;
fig. 10: schematic diagram of the positional relationship between the seventh point and a given convex polygon;
fig. 11: schematic diagram of the positional relationship between the eighth point and a given convex polygon;
fig. 12: a schematic diagram of the positional relationship between the ninth point of the embodiment of the present invention and a given convex polygon.
Detailed description of the preferred embodiments
In order to facilitate the understanding and practice of the invention, those of ordinary skill in the art will now make further details with reference to the drawings and examples, it being understood that the examples described herein are for the purpose of illustration and explanation only and are not intended to limit the invention thereto.
Please refer to fig. 1, assume that the geometric range designated by the user is a convex polygon L with n vertices, which are numbered counterclockwise from the vertex with the largest ordinate, assuming { P } 1 ,P 2 ,…,P n And the coordinates thereof are (x) i ,y i ) I=1, 2, …, n. Wherein four feature vertices are P 1 (uppermost vertex), P l (leftmost vertex), P d (lowest vertex), P r (right most vertex).
Please refer to fig. 2, the location of the user friend is represented as a point P, and a division of the convex polygon is implemented according to four feature vertices, so as to obtain 5 partitions: the first zone corresponds to the blank area in fig. 2, and if point P falls within this area, it is indicated that point P is outside the convex polygon (see fig. 4); the second zone corresponds to the shaded area marked I in fig. 2, and if point P falls in this area, it is necessary to further determine its positional relationship with the convex polygon (see fig. 5 and 6); the third zone corresponds to the shaded area marked II in fig. 2, and if the point P falls in this area, it is necessary to further determine its positional relationship with the convex polygon (see fig. 7 and 8); the fourth zone corresponds to the shaded area marked III in fig. 2, and if the point P falls in this area, it is necessary to further determine its positional relationship with the convex polygon (see fig. 9 and 10); the fifth zone corresponds to the shaded area marked IV in fig. 2, and if the point P falls in this area, it is necessary to further determine its positional relationship with the convex polygon (see fig. 11 and 12).
Referring to fig. 3, the method for detecting the neighbors in the social network based on the position provided by the invention comprises the following steps:
step 1: finding out four characteristic vertexes of the convex polygon L: uppermost vertex, leftmost vertex, lowermost vertex, and rightmost vertex. As can be seen from the numbering convention above, the uppermost vertex is P 1 Let the leftmost vertex be P l The lowest vertex is P d The rightmost vertex is P r Then l is more than or equal to 1 and less than or equal to d is more than or equal to r and less than or equal to n. A partitioning of the convex polygon is actually achieved based on four feature vertices, see fig. 2, where a given convex polygon is partitioned into 5 partitions.
Step 2: the positional relationship of the given point P and the convex polygon L is determined.
Please refer to steps 2.1 to 2.5 and fig. 4 to 12 in fig. 3, the specific implementation of step 2 includes the following sub-steps:
step 2.1: if y p <y d Or y p >y 1 Or x p <x l Or x p >x r I.e. point P (x p ,y p ) Falls within the blank region (corresponding to the case shown in fig. 4), then a given point P (x p ,y p ) Outside the convex polygon L, otherwise, enter step 2.2;
step 2.2: if x p ≤x 1 And y is p ≥y l I.e. point P (x p ,y p ) Falls into region I, at which time the following steps 2.2.1 to 2.2.3 are performed, otherwise step 2.3 is entered.
Step 2.2.1: at the vertex { P 1 ,P 2 ,…,P l Find in }To two adjacent vertices P i And P i+1 So that x is i ≤x≤x i+1 Wherein i is more than or equal to 1 and less than or equal to l-1;
step 2.2.2: calculated vertex P i And P i+1 Is denoted by the symbol f 1 (x) Representing the straight line;
step 2.2.3: if y p ≤f 1 (x p ) (corresponding to the case shown in fig. 5), then a given point P (x p ,y p ) Located inside the convex polygon L, otherwise (corresponding to the case shown in FIG. 6) a given point P (x p ,y p ) Is located outside the convex polygon L.
Step 2.3: if x p ≤x d And y is p <y l I.e. point P (x p ,y p ) Falls into zone II, at which time the following steps 2.3.1 to 2.3.3 are performed, otherwise step 2.4 is entered.
Step 2.3.1: at the vertex { P l ,P l+1 ,P l+2 ,…,P d Finding two adjacent vertices P i And P i+1 So that x is i+1 ≤x≤x i Wherein l-1 is less than or equal to i and less than or equal to d;
step 2.3.2: calculated vertex P i And P i+1 Is denoted by the symbol f 2 (x) Representing the straight line;
step 2.3.3: if y p ≥f 2 (x p ) (corresponding to the case shown in fig. 7), then a given point P (x p ,y p ) Located inside the convex polygon L, otherwise (corresponding to the case shown in FIG. 8) a given point P (x p ,y p ) Is located outside the convex polygon L.
Step 2.4: if x p >x d And y is p <y r I.e. point P (x p ,y p ) Falling in zone III, the following steps 2.4.1 to 2.4.3 are performed at this time, otherwise step 2.5 is entered.
Step 2.4.1: at the vertex { P d ,P d+1 ,P d+2 ,…,P r Finding two adjacent vertices P i And P i+1 So that x is i ≤x≤x i+1 Wherein d is equal to or more than i is equal to or less than r-1;
step 2.4.2: calculated vertex P i And P i+1 Is denoted by the symbol f 3 (x) Representing the straight line;
step 2.4.3: if y p ≥f 3 (x p ) (corresponding to the case shown in fig. 9), then a given point P (x p ,y p ) Located inside the convex polygon L, otherwise (corresponding to the case shown in FIG. 10) a given point P (x p ,y p ) Is located outside the convex polygon L.
Step 2.5: at this time x p >x 1 And y is p ≥y r I.e. point P (x p ,y p ) Falling in zone IV, the following steps 2.5.1 to 2.5.3 are performed.
Step 2.5.1: if x 1 ≤x≤x n Then select vertex P n And P 1 Otherwise at the vertex { P ] r ,P r+1 ,P r+2 ,…,P n Finding two adjacent vertices P i And P i+1 So that x is i+1 ≤x≤x i Wherein r-1 is less than or equal to i is less than or equal to n;
step 2.5.2: if the selected vertex is P n And P 1 Then calculate the vertex P n And P 1 Or else calculate the vertex P i And P i+1 Is denoted by the symbol f 4 (x) Representing the calculated straight line;
step 2.5.3: if y p ≤f 4 (x p ) (corresponding to the case shown in fig. 11), then a given point P (x p ,y p ) Located inside the convex polygon L, otherwise (corresponding to the case shown in FIG. 12) a given point P (x p ,y p ) Is located outside the convex polygon L.
Step 3: if the point P is inside the convex polygon L, returning that the friend of the user is located in the geometric range designated by the user; if point P is outside of convex polygon L, then the friend returning to the user is not within the user-specified geometric range.
Aiming at the problem of neighbor detection in a social network, firstly abstracting a geometric range selected by a user into a convex polygon, abstracting the position of a friend of the user into a point, then extracting four characteristic vertexes of the convex polygon, dividing the convex polygon according to the four characteristic vertexes, and providing a position judging process of the point in each partition and the convex polygon; and finally, judging which partition the given point falls in according to the coordinates of the given point, and then executing a corresponding position judging process to finally obtain a solution of the problem. The method can obtain the position relationship of the point and the convex polygon only by judging the point and the edge once, thereby efficiently solving the problem of neighbor detection in the social network.
It should be understood that parts of the specification not specifically set forth herein are all prior art.
It should be understood that the foregoing description of the preferred embodiments is not intended to limit the scope of the invention, but rather to limit the scope of the claims, and that those skilled in the art can make substitutions or modifications without departing from the scope of the invention as set forth in the appended claims.
Claims (1)
1. A neighbor detection method in a social network based on position, which assumes that the geometric range designated by a user is a convex polygon L with n vertexes, and is numbered anticlockwise from the vertex with the largest ordinate in sequence, and is assumed to be { P } 1 ,P 2 ,…,P n And the coordinates thereof are (x) i ,y i ) I=1, 2, …, n, and represents the location of the user's friend as a point P (x p ,y p ) Judging the position relationship between the point P and the convex polygon L, namely judging whether the point P is positioned outside or inside the convex polygon L; the point P being located inside the convex polygon L includes the case where the point P is on the edge of the convex polygon L; if point P is outside of convex polygon L, then it is indicated that the user's friends are not within the user-specified geometric range; if the point P is located inside the convex polygon L, then the friends of the user are indicated to be located within the geometric range specified by the user;
characterized in that the method comprises the steps of:
step 1: finding out four characteristic vertexes of the convex polygon L: uppermost vertexA leftmost vertex, a bottommost vertex, and a rightmost vertex; the uppermost vertex is denoted as P 1 Let the leftmost vertex be denoted P l The lowest vertex is denoted as P d The rightmost vertex is denoted as P r Then l is more than or equal to 1 and less than or equal to d is more than or equal to r and less than or equal to n;
step 2: judging the position relation between a given point P and the convex polygon L;
the specific implementation of the step 2 comprises the following sub-steps:
step 2.1: if y p <y d Or y p >y 1 Or x p <x l Or x p >x r Then given point P (x p ,y p ) The flow is finished when the convex polygon L is positioned outside;
otherwise, enter step 2.2;
step 2.2: if x p ≤x 1 And y is p ≥y l I.e. at a given point P (x p ,y p ) At the uppermost point P 1 Left and leftmost vertex P l At this time, the judgment process I is executed, and the present process ends;
otherwise, enter step 2.3;
the specific implementation of the judging process I comprises the following substeps:
step 2.2.1: at the vertex { P 1 ,P 2 ,…,P l Finding two adjacent vertices P i And P i+1 So that x is i ≤x≤x i+1 Wherein i is more than or equal to 1 and less than or equal to l-1;
step 2.2.2: calculated vertex P i And P i+1 Is denoted by the symbol f 1 (x) Representing the straight line;
step 2.2.3: if y p ≤f 1 (x p ) Then given point P (x p ,y p ) Located inside the convex polygon L, otherwise given point P (x p ,y p ) Is positioned outside the convex polygon L;
step 2.3: if x p ≤x d And y is p <y l I.e. at a given point P (x p ,y p ) At the lowest vertex P d Left and leftmost vertex P l Is arranged at the lower side of (a)At this time, the judging process II is executed, and the present process is ended;
otherwise, enter step 2.4;
the specific implementation of the judging process II comprises the following sub-steps:
step 2.3.1: at the vertex { P l ,P l+1 ,P l+2 ,…,P d Finding two adjacent vertices P i And P i+1 So that x is i+1 ≤x≤x i Wherein l-1 is less than or equal to i and less than or equal to d;
step 2.3.2: calculated vertex P i And P i+1 Is denoted by the symbol f 2 (x) Representing the straight line;
step 2.3.3: if y p ≥f 2 (x p ) Then given point P (x p ,y p ) Located inside the convex polygon L, otherwise given point P (x p ,y p ) Is positioned outside the convex polygon L;
step 2.4: if x p >x d And y is p <y r I.e. at a given point P (x p ,y p ) At the lowest vertex P d Right and rightmost vertices P r At this time, the judgment process III is executed, and the present process ends;
otherwise, enter step 2.5;
the specific implementation of the judging process III comprises the following substeps:
step 2.4.1: at the vertex { P d ,P d+1 ,P d+2 ,…,P r Finding two adjacent vertices P i And P i+1 So that x is i ≤x≤x i+1 Wherein d is equal to or more than i is equal to or less than r-1;
step 2.4.2: calculated vertex P i And P i+1 Is denoted by the symbol f 3 (x) Representing the straight line;
step 2.4.3: if y p ≥f 3 (x p ) Then given point P (x p ,y p ) Located inside the convex polygon L, otherwise given point P (x p ,y p ) Is positioned outside the convex polygon L;
step 2.5: if x p >x 1 And y is p ≥y r I.e. at a given point P (x p ,y p ) At the uppermost point P 1 Right and rightmost vertices P r At this time, the judgment process IV is executed, and the present process ends;
the specific implementation of the judging process IV comprises the following sub-steps:
step 2.5.1: if x 1 ≤x≤x n Then select vertex P n And P 1 Otherwise at the vertex { P ] r ,P r+1 ,P r+2 ,…,P n Finding two adjacent vertices P i And P i+1 So that x is i+1 ≤x≤x i Wherein r-1 is less than or equal to i is less than or equal to n;
step 2.5.2: if the selected vertex is P n And P 1 Then calculate the vertex P n And P 1 Or else calculate the vertex P i And P i+1 Is denoted by the symbol f 4 (x) Representing the calculated straight line;
step 2.5.3: if y p ≤f 4 (x p ) Then given point P (x p ,y p ) Located inside the convex polygon L, otherwise given point P (x p ,y p ) Is positioned outside the convex polygon L;
step 3: if the point P is inside the convex polygon L, returning that the friend of the user is located in the geometric range designated by the user; if point P is outside of convex polygon L, then the friend returning to the user is not within the user-specified geometric range.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910808171.XA CN110569445B (en) | 2019-08-29 | 2019-08-29 | Neighbor detection method in social network based on position |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910808171.XA CN110569445B (en) | 2019-08-29 | 2019-08-29 | Neighbor detection method in social network based on position |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110569445A CN110569445A (en) | 2019-12-13 |
CN110569445B true CN110569445B (en) | 2023-06-02 |
Family
ID=68776700
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910808171.XA Active CN110569445B (en) | 2019-08-29 | 2019-08-29 | Neighbor detection method in social network based on position |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110569445B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112509031B (en) * | 2020-12-02 | 2022-08-16 | 湖北工业大学 | Position judging method |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102063493A (en) * | 2010-12-30 | 2011-05-18 | 北京大学 | Content extraction method based on regular expression group and control logic |
CN108777839A (en) * | 2018-05-25 | 2018-11-09 | 湖北工业大学 | The positioning of secret protection is registered system and method in a kind of mobile Internet |
CN109934890A (en) * | 2019-03-08 | 2019-06-25 | 南京泛在地理信息产业研究院有限公司 | A kind of meander envelope extraction method |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN100524361C (en) * | 2007-09-07 | 2009-08-05 | 中国科学院软件研究所 | Method for judging point whether or not situated in polygon |
US8536999B2 (en) * | 2008-07-16 | 2013-09-17 | Qualcomm Incorporated | Method for dynamic creation of a GeoFence in a wireless system |
US8930245B2 (en) * | 2010-06-23 | 2015-01-06 | Justin Streich | Methods, systems and machines for identifying geospatial compatibility between consumers and providers of goods or services |
CN102982562A (en) * | 2012-10-19 | 2013-03-20 | 浙江中正智能科技有限公司 | Method for judging whether target point is positioned inside polygon area |
CN104123737A (en) * | 2014-07-15 | 2014-10-29 | 沈颖 | Testing method for judging inclusivity of points on inner portion, outer portion or boundary of polygonal area |
CN105869188B (en) * | 2016-04-22 | 2019-06-21 | 日立楼宇技术(广州)有限公司 | The detection method and system of point-to-points side shape position relation |
CN106878941A (en) * | 2016-12-29 | 2017-06-20 | 贵州财富之舟科技有限公司 | position reminding method and device |
CN108269283A (en) * | 2017-12-26 | 2018-07-10 | 武汉长江通信智联技术有限公司 | A kind of implementation method for judging transfer point disengaging polygonal region |
-
2019
- 2019-08-29 CN CN201910808171.XA patent/CN110569445B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102063493A (en) * | 2010-12-30 | 2011-05-18 | 北京大学 | Content extraction method based on regular expression group and control logic |
CN108777839A (en) * | 2018-05-25 | 2018-11-09 | 湖北工业大学 | The positioning of secret protection is registered system and method in a kind of mobile Internet |
CN109934890A (en) * | 2019-03-08 | 2019-06-25 | 南京泛在地理信息产业研究院有限公司 | A kind of meander envelope extraction method |
Non-Patent Citations (2)
Title |
---|
一种隐私保护的智能电网多级用户电量聚合控制方案;沈华;张明武;;密码学报(第02期);全文 * |
点对多边形位置检测的稳定串行最优与并行的算法;郝建强;宫云战;叶红;;计算机应用研究(第04期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN110569445A (en) | 2019-12-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111504325B (en) | Global path planning method based on weighted A-algorithm of enlarged search neighborhood | |
US20230179143A1 (en) | Method and system for optimizing the configuration of a solar power system | |
CN103247041B (en) | A kind of dividing method of the cloud data of the many geometric properties based on local sampling | |
JP5120786B2 (en) | Radio wave propagation characteristic estimation system, method and program | |
Feng et al. | Unknown hostile environment-oriented autonomous WSN deployment using a mobile robot | |
CN110569445B (en) | Neighbor detection method in social network based on position | |
CN111369539B (en) | Building facade window detecting system based on multi-feature image fusion | |
CN105787977A (en) | Building vector boundary simplification method | |
CN112199453A (en) | Traffic hot spot clustering method, device, equipment and computer storage medium | |
CN114003623A (en) | Similar path typhoon retrieval method | |
CN108269283A (en) | A kind of implementation method for judging transfer point disengaging polygonal region | |
CN111220943A (en) | Positioning method, positioning system, computer-readable storage medium and vehicle | |
CN111681313A (en) | Digital topographic map-based space vision field analysis method and electronic equipment | |
CN108012235B (en) | Positioning method and device based on hotspot group | |
CN110351657A (en) | A kind of method of wireless sensor network interior joint geometry location | |
CN115294237A (en) | Power simulation modeling connection line optimization method, device and equipment and readable storage medium | |
CN107480804B (en) | Maze solving method based on line-surface spatial relation | |
CN113487858B (en) | Road network data-oriented abnormal track detection method | |
CN109803268B (en) | Method and device for determining associated sector and computer readable storage medium | |
CN110763223B (en) | Sliding window based indoor three-dimensional grid map feature point extraction method | |
CN113055239B (en) | Data display method, device, equipment and medium | |
CN109151728B (en) | Indoor wireless positioning method with space filtering mechanism and system thereof | |
CN109581286A (en) | A kind of two dimension fingerprint distribution indoor positioning method and structure | |
CN113573321B (en) | Method, device, medium and electronic device for determining network correlation of cell | |
KR101011401B1 (en) | Method for determining intersection between the objects using image of the configuration of the objects |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |