Region and device association method, computer device and storage medium

By acquiring and encoding the location data of the processing area and the device and determining its relative position relationship, the problems of low efficiency and low accuracy of the region and device association in the prior art are solved, and more accurate and efficient correlation is achieved.

CN119254827AActive Publication Date: 2025-01-03ZHEJIANG DAHUA TECH CO LTD

Patent Information

Application Number
CN202411778025.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-01-03
Estimated Expiration
2044-12-05

AI Technical Summary

Technical Problem

The existing regional and device association methods rely on user operations, are inefficient and error-prone, resulting in low correlation accuracy.

Method used

通过获取目标区域和设备的位置数据,利用GeoHash编码转换确定相对位置关系,基于此关系确定设备与区域的关联关系,并在设备位于区域外时,利用设备与区域的相关信息进一步确定关联关系。

Benefits of technology

Improve the accuracy of the correlation between the equipment and the area, reduce human errors, and improve correlation efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119254827A_ABST
    Figure CN119254827A_ABST
Patent Text Reader

Abstract

The invention discloses a region and equipment association method, computer equipment and a storage medium. The method comprises the following steps: respectively obtaining area position data of a target area and device position data of a plurality of devices to be associated; determining a relative position relationship between the target area and each device by using the area position data and the device position data; determining an association relationship between the target area and the equipment based on the relative position relationship; wherein under the condition that the relative position relationship is that the equipment is located outside the target area, the association relationship between the target area and the equipment is determined by utilizing related information between the equipment and the target area. According to the scheme, the accuracy of association between the equipment and the region can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a method for associating a region with a device, a computer device, and a storage medium. Background Art

[0002] With the development of computer technology, various devices are applied in many fields. Then, in some application scenarios, devices usually need to be associated with specific areas in order to effectively complete their tasks. However, the current area-device association method often relies on user operations for association, which is inefficient and prone to errors, resulting in low accuracy in the association between devices and areas. Summary of the invention

[0003] The main technical problem solved by the present application is to provide a method for associating a region with a device, a computer device and a storage medium, which can improve the accuracy of associating a device with a region.

[0004] In a first aspect, the present application provides a method for associating an area with a device, the method comprising: respectively acquiring area location data of a target area and device location data of a number of devices to be associated; determining a relative position relationship between the target area and each device using the area location data and the device location data; determining an association relationship between the target area and the device based on the relative position relationship; wherein, when the relative position relationship is that the device is located outside the target area, determining an association relationship between the target area and the device using relevant information between the device and the target area.

[0005] A second aspect of the present application provides a computer device, which includes a memory and a processor coupled to each other, wherein program data is stored in the memory, and the processor is used to execute the program data to implement any step of the above-mentioned method for associating a region with a device.

[0006] A third aspect of the present application provides a computer-readable storage medium, which stores program data that can be executed by a processor, and the program data is used to implement any step of the above-mentioned method for associating a region with a device.

[0007] The above scheme obtains the regional location data of the target area and the device location data of several devices to be associated respectively, and uses the regional location data and the device location data to determine the relative position relationship between the target area and each device. Based on the relative position relationship, the association relationship between the target area and the device can be determined. When the relative position relationship is that the device is outside the target area, the relevant information between the device and the target area can be used to determine the association relationship between the target area and the device. The association relationship of devices outside the target area can be determined more accurately, thereby improving the accuracy of the association between devices and areas as a whole.

[0008] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] In order to more clearly illustrate the technical solutions in this application, the following briefly introduces the drawings required in the description of the embodiments. Obviously, the drawings described below are only some embodiments of this 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 the first embodiment of the method for associating regions with devices of the present application; Figure 2 It is a flowchart of the second embodiment of the method for associating regions with devices of the present application; Figure 3 It is a flowchart of the third embodiment of the method for associating regions with devices of the present application; Figure 4 It is a structural schematic diagram of an embodiment of an apparatus for associating a region with a device of the present application; Figure 5 It is a structural schematic diagram of an embodiment of a computer device of the present application; Figure 6 It is a structural diagram of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION

[0010] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0011] The terms "first" and "second" in this application are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first" and "second" can explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "multiple" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices.

[0012] Reference to "embodiments" in this application 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 application. The appearance of the phrase in various locations 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.

