Method, system and equipment for judging entering and exiting of polygonal area and storage medium

By constructing the minimum circumscribed circle and continuous counting mechanism of polygonal areas, the problem of high false alarm rate in the existing technology is solved, and accurate positioning and stable judgment of irregular polygonal areas are achieved, the false alarm rate is reduced, and the accuracy and practicality of positioning monitoring are improved.

CN120630265APending Publication Date: 2025-09-12XIAMEN OCEAN VOCATIONAL & TECH COLLEGE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510732403.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-03
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

Existing technologies have a high false alarm rate when judging entry and exit of irregular polygonal areas, making it difficult to meet the positioning monitoring needs in complex scenarios. In addition, errors in GPS or Beidou positioning systems cause positioning points to frequently enter and exit the edge of polygonal areas, triggering false alarms.

Method used

By constructing the minimum circumscribed circle of the polygonal area, combining positioning error and continuous counting mechanism, it is determined whether the target point enters or leaves the polygonal area. This includes constructing the minimum circumscribed circle, calculating the distance from the target point to the center of the circle, setting the positioning error threshold and the number of consecutive times the conditions are met, thereby reducing the risk of misjudgment.

Benefits of technology

It significantly reduces the false alarm rate, improves the accuracy and stability of entry and exit area judgment, meets the positioning and monitoring needs of irregular polygonal areas, and enhances the practicality and reliability of positioning technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120630265A_ABST
    Figure CN120630265A_ABST
Patent Text Reader

Abstract

The invention provides a judgment method, system and device for entering and exiting a polygonal area and a storage medium, and the method comprises the following steps: S1, constructing a minimum circumcircle of the polygonal area, and determining the circle center latitude and longitude and the radius r of the minimum circumcircle; s2, periodically acquiring positioning information of a target point, calculating a distance D from the target point to the center of the minimum circumcircle, and presetting a positioning error E; s3, when the target point is transferred from the inside of the polygonal area to the outside of the polygonal area, if the distance D meets Dgt; r + 2E, and determining that the target point leaves the polygonal region if the number of times that the condition is continuously met reaches a preset threshold value M times; when the target point is transferred from the outside of the polygonal area to the inside of the polygonal area, if the distance D meets Dlt; and judging that the target point enters the polygonal region if the target point meets the condition for M times and the number of times for continuously meeting the condition reaches a preset threshold value for M times. According to the invention, frequent false alarm or false alarm caused by GPS or Beidou positioning errors can be effectively avoided, and the accuracy of area entering and exiting judgment is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of positioning technology, and in particular to a method, system, device and storage medium for determining entry and exit of a polygonal area. Background Art

[0002] With the widespread application of positioning technology, devices such as children's smartwatches and elderly positioning terminals are becoming increasingly popular. These devices often have the ability to determine whether a person has entered or exited a zone, allowing guardians to track their child's location in real time. However, existing technologies for determining whether a person has entered or exited a zone have limitations.

[0003] Currently, most products on the market primarily rely on circular area detection, determining whether a target point has left or entered the area by judging whether the positioning point exceeds the circular boundary. This determination method is relatively simple, but it is difficult to accurately apply to irregularly shaped polygonal areas. In real life, the coverage area of ​​residential communities, schools, or workplaces, for example, often takes the form of irregular polygons rather than simple circles. Therefore, methods that rely solely on circular area detection are unable to meet the positioning and monitoring needs in complex scenarios.

[0004] Crucially, while GPS and Beidou positioning systems provide relatively accurate positioning services, they still exhibit a certain degree of accuracy error, typically around 10 meters. When a positioning point approaches the edge of a polygonal area and moves or rests along it, positioning data may drift. This is due to the inherent randomness of positioning errors, which can cause the positioning point to frequently enter and exit the area near the actual boundary, leading to frequent or false alarms.

[0005] For example, if the coverage area of ​​a residential complex or school is set as an irregular polygonal area, when a supervised person walks on a path outside the school or community wall with a positioning device, the positioning data may sometimes fall within the area and sometimes outside the area due to errors. This can cause the detection system to repeatedly misjudge the entry and exit status of the target point, sending a large number of unnecessary alarm messages to the supervisor, causing confusion and worry.

