Business district boundary trimming method and device
By updating the boundary points of the business district, the problem of difficulty in eliminating blank areas in the business district and ensuring the integrity of the area of interest in the existing technology is solved, and the reduction of blank areas in the business district and the improvement of pruning efficiency is achieved.
Patent Information
- Application Number
- CN202411802355.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-04-15
AI Technical Summary
It is difficult to effectively remove blank areas in business districts and ensure the integrity of areas of interest in business districts.
By obtaining the original boundary of the business district, multiple boundary points on the boundary are determined, and the first boundary point is updated in the preset direction until it reaches the boundary of the area of interest, and the target boundary of the business district is determined.
On the premise of maintaining the integrity of the areas of interest in the business district, reduce the blank areas in the business district and improve the efficiency and accuracy of the business district pruning.
Smart Images

Figure CN119831467A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of logistics technology, and in particular to a method and device for trimming the boundaries of a business district. Background Art
[0002] In the field of logistics, distribution capacity is allocated according to the business district where the store is located. The business district usually includes multiple areas of interest, and the business district is the area covering these areas of interest. In practical applications, it is sometimes necessary to trim the business district. However, the business district trimming method in the related art is not only difficult to effectively eliminate the blank area in the business district (that is, the area in the business district other than the area of interest), but also difficult to ensure the integrity of the area of interest in the business district. Summary of the invention
[0003] In a first aspect, an embodiment of the present application provides a method for trimming the boundary of a business district, the method comprising: obtaining an original boundary of a business district; the business district comprises a plurality of regions of interest, and the plurality of regions of interest are within the distribution range of distribution capacity; determining a plurality of boundary points on the original boundary; updating a first boundary point among the plurality of boundary points along a preset direction until the updated first boundary point reaches the boundary of the region of interest within the business district; wherein the preset direction is a direction in which the area of the business district is reduced, and the first boundary point is a boundary point on the boundary of the region of interest that is not within the business district; determining a target boundary of the business district based on the updated first boundary point and a second boundary point among the plurality of boundary points; wherein the second boundary point is a boundary point on the boundary of the region of interest within the business district, and the target boundary is used to allocate distribution capacity within the business district.
[0004] In some embodiments, obtaining the original boundary of the business district includes: obtaining the convex hulls of the multiple regions of interest; performing boundary extraction on the convex hull to obtain the boundary of the convex hull, and determining the boundary of the convex hull as the original boundary of the business district.
[0005] In some embodiments, determining the plurality of boundary points on the original boundary includes: determining the plurality of boundary points on the original boundary according to a preset interval.
[0006] In some embodiments, the updating of the first boundary point among the multiple boundary points along a preset direction until the updated first boundary point reaches the boundary of the area of interest in the business district includes: iteratively updating the first boundary point; wherein the iteratively obtained 1st intermediate point is obtained by moving the original first boundary point along the preset direction and according to a preset step size, and the iteratively obtained ith intermediate point is obtained by moving the iteratively obtained i-1th intermediate point along the preset direction and according to a preset step size; the original first boundary point is the first boundary point on the original boundary, and i is an integer greater than 1; after any iterative update, determining whether there is a target point corresponding to the original first boundary point on the line segment with the current intermediate point and the original first boundary point as endpoints, the current intermediate point is the intermediate point obtained in the current iteration, and the target point is the intersection between the line segment with the current intermediate point and the original first boundary point as endpoints and the boundary of the area of interest in the business district; if so, the target point is determined as the updated first boundary point, otherwise, the next iterative update is performed.
[0007] In some embodiments, if the current middle point is on the boundary of the area of interest in the business district, the current middle point is the target point, and the current middle point is the updated first boundary point.
[0008] In some embodiments, determining the target point as the updated first boundary point includes: if the current middle point is within the area of interest within the business district and the target point is unique, determining the target point as the updated first boundary point.
[0009] In some embodiments, determining the target point as the updated first boundary point includes: if the current middle point is within the area of interest within the business district, and the target point is not unique, determining the target point farthest from the current middle point among multiple target points as the updated first boundary point.
[0010] In some embodiments, the method also includes: after any iterative update, if there is no target point corresponding to the first boundary point on the line segment with the current middle point and the first boundary point as endpoints, and the iteration stop condition is not met, performing the next iterative update; otherwise, determining the current middle point as the updated first boundary point, and stopping the iteration.
[0011] In some embodiments, the iteration stop condition includes any one of the following: the total distance moved by the intermediate points obtained in previous iterations reaches a preset distance threshold; the business district determined based on the updated first boundary point and the second boundary point among the multiple boundary points has self-intersection; the change rate of the number of target points determined in the current iteration is less than a preset change rate threshold.
[0012] In some embodiments, the determining of the target boundary of the business district based on the updated first boundary point and the second boundary point among the multiple boundary points includes: if the total distance moved by the intermediate points obtained in previous iterations reaches a preset distance threshold, or the rate of change in the number of target points determined in the current iteration is less than a preset rate of change threshold, determining the target boundary of the business district based on the updated first boundary point and the second boundary point among the multiple boundary points obtained in the current iteration; if the business district determined based on the updated first boundary point and the second boundary point among the multiple boundary points has self-intersection, determining the target boundary of the business district based on the updated first boundary point and the second boundary point among the multiple boundary points obtained in the previous iteration.
[0013] In some embodiments, the preset direction is the direction of the first boundary pointing to the centroid of the business district.
[0014] In a second aspect, an embodiment of the present application provides a device for trimming the boundary of a business district, the device comprising: an acquisition module, used to acquire the original boundary of the business district; the business district comprises multiple areas of interest, and the multiple areas of interest are within the distribution range of the distribution capacity; a first determination module, used to determine multiple boundary points on the original boundary; an update module, used to update a first boundary point among the multiple boundary points along a preset direction until the updated first boundary point reaches the boundary of the area of interest within the business district; wherein the preset direction is a direction that reduces the area of the business district, and the first boundary point is a boundary point on the boundary of the area of interest that is not within the business district; a second determination module, used to determine the target boundary of the business district based on the updated first boundary point and a second boundary point among the multiple boundary points; wherein the second boundary point is a boundary point on the boundary of the area of interest within the business district, and the target boundary is used to allocate the distribution capacity within the business district.
[0015] In some embodiments, the acquisition module is used to: acquire the convex hulls of the multiple regions of interest; perform boundary extraction on the convex hull to obtain the boundary of the convex hull, and determine the boundary of the convex hull as the original boundary of the business district.
[0016] In some embodiments, the first determination module is used to: determine a plurality of boundary points on the original boundary according to a preset interval.
[0017] In some embodiments, the update module is used to: iteratively update the first boundary point; wherein, the iteratively obtained 1st intermediate point is obtained by moving the original first boundary point along a preset direction and according to a preset step size, and the iteratively obtained i-th intermediate point is obtained by moving the iteratively obtained i-1th intermediate point along a preset direction and according to a preset step size; the original first boundary point is the first boundary point on the original boundary, and i is an integer greater than 1; after any iterative update, determine whether there is a target point corresponding to the original first boundary point on the line segment with the current intermediate point and the original first boundary point as endpoints, the current intermediate point is the intermediate point obtained in the current iteration, and the target point is the intersection between the line segment with the current intermediate point and the original first boundary point as endpoints and the boundary of the area of interest in the business district; if so, the target point is determined as the updated first boundary point, otherwise, the next iterative update is performed.
[0018] In some embodiments, if the current middle point is on the boundary of the area of interest in the business district, the current middle point is the target point, and the current middle point is the updated first boundary point.
[0019] In some embodiments, the updating module is used to: if the current middle point is within the area of interest within the business district and the target point is unique, determine the target point as the updated first boundary point.
[0020] In some embodiments, the updating module is used to: if the current middle point is within the area of interest in the business district and the target point is not unique, determine the target point farthest from the current middle point among multiple target points as the updated first boundary point.
[0021] In some embodiments, the device also includes: an update stop module, which is used to execute the next iterative update after any iterative update if there is no target point corresponding to the first boundary point on the line segment with the current middle point and the first boundary point as endpoints, and the iterative stop condition is not met; otherwise, the current middle point is determined as the updated first boundary point and the iteration is stopped.
[0022] In some embodiments, the iteration stop condition includes any one of the following: the total distance moved by the intermediate points obtained in previous iterations reaches a preset distance threshold; the business district determined based on the updated first boundary point and the second boundary point among the multiple boundary points has self-intersection; the change rate of the number of target points determined in the current iteration is less than a preset change rate threshold.
[0023] In some embodiments, the second determination module is used to: determine the target boundary of the business district based on the updated first boundary point obtained in the current iteration and the second boundary point among the multiple boundary points if the total distance moved by the intermediate points obtained in previous iterations reaches a preset distance threshold, or the rate of change in the number of target points determined in the current iteration is less than a preset rate of change threshold; if the business district determined based on the updated first boundary point and the second boundary point among the multiple boundary points has self-intersection, determine the target boundary of the business district based on the updated first boundary point obtained in the previous iteration and the second boundary point among the multiple boundary points.
[0024] In some embodiments, the preset direction is the direction of the first boundary pointing to the centroid of the business district.
[0025] In a third aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any embodiment of the present application.
[0026] In a fourth aspect, an embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in any embodiment of the present application when executing the computer program.
[0027] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the method described in any embodiment of the present application.
[0028] When trimming the boundary of a business district, the embodiment of the present application only updates the first boundary point on the boundary of the business district (the boundary point that is not on the boundary of the region of interest), and retains the second boundary point on the boundary of the business district (the boundary point on the boundary of the region of interest). Moreover, when updating the first boundary point, when the updated first boundary point reaches the boundary of the region of interest, the first boundary point is no longer updated, which can minimize the situation of splitting the region of interest during the update process and ensure the integrity of the region of interest in the original business district. Moreover, when updating the first boundary point, the first boundary point is moved along the preset direction that reduces the area of the business district. Therefore, the blank area in the business district can be reduced by updating. In summary, the present application reduces the blank area in the business district while maintaining the integrity of the region of interest in the business district.
[0029] 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
[0030] The drawings herein are incorporated into the specification and constitute a part of the present application. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solutions of the present application.
[0031] Figure 1 It is a schematic diagram of a business district and an area of interest in an embodiment of the present application.
[0032] Figure 2 It is a schematic diagram of a business district pruning method in the related art.
[0033] Figure 3 It is a flow chart of a method for trimming business district boundaries according to an embodiment of the present application.
[0034] Figure 4 It is a schematic diagram of multiple boundary points on the original boundary of an embodiment of the present application.
[0035] Figure 5 It is a schematic diagram of the preset direction of an embodiment of the present application.
[0036] Fig. 6A , Figure 6B and Figure 6C It is a schematic diagram of the target point of an embodiment of the present application.
[0037] Figure 7 It is a schematic diagram of a blank area with a large depth within a business district in an embodiment of the present application.
[0038] Figure 8 It is a schematic diagram of the target boundary of the business district in an embodiment of the present application.
[0039] Fig. 9 It is a block diagram of a device for trimming the boundary of a business district according to an embodiment of the present application.
[0040] Fig.10 It is a schematic diagram of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION
[0041] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0042] The terms used in this application are only for the purpose of describing specific embodiments, and are not intended to limit the application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in this article refers to and includes any or all possible combinations of one or more associated listed items. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a variety of.
[0043] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0044] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application and to make the above-mentioned purposes, features and advantages of the embodiments of the present application more obvious and understandable, the technical solutions in the embodiments of the present application are further described in detail below in conjunction with the accompanying drawings.
[0045] In the field of logistics, a business district refers to the collection of areas that can be delivered by distribution capacity. A business district usually includes multiple areas of interest (Area of AOI is usually an area with some kind of geographic semantic information, where the geographic semantic information may include but is not limited to a community, a building, a park, a scenic spot, a hospital, a school, a factory, etc. The AOI within an area can be determined by semantically identifying the area. Figure 1 As shown, each color block represents an AOI, the black solid line surrounding each color block represents the boundary of the business district, and the area surrounded by the black solid line is the business district.
[0046] In related technologies, the original business district can be determined based on the historical order data of the e-commerce platform, and then the original business district can be pruned according to actual needs to obtain a target business district that better meets actual needs. At present, most of the methods for pruning the boundaries of business districts are to dilute the trajectory points through the Douglas Peucker algorithm, or to use the convex hull algorithm to form a new business district boundary using the convex hull of the AOI within the business district. The principle of the Douglas Peucker algorithm is as follows Figure 2 As shown, the specific steps are as follows:
[0047] Step 1: Connect the first boundary point A and the last boundary point B on the business district boundary into a straight line AB;
[0048] Step 2: Confirm a threshold (this value is used to control the accuracy of the trimmed business district boundary);
[0049] Step 3: Calculate the distance from each boundary point on the business district boundary to the straight line, and take out the farthest distance and compare it with the threshold;
[0050] Step 4: If the maximum distance is greater than the threshold, the boundary point is retained and recorded as C. At this time, two straight lines AC and CB can be generated, and step 1 is repeated; otherwise, the boundary point is discarded.
[0051] The pruning method in the related art has the following problems:
[0052] (1) After the Douglas Peucker algorithm dilutes the trajectory points, the AOI in the business district cannot be completely preserved, and may cause a certain encroachment on the AOI in the original business district. At the same time, the algorithm needs to specify the size of the threshold. If the threshold is not set ideally, the smoothed business district may even deviate greatly from the original business district.
[0053] (2) The dilution trajectory point and convex hull algorithms cannot essentially eliminate the redundant blank areas contained in the original business district.
[0054] Based on this, this application provides a method for trimming the boundaries of a business district, see Figure 3 , the method comprising:
[0055] Step S11: obtaining the original boundary of the business district; the business district includes a plurality of regions of interest, and the plurality of regions of interest are within the distribution range of the distribution capacity;
[0056] Step S12: determining a plurality of boundary points on the original boundary;
[0057] Step S13: updating a first boundary point among the plurality of boundary points along a preset direction until the updated first boundary point reaches the boundary of the region of interest within the business district; wherein the preset direction is a direction that reduces the area of the business district, and the first boundary point is a boundary point on the boundary of the region of interest that is not within the business district;
[0058] Step S14: Determine the target boundary of the business district based on the updated first boundary point and the second boundary point among the multiple boundary points; wherein the second boundary point is a boundary point on the boundary of the area of interest in the business district, and the target boundary is used to allocate distribution capacity in the business district.
[0059] In step S11, semantic recognition can be performed on a geographic area within a certain range to determine the area of interest (AOI) included in the geographic area, and then the business district can be divided based on the AOI. For example, historical order data of an e-commerce platform can be obtained, and merchant location information, user location information, delivery time, order volume, delivery distance and other information can be extracted from the historical order data. Cluster analysis is performed based on the above information to identify AOIs with dense orders, and these AOIs are determined as AOIs in the same business district.
[0060] In some embodiments, the convex hulls of multiple regions of interest may be obtained, and the boundaries of the convex hulls may be extracted to obtain the boundaries of the convex hulls, and the boundaries of the convex hulls may be determined as the original boundaries of the business district. The convex hulls of multiple regions of interest refer to the smallest polygons surrounding the multiple regions of interest. Determining the original boundaries of the business district based on the convex hulls of multiple regions of interest can effectively reduce the amount of data in the subsequent processing process and improve the efficiency of business district pruning. It can be understood that in addition to determining the original boundaries of the business district based on the convex hull, the boundaries of other polygons including the above-mentioned multiple regions of interest may also be determined as the original boundaries of the business district.
[0061] In step S12, multiple boundary points on the original boundary can be determined. For example, multiple boundary points on the original boundary can be determined according to a preset spacing. For the final business district pruning result, the more boundary points there are (that is, the smaller the preset spacing between boundary points), the higher the accuracy, but the greater the amount of calculation. In addition, when the number of boundary points increases to a certain extent, its accuracy will no longer continue to increase as the boundary point spacing decreases. Therefore, the preset spacing can be determined based on a preset accuracy condition and a preset amount of calculation condition. In some embodiments, the preset spacing is 2 meters, that is, a boundary point on the original boundary is determined every 2 meters, so that x boundary points on the original boundary can be determined, and the calculation formula for x is as shown in the following formula (1):
[0062]
[0063] Wherein, c represents the perimeter of the original boundary. It is understood that the above values are only exemplary and are not intended to limit the present application.
[0064] Multiple boundary points such as Figure 4 As shown, the multiple boundary points include a first boundary point (shown as a black dot in the figure) and a second boundary point (shown as a gray dot in the figure), the first boundary point is a boundary point on the boundary of the area of interest that is not in the business district, and the second boundary point is a boundary point on the boundary of the area of interest in the business district. Each boundary point can be numbered in sequence according to the order in which each boundary point is generated.
[0065] In step S13, the first boundary point may be updated along a preset direction, while the second boundary point is not updated. The preset direction is a direction that reduces the area of the business district, for example, Figure 5 As shown, the preset direction can be the direction from the first boundary point to the centroid of the business district (as shown by "☆" in the figure, denoted as O). Taking the two first boundary points A and B as an example, for the first boundary point A, the preset direction is the direction from the first boundary point A to the centroid of the business district, denoted as direction For the first boundary point B, the preset direction is the direction from the first boundary point B to the centroid of the business district, which is recorded as direction
[0066] In some embodiments, the first boundary point can be iteratively updated. The iteratively obtained first intermediate point is obtained by moving the original first boundary point along a preset direction and according to a preset step length (for example, 1 meter, but not limited thereto), and the iteratively obtained i-th intermediate point is obtained by moving the iteratively obtained i-1th intermediate point along a preset direction and according to a preset step length; the original first boundary point is the first boundary point on the original boundary, and i is an integer greater than 1. After any iterative update, it can be determined whether there is a target point corresponding to the original first boundary point on the line segment with the current intermediate point and the original first boundary point as endpoints, the current intermediate point is the intermediate point obtained in the current iteration, and the target point is the intersection between the line segment with the current intermediate point and the original first boundary point as endpoints and the boundary of the area of interest in the business district. If so, the target point is determined as the updated first boundary point, otherwise, the next iterative update is performed.
[0067] Since the number of first boundary points is often greater than 1, multiple first boundary points can be updated in each iteration. Figure 5 Take the first boundary point A in step S12 as an example, the first boundary point A is the original first boundary point, that is, the first boundary point on the original boundary determined in step S12, and the original boundary point is the first boundary point that has not been iteratively updated. The first boundary point A is updated according to the preset step length of 1 meter to obtain the first intermediate point corresponding to the first boundary point A. Then, determine whether there is a target point corresponding to the first boundary point A on the line segment with the first boundary point A and the first intermediate point corresponding to the first boundary point A as endpoints (that is, whether the line segment has an intersection with any AOI in the business district). If so, the target point is determined as the updated first boundary point and the iteration is stopped. Otherwise, continue along the direction The first intermediate point corresponding to the first boundary point A is updated according to the preset step length of 1 meter to obtain the second intermediate point corresponding to the first boundary point A, and it is further determined whether there is a target point corresponding to the first boundary point A on the line segment with the first boundary point A and the second intermediate point corresponding to the first boundary point A as endpoints. And so on.
[0068] In the above process, since the first boundary point is updated in the direction of reducing the area of the business district, the blank area in the business district can be effectively reduced. In addition, since the update process stops iterating when the target point corresponding to the first boundary point is found, the update process can effectively reduce the fragmentation of the AOI and maintain the integrity of the AOI as much as possible.
[0069] In practical applications, the target point may exist in the following situations:
[0070] Case 1: The current middle point obtained in the current iteration is on the boundary of the area of interest in the business district. In this case, the current middle point is the target point. Fig. 6A As shown, for the first boundary point C, it is assumed that the middle point obtained in the first iteration (i.e., the first middle point corresponding to the first boundary point C) is C1, the middle point obtained in the second iteration (i.e., the second middle point corresponding to the first boundary point C) is C2, and the middle point obtained in the third iteration (i.e., the third middle point corresponding to the first boundary point C) is C3. Assuming that C3 is just on the boundary of the region of interest represented by the gray block, C3 is the target point corresponding to the first boundary point C.
[0071] Case 2: The current middle point obtained in the current iteration is within the area of interest in the business district, and the target point is unique. In this case, the line segment with the first boundary point and the current middle point as endpoints has a unique intersection with the boundary of the area of interest (i.e., the target point), and the target point is the updated first boundary point. Figure 6B As shown, for the first boundary point D, it is assumed that the middle point obtained in the first iteration (i.e., the first middle point corresponding to the first boundary point D) is D1, and the middle point obtained in the second iteration (i.e., the second middle point corresponding to the first boundary point D) is D2, wherein D1 is located outside the area of interest in the business district (i.e., the blank area in the business district), D2 is located within the area of interest represented by the gray block, and the line segment with D2 and D as endpoints has only one intersection with the area of interest in the business district represented by the gray block, then the intersection is the target point, that is, the updated first boundary point.
[0072] Case 3: The current middle point obtained in the current iteration is within the region of interest in the business district, and the target point is not unique (for example, the line segment with the first boundary point and the current middle point as endpoints overlaps with a certain boundary of the region of interest). In this case, the target point farthest from the current middle point among the multiple target points can be determined as the updated first boundary point. Figure 6C As shown, for the first boundary point E, assuming that the middle point obtained in the first iteration (i.e., the first middle point corresponding to the first boundary point E) is E1, and the line segment with E and E1 as endpoints coincides with a section of the boundary of the AOI, assuming that the coincident portion is recorded as F1F2, then all points on the line segment F1F2 are the intersection points of the line segment with E and E1 as endpoints and the boundary of the AOI. At this time, the point on the line segment F1F2 that is farthest from E1 (i.e., the intersection point F1) can be determined as the updated first boundary point.
[0073] In practical applications, there may be situations where the target point cannot be obtained after multiple iterations. Figure 7 As shown in the figure, there are some deep blank areas in the business district. When updating the first boundary points around these blank areas, it takes many iterations to obtain the corresponding target points. In order to compare the low efficiency of business district pruning and excessive resource consumption caused by too many iterations, it is not necessary to find the corresponding target point for each first boundary point. As long as certain iteration stop conditions are met, the next round of iteration will not be performed.
[0074] Specifically, after any iterative update, if there is no target point corresponding to the first boundary point on the line segment with the current middle point and the first boundary point as endpoints, and the iteration stop condition is not met, the next iterative update is performed; otherwise, the current middle point is determined as the updated first boundary point, and the iteration is stopped.
[0075] The iteration stopping condition includes any of the following:
[0076] (1) The total distance of the intermediate points obtained in previous iterations reaches the preset distance threshold. For example, in the first iteration, the first boundary point is moved by a distance d1 to obtain the first intermediate point, and the total distance of the intermediate points obtained in the first iteration is d1; in the second iteration, the first intermediate point is moved by a distance d2 to obtain the second intermediate point, and the total distance of the intermediate points obtained in the second iteration is d1+d2; and so on. The above total distance can reflect the depth of the blank area in the business district. If the total distance reaches the preset distance threshold, it means that the depth of the blank area is too large. In order to improve efficiency and reduce resource usage, it is not necessary to continue iterating.
[0077] (2) The business district determined based on the updated first boundary point and the second boundary point among the multiple boundary points has self-intersection. The existence of self-intersection in the business district means that at least two boundary lines on the boundary of the business district have an intersection. Business districts are usually modeled and analyzed in a geographic information system (GIS). GIS uses boundaries to represent the spatial scope of the business district, and it is usually expected that these boundaries are simple polygons, that is, non-self-intersecting. If the boundaries of the business district are self-intersecting, it may cause difficulties in the planning and management of the business district. Therefore, if the business district generated in the current iteration has self-intersection, the iteration can be stopped.
[0078] (3) The rate of change of the number of target points determined by the current iteration is less than the preset rate of change threshold. The rate of change of the number of target points can be represented by the ratio between the target points determined by the current iteration and the total number of target points determined by previous iterations. If the rate of change of the number of target points is less than the preset rate of change threshold (such as close to 0), it means that most of the boundary points on the boundary of the business district have found the target points, and further iterations will not be able to achieve a significant improvement in the update effect. Therefore, in order to improve efficiency and reduce resource usage, it is not necessary to continue iterating.
[0079] In step S14, the target boundary of the business district may be determined based on the updated first boundary point and the second boundary point among the plurality of boundary points. The numbers of the first boundary points before and after the update may be the same, and the boundary points may be connected in sequence according to their numbers to obtain the target boundary. Figure 8 , and compare Figure 1 , it can be seen that the target boundary (such as Figure 8 The area of the blank area in the business circle surrounded by the target boundary is significantly reduced, and the AOIs in the business circle surrounded by the target boundary are Figure 1 Compared with the various AOIs in the image, it remains basically unchanged.
[0080] In some embodiments, if the total distance moved by the intermediate points obtained in previous iterations reaches a preset distance threshold, or the rate of change of the number of target points determined in the current iteration is less than a preset rate of change threshold, the target boundary of the business district can be determined based on the updated first boundary point obtained in the current iteration and the second boundary point among the multiple boundary points. That is, in this embodiment, the target boundary of the business district can be determined based on the result of the current iteration.
[0081] In some embodiments, if the business district determined based on the updated first boundary point and the second boundary point among the multiple boundary points has self-intersection, the target boundary of the business district can be determined based on the updated first boundary point and the second boundary point among the multiple boundary points obtained in the previous iteration. That is, in this embodiment, the iteration result can be returned to the previous iteration result, and the target boundary of the business district can be determined based on the result of the previous iteration.
[0082] The present application also provides a trimming device for the boundary of a business district, such as Fig. 9 As shown, the device comprises:
[0083] An acquisition module 101 is used to acquire the original boundary of a business district; the business district includes a plurality of interest areas, and the plurality of interest areas are within the distribution range of the distribution capacity;
[0084] A first determining module 102, configured to determine a plurality of boundary points on the original boundary;
[0085] An updating module 103 is configured to update a first boundary point among the plurality of boundary points along a preset direction until the updated first boundary point reaches a boundary of the region of interest within the business district; wherein the preset direction is a direction that reduces the area of the business district, and the first boundary point is a boundary point on the boundary of the region of interest that is not within the business district;
[0086] The second determination module 104 is used to determine the target boundary of the business district based on the updated first boundary point and the second boundary point among the multiple boundary points; wherein the second boundary point is a boundary point on the boundary of the area of interest in the business district, and the target boundary is used to allocate the distribution capacity in the business district.
[0087] The functions or modules included in the device provided in the present application can be used to execute the method described in the above method embodiment. Its specific implementation can refer to the description of the above method embodiment. For the sake of brevity, it will not be repeated here.
[0088] An embodiment of the present application further provides a computer device, which comprises at least a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in any of the foregoing embodiments is implemented.
[0089] Fig.10A more specific hardware structure diagram of a computer device provided in an embodiment of the present application is shown, and the device may include: a processor 201, a memory 202, an input / output interface 203, a communication interface 204, and a bus 205. The processor 201, the memory 202, the input / output interface 203, and the communication interface 204 are connected to each other in communication within the device through the bus 205.
[0090] The processor 201 can be implemented by a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., for executing relevant programs to implement the technical solutions provided in the embodiments of the present application. The processor 201 can also include a graphics card, which can be a Nvidia titan X graphics card or a 1080Ti graphics card, etc.
[0091] The memory 202 can be implemented in the form of a read-only memory (ROM), a random access memory (RAM), a static storage device, a dynamic storage device, etc. The memory 202 can store an operating system and other application programs. When the technical solution provided in the embodiment of the present application is implemented by software or firmware, the relevant program code is stored in the memory 202 and is called and executed by the processor 201.
[0092] The input / output interface 203 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0093] The communication interface 204 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.).
[0094] The bus 205 comprises a pathway for transmitting information between the various components of the device (eg, the processor 201 , the memory 202 , the input / output interface 203 , and the communication interface 204 ).
[0095] It should be noted that, although the above device only shows the processor 201, the memory 202, the input / output interface 203, the communication interface 204 and the bus 205, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiment of the present application, and does not necessarily include all the components shown in the figure.
[0096] An embodiment of the present application provides a computer program product, including a computer program, which implements the method described in any embodiment of the present application when executed by a processor.
[0097] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any of the foregoing embodiments.
[0098] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computer device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0099] Each embodiment in the present application is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts refer to the partial description of the method embodiment. The device embodiment described above is merely schematic, wherein the modules described as separate components may or may not be physically separated, and the functions of each module can be implemented in the same one or more software and / or hardware when implementing the embodiment scheme of the present application. It is also possible to select some or all of the modules according to actual needs to achieve the purpose of the embodiment scheme. Those of ordinary skill in the art can understand and implement it without paying creative work.
[0100] The above is only a specific implementation of the embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the embodiment of the present application. These improvements and modifications should also be regarded as the protection scope of the embodiment of the present application.
Claims
1. A method for trimming the boundaries of a business district, characterized in that: The method comprises: Acquire the original boundary of the business district; the business district includes a plurality of regions of interest, and the plurality of regions of interest are within the distribution range of the distribution capacity; determining a plurality of boundary points on the original boundary; Updating a first boundary point among the plurality of boundary points along a preset direction until the updated first boundary point reaches a boundary of the region of interest within the business district; wherein the preset direction is a direction that reduces the area of the business district, and the first boundary point is a boundary point on the boundary of the region of interest that is not within the business district; The target boundary of the business district is determined based on the updated first boundary point and the second boundary point among the multiple boundary points; wherein the second boundary point is a boundary point on the boundary of the area of interest in the business district, and the target boundary is used to allocate distribution capacity in the business district.
2. The method according to claim 1, characterized in that The updating of a first boundary point among the plurality of boundary points along a preset direction until the updated first boundary point reaches a boundary of the area of interest in the business district includes: Iteratively updating the first boundary point; wherein the iteratively obtained first intermediate point is obtained by moving the original first boundary point along a preset direction and according to a preset step length, and the iteratively obtained i-th intermediate point is obtained by moving the iteratively obtained i-1th intermediate point along a preset direction and according to a preset step length; the original first boundary point is the first boundary point on the original boundary, and i is an integer greater than 1; After any iterative update, determine whether there is a target point corresponding to the original first boundary point on the line segment with the current middle point and the original first boundary point as endpoints, the current middle point is the middle point obtained in the current iteration, and the target point is the intersection between the line segment with the current middle point and the original first boundary point as endpoints and the boundary of the area of interest in the business district; If so, the target point is determined as the updated first boundary point, otherwise, the next iterative update is performed.
3. The method according to claim 2, characterized in that If the current middle point is on the boundary of the area of interest in the business district, the current middle point is the target point, and the current middle point is the updated first boundary point.
4. The method according to claim 2, characterized in that: The step of determining the target point as the updated first boundary point comprises: If the current middle point is within the area of interest in the business district and the target point is unique, the target point is determined as the updated first boundary point.
5. The method according to claim 2, characterized in that: The step of determining the target point as the updated first boundary point comprises: If the current middle point is within the area of interest in the business district, and the target point is not unique, the target point farthest from the current middle point among the multiple target points is determined as the updated first boundary point.
6. The method according to claim 2, characterized in that The method further comprises: After any iterative update, if there is no target point corresponding to the first boundary point on the line segment with the current middle point and the first boundary point as endpoints, and the iteration stop condition is not satisfied, the next iterative update is performed; Otherwise, the current middle point is determined as the updated first boundary point and the iteration is stopped.
7. The method according to claim 6, characterized in that The iteration stop condition includes any of the following: The total distance moved by the intermediate points obtained in all iterations reaches a preset distance threshold; The business district determined based on the updated first boundary point and the second boundary point among the plurality of boundary points has self-intersection; The change rate of the number of target points determined in the current iteration is less than a preset change rate threshold.
8. The method according to claim 7, characterized in that The determining the target boundary of the business district based on the updated first boundary point and the second boundary point among the multiple boundary points includes: If the total distance moved by the intermediate points obtained in previous iterations reaches a preset distance threshold, or the rate of change of the number of target points determined in the current iteration is less than a preset rate of change threshold, the target boundary of the business district is determined based on the updated first boundary point obtained in the current iteration and the second boundary point among the multiple boundary points; If the business district determined based on the updated first boundary point and the second boundary point among the multiple boundary points has self-intersection, the target boundary of the business district is determined based on the updated first boundary point and the second boundary point among the multiple boundary points obtained in the previous iteration.
9. The method according to claim 1, characterized in that: The preset direction is the direction of the first boundary pointing to the centroid of the business district.
10. The method according to claim 1, characterized in that The obtaining of the original boundary of the business district includes: Obtaining the convex hulls of the multiple regions of interest; Boundary extraction is performed on the convex hull to obtain a boundary of the convex hull, and the boundary of the convex hull is determined as the original boundary of the business district.
11. The method according to claim 1, characterized in that: The determining of a plurality of boundary points on the original boundary comprises: A plurality of boundary points on the original boundary are determined according to a preset interval.
12. A trimming device for a commercial district boundary, characterized in that: The device comprises: An acquisition module, used to acquire the original boundary of a business district; the business district includes a plurality of interest areas, and the plurality of interest areas are within the distribution range of the distribution capacity; A first determining module, used to determine a plurality of boundary points on the original boundary; An updating module, configured to update a first boundary point among the plurality of boundary points along a preset direction until the updated first boundary point reaches a boundary of the region of interest within the business district; wherein the preset direction is a direction that reduces the area of the business district, and the first boundary point is a boundary point on the boundary of the region of interest that is not within the business district; The second determination module is used to determine the target boundary of the business district based on the updated first boundary point and the second boundary point among the multiple boundary points; wherein the second boundary point is a boundary point on the boundary of the area of interest in the business district, and the target boundary is used to allocate the distribution capacity in the business district.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.
14. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 11 is implemented.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.