[0013] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the objects associated before and after are in an "or" relationship. In addition, "many" in this article means two or more than two. In addition, the term "at least one" in this article means any combination of at least two of any one or more of a plurality of, for example, including at least one of A, B, and C, can mean including any one or more elements selected from the set consisting of A, B, and C.

[0014] The present application provides the following embodiments, and each embodiment is described in detail below.

[0015] It is understandable that the method for associating a region with a device in the present application can be executed by a computer device, and the computer device can be any device with processing capabilities, such as a mobile device, a computer, a server, etc., and the present application does not limit this. In some possible implementations, the method for associating a region with a device can be implemented by a processor calling program data stored in a memory.

[0016] See also Figure 1 , Figure 1 This is a flow chart of the first embodiment of the method for associating a region with a device of the present application. The method may include the following steps: S11: Acquire the area location data of the target area and the device location data of several devices to be associated respectively.

[0017] Among them, the device can be an electronic device, a movable device, an intelligent device or an object, etc., and the plurality of devices can refer to one, two or more devices, etc., and can be any device to be associated, for example, the plurality of devices can be devices of the same type or devices of different types, etc., and this application does not limit the device. The target area can be an area where the device needs to be associated, and the target area can be a polygonal geometric area, such as a square, a circle, a rectangle, an irregular shape, etc., and this application does not limit the target area.

[0018] The regional location data of the target area can be obtained, and the regional location data can be used to represent the location information of the target area, such as geographic coordinates, data obtained by processing the geographic coordinates, etc. Optionally, the target area and the regional location data can be determined in response to the regional information input by the user, and the input regional information can be a defined regional range, a regional name of the area, a geographical area, etc., which is not limited in this application.

[0019] Obtain device location data of several devices to be associated, and the device location data can be used to represent the location information of the device, such as geographic coordinates, data obtained by processing geographic coordinates, etc. Optionally, the several devices to be associated can be all devices, devices related to the target area, devices located in the collection range of the target area, etc., and this application does not limit this. Exemplarily, several devices located in the collection range of the target area can be obtained to obtain the device location data of several devices in the collection range. Among them, the collection range is a range larger than the target area, for example, the collection range is a preset multiple of the target area. This application does not limit the several devices.

[0020] For example, the target area can be a geographical area or a polygon, and the geographical coordinates of the target area can be represented by a set of point arrays with the same latitude and longitude at the beginning and the end. The geographical coordinates of each device can be represented by a point number of latitude and longitude.

[0021] In some implementations, the device location data includes a first hash code obtained by converting the device's geographic coordinates into a preset code, and the area location data includes a set of second hash codes obtained by converting the geographic coordinates of the target area into a preset code.

[0022] Optionally, the preset code conversion may be a geographic hash code. For example, the preset code conversion may include the GeoHash method, which is a method for encoding geographic coordinates into a string, and can convert two-dimensional longitude and latitude into a string. It converts the longitude and latitude coordinates of geographic coordinates into a string of letters and numbers for subsequent storage and transmission. Among them, the GeoHash code can represent the location by dividing the geographic location into multiple rectangular areas. Each rectangular area is represented by a specific code. The longer the code length, the smaller the represented area and the higher the accuracy. Through the above-mentioned preset code conversion, the geographic coordinates can be effectively converted into hash codes to ensure the uniqueness and consistency of the data, and facilitate subsequent processing and matching.

[0023] In some embodiments, the device location data of several devices to be associated are obtained respectively. Specifically, the geographic coordinates of the device (such as the number of latitude and longitude points) can be converted into a preset code according to a first preset accuracy to obtain a first hash code as the device location data. The first preset accuracy includes the number of precise digits, which can be the same as the number of precise digits of the second preset accuracy. For example, the number of precise digits included in the first preset accuracy is 11. The preset code conversion can include a GeoHash method, which can obtain an 11-digit GeoHash number corresponding to each device as the device location data corresponding to each device.

[0024] In some embodiments, regional location data of a target area is obtained. Specifically, the target area can be preprocessed, and then the geographic coordinates of the target area can be converted into a preset code according to a second preset accuracy to obtain a set of initial hash codes, which are then converted into a preset tree structure to obtain a set of second hash codes as the regional location data.