[0006] In view of this, the present invention proposes a method, system, device and storage medium for judging entry and exit of a polygonal area, which can significantly reduce the false alarm rate. Summary of the Invention

[0007] In order to solve the problems that the existing technology relies solely on circular area judgment, which is difficult to meet the positioning and monitoring needs in complex scenarios, and has a high false alarm rate, the present invention provides a method, system, device and storage medium for judging entry and exit of polygonal areas to solve the above technical defects.

[0008] In a first aspect, the present invention proposes a method for judging entry into and exit from a polygonal area, including the following steps:

[0009] S1. Construct the minimum circumscribed circle of the polygonal area, and determine the longitude and latitude of the center of the minimum circumscribed circle and the radius r;

[0010] S2. Periodically obtain the positioning information of the target point, calculate the distance D from the target point to the center of the minimum circumscribed circle, and preset the positioning error E;

[0011] S3. When the target point transfers from inside the polygonal area to outside the polygonal area, if the distance D satisfies D > r + 2E, and the number of consecutive times of satisfying this condition reaches the preset threshold M times, it is determined that the target point leaves the polygonal area;

[0012] When the target point transfers from outside the polygonal area to inside the polygonal area, if the distance D satisfies D < r - 2E, and the number of consecutive times of satisfying this condition reaches the preset threshold M times, it is determined that the target point enters the polygonal area.

[0013] Preferably, in step S1, the specific method for constructing the minimum circumscribed circle of the polygonal area is as follows:

[0014] By using the rotating calipers algorithm or the convex hull optimization algorithm, calculate the longitude and latitude of the center of the minimum circumscribed circle and the radius r according to the longitude and latitude coordinates of each vertex of the polygonal area.

[0015] Preferably, in step S2, the real-time positioning longitude and latitude of the target point are collected by a positioning terminal at a fixed frequency to periodically obtain the positioning information of the target point; based on the spherical distance algorithm, calculate the distance D from the target point to the center of the minimum circumscribed circle according to the longitude and latitude coordinates of the target point and the center of the circle.

[0016] Preferably, in step S3, determine the moving direction of the target point by comparing the positioning longitude and latitude of the target point at the current moment with the positioning longitude and latitude at the previous moment.

[0017] Preferably, the method for judging entry into and exit from a polygonal area proposed by the present invention further includes: when it is determined that the target point enters or leaves the polygonal area, trigger an alarm or notification event, and report the event to the server or the user terminal.

[0018] Preferably, the method for judging entry into and exit from a polygonal area proposed by the present invention further includes: according to the positioning signal strength of the environment where the target point is located or the fluctuation situation of historical positioning data, real-time correct the value of the positioning error E.

[0019] Preferably, a method for judging entry into and exit from a polygon area proposed by the present invention further includes: when a target point transfers from inside the polygon area to outside the polygon area, if the distance D satisfies D>r + 2E and the number of consecutive times of satisfying this condition reaches a preset threshold M times, it is determined that the target point leaves the polygon area;

[0020] When a target point transfers from outside the polygon area to inside the polygon area, if the distance D satisfies D<r - 2E and the number of consecutive times of satisfying this condition reaches a preset threshold M times, it is determined that the target point enters the polygon area;

[0021] When the distance D of the target point does not meet the continuous counting condition, clear the previously accumulated number of consecutive determinations and start counting again;

[0022] After completing the determination of the target point entering or leaving the polygon area, it further includes the step of resetting the number of consecutive determinations:

[0023] When the status of the target point changes, clear the previously accumulated number of consecutive determinations and start counting again

[0024] In a second aspect, the present invention proposes a system for judging entry into and exit from a polygon area, and the system includes: a mobile terminal application, a server, and a positioning terminal;

