Associated information determination method, electronic equipment and storage medium
By obtaining the location information and names of the smart terminal equipment and the place, combining absolute judgment and slack judgment methods, the correlation information between the device and the place is determined, and the judgment error problem caused by position offset in the prior art is solved, and the accuracy of the correlation information is improved.
Patent Information
- Application Number
- CN202510263938.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-06
- Publication Date
- 2025-04-08
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, when determining the correlation information between the smart terminal device and the place, judgment errors and inaccuracies caused by position offset are prone to occur.
By acquiring the first location information and device name of the target device, and obtaining the area information and site name of the target site, the first location information and area information are used to determine the first location relationship, and when the target device is located outside the target site, the similarity judgment is made using the equipment name and site name to determine the second location relationship, and then the association information is determined based on the two.
It effectively improves the accuracy of the associated information, reduces judgment errors caused by position offset, and improves the accuracy of judging the position relationship between the equipment and the place.
Smart Images

Figure CN119782845A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data analysis, and in particular to a method for determining associated information, an electronic device, and a storage medium. Background Art
[0002] With the explosive growth of computer applications, the data of various smart scenarios is also increasing. In order to grasp the distribution of some fixed smart terminal devices and specific location areas (Area of Interest, AOI), it is necessary to analyze the device and location data based on the collected data to determine the location relationship between the location and the device, that is, to determine the associated information.
[0003] In current solutions for determining associated information, Euclidean distance is usually used for judgment, but there may be positional offsets, which may lead to erroneous and inaccurate judgments, thus affecting the accuracy of the associated information. Summary of the invention
[0004] The technical solution to the technical problem mainly solved by the present application is: to provide a method for determining associated information, an electronic device and a storage medium, by obtaining the first position information and device name of the target device, and obtaining the area information and the place name of the target place, and then determining the first position relationship with the first position information and the area information, and when the target device is outside the target place, determining the second position relationship with the device name and the place name, and then determining the associated information between the target device and the target place with the first position relationship and the second position relationship, which can effectively improve the accuracy of the associated information.
[0005] To solve the above technical problems, a technical solution adopted in the present application is: to provide a method for determining associated information, including: obtaining first location information and a device name of a target device, and obtaining area information and a place name of a target place; using the first location information and the area information, determining a first position relationship between the target device and the target place; in response to the target device being outside the target place, and the target distance between the target device and the target place being less than a distance threshold, using the device name and the place name to perform a similarity judgment, and determining a second position relationship between the target device and the target place; using the first position relationship and the second position relationship, determining the associated information between the target device and the target place.
[0006] In some embodiments, the use of the first position information and the area information to determine the first position relationship between the target device and the target place includes: using the area information to determine the area shape of the target place and obtaining boundary information of the area shape; using the boundary information and the first position information to determine the first position relationship between the target device and the target place.
[0007] In some embodiments, the using of the area information to determine the area shape of the target place and obtaining boundary information of the area shape includes: using the area information to determine the circumscribed rectangle of the target place and obtaining first boundary information of the circumscribed rectangle; the using of the boundary information and the first position information to determine the first position relationship between the target device and the target place includes: using the first boundary information and the first position information to determine the third position relationship between the target device and the circumscribed rectangle, and then using the third position relationship to determine the first position relationship.
[0008] In some embodiments, it also includes: in response to the target device being located within the circumscribed rectangle, using the area information to determine the polygon of the target location and obtaining second boundary information of the polygon; and using the second boundary information and the first position information to determine the first position relationship.
[0009] In some embodiments, before obtaining the second boundary information of the polygon, it also includes: obtaining the first longitude, first latitude, second longitude and second latitude of the first boundary information, and obtaining the third longitude and third latitude of the first position information. In response to the third longitude being between the first longitude and the second longitude, and the third latitude being between the first latitude and the second latitude, it is determined that the target device is within the circumscribed rectangle.
[0010] In some embodiments, the second boundary information includes multiple target endpoints of the polygon; the use of the second boundary information and the first position information to determine the first position relationship includes: obtaining a first straight line, wherein the first straight line passes through the first position information and is perpendicular to the first axial direction corresponding to the longitude; obtaining the fourth longitude and fourth latitude of the first target endpoint, and obtaining the fifth longitude and fifth latitude of the second target endpoint, and taking the line between the first target endpoint and the second target endpoint as the second straight line, wherein the second target endpoint is adjacent to the first target endpoint; in response to the second straight line intersecting the first straight line, using a preset judgment condition to determine the slope relationship between the third straight line and the second straight line, wherein the third straight line is the line between the first target endpoint and the first position information; and determining the first position relationship using the slope relationship.
[0011] In some embodiments, in response to the second straight line intersecting the first straight line, using a preset judgment condition, determining the slope relationship between the third straight line and the second straight line includes: obtaining a first value, wherein the first value is the number of endpoints where the second straight line intersects the first straight line; in response to the third straight line satisfying the preset judgment condition, superimposing a target value on the first value; traversing all of the target endpoints, and in response to the first value of the superimposed target value being an odd number, determining that the target device is located inside the polygon.
[0012] In some embodiments, it also includes: in response to the target device being located outside the circumscribed rectangle, using the first boundary information of the circumscribed rectangle and the first position information to determine the target distance between the target device and the circumscribed rectangle; obtaining the extension line of each boundary line of the polygon, and then obtaining the first intersection information of the extension line and the first position information; using the target distance, the first intersection information and the first position information to determine the arc distance between the target device and the polygon.
[0013] In some embodiments, in response to the target device being located outside the target place and the distance between the target device and the target place being less than a distance threshold, a similarity judgment is performed using the device name and the place name to determine a second positional relationship between the target device and the target place, including: in response to the arc distance being less than a preset distance threshold, word segmentation is performed on the device name and the place name, and a target dictionary is established; a first feature vector of the device name is determined using the target dictionary, and a second feature vector of the place name is determined; a similarity judgment is performed using the first feature vector and the second feature vector to determine a target similarity between the device name and the place name; the second positional relationship between the target device and the target place is determined using the target similarity; and in response to the target similarity being greater than a preset similarity threshold, it is determined that the target device is located within the target place.
[0014] To solve the above technical problems, another technical solution adopted in the present application is: to provide an electronic device, the electronic device comprising a memory and a processor coupled to the memory, the memory storing at least one computer program, and the at least one computer program, when loaded and executed by the processor, is used to implement the method as described above.
[0015] To solve the above technical problems, another technical solution adopted in the present application is: providing a computer-readable storage medium, the computer-readable storage medium having at least one program, and when the at least one program is loaded and executed by a processor, it is used to implement the above method.
[0016] Different from the current technology, the method for determining associated information provided by the present application includes: obtaining first location information and a device name of a target device, and obtaining regional information and a place name of a target place; using the first location information and the regional information to determine a first location relationship between the target device and the target place; in response to the target device being outside the target place and the distance between the target device and the target place being less than a distance threshold, using the device name and the place name to perform a similarity judgment to determine a second location relationship between the target device and the target place; using the first location relationship and the second location relationship to determine the associated information between the target device and the target place; that is, in the present application, by obtaining the first location information and the device name of the target device, and obtaining the regional information and the place name of the target place, and then determining the first location relationship with the first location information and the regional information, and when the target device is outside the target place, determining the second location relationship with the device name and the place name, and then determining the associated information between the target device and the target place with the first location relationship and the second location relationship, the combination of the absolute judgment method and the relaxed judgment method can effectively improve the accuracy of the judgment of the position offset, and thus improve the accuracy of the associated information. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them: Figure 1 It is a flowchart of an embodiment of a method for determining associated information in the present application; Figure 2 It is a schematic structural diagram of a polygonal embodiment of the present application; Figure 3a It is a schematic diagram of an embodiment in which point A is on the left side of the line segment in the present application; Figure 3b This is a schematic diagram of an embodiment in which point A is in the middle of a line segment in the present application; Figure 3c This is a schematic diagram of an embodiment in which point A is on the right side of the line segment in the present application; Figure 4 It is a structural diagram of an embodiment of a system for determining associated information in the present application; Figure 5 It is a structural schematic diagram of an embodiment of an electronic device in the present application; Figure 6 It is a structural diagram of an embodiment of a computer-readable storage medium in the present application. DETAILED DESCRIPTION
[0018] The present invention will be further described in detail below in conjunction with the accompanying drawings and examples. It is particularly noted that the following examples are only used to illustrate the present invention, but are not intended to limit the scope of the present invention. Similarly, the following examples are only partial embodiments of the present invention rather than all embodiments, and all other embodiments obtained by those of ordinary skill in the art without creative work are within the scope of protection of the present invention.
[0019] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0020] Traditional methods for determining associated information, especially for associating field equipment and venue areas, still rely on pure mathematical calculations of Euclidean distance to derive the relative position relationship between the two. However, in actual scenarios, the acquired longitude and latitude information of the equipment and venue may be offset, and the determination based on absolute distance may be erroneous and inaccurate, making it impossible to guarantee the accuracy of the association between venues and equipment.
[0021] Therefore, a method for determining associated information is provided, which determines a first position relationship through the first position information of the target device and the area information of the target place; and when the target device is located outside the target place, the second position relationship is determined using the device name and the place name, and then the associated information of the target device and the target place is determined based on the first position relationship and the second position relationship. The combination of absolute judgment method and relaxed judgment method can effectively improve the accuracy of judgment on position offset, thereby improving the accuracy of associated information.
[0022] See also Figure 1 , Figure 1 is a flowchart of an embodiment of a method for determining associated information in the present application; it should be noted that if there is a substantial result, the method of the present application is not based on Figure 1 The process sequence shown is limited.
[0023] like Figure 1 As shown, the method for determining associated information of the present application may include the following steps: S10: Acquire the first location information and device name of the target device, and acquire the area information and place name of the target place.
[0024] Among them, the target device refers to a smart terminal device, which can be associated with a place; the first location information refers to the geographical location information of the target device, such as longitude and latitude; the device name refers to the name of the target device; the target place refers to the set place area, which can be a specific place area or a set place area; the area information refers to the place information corresponding to the target place, which can include boundary information, endpoint information, etc.; the place name refers to the name of the target place.
[0025] Specifically, the first location information, device name, device number and other related information of the target device are obtained through the device information acquisition module; and the area information, venue name, venue number and other related information of the target venue are obtained through the venue information acquisition module; the relevant information can be actively uploaded to the system, or synchronized to the system from a third-party database.
[0026] S20: Determine a first position relationship between the target device and the target location by using the first position information and the area information.
[0027] The first position relationship refers to the position relationship between the target device and the target location determined by the geographical location information.
[0028] Specifically, after obtaining the first location information of the target device and the area information of the target place, the first location information and the area information can be used to determine the initial location relationship between the target device and the target place in terms of geographical location, that is, the first location relationship.
[0029] S30: In response to the target device being located outside the target place and the target distance between the target device and the target place being less than a distance threshold, similarity judgment is performed using the device name and the place name to determine a second positional relationship between the target device and the target place.
[0030] Among them, the target device can be inside or outside the target place, so it needs to be judged separately; similarity refers to the text similarity between the device name and the place name; the target distance refers to the distance between the target device and the target place, such as the Euclidean distance; the second positional relationship refers to the positional relationship between the target device and the target place determined by the similarity.
[0031] Specifically, when it is determined that the target device is outside the target place, it is necessary to obtain the target distance between the target device and the target place, and compare the target distance with a preset distance threshold. Then, when the target distance is less than the distance threshold, the text similarity of the device name and the place name is judged to determine the second position relationship.
[0032] S40: Determine association information between the target device and the target location by using the first position relationship and the second position relationship.
[0033] Among them, because the first position relationship is the position relationship corresponding to the geographical location information, and the second position relationship is the position relationship corresponding to the text similarity, they can be combined for comprehensive judgment.
[0034] Specifically, after the second position relationship is acquired, the first position relationship and the second position relationship are directly used to perform a comprehensive judgment, thereby determining the association information between the target device and the target location.
[0035] In this embodiment, by obtaining the absolute position relationship between the target device and the target place, that is, the first position relationship, and obtaining the relaxed position relationship between the target device and the target place, that is, the second position relationship, the association information between the target device and the target place is determined. The combination of the absolute judgment method and the relaxed judgment method can effectively improve the accuracy of the judgment of the position offset situation, thereby improving the accuracy of the association information.
[0036] In some embodiments, S20 may include the following operation steps.
[0037] The area information is used to determine the area shape of the target location and obtain the boundary information of the area shape.
[0038] Among them, the area shape refers to the shape corresponding to the area of the target place, which can be a quadrilateral, pentagon, hexagon or other polygon; the boundary information refers to the boundary-related information of the target place, such as the endpoint information of the polygon, the connection information between the endpoints, etc.
[0039] Specifically, after the region information of the target place is obtained, the approximate shape of the target place can be determined using the region information, that is, the region shape can be obtained, and then the boundary information of the region shape can be obtained for the obtained region shape.
[0040] The first position relationship between the target device and the target location is determined using the boundary information and the first position information.
[0041] Among them, because the boundary information corresponds to the area shape of the target place, the first position relationship between the target device and the target place can be determined. The first position relationship refers to the straight-line distance determined by the first position information of the target device and the boundary information of the target place.
[0042] Specifically, after the shape of the area is acquired, the straight-line distance between the target device and the target place, ie, the first position relationship, is calculated based on the boundary information corresponding to the target place and the first position information corresponding to the target device.
[0043] In this embodiment, by obtaining boundary information corresponding to the area shape of the target place, and then using the boundary information and the first position information of the target device to determine the first position relationship of the target device to the target place, the absolute judgment method can be used to obtain the accurate straight-line distance between the target device and the target place, thereby providing accurate data support for the follow-up.
[0044] Furthermore, the following operations may also be included.
[0045] The area information is used to determine the bounding rectangle of the target location, and first boundary information of the bounding rectangle is obtained.
[0046] The circumscribed rectangle refers to a rectangle that contains and contacts the target location, and the first boundary information refers to boundary-related information of the circumscribed rectangle, which may include endpoint information of the circumscribed rectangle and line information between endpoints and adjacent endpoints.
[0047] Specifically, after obtaining the area information of the target place, the area information can be used to determine the approximate shape of the target place, that is, to obtain the area shape, and then use a rectangle to frame the area shape, and the rectangle is inscribed with the sides of the area shape, and the rectangle is the circumscribed rectangle. Then, for the obtained circumscribed rectangle, the boundary-related information of the circumscribed rectangle, that is, the first boundary information, is obtained.
[0048] The first boundary information and the first position information are used to determine a third position relationship between the target device and the circumscribed rectangle, and then the first position relationship is determined using the third position relationship.
[0049] The third position relationship refers to the direct distance between the target device and the circumscribed rectangle.
[0050] Specifically, after obtaining the first boundary information of the circumscribed rectangle, the straight-line distance between the target device and the circumscribed rectangle can be determined, that is, the positional relationship between the target device and the circumscribed rectangle, that is, the third positional relationship, is calculated using the first boundary information of the circumscribed rectangle and the first position information of the target device. Then, the third positional relationship is used to determine whether the target device is in the target location or in the target location, that is, the first positional relationship.
[0051] In this embodiment, by obtaining the circumscribed rectangle of the target location, the area shape of the target location can be effectively reduced, thereby effectively improving the accuracy of determining whether the target device is inside or outside the target location.
[0052] Furthermore, the following operations may also be included.
[0053] In response to the target device being located within the circumscribed rectangle, the polygon of the target location is determined using the area information, and second boundary information of the polygon is acquired.
[0054] Among them, in response to the target device being located within the circumscribed rectangle, it means that the circumscribed rectangle frames both the target place and the target device within the circumscribed rectangle; the polygon refers to the shape of the area corresponding to the further refinement of the target place, which can be a regular polygon or an irregular polygon. The number of sides of the polygon can be set according to actual conditions, such as a pentagon, hexagon, heptagon, etc.
[0055] Specifically, when the target device is determined to be within the circumscribed rectangle using the third positional relationship, the polygon of the target location is further determined using the area information, that is, based on the circumscribed rectangle, the range of the circumscribed polygon is further narrowed to obtain the second boundary information corresponding to the polygon.
[0056] The first position relationship is determined using the second boundary information and the first position information.
[0057] The second boundary information corresponds to the polygon of the target place, and the first position information corresponds to the target device. Therefore, a first position relationship between the target device and the target place can be determined.
[0058] Specifically, after obtaining the second boundary information corresponding to the polygon, the straight-line distance between the polygon and the target device can be determined. Because the second boundary information of the polygon can be infinitely close to the target place, the second boundary information and the first position information can be used to determine the straight-line distance between the target device and the target place, that is, the first position relationship.
[0059] In this embodiment, by acquiring the polygon corresponding to the target location, the area shape of the target location can be further reduced, and the accuracy of determining whether the target device is inside or outside the target location can be further effectively improved.
[0060] Furthermore, before obtaining the second boundary information of the polygon, the following operations may also be included.
[0061] The first longitude, the first latitude, the second longitude and the second latitude of the first boundary information are acquired, and the third longitude and the third latitude of the first position information are acquired.
[0062] Among them, the first boundary information corresponds to the circumscribed rectangle, therefore, the first longitude can be the minimum longitude of the circumscribed rectangle, the second longitude is the maximum longitude of the circumscribed rectangle, the first latitude is the minimum latitude of the circumscribed rectangle, and the second latitude is the maximum latitude of the circumscribed rectangle; the first position information corresponds to the position information of the target device, therefore, the third longitude is the longitude coordinate of the target device in the longitude and latitude coordinate system, and the third latitude is the latitude coordinate of the target device in the longitude and latitude coordinate system.
[0063] In response to the third longitude being between the first longitude and the second longitude, and the third latitude being between the first latitude and the second latitude, it is determined that the target device is located within the bounding rectangle.
[0064] Specifically, if the third longitude is between the first longitude and the second longitude, and the third latitude is between the first latitude and the second latitude, it means that the first location information is inside the circumscribed rectangle, that is, the target device is inside the circumscribed rectangle. If the above conditions are not met, it means that the target device is outside the circumscribed rectangle.
[0065] For example, the first longitude of the bounding rectangle is the minimum longitude , the second longitude is the maximum longitude , the first latitude is the minimum latitude , the second latitude is the maximum latitude , then the coordinates of the upper left corner of the circumscribed rectangle are ( , ), the coordinates of the lower left corner are ( , ), the coordinates of the upper right corner are ( , ), the coordinates of the lower right corner are ( , ), the coordinates of the target device are: ; then yes, if the following conditions are met: ,and ; If the target device is within the bounding rectangle, it means that the target device is within the bounding rectangle; otherwise, it means that the target device is outside the bounding rectangle.
[0066] Furthermore, the following operations may also be included.
[0067] A first straight line is obtained, wherein the first straight line passes through the first position information and is perpendicular to a first axial direction corresponding to the longitude.
[0068] Among them, the second boundary information includes multiple target endpoints of the polygon, the target endpoint refers to the endpoint between the boundary line and the boundary line of the polygon, and the second boundary information can also include the connection information between adjacent target endpoints of the polygon; the first axis refers to the X-axis in the longitude and latitude coordinate system, and the longitude is parallel to the X-axis in the longitude and latitude coordinate system, that is, the first straight line passes through the first position information of the target device and is perpendicular to the X-axis in the longitude and latitude coordinate system.
[0069] The fourth longitude and fourth latitude of the first target endpoint are obtained, and the fifth longitude and fifth latitude of the second target endpoint are obtained, and a line connecting the first target endpoint and the second target endpoint is used as a second straight line, wherein the second target endpoint is adjacent to the first target endpoint.
[0070] The first target endpoint and the second target endpoint refer to two adjacent target endpoints in the polygon.
[0071] Specifically, two adjacent target endpoints in the polygon are obtained, one of which is the first target endpoint and the other is the second target endpoint, and then the longitude and latitude of the first target endpoint, i.e., the fourth longitude and the fourth latitude, are obtained, and the longitude and latitude of the adjacent second target endpoint, i.e., the fifth longitude and the fifth latitude, are obtained.
[0072] In response to the second straight line intersecting the first straight line, a slope relationship between a third straight line and the second straight line is determined using a preset judgment condition, wherein the third straight line is a line connecting the first target endpoint and the first position information.
[0073] The second straight line intersects the first straight line, that is, the first target endpoint is on one side of the first straight line, and the second target endpoint is on the other side of the first straight line. For example, if the first target endpoint is on the left side of the first straight line, the second target endpoint is on the right side of the first straight line.
[0074] Specifically, after obtaining the second straight line between the first target endpoint and the second target endpoint, determine whether the second straight line intersects with the first straight line, and when the second straight line intersects with the first straight line, obtain the connection line between the first target endpoint and the first position information of the target device as the third straight line, and then use the preset judgment condition to determine the slope relationship between the third straight line and the second straight line.
[0075] The preset judgment condition is set using the longitude and latitude of the target endpoint, that is, when the second straight line intersects the first straight line, the longitude and latitude are used to judge the slope relationship between the third straight line and the second straight line.
[0076] The first position relationship is determined using the slope relationship.
[0077] The slope relationship represents a comparison between the slope of a line connecting the first target endpoint and the first position relationship and the slope of a line connecting the first target endpoint and the second target endpoint.
[0078] Specifically, after obtaining the slope relationship between the third straight line and the second straight line corresponding to multiple target endpoints, the straight-line distance between the target device and the polygon can be determined, that is, the first position relationship between the target device and the target location can be determined.
[0079] For example, the target location is defined as a polygonal area, and the boundary of the polygon is represented by a series of ordered longitude and latitude coordinates. The boundary of the target location is determined by sequentially connecting the longitude and latitude endpoints of the polygonal boundary, where the connection between two longitude and latitude endpoints constitutes a boundary line, and the polygon contains multiple boundary lines.
[0080] See also Figure 2 , Figure 2 It is a schematic structural diagram of a polygonal embodiment of the present application.
[0081] like Figure 2 As shown, the first axis of the latitude and longitude coordinate system is the lon axis, and the second axis is the lat axis; the target endpoints of the polygon include V0, V1, V2, ..., V n-2 、V n-1 、V n , where the line between two adjacent target endpoints constitutes a boundary line, such as V0V1, V1V2, ..., V n-1 V n 、V n V1; and the polygon has the following characteristics: (1) all endpoints are different from each other; (2) any endpoint belongs only to the edge where the endpoint is located; (3) it is composed only of non-intersecting line segments. The coordinate values of the polygon are as follows: V1(lon1, lat1), V2(lon2, lat2), ..., V n (lon n ,lat n ); Assume that the first position information of the target device is: A(lon, lat); then draw a line perpendicular to the lon axis through point A and intersect the lon axis, intersecting the S and T intersections of the polygon, that is, ST is the first straight line; take V1 as the first target endpoint, then V n As the second target endpoint, both V n V1 is the second straight line, and V1A is the third straight line.
[0082] Furthermore, the following operations may also be included.
[0083] A first value is obtained, wherein the first value is the number of target endpoints at which the slope of the third straight line is greater than the slope of the second straight line.
[0084] The initial value of the first value is set to 0.
[0085] Specifically, the number of target endpoints whose slope of the third straight line is greater than the slope of the second straight line is counted as the first value.
[0086] In response to the third straight line satisfying the preset judgment condition, the target value is superimposed on the first value.
[0087] The third straight line satisfies a preset judgment condition, that is, the slope of the third straight line is greater than the slope of the second straight line.
[0088] Specifically, after obtaining the first value, the third straight line is judged using a preset judgment condition. If the slope of the third straight line is greater than the slope of the second straight line, it means that the third straight line meets the preset judgment condition, and then the target value is superimposed on the first value. In some embodiments, the target value can be 1, that is, the first value is superimposed with 1.
[0089] Traverse all target endpoints, and if the first numerical value of the superimposed target value is odd, determine that the target device is inside the polygon.
[0090] Among them, since each polygon has multiple target endpoints and each target endpoint needs to be judged, it is necessary to traverse all target endpoints to obtain the final first numerical value.
[0091] Specifically, determine the number of target endpoints of the polygon, and then traverse all target endpoints, that is, use the preset judgment condition to perform the corresponding third straight line judgment on all target endpoints, that is, judge whether the slope of the third straight line is greater than the slope of the second straight line. And when the slope of the third straight line is greater than the slope of the second straight line, add a target value to the first straight line. If multiple target endpoints meet the preset judgment condition, the first numerical value is superimposed with multiple target values, and the final first numerical value after superposition is used for judgment. If the final first numerical value is odd, it is determined that the first position information of the target device is inside the polygon; otherwise, the first position information of the target device is outside the polygon.
[0092] Continue to refer to Figure 2 Then, traverse each endpoint V of the polygon i If point A coincides with any endpoint, it is determined that point A is inside the area of the polygon.
[0093] For example, define a flag value, that is, the first numerical value f, and set the initial value to 0. Then use the line position method to judge. Specifically: traverse each endpoint Vi of the polygon, judge whether the endpoint Vi is on the left side of the first straight line ST, and determine whether the adjacent endpoint Vi-1 or Vi+1 is on the right side of the first straight line. Especially when i = 1, Vi-1 = Vi, and when i = n, Vi-1 = Vn. Then judge whether the third straight line (Vi, Vi+1) or (Vi-1, Vi) meets the following preset judgment conditions.
[0094] Preset judgment condition 1: When lon i < lon, and at the same time lon i+1 > lon, judge whether the relationship (V i , V i+1 ) satisfies: (lat - Vi·lat)(Vi+1·lon - Vi·lon) - (Vi+1·lat - Vi·lat)(lon - Vi·lon)>0. If it is satisfied, then f = f + 1.
[0095] Preset judgment condition 2: When lon i < lon, and at the same time lon i-1 > lon, judge the relationship (V i , V i-1), whether it meets: (lat-Vi·lat)(Vi-1·lon-Vi·lon)-(Vi-1·lat-Vi·lat)(lon-Vi·lon)>0, if it satisfies, then f=f+1.
[0096] After traversing all the endpoints of the polygon, determine the parity of the first value f. If the first value is an odd number, point A is within the area of the polygon; otherwise, point A is outside the area of the polygon.
[0097] In this embodiment, the positional relationship between the target device and the polygon is more accurately determined by judging the intersection of the first straight line and the second straight line and then judging the slope relationship between the second straight line and the third straight line.
[0098] Furthermore, the following operations may also be included.
[0099] In response to the target device being outside the bounding rectangle, a target distance between the target device and the bounding rectangle is determined using first boundary information and first position information of the bounding rectangle.
[0100] The target distance refers to the straight-line distance between the target device and the external matrix.
[0101] Specifically, if the target device is outside the bounding rectangle, it is necessary to calculate the straight-line distance between the target device and the bounding rectangle; that is, using the first boundary information of the bounding rectangle and the first position information of the target device, calculate the straight-line distance between the target device and the bounding rectangle, that is, the target distance.
[0102] The extension line of each boundary line of the polygon is obtained, and then the first intersection point information of the extension line and the first position information is obtained.
[0103] The polygon may include a plurality of boundary lines. In order to obtain the first intersection information between the first position information and the boundary lines, the boundary lines may be extended to obtain extended lines.
[0104] Specifically, the boundary line of the corresponding polygon is extended to obtain an extended line, and then the first intersection point information of the vertical line between the extended line and the first position information is obtained, and the vertical line is also the minimum distance between the first position information and the extended line.
[0105] The arc distance between the target device and the polygon is determined using the target distance, the first intersection point information and the first position information.
[0106] The arc distance refers to the arc distance corresponding to the arc of the angle between two points and the center of the earth. Therefore, the angle between the center of the earth also needs to be used for calculation.
[0107] Specifically, after obtaining the first intersection information, the radian of the angle between the first intersection information and the first position information and the center of the earth is determined, and then the arc distance between the first position information and the first intersection information of the target device is calculated using the target distance, the first position information and the radian.
[0108] See also Figure 3a , Figure 3b and Figure 3c , Figure 3a It is a schematic diagram of an embodiment in which point A is on the left side of the line segment in the present application; Figure 3b This is a schematic diagram of an embodiment in which point A is in the middle of a line segment in the present application; Figure 3c This is a schematic diagram of an embodiment in which point A is on the right side of the line segment in the present application.
[0109] For example, the first position information is A (lon, lat), B (lon1, lat1) represents the starting point of the boundary line segment, C (lon2, lat2) represents the end point of the boundary line segment, and the first intersection information is D. Then the distance from point A to line segment BC can be divided into the following three cases.
[0110] The first case: When (lon2 - lon1)×(lon - lon1) + (lat2 - lat1)×(lat -lat1)<0, ∠A is an obtuse angle, C is on the left side of line segment AB, and the shortest distance is AC, such as Figure 3a .
[0111] The second case: When (lon2 - lon1)×(lon - lon1) + (lat2 - lat1)×(lat -lat1)>(lon2 - lon1)×(lon2 - lon1) + (lat2 - lat1×(lat2 - lat1), ∠B is an obtuse angle and the shortest distance is BC, such as Figure 3c .
[0112] The third case: When ∠A and ∠B are not obtuse angles, the shortest distance is the perpendicular distance from C to line segment AB, such as Figure 3b The coordinates of the intersection of the perpendicular line CD and the line segment AB are expressed as ,in, , , r = (lon2 - lon1)×(lon - lon1) + (lat2 - lat1)×(lat - lat1) / (lon2- lon1)×(lon2 - lon1) + (lat2 - lat1) × (lat2 - lat1).
[0113] Then determine C (lon, lat) and the vertical point D The radian of the angle with the center of the earth may include a first radian H1 and a second radian H2. The first radian H1 is calculated as follows: ; Or the second radian H2 is calculated as follows: ; Then, use radians to calculate C (lon, lat) and the vertical point D The arc distance L between them may include a first arc distance L1 and a second arc distance L2, that is, the first arc distance L1 is calculated as follows: ; Alternatively, the arc distance L2 is calculated as follows: ; The unit is m.
[0114] In this embodiment, the shortest distance between the target device and the polygon, ie, the arc distance, is determined by acquiring the first position information of the target device and the first intersection information of the extension line of the polygon boundary line, thereby further improving the accuracy of the calculation result.
[0115] In some embodiments, the following operations may also be included.
[0116] In response to the arc distance being less than a preset distance threshold, the device name and the place name are segmented and a target dictionary is established.
[0117] Among them, the preset distance threshold is to further determine the location of the target device and the target place; the target dictionary refers to a dictionary composed of text information of the name; the arc distance is less than the preset distance threshold, indicating that the target device and the target place are relatively close, and misjudgment may occur, so further analysis and judgment are needed.
[0118] Specifically, in the case where it is determined that the target device is outside the target place, a preset distance threshold is set in advance, and the arc distance is compared with the preset distance threshold. When the arc distance is less than the preset distance threshold, the device name and the place name are subjected to corresponding word segmentation processing, and then the content obtained from the word segmentation processing is constructed into a dictionary.
[0119] For example, remove the noise words that appear in the text of the equipment name and the place name, that is, remove the noise words that appear in the name: "road", "road", letters, numbers, etc., so as to highlight the high-value keywords. Further replace the special symbols of the processed text, such as: "-", "_", "+", "*", " / ", "~", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "{", "}", "[", " / ", "]", "\", "'", "," "·", "."", ".", "," ";", "" "," "" "," "" "="", "=", "`", etc. Special symbols in the name are often decomposition symbols of two words, so they can be replaced. Space characters can be used to replace special symbols to improve the accuracy of word segmentation. Spaces can be used to separate common characters before and after, such as the common characters XXX in the equipment name XXXX and the common characters XX in the place name XXXX.
[0120] The two processed texts are then input into the word segmentation module. Based on each character, it is determined whether the next character can form a phrase with the current character. If so, it is used as a token and the segmentation is continued until the entire text is traversed. The words that appear in the two texts are then constructed into a dictionary.
[0121] It can be understood that if the arc distance is greater than the preset distance threshold, it indicates that the target device is located outside the target location.
[0122] A first feature vector of the device name is determined using the target dictionary, and a second feature vector of the place name is determined.
[0123] The first feature vector represents the text feature of the device name, and the second feature vector represents the place name.
[0124] Specifically, the constructed dictionary is used to convert the text into a feature vector, that is, one word corresponds to one index, and the index is used as the feature vector.
[0125] For example, the device name includes: city name, street name, village name, location name, and the place name includes: district name, street name, village name, and road name. The dictionary is constructed with the above-mentioned contents, and the city name index is set to 0, the district name index is 1, the street name index is 2, the village name index is 3, the location name index is 4, and the road name index is 5. Then, the first text feature corresponding to the device name is generated: 101110, and the second text feature corresponding to the place name is generated: 011101; wherein, 1 in the text feature indicates that there is such a name, and 0 in the text feature indicates that there is no such name.
[0126] The first feature vector and the second feature vector are used to perform similarity judgment to determine the target similarity between the device name and the place name.
[0127] The similarity judgment refers to performing cosine similarity judgment using the first characteristic vector and the second characteristic vector, and taking the calculated similarity as the target similarity.
[0128] Specifically, after obtaining the first eigenvector and the second eigenvector, the similarity of the angle between the first eigenvector and the second eigenvector is measured, and cosine similarity may be used for measurement.
[0129] For example, given two non-zero vectors E and F, the cosine similarity between E and F is: ; Where E·F represents the dot product of vectors E and F. , are the magnitudes (Euclidean norms) of vectors E and F respectively.
[0130] Because the value range of cosine similarity is [-1, 1], when the directions of two vectors are exactly the same, the similarity is 1; when the directions of two vectors are orthogonal, that is, vertical, the similarity is 0; when the directions of two vectors are completely opposite, the similarity is -1.
[0131] The target similarity is used to determine a second positional relationship between the target device and the target location.
[0132] A similarity threshold may also be set, and then the target similarity is compared with the similarity threshold to determine the second positional relationship between the target device and the target location.
[0133] Specifically, a similarity threshold is set, and the target similarity is compared with the similarity threshold. If the target similarity is greater than the similarity threshold, it is determined that the target device is within the target location; if the target similarity is less than the similarity threshold, it is determined that the target device is outside the target location.
[0134] In some embodiments, the associated result data can also be pushed to a relational database. The associated result data can be pushed to a relational database, and the backend retrieves and returns it to the frontend for display. The frontend can click on the map to view the relative position relationship between the device and the place.
[0135] In this embodiment, through the text similarity judgment method, the target device that is not in the target place according to the above distance judgment is further relaxed. By effectively combining the absolute judgment and the relaxed judgment, the positional relationship between the target device and the target place can be determined more accurately.
[0136] In some embodiments, the present application also provides a system for determining associated information.
[0137] See also Figure 4 , Figure 41 is a schematic diagram of a structure of an embodiment of a system for determining related information in the present application. The system for determining related information can execute the steps of the method for determining related information in the above method.
[0138] The association information determination system 400 includes: a device information acquisition module 410, a place information acquisition module 420, an absolute relationship determination module 430, a loose relationship determination module 440, and a data interaction display module 450. The device information acquisition module 410 is used to obtain the first position information and device name of the target device; the place information acquisition module 420 is used to obtain the area information and place name of the target place; the absolute relationship determination module 430 uses the first position information and area information to determine the first position relationship between the target device and the target place; in response to the target device being outside the target place and the target distance between the target device and the target place being less than the distance threshold, the loose relationship determination module 440 uses the device name and the place name to perform similarity judgment and determine the second position relationship between the target device and the target place; the data interaction display module 450 uses the first position relationship and the second position relationship to determine the association information between the target device and the target place, and displays the association information.
[0139] In some embodiments, the present application also provides an electronic device.
[0140] See also Figure 5 , Figure 5 1 is a schematic diagram of the structure of an electronic device in an embodiment of the present application. The electronic device can execute the steps of the method for determining the associated information in the above method.
[0141] The electronic device 500 includes a memory 520, a processor 510 coupled to the memory, and at least one computer program stored in the memory 520 and executable on the processor 510; when the processor 510 loads and executes the at least one computer program, it is used to implement the step of determining the associated information in the above method. For related contents, please refer to the detailed description in the above method, which will not be repeated here.
[0142] In some embodiments, a computer-readable storage medium is also included.
[0143] See also Figure 6 , Figure 6 It is a structural diagram of an embodiment of a computer-readable storage medium in the present application.
[0144] The computer readable storage medium 600 stores at least one program 610, which is used to implement the step of determining the associated information in the above method when loaded and executed by the processor. For related contents, please refer to the detailed description of the above method, which will not be repeated here.
[0145] The above scheme obtains the first location information and device name of the target device, and obtains the area information and place name of the target place, and then determines the first location relationship with the first location information and area information, and when the target device is outside the target place, determines the second location relationship using the device name and place name, and then determines the association information between the target device and the target place with the first location relationship and the second location relationship, which can effectively improve the accuracy of the association information.
[0146] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0147] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0148] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0149] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0150] The above description is only an implementation mode of the present invention, and does not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for determining associated information, characterized in that: include: Acquire the first location information and device name of the target device, and acquire the area information and place name of the target place; Determine a first position relationship between the target device and the target location using the first position information and the area information; In response to the target device being located outside the target place and the target distance between the target device and the target place being less than a distance threshold, performing similarity judgment using the device name and the place name to determine a second positional relationship between the target device and the target place; The association information between the target device and the target place is determined by using the first position relationship and the second position relationship.
2. The method according to claim 1, characterized in that: The determining a first position relationship between the target device and the target place by using the first position information and the area information includes: Determine the area shape of the target location using the area information, and obtain boundary information of the area shape; The first position relationship between the target device and the target place is determined by using the boundary information and the first position information.
3. The method according to claim 2, characterized in that The step of determining the area shape of the target location by using the area information and acquiring boundary information of the area shape includes: Determine a bounding rectangle of the target location using the area information, and obtain first boundary information of the bounding rectangle; The determining a first position relationship between the target device and the target place by using the boundary information and the first position information includes: The third positional relationship between the target device and the circumscribed rectangle is determined by using the first boundary information and the first positional information, and the first positional relationship is further determined by using the third positional relationship.
4. The method according to claim 3, characterized in that Also includes: In response to the target device being located within the circumscribed rectangle, determining a polygon of the target location using the area information, and acquiring second boundary information of the polygon; The first position relationship is determined using the second boundary information and the first position information.
5. The method according to claim 4, characterized in that Before obtaining the second boundary information of the polygon, the method further includes: Acquire a first longitude, a first latitude, a second longitude, and a second latitude of the first boundary information, and acquire a third longitude and a third latitude of the first location information; In response to the third longitude being between the first longitude and the second longitude, and the third latitude being between the first latitude and the second latitude, it is determined that the target device is located within the circumscribed rectangle.
6. The method according to claim 4, characterized in that The second boundary information includes a plurality of target endpoints of the polygon; The determining the first position relationship by using the second boundary information and the first position information includes: Acquire a first straight line, wherein the first straight line passes through the first position information and is perpendicular to a first axial direction corresponding to the longitude; Acquire a fourth longitude and a fourth latitude of a first target endpoint, and acquire a fifth longitude and a fifth latitude of a second target endpoint, and use a line connecting the first target endpoint and the second target endpoint as a second straight line, wherein the second target endpoint is adjacent to the first target endpoint; In response to the second straight line intersecting the first straight line, using a preset judgment condition, determining a slope relationship between a third straight line and the second straight line, wherein the third straight line is a line connecting the first target endpoint and the first position information; The first position relationship is determined using the slope relationship.
7. The method according to claim 6, characterized in that In response to the second straight line intersecting the first straight line, determining the slope relationship between the third straight line and the second straight line using a preset judgment condition includes: Obtaining a first value, wherein the first value is the number of target endpoints where the slope of the third straight line is greater than the slope of the second straight line; In response to the third straight line satisfying the preset judgment condition, superimposing a target value on the first value; All the target endpoints are traversed, and in response to the first value of the superimposed target value being an odd number, it is determined that the target device is located inside the polygon.
8. The method according to claim 4, characterized in that Also includes: In response to the target device being outside the bounding rectangle, determining a target distance between the target device and the bounding rectangle by using first boundary information of the bounding rectangle and the first position information; Obtaining an extension line of each boundary line of the polygon, and then obtaining first intersection information of the extension line and the first position information; The arc distance between the target device and the polygon is determined by using the target distance, the first intersection information and the first position information.
9. The method according to claim 8, characterized in that The using the device name and the place name to perform similarity judgment to determine the second positional relationship between the target device and the target place includes: In response to the arc distance being less than a preset distance threshold, performing word segmentation processing on the device name and the place name, and establishing a target dictionary; Determine a first feature vector of the device name and a second feature vector of the place name using the target dictionary; Performing similarity judgment using the first feature vector and the second feature vector to determine a target similarity between the device name and the place name; Determining a second positional relationship between the target device and the target location using the target similarity; In response to the target similarity being greater than a preset similarity threshold, it is determined that the target device is located in the target location.
10. An electronic device, characterized in that: The electronic device includes a memory and a processor coupled to the memory, the memory stores at least one computer program, and when the at least one computer program is loaded and executed by the processor, it is used to implement the method according to any one of claims 1 to 9.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium has at least one program, and when the at least one program is loaded and executed by the processor, it is used to implement the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Geofence detection method and device and electronic equipment
CN115209349A
Position determination method and device of monitoring equipment, terminal and storage medium
CN115243191A
Position determination method and device of monitoring equipment, storage medium and electronic device
CN116261101A
Associated information determination method and device, electronic equipment and storage medium
CN118354279A
Region and device association method, computer device and storage medium
CN119254827A