[0025] In other embodiments, the geographic coordinates of the target area (such as a point array of longitude and latitude) can be used to obtain a preset bounding rectangle of the target area. The preset bounding rectangle can be a minimum bounding rectangle or a minimum circumscribed rectangle. For example, the maximum values ​​of the geographic coordinates of all vertices of the target area are obtained to obtain the maximum longitude, maximum latitude, minimum longitude, and minimum latitude, that is, the vertices of the circumscribed rectangle of the target area can be obtained, that is, the preset bounding rectangle of the target area can be obtained.

[0026] According to the second preset precision and the preset circumscribed rectangle, the geographic coordinates of the target area are converted to a preset code to obtain a set of initial hash codes. The set of initial hash codes may include initial hash codes of multiple sub-areas of the target area. The second preset precision includes the number of precise digits and also includes an error range. For example, the second preset precision includes 11 digits of precise digits and an error range of ±1.492 meters, which is not limited in this application. The preset code conversion may include a GeoHash method, which may obtain an 11-digit GeoHash array corresponding to the target area as the target area data.

[0027] Specifically, the geographic coordinates of at least two vertices of the target area can be converted to a preset code according to the second preset accuracy to obtain the hash code GeoHash corresponding to each vertex. Then, the common prefix of the hash code GeoHash of at least two vertices of the target area is obtained to obtain the maximum hash code maxGeoHash, which can represent the common prefix of the preset circumscribed rectangle. Since the hash code GeoHash of the at least two vertices includes the maximum and minimum vertices of longitude and latitude in the target area, the obtained maximum hash code maxGeoHash must include the entire target area and may also include the preset circumscribed rectangle.

[0028] Then, the maximum hash code maxGeoHash is grid-divided to obtain hash codes corresponding to several sub-regions of the preset circumscribed rectangle. For example, the GeoHash method can be encoded in Base32 encoding, and the maximum hash code maxGeoHash can be divided into 32 sub-regions, such as wtwv1 can be divided into: wtwv10 to wtwv1z.

[0029] Determine the positional relationship between each sub-region and the target region.

[0030] For the sub-regions within the target area, the hash codes corresponding to the sub-regions are added to the set of initial hash codes. For the sub-regions intersecting the target area, they are recursively divided into networks, for example, divided into 32 sub-regions, and the positional relationship between each sub-region and the target area is continuously determined until the number of bits of the hash codes corresponding to the recursively divided sub-regions reaches the second preset accuracy, that is, 11 bits, and the error range is ±1.492 meters. Then, all the intersecting sub-regions are added to the set of initial hash codes to obtain the final set of initial hash codes, that is, the set of initial hash codes corresponding to the target area / preset circumscribed rectangle.

[0031] Finally, the set of initial hash codes is converted into a preset tree structure to obtain a set of second hash codes as the regional location data. The second hash code set includes second hash codes corresponding to multiple sub-regions of the target region. For example, the preset tree structure may include a binary tree, a dictionary tree, an R tree, a variant GIST (Generalized Search Trees) tree, or a quadtree, etc. This application does not limit the preset tree structure.

[0032] Exemplarily, the preset tree structure includes a dictionary tree as an example for explanation. The dictionary tree (Trie tree or prefix tree) is a tree data structure used to store and operate strings. The characteristic of the dictionary tree is that each string is split into a sequence of characters and stored on the nodes of the tree. The root node represents an empty string, and the child nodes of each node correspond to a character, forming a path from the root to the leaf node to represent a complete string. The initial hash code GeoHash is a string, so that the set of initial hash codes can be converted into a dictionary tree. Since the number of bits of the initial hash code GeoHash is 11 bits and the maximum length is 11 bits, the subsequent dictionary tree matching is calculated at most 11 times, and the time complexity is O(1), that is, the amount of calculation is a constant, which can speed up the subsequent matching process.

[0033] The above method converts the polygonal target area into a GeoHash dictionary tree. When the device and the target area are subsequently matched, the complexity of the association calculation can be reduced, and the efficiency of determining whether the device point is located within the polygon of the target area can be improved.

[0034] S12: Determine the relative position relationship between the target area and each device using the area location data and the device location data.

[0035] By matching the regional location data with the device location data corresponding to a number of devices, the matching results of each sub-region of the target region and each device can be obtained, thereby determining the relative position relationship between the target region and each device according to the matching results between the target region and each device. If the matching result satisfies the matching condition, it means that the relative position relationship between the target region and the device is that the device is located within the target region. If the matching result does not satisfy the matching condition, it means that the relative position relationship between the target region and the device is that the device is located outside the target region.