[0025] The mobile terminal application is used to receive the longitude and latitude coordinates of the vertices of the polygon area input by the user, construct the minimum circumscribed circle of the polygon area according to the longitude and latitude coordinates of the vertices, determine the longitude and latitude of the center of the minimum circumscribed circle and the radius r, and upload the longitude and latitude of the polygon vertices, the longitude and latitude of the center of the minimum circumscribed circle, and the radius r to the server;

[0026] The server is used to store the longitude and latitude coordinates of the vertices of the polygon area, the longitude and latitude of the center of the minimum circumscribed circle, the radius r information, and the positioning error E; respond to the configuration request of the positioning terminal and send the longitude and latitude coordinates of the vertices of the polygon area and the longitude and latitude of the center of the minimum circumscribed circle to it; receive the entry and exit area events reported by the positioning terminal and push notifications to the mobile terminal application;

[0027] The positioning terminal is used to periodically obtain the positioning information of the target point, calculate the distance D from the target point to the center of the minimum circumscribed circle, obtain the positioning error E from the server, and execute the following determination logic:

[0028] When a target point transfers from inside the polygon area to outside the polygon area, if the distance D satisfies D>r + 2E and the number of consecutive times of satisfying this condition reaches a preset threshold M times, it is determined that the target point leaves the polygon area.

[0029] When the target point transfers from outside the polygon area to inside the polygon area, if the distance D satisfies D < r - 2E and the number of consecutive times this condition is met reaches the preset threshold M times, it is determined that the target point enters the polygon area.

[0030] When the positioning terminal determines that the target point enters or leaves the polygon area, it triggers an alarm or notification event and reports the event to the server, which then pushes it to the mobile terminal application.

[0031] In a third aspect, the present invention proposes a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the method for judging entry and exit from a polygon area as described in any one of the above.

[0032] In a fourth aspect, the present invention proposes a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the method for judging entry and exit from a polygon area as described in any one of the above.

[0033] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0034] (1) Reducing the false alarm rate: By constructing the minimum circumscribed circle framework of the polygon area and combining multi-factor fusion judgments such as the minimum circumscribed circle radius, positioning error threshold, and continuous measurement, it effectively avoids frequent or false alarms when the target point moves or stays normally at the edge of the polygon area due to GPS or Beidou positioning errors. Compared with the prior art, the false alarm rate is significantly reduced, and the accuracy of judging entry and exit from the area is improved.

[0035] (2) Accurately positioning the polygon area: Different from the method based on circular area judgment in the prior art, the present invention focuses on judging entry and exit from irregular polygon areas, which can meet the positioning and monitoring requirements of irregularly shaped areas in actual scenarios such as residential communities, schools, and workplaces, making the application of positioning technology more practical, flexible, and extensive.

[0036] (3) Improving the judgment stability: Introducing a continuous judgment mechanism, that is, only when the conditions for leaving or entering the area are accumulated to M times will a final judgment be made, avoiding misjudgment caused by accidental factors or short-term fluctuations in positioning data, and enhancing the stability and reliability of the judgment of the target point state.

[0037] (4) Real-time and practical: It can trigger an alarm or notification event in a timely manner after determining that the target point enters or leaves the polygon area, and report the event to the server or the user terminal, facilitating the guardian to grasp the location dynamics of the ward in real time, and improving the practicality and reliability of the positioning technology in devices such as children's phone watches and elderly positioning terminals.

[0038] (5) Optimize positioning error processing: According to the positioning signal strength of the target point's environment or the fluctuation of historical positioning data, the positioning error E is corrected in real time, which further improves the positioning accuracy and enhances the adaptability and robustness of the system in different environments.

[0039] (6) System collaboration and efficiency: The proposed judgment system for entering and exiting polygonal areas includes mobile terminal applications, servers, and positioning terminals. Each part has a clear division of labor and works together, realizing a complete process from area setting, data processing to event push, providing users with a more comprehensive and efficient positioning monitoring solution. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Other features, objects and advantages of the present application will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:

[0041] Figure 1 is a flow chart of a method for determining entry and exit of a polygonal area according to the present invention;

[0042] Figure 2 Schematic diagram of a polygonal area and its minimum circumscribed circle of the present invention;