[0036] In some implementations, since the device location data includes a first hash code obtained by converting the device's geographic coordinates into a preset code, and the region location data includes a set of second hash codes obtained by converting the geographic coordinates of the target region into a preset code, i.e., a dictionary tree, each second hash code in the set of the first hash code and the second hash code can be matched to obtain a matching result.

[0037] Optionally, in response to the matching result satisfying the matching condition, that is, the sub-area of ​​the target area and the geographic coordinates of the device are matched, it is determined that the relative position relationship between the target area and the device is that the device is located within the target area.

[0038] Optionally, in response to the matching result not satisfying the matching condition, that is, the sub-area of ​​the target area and the geographic coordinates of the device do not match, it is determined that the relative position relationship between the target area and the device is that the device is located outside the target area.

[0039] S13: determining the association relationship between the target area and the device based on the relative position relationship; wherein, when the relative position relationship is that the device is located outside the target area, determining the association relationship between the target area and the device using relevant information between the device and the target area.

[0040] Then, the association relationship between the target area and the device may be determined based on the relative position relationship between each device and the target area.

[0041] In some implementations, when the relative position relationship is that the device is located within the target area, it can be determined that the association relationship between the target area and the device is associated.

[0042] In some implementations, when the relative position relationship is that the device is outside the target area, in order to more accurately determine the association relationship, the relevant information between the device and the target area may be used to further determine the association relationship between the target area and the device.

[0043] In some embodiments, the relevant information includes at least one of the following: a first distance between the device and the target area, and an identification match between area identification information of the target area and device identification information of the device, wherein the first distance represents the distance between the device and a preset circumscribed rectangle of the target area.

[0044] The identification information may be corresponding name information, geographic information, etc. For example, the region identification information may include the region name, and the device identification information may include the device name. This application does not impose any limitation on this.

[0045] Among them, for a device located outside the target area, if the distance between the device and the target area is within a certain range, it can also be determined that the device is associated with the target area. Therefore, the association relationship between the target area and the device can be further determined based on the first distance between the device and the preset circumscribed rectangle of the target area, thereby improving the accuracy of the association between the device and the target area.

[0046] Among them, for a device located outside the target area, if the identification information of the device is similar or identical to that of the target area, and the matching degree between the device identification information and the area identification information is high, it can also be determined that the device is associated with the target area. Therefore, the association relationship between the target area and the device can be further determined based on the matching degree between the area identification information of the target area and the device identification information of the device, thereby improving the accuracy of the association between the device and the target area.

[0047] It is understandable that the association relationship between the target area and the device can be determined by combining the first distance between the device and the preset circumscribed rectangle of the target area, the identification matching degree between the area identification information of the target area and the device identification information of the device, so as to further improve the accuracy of the association between the device and the target area. This application does not limit the above-mentioned related information.

[0048] In some embodiments, the association relationship may include the association and association distance between the device and the target area. For a device located within the target area and associated with the target area, the association relationship may be recorded as: associated, and the association distance is 0. For a device located outside the target area and associated with the target area, the association relationship may be recorded as: associated, and the association distance is the first distance. Wherein, in the case where the first distance is updated from the second distance, the association distance is the updated first distance. For an unassociated device, the association relationship may be recorded as: unassociated, and / or, association distance.

[0049] In some embodiments, after the above step S13, each device may be associated with the target area. Specifically, for a device within or outside the target area, in response to the association relationship between the target area and the device being associated, the target area is associated with the device.

[0050] The above scheme obtains the regional location data of the target area and the device location data of several devices to be associated respectively, and uses the regional location data and the device location data to determine the relative position relationship between the target area and each device. Based on the relative position relationship, the association relationship between the target area and the device can be determined. When the relative position relationship is that the device is outside the target area, the relevant information between the device and the target area can be used to determine the association relationship between the target area and the device. The association relationship of devices outside the target area can be determined more accurately, thereby improving the accuracy of the association between devices and areas as a whole.

[0051] In addition, by determining whether the device is within the target area, the device within the target area can be associated with the target area. For devices outside the target area, the association relationship is determined by the first distance between the device and a preset circumscribed rectangle of the target area. This can reduce the number of devices that require precise calculation of the second distance. The association relationship of devices outside the target area can be determined based on the first distance between the device and the target area and the degree of identification matching, thereby improving the accuracy of the association between the device and the area.

[0052] In some embodiments, in step S13 of the above embodiment, when the relative position relationship is that the device is outside the target area, the association relationship between the target area and the device can be further expanded by using the relevant information between the device and the target area. For details, please refer to the following embodiments.

[0053] See also Figure 2 , Figure 2 This is a flow chart of the second embodiment of the method for associating a region with a device of the present application. The method may include the following steps: S21: Obtain a first distance corresponding to the device.

[0054] The first distance represents the distance between the device and the preset bounding rectangle of the target area. For example, the closest distance between the device's geographic coordinates and the preset bounding rectangle can be obtained, that is, the distance from the device's geographic coordinates to the nearest edge of the preset bounding rectangle.

[0055] The association relationship between the target area and the device may be determined according to the first distance.

[0056] S22: Determine whether the first distance corresponding to the device meets a preset range condition.

[0057] The preset range condition includes: the first distance is greater than the first preset range, or the first distance is less than or equal to the second preset range, wherein the first preset range is greater than the second preset range. And / or the first preset range and the second preset range respectively represent different ranges of the preset periphery of the target area.

[0058] In some embodiments, when the first distance corresponding to the device satisfies a preset range condition, in response to the first distance being greater than the first preset range, the association relationship between the target area and the device is determined to be unassociated; or, in response to the first distance being less than the second preset range, the association relationship between the target area and the device is determined to be associated.

[0059] In some embodiments, it is determined whether the first distance is greater than a first preset range, wherein the first preset range minSimilarDistance may represent a range within a preset periphery of the target area, for example, the first preset range represents a range of 30 meters from the target area.

[0060] Optionally, if the first distance corresponding to the device is greater than the first preset range, the distance between the device and the target area is too large, and the device is not associated with the target area. In this case, the following step S23 may be executed in response to the first distance being greater than the first preset range.

[0061] Optionally, if the first distance corresponding to the device is not greater than the first preset range, in this case, other conditions may be judged, or it may be determined that the device is associated with the target area. This application does not impose any limitation on this.

[0062] In some embodiments, it is determined whether the first distance is less than or equal to a second preset range, wherein the second preset range minDistance can represent a range within a preset periphery of the target area, and the second preset range is smaller than the first preset range, for example, the second preset range represents a range of 5 meters from the target area.

[0063] Optionally, if the first distance corresponding to the device is less than or equal to the second preset range, the distance between the device and the target area is relatively close, and the device and the target area are associated. In this case, in response to the first distance being less than or equal to the second preset range, the following step S24 may be executed.

[0064] Optionally, if the first distance corresponding to the device is not less than the second preset range, in this case, other conditions may be judged, or it may be determined that the device is not associated with the target area. This application does not impose any limitation on this.

[0065] In some embodiments, when the first distance is between the first preset range and the second preset range, that is, the first distance is not greater than the first preset range and the first distance is not less than the second preset range, it is determined that the first distance of the device does not meet the preset range condition, and the following S25 and subsequent steps can be executed.

[0066] Through the above method, the first distance between the device and the preset circumscribed rectangle can be used to filter out devices with a large distance, and it can be determined that devices with a closer distance are associated with the target area, thereby achieving the association within and outside the target area and reducing the subsequent calculation amount.

[0067] S23: Determine that the association relationship between the target area and the device is no association.

[0068] Optionally, in response to the first distance being greater than a first preset range, it is determined that the association relationship between the target area and the device is unassociated.

[0069] Optionally, in response to the identification matching degree corresponding to the filtered device not satisfying the matching condition, it is determined that the association relationship between the target area and the filtered device is not associated.

[0070] S24: Determine whether the association relationship between the target area and the device is associated.

[0071] Optionally, in response to the first distance being less than or equal to the second preset range, it is determined that the association relationship between the target area and the device is associated.

[0072] Optionally, in response to the identification matching degree corresponding to the filtered device satisfying the matching condition, it is determined that the association relationship between the target area and the filtered device is associated.

[0073] S25: Filter out devices corresponding to the first distance that does not satisfy the preset range condition, and obtain filtered devices.

[0074] When the first distance does not satisfy the preset range condition, devices corresponding to the first distance not satisfying the preset range condition are screened out to obtain screened devices.