[0043] Figure 3 is a schematic diagram of a system for determining entry and exit of a polygonal area according to the present invention;

[0044] Figure 4 It is a schematic diagram of the structure of a computer system suitable for implementing an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0045] The present application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely for the purpose of explaining the relevant invention and are not intended to limit the invention. It should also be noted that, for ease of description, only portions relevant to the relevant invention are shown in the accompanying drawings.

[0046] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in this application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0047] The present invention proposes a method for judging entry and exit of a polygonal area. Figure 1 FIG. 4 is a flow chart showing a method for determining entry and exit of a polygonal area according to the present invention. Figure 1 As shown, the method includes the following steps:

[0048] S1. Construct the minimum circumscribed circle of the polygonal area and determine the longitude and latitude of the center and the radius r of the minimum circumscribed circle.

[0049] In this embodiment, after the user frames a polygonal area on the electronic map through a mobile terminal application (such as a mobile phone APP or computer software), the mobile terminal application calculates the longitude and latitude of the center of the minimum circumscribed circle and the radius r based on the minimum circumscribed circle algorithm of the polygon (such as the rotating calipers algorithm or convex hull optimization algorithm), according to the longitude and latitude coordinates of each vertex of the polygonal area, and uploads this data to the server of the cloud service platform.

[0050] S2. Periodically obtain the positioning information of the target point, calculate the distance D from the target point to the center of the minimum circumscribed circle, and preset a positioning error E (E is the GPS or Beidou positioning error).

[0051] In this embodiment, the positioning terminal can collect the real-time positioning longitude and latitude of the target point at a fixed frequency (such as once per second) to periodically obtain the positioning information of the target point. Based on the spherical distance algorithm, calculate the distance D from the target point to the center of the minimum circumscribed circle according to the longitude and latitude coordinates of the target point and the center of the circle, and obtain the preset positioning error E of the server. Preferably, the positioning error E is 10 meters.

[0052] Specifically, calculate the spherical distance based on the Haversine formula, and the formula is as follows:

[0053]

[0054] Among them, φ1, λ1 are the latitude and longitude of the center of the minimum circumscribed circle; φ2, λ2 are the latitude and longitude of the target point; Δφ is the latitude difference; Δλ is the longitude difference; R is the radius of the earth (default value is 6371 kilometers).

[0055] S3. When the target point transfers from inside the polygonal area to outside the polygonal area, if the distance D satisfies D > r + 2E, and the number of consecutive times of satisfying this condition reaches the preset threshold M times, where M is a natural number greater than 0, then it is determined that the target point leaves the polygonal area;

[0056] When the target point transfers from outside the polygonal area to inside the polygonal area, if the distance D satisfies D < r - 2E, and the number of consecutive times of satisfying this condition reaches the preset threshold M times, then it is determined that the target point enters the polygonal area.

[0057] In this embodiment, the positioning terminal determines the moving direction of the target point by comparing the positioning longitude and latitude of the target point at the current moment with the positioning longitude and latitude at the previous moment, and judges whether the target point transfers from inside the polygonal area to outside the area or from outside the polygonal area to inside the area. It is also possible to combine the ray method or the winding number method to judge whether the target point is located inside the polygonal area.

[0058] When it is determined that the target point enters or leaves the polygon area, an alarm or notification event is triggered, and the event is reported to the server or the user terminal. Among them, the alarm events include SMS notifications, APP push messages, and local audible and visual alarms of the device. The SMS notification is sent to the guardian's mobile phone through the operator interface; the APP push message is sent to the mobile terminal application through the server based on the MQTT protocol; the audible and visual alarm is triggered by the buzzer and LED light of the positioning terminal.

[0059] When the target point transfers from inside the polygon area to outside the polygon area, if the distance D from the target point to the center of the circle and the radius r of the circle satisfy D > r + 2E, and the number of consecutive occurrences of this situation reaches the preset threshold M (the preferred preset threshold M is 3) times, it is determined that the target point leaves the polygon area. The positioning terminal reports the leaving area event to the server of the cloud service platform. After receiving the event, the server sends a notification to the mobile phone APP through the push server to inform the guardian that the target point has left the polygon area.