[0075] When the first distance does not satisfy the preset range condition, that is, the association relationship cannot be determined through the first preset range and the second preset range in the preset range condition, such devices can be screened out, that is, the devices corresponding to the first distance not satisfying the preset range condition are screened out, and the screened devices are obtained to further determine their association relationship.

[0076] S26: Determine the association relationship between the target area and the screened devices based on the matching degree of the identifiers corresponding to the screened devices.

[0077] For devices that do not meet the preset range conditions, the association relationship between the target area and the screened devices can be further determined based on the identification matching degree between the device and the target area.

[0078] Exemplarily, although the first distance between some devices and the target area exceeds the second preset range minDistance, since the device identification information (such as name information) of the device and the area identification information (such as name information) of the target area have a high similarity, it may still be associated with the target area. For example: the name information of the device is: XXX_A_1, and the name information of the target area is: A. And if the first distance of this device is within the first preset range minSimilarDistance, the device is associated with the target area. Therefore, when the device does not meet the preset range conditions, the correlation between the target area and the device can be further determined based on the identification matching degree between the device and the target area, thereby improving the accuracy of the association between the device and the target area.

[0079] In some implementations, in response to the identification matching degree corresponding to the screened device satisfying the matching condition, it is determined that the association relationship between the target area and the screened device is associated.

[0080] In some implementations, in response to the identification matching degree corresponding to the screened device not satisfying the matching condition, it is determined that the association relationship between the target area and the screened device is not associated.

[0081] The matching condition includes that the identification matching degree is greater than a preset matching degree.

[0082] The above scheme can more accurately determine the association between the device and the target area by matching according to the identification matching degree of the identification information when the preset range conditions are met; in addition, by combining the distance between the device and the target area and the identification matching degree to determine the association relationship, a device that is a certain distance away from the target area but has matching identification information can be associated with the target area, thereby improving the recall rate of the association judgment between the device and the target area.

[0083] In some embodiments, for the above step S26, in response to the matching degree of the identification corresponding to the screened device meeting the matching condition, the second distance is obtained according to the target area, so as to redetermine the corresponding first distance, and further redetermine the association relationship between the target area and the device. For details, please refer to the process of the following embodiment.

[0084] Specifically, when the first distance of the device does not meet the preset range condition, that is, the first distance is between the first preset range and the second preset range, and the identification matching degree corresponding to the screened device meets the matching condition, a more accurate first distance can be obtained according to the target area to re-determine the association relationship.

[0085] That is, in the above process, the association relationship is determined based on the first distance between the device and the preset circumscribed rectangle, which can speed up the screening speed and the association speed, reduce the amount of calculation, and filter out the devices whose first distance is greater than the first preset range, or whose first distance is between the first preset range and the second preset range, and whose identification matching degree corresponding to the screened devices does not meet the matching conditions. After filtering such devices, a more accurate first distance is obtained based on the target area, and the association relationship is re-determined, which reduces the amount of calculation as a whole and improves the accuracy of the association.

[0086] See also Figure 3 , Figure 3 1 is a flow chart of the third embodiment of the method for associating a region with a device of the present application. The method may include the following steps: S31: In response to the identification matching degree corresponding to the filtered device satisfying the matching condition, a second distance between the filtered device and the target area is obtained; wherein the second distance represents the minimum distance between the filtered device and the polygon of the target area.

[0087] Wherein, the target area is a polygonal geometric area. In the above step S26, when the identification matching degree corresponding to the screened device meets the matching condition, that is, for the device whose first distance is between the second preset range minDistance and the first preset range minSimilarDistance, but the identification matching degree is successfully matched, the second distance between such device and the target area can be obtained.

[0088] The second distance represents the minimum distance between the device and the polygon of the target area after screening. The distance between the device and the nearest edge of the polygon of the target area can be obtained, or the minimum distance between the device and each edge of the polygon can be obtained to obtain the second distance. In this way, a more accurate distance between the device and the target area can be calculated.

[0089] S32: Update the first distance to the second distance to obtain an updated first distance; wherein the updated first distance is used to re-execute the step of determining whether the first distance corresponding to the device meets the preset range condition and subsequent steps.

[0090] A more accurate second distance can be used to determine the correlation, and the first distance of the above-screened device can be updated to the second distance to obtain an updated first distance distance. The updated first distance is used to re-execute the step of determining whether the first distance corresponding to the device meets the preset range condition and subsequent steps.