[0060] When the target point transfers from outside the polygon area to inside the polygon area, if the distance D from the target point to the center of the circle and the radius r of the circle satisfy D < r - 2E, and the number of consecutive occurrences of this situation reaches the preset threshold M (the preferred preset threshold M is 3) times, it is determined that the target point enters the polygon area. The positioning terminal reports the entering area event to the server, and the server sends a notification to the mobile phone APP through the push server to inform the guardian that the target point has entered the polygon area.

[0061] Figure 2 The schematic diagram of the polygon area and its minimum circumscribed circle of the present invention is shown. With reference to Figure 1 and Figure 2 , in a specific embodiment, it is assumed that the community where the family is located is set as an irregular polygon area, and the guardian equips a children's phone watch with positioning function as the positioning terminal. The specific operation process is as follows:

[0062] The guardian uses the mobile phone APP to frame the polygon area of the community on the electronic map, sets the number of vertices of the polygon to 8 (not greater than the preset vertex number threshold 10). The APP calculates the longitude and latitude of the center of the minimum circumscribed circle of the polygon as (116.3565, 39.8889), and the radius r is 两百 meters, and uploads these data to the server of the cloud service platform.

[0063] It should be noted that in the translation of "半径r为200米", there is an error in the original Chinese text where it is written as "两百 meters" which should be "200 meters" in English. The corrected translation is provided above.The child's phone watch serves as a positioning terminal, which periodically (for example, once every 10 minutes) requests the latest regional configuration from the server, and receives information such as the longitude and latitude coordinates of the polygonal area vertices, the longitude and latitude of the center of the minimum circumscribed circle (116.3565, 39.8889), the radius r (200 meters), the positioning error threshold E (10 meters), and the threshold M of 3 for the number of target points entering or leaving the area.

[0064] The positioning terminal performs positioning once per second, obtaining the child's current latitude and longitude and calculating the distance D between the child and the center of the minimum circumscribed circle. Simultaneously, based on a spherical distance algorithm, the child's current latitude and longitude are compared with the previous one to determine the child's direction of movement.

[0065] When a child leaves the neighborhood, the positioning terminal determines that the child has moved from within the polygonal area to outside it. If the distance D between the child and the center of the circle satisfies D > 200 + 2 × 10 = 220 meters, and this condition occurs three times consecutively, the child is considered to have left the neighborhood. The positioning terminal reports the departure event to the server, which sends a push notification to the guardian's mobile app, informing them that the child has left the neighborhood.

[0066] When the child returns to the neighborhood, the positioning terminal determines that the child has moved from outside the polygonal area to inside it. If the distance D between the child and the center of the circle satisfies D < 200 - 2 × 10 = 180 meters, and this condition occurs three times consecutively, the child is considered to have entered the neighborhood. The positioning terminal reports the entry event to the server, which sends a push notification to the guardian's mobile app, informing them that the child has entered the neighborhood.

[0067] In a specific embodiment, the positioning terminal corrects the value of the positioning error E in real time based on the positioning signal strength of the target point's environment or the fluctuation of historical positioning data. The specific method for correcting the value of the positioning error E in real time is as follows: if the GPS / Beidou signal strength is lower than 20dB or the number of visible satellites is less than 4, E is adjusted to 1.5 times the default value; if the standard deviation of the fluctuation of the historical positioning trajectory is greater than 15 meters, E is adjusted to 1.2 times the default value. For example, in an open area with good signal, the positioning error E may be low, such as 5 meters; while in a densely populated area with weak signal, the positioning error E may be higher, such as 15 meters. By correcting the value of the positioning error E in real time, the actual positioning accuracy can be more accurately reflected, thereby improving the accuracy of judgment of entry and exit areas.