[0091] In some embodiments, if the updated first distance of the device is less than the second preset range minDistance, or the updated first distance is between the second preset range minDistance and the first preset range minSimilarDistance, and the identification matching degree meets the matching condition, then the device is associated with the target area, and the remaining devices are not associated with the target area.

[0092] In some embodiments, if the updated first distance of the device is greater than the first preset range minSimilarDistance, or the updated first distance is between the second preset range minDistance and the first preset range minSimilarDistance, and the identification matching degree does not meet the matching condition, then the device is not associated with the target area, and the remaining devices are associated with the target area.

[0093] The above scheme can filter out devices that meet the preset range conditions and devices with unmatched identification information through the first distance from the device's point position, i.e., the geographic coordinates, to the preset circumscribed rectangle of the target area, thereby reducing the amount of calculation required for determining the association relationship between the device's point position and the polygon of the target area based on the second distance.

[0094] In addition, for devices whose first distance is between the second preset range minDistance and the first preset range minSimilarDistance, and whose identification matching degree meets the matching conditions, the minimum distance between the device and the polygon of the target area can be obtained to obtain the second distance, and the first distance is used to update the first distance to obtain a more accurate distance between the device and the target area, thereby improving the accuracy of the association between the device and the target area.

[0095] It is understandable that in the above method of the specific implementation mode, the writing order of each step does not mean a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0096] For the above embodiments, the present application also provides a device for associating a region with a device, which is used to implement the method for associating a region with a device in any of the above embodiments.

[0097] See also Figure 4 , Figure 4 1 is a schematic diagram of the structure of an embodiment of the device for associating a region with a device of the present application. The device for associating a region with a device 40 comprises an acquisition module 41, a matching module 42 and an association module 43. The modules are interconnected.

[0098] The acquisition module 41 is used to respectively acquire the area location data of the target area and the device location data of several devices to be associated.

[0099] The matching module 42 is used to determine the relative position relationship between the target area and each device by using the area position data and the device position data.

[0100] The association module 43 is used to determine the association relationship between the target area and the device based on the relative position relationship; wherein, when the relative position relationship is that the device is located outside the target area, the association relationship between the target area and the device is determined using the relevant information between the device and the target area.

[0101] It should be noted that the region-device association device provided in the above embodiment and the region-device association method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment and will not be repeated here. In practical applications, the region-device association device provided in the above embodiment can allocate the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this application does not limit this.

[0102] For the above embodiment, the present application provides a computer device, see Figure 5 , Figure 5 1 is a schematic diagram of the structure of an embodiment of a computer device of the present application. The computer device 50 includes a memory 51 and a processor 52, wherein the memory 51 and the processor 52 are coupled to each other, the memory 51 stores program data, and the processor 52 is used to execute the program data to implement the steps of any embodiment of the above-mentioned method for associating regions with devices.

[0103] In this embodiment, the processor 52 may also be referred to as a CPU (Central Processing Unit). The processor 52 may be an integrated circuit chip having the ability to process signals. The processor 52 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor may be a microprocessor or the processor 52 may also be any conventional processor, etc.

[0104] The method of the above embodiment can be implemented in the form of a computer program, so the present application proposes a computer readable storage medium, see Figure 6 , Figure 6The computer-readable storage medium 60 stores program data 61 that can be run by a processor, and the program data 61 can be executed by the processor to implement the steps of any embodiment of the method for associating regions with devices.

[0105] The computer-readable storage medium 60 of this embodiment may be a medium that can store the program data 61, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or may be a server storing the program data 61. The server may send the stored program data 61 to other devices for execution, or may execute the stored program data 61 by itself.

[0106] In some embodiments, the functions or modules included in the device provided in the above embodiments of the present application can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments. For the sake of brevity, the present application will not go into details here.

[0107] The above description of the various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other. For the sake of brevity, this application will not go into details here.

[0108] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0109] 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.

[0110] In addition, each functional unit in each embodiment of the present application 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.

[0111] 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, which is a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially 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, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of each implementation method of the present application.

[0112] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a computer-readable storage medium and executed by a computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the present application is not limited to any specific combination of hardware and software.