[0068] After determining that the target point enters or leaves the polygon area, when the status of the target point changes (such as changing from the leaving state to the entering state, or from the entering state to the leaving state), the positioning terminal clears the previously accumulated consecutive determination times and starts counting again. This mechanism can avoid the accumulation of misjudgments caused by the frequent state switching of the target point near the boundary, ensuring the reliability and stability of the judgment result.

[0069] For further reference Figure 3 , as an implementation of the above method, the present invention provides a judgment system for entering and leaving a polygon area, which can be specifically applied to various electronic devices. The judgment system for entering and leaving a polygon area includes: a mobile terminal application, a server, and a positioning terminal.

[0070] The mobile terminal application (such as a mobile phone APP) is used to receive the longitude and latitude coordinates of the vertices of the polygon area input by the user, construct the minimum circumcircle of the polygon area according to the longitude and latitude coordinates of the vertices, determine the longitude and latitude of the center of the minimum circumcircle and the radius r, and upload the longitude and latitude of the polygon vertices, the longitude and latitude of the center of the minimum circumcircle, and the radius r to the server;

[0071] The server is used to store the longitude and latitude coordinates of the vertices of the polygon area, the longitude and latitude of the center of the minimum circumcircle, and the radius r information; respond to the configuration request of the positioning terminal and send the longitude and latitude coordinates of the vertices of the polygon area and the longitude and latitude of the center of the minimum circumcircle to it; receive the entering and leaving area events reported by the positioning terminal and push notifications to the mobile terminal application.

[0072] The positioning terminal is used to periodically obtain the positioning information of the target point, calculate the distance D from the target point to the center of the minimum circumcircle, obtain the positioning error E preset by the server, and execute the following judgment logic:

[0073] When the target point transfers from inside the polygon area to outside the polygon area, if the distance D satisfies D>r + 2E, and the number of consecutive times of satisfying this condition reaches the preset threshold M times, it is determined that the target point leaves the polygon area.

[0074] When the target point transfers from outside the polygon area to inside the polygon area, if the distance D satisfies D<r - 2E, and the number of consecutive times of satisfying this condition reaches the preset threshold M times, it is determined that the target point enters the polygon area;

[0075] When the positioning terminal determines that the target point enters or leaves the polygon area, it triggers an alarm or notification event and reports the event to the server, and the server then pushes it to the mobile terminal application.

[0076] ]>In a specific embodiment, a user uses a mobile app to define a polygonal area on an electronic map and enter the longitude and latitude coordinates of the polygonal area's vertices. The app then constructs a minimum circumscribed circle based on the longitude and latitude coordinates of the vertices, determines the longitude and latitude of the minimum circumscribed circle's center, and its radius r. The app then uploads the polygonal vertex longitude and latitude, the minimum circumscribed circle's center longitude and latitude, and its radius r to a server on the cloud service platform.

[0077] After receiving the data uploaded by the APP, the server stores it in the database server and records the polygon area and the corresponding user account and other related information so that the correct area configuration data can be sent to the positioning terminal later.

[0078] The positioning terminal sends a configuration request to the server of the cloud service platform when it is turned on or at a fixed time (such as once every 10 minutes) to apply for the latest configuration information of the polygon area.

[0079] After receiving the configuration request from the positioning terminal, the server queries the corresponding polygon area vertex longitude and latitude, the minimum circumscribed circle center longitude and latitude, and radius r from the database server according to the user account associated with the positioning terminal, and sends this data to the positioning terminal.

[0080] After receiving the configuration data sent by the server, the positioning terminal updates the locally stored polygon area information and prepares to locate the target point and judge the entry and exit of the area based on the preset positioning error threshold E and the threshold M of the number of target points entering or leaving.

[0081] The positioning terminal obtains the real-time positioning latitude and longitude of the target point at a set frequency (such as once per second), and calculates the distance D from the target point to the center of the minimum circumscribed circle based on the spherical distance algorithm.

[0082] The positioning terminal compares the current and previous positioning latitude and longitude of the target point to determine the moving direction of the target point and judge whether the target point moves from inside the polygonal area to outside the area or from outside the area to inside the area.