[0113] The above descriptions are merely embodiments of the present application and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A method for associating a region with a device, characterized in that: include: Respectively obtaining the regional location data of the target area and the device location data of the plurality of devices to be associated; Determine the relative position relationship between the target area and each device by using the area location data and the device location data; Based on the relative position relationship, determining an association relationship between the target area and the device; Wherein, when the relative position relationship is that the device is located outside the target area, the association relationship between the target area and the device is determined by using the relevant information between the device and the target area.

2. The method according to claim 1, characterized in that The relevant information includes at least one of the following: a first distance between the device and the target area, and a matching degree between the area identification information of the target area and the device identification information of the device, wherein the first distance represents a distance between the device and a preset circumscribed rectangle of the target area.

3. The method according to claim 2, characterized in that The determining the association relationship between the target area and the device by using the relevant information between the device and the target area includes: Determining whether a first distance corresponding to the device meets a preset range condition; In the case that the first distance does not satisfy the preset range condition, filtering out devices corresponding to the first distance not satisfying the preset range condition to obtain filtered devices; Based on the matching degrees of the identifiers corresponding to the screened devices, an association relationship between the target area and the screened devices is determined.

4. The method according to claim 3, characterized in that The determining the association relationship between the target area and the screened device based on the matching degree of the identification corresponding to the screened device includes: In response to the identification matching degree corresponding to the screened device satisfying the matching condition, determining that the association relationship between the target area and the screened device is associated; or, in response to the identification matching degree corresponding to the screened device not satisfying the matching condition, determining that the association relationship between the target area and the screened device is not associated; And / or, the preset range condition includes: the first distance is greater than a first preset range, or the first distance is less than or equal to a second preset range, wherein the first preset range is greater than the second preset range; And / or, the first preset range and the second preset range respectively represent the range of the preset periphery of the target area.

5. The method according to claim 3 or 4, characterized in that: After determining whether the first distance corresponding to the device meets the preset range condition, the method further includes: When the first distance corresponding to the device satisfies a preset range condition, in response to the first distance being greater than a first preset range, it is determined that the association relationship between the target area and the device is unassociated; or, in response to the first distance being less than a second preset range, it is determined that the association relationship between the target area and the device is associated.

6. The method according to claim 3, characterized in that: The target area is a polygonal geometric area; The determining the association relationship between the target area and the screened device based on the matching degree of the identification corresponding to the screened device further includes: In response to the identification matching degree corresponding to the filtered device satisfying the matching condition, obtaining a second distance between the filtered device and the target area; wherein the second distance represents the minimum distance between the filtered device and the polygon of the target area; Updating the first distance to the second distance to obtain an updated first distance; The updated first distance is used to re-execute the step of determining whether the first distance corresponding to the device meets the preset range condition and subsequent steps.

7. The method according to claim 1, characterized in that The step of respectively acquiring the area location data of the target area and the device location data of the plurality of devices to be associated includes: According to a first preset accuracy, the geographic coordinates of the device are converted into a preset code to obtain a first hash code as the device location data; and Using the geographic coordinates of the target area, obtaining a preset circumscribed rectangle of the target area; According to the second preset precision and the preset circumscribed rectangle, the geographic coordinates of the target area are converted into a preset code to obtain a set of initial hash codes; The set of initial hash codes is converted into a preset tree structure to obtain a set of second hash codes as the regional location data.

8. The method according to claim 1 or 7, characterized in that: The device location data includes a first hash code obtained by converting the geographic coordinates of the device into a preset code, and the area location data includes a set of second hash codes obtained by converting the geographic coordinates of the target area into a preset code; The determining the relative position relationship between the target area and each device by using the area location data and the device location data includes: Matching each second hash code in the set of the first hash code and the second hash code to obtain a matching result; In response to the matching result not satisfying a matching condition, determining that the relative position relationship between the target area and the device is that the device is located outside the target area.

9. A computer device, characterized in that: The invention comprises a memory and a processor coupled to each other, wherein the memory stores program data, and the processor is used to execute the program data to implement the steps of the method according to any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that: Program data that can be executed by a processor are stored, and the program data is used to implement the steps of the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • User presence detection and event discovery

    CN103327063A

  • Position determination method and device

    CN111787483A

  • Position determination method and device of monitoring equipment, terminal and storage medium

    CN115243191A

  • Configuration method, device and system of equipment association relationship and storage medium

    CN116456052A

  • Method of associating or re-associating devices in a control network

    US20120203841A1

Cited By

  • Associated information determination method, electronic equipment and storage medium

    CN119782845A