[0083] The system determines whether a target is entering or exiting a zone based on the relationship between the target's moving direction and distance D and the circle radius r, combined with the preset positioning error E and the threshold for consecutive determinations M. If the conditions for leaving or entering a zone are met, the corresponding determination result is recorded and the number of consecutive determinations is accumulated.

[0084] When the number of consecutive determinations reaches the threshold M, the positioning terminal confirms that the target point leaves or enters the polygonal area and reports the event to the server of the cloud service platform.

[0085] After receiving the event of leaving or entering the polygon area reported by the positioning terminal, the server of the cloud service platform records the event information (such as the time of event occurrence, the positioning information of the target point, the identification of the polygon area, etc.) in the database server.

[0086] The push server retrieves event information from the server and, based on the association between the user account and the mobile app, sends a notification to the guardian's mobile app. The notification includes information such as the target's departure or entry event, the time of occurrence, and the name or location of the polygon area, allowing the guardian to stay informed of the target's dynamics.

[0087] Through the detailed description of the above embodiments, the present invention provides a method and system for judging entry and exit of polygonal areas based on positioning technology, which can effectively solve the problem of high false alarm rate of circular area judgment methods in the existing technology when dealing with irregular polygonal areas, and significantly improves the accuracy, stability and practicality of entry and exit area judgment, providing a more reliable positioning monitoring solution for children's phone watches, elderly positioning terminals and other devices.

[0088] In a third aspect, the present invention proposes a terminal device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of any of the above-mentioned methods for determining entry and exit of a polygonal area are implemented.

[0089] In a fourth aspect, the present invention proposes a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of any of the above-mentioned methods for determining entry into and exiting a polygonal area.

[0090] Reference below Figure 4 , which shows a structural diagram of a computer system 400 suitable for implementing a terminal device or server of an embodiment of the present application. Figure 4 The terminal device or server shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.

[0091] like Figure 4 As shown, the computer system 400 includes a central processing unit (CPU) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage unit 408 into a random access memory (RAM) 403. Various programs and data required for the operation of the computer system 400 are also stored in the RAM 403. The CPU 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0092] The following components are connected to the I / O interface 405: an input section 406 including a keyboard, a mouse, and the like; an output section 407 including a liquid crystal display (LCD), a speaker, and the like; a storage section 408 including a hard disk and the like; and a communication section 409 including a network interface card such as a LAN card or a modem. The communication section 409 performs communication processing via a network such as the Internet. A drive 410 is also connected to the I / O interface 405 as needed. A removable medium 411, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 410 as needed, so that a computer program read therefrom can be installed into the storage section 408 as needed.

[0093] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 409, and / or installed from the removable medium 411. When the computer program is executed by the central processing unit (CPU) 401, the above-mentioned functions defined in the method of the present application are executed. It should be noted that the computer-readable medium described in the present application can be a computer-readable signal medium or a computer-readable medium or any combination of the above two. The computer-readable medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable media may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this application, a computer-readable medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such a propagated data signal may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including, but not limited to, wireless, wire, optical cable, RF, or any suitable combination thereof.

[0094] Computer program code for performing the operations of the present application can be written in one or more programming languages, or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as C or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0095] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and the module, program segment or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.

[0096] The above description is merely a preferred embodiment of the present application and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also encompasses other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned inventive concept. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this application.

Claims

1. A method for judging entry and exit of a polygonal area, characterized in that: It includes the following steps: S1. Construct the minimum circumscribed circle of the polygon area, and determine the longitude and latitude of the center of the minimum circumscribed circle and the radius r; S2. Periodically obtain the positioning information of the target point, calculate the distance D from the target point to the center of the minimum circumscribed circle, and preset the positioning error E; S3. When the target point transfers from inside the polygon area to outside the polygon area, if the distance D satisfies D > r + 2E, and the number of consecutive times of satisfying this condition reaches the preset threshold M times, it is determined that the target point leaves the polygon area; When the target point transfers from outside the polygon area to inside the polygon area, if the distance D satisfies D < r - 2E, and the number of consecutive times of satisfying this condition reaches the preset threshold M times, it is determined that the target point enters the polygon area.

2. The method for determining entry and exit of a polygonal area according to claim 1, wherein: In step S1, the specific method for constructing the minimum circumscribed circle of the polygon area is as follows: Through the rotating calipers algorithm or the convex hull optimization algorithm, calculate the longitude and latitude of the center of the minimum circumscribed circle and the radius r according to the longitude and latitude coordinates of each vertex of the polygon area.

3. The method for judging entry and exit of a polygonal area according to claim 1, wherein: In step S2, the positioning terminal collects the real-time positioning longitude and latitude of the target point at a fixed frequency to periodically obtain the positioning information of the target point; based on the spherical distance algorithm, calculate the distance D from the target point to the center of the minimum circumscribed circle according to the longitude and latitude coordinates of the target point and the center of the circle.

4. The method for determining entry and exit of a polygonal area according to claim 1, wherein: In step S3, determine the moving direction of the target point by comparing the positioning longitude and latitude of the target point at the current moment with the positioning longitude and latitude at the previous moment.

5. The method for determining entry and exit of a polygonal area according to claim 1, wherein: It also includes: According to the positioning signal strength of the environment where the target point is located or the fluctuation of historical positioning data, the value of the positioning error E is corrected in real time.

6. The method for determining entry and exit of a polygonal area according to claim 1, wherein: When the target point transfers from inside the polygon area to outside the polygon area, if the distance D satisfies D > r + 2E, and the number of consecutive times of satisfying this condition reaches the preset threshold M times, it is determined that the target point leaves the polygon area; When the target point transfers from outside the polygon area to inside the polygon area, if the distance D satisfies D < r - 2E, and the number of consecutive times of satisfying this condition reaches the preset threshold M times, it is determined that the target point enters the polygon area; When the distance D of the target point does not meet the continuous counting condition, clear the previously accumulated continuous determination times and start counting again; After completing the determination of whether the target point enters or leaves the polygon area, it also includes the step of resetting the continuous determination times: When the state of the target point changes, clear the previously accumulated continuous determination times and start counting again.

7. A system for judging entry and exit of a polygonal area, characterized in that: The system includes: a mobile terminal application, a server, and a positioning terminal; The mobile terminal application is used to receive the longitude and latitude coordinates of the vertices of the polygon area input by the user, construct the minimum circumscribed circle of the polygon area according to the longitude and latitude coordinates of the vertices, determine the longitude and latitude of the center of the minimum circumscribed circle and the radius r, and upload the longitude and latitude of the polygon vertices, the longitude and latitude of the center of the minimum circumscribed circle, and the radius r to the server; The server is used to store the longitude and latitude coordinates of the vertices of the polygon area, the longitude and latitude of the center of the minimum circumscribed circle, the radius r, and the positioning error E; in response to the configuration request of the positioning terminal, send the longitude and latitude coordinates of the vertices of the polygon area and the longitude and latitude of the center of the minimum circumscribed circle to it; receive the in-out area event reported by the positioning terminal, and push a notification to the mobile terminal application. The positioning terminal is used to periodically obtain the positioning information of the target point, calculate the distance D from the target point to the center of the minimum circumscribed circle, obtain the preset positioning error E of the server, and execute the following decision logic: When the target point transfers from inside the polygon area to outside the polygon area, if the distance D satisfies D > r + 2E, and the number of consecutive times of satisfying this condition reaches the preset threshold M times, it is determined that the target point leaves the polygon area. When the target point transfers from outside the polygon area to inside the polygon area, if the distance D satisfies D < r - 2E, and the number of consecutive times of satisfying this condition reaches the preset threshold M times, it is determined that the target point enters the polygon area. When the positioning terminal determines that the target point enters or leaves the polygon area, it triggers an alarm or notification event, and reports the event to the server, and the server then pushes it to the mobile terminal application.

8. A terminal device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, it implements the steps of the method for judging entry and exit from a polygon area according to any one of claims 1 to 6.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by the processor, it implements the steps of the method for judging entry and exit from a polygon area according to any one of claims 1 to 6.