Area division method, device, equipment and storage medium based on area analysis

Through the area division method based on area analysis, the areas to be divided are automatically divided into multiple demand areas, solving the problem of inefficient manual drawing and adjustment, and achieving efficient area division and generation of multiple solutions.

CN114241032BActive Publication Date: 2025-06-06CHINA CONSTR FIFTH ENG DIV CORP LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111518506.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-10
Publication Date
2025-06-06
Estimated Expiration
2041-12-10

AI Technical Summary

Technical Problem

In the prior art, there are errors in manual drawing of demand areas, which lead to repeated adjustments and calculations, which are inefficient, especially in the case of multiple demand areas.

Method used

The area division method based on area analysis is adopted, by obtaining the boundaries of the area to be divided, dividing it into multiple rectangles of equal size, the effective area of ​​each rectangle is calculated, and the area and effective area of ​​the demand area are automatically divided.

Benefits of technology

Automatic division of the divided areas is realized, the steps of manual calculation and adjustment are reduced, efficiency is improved, and a variety of partitioning plans can be quickly generated for users to choose.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114241032B_ABST
    Figure CN114241032B_ABST
Patent Text Reader

Abstract

The present application relates to a method, device, equipment and storage medium for area division based on area analysis, and relates to the technical field of graphics processing, wherein the method comprises: obtaining the boundary of the area to be divided, determining a first rectangle containing the boundary of the area to be divided; dividing the first rectangle into a plurality of second rectangles of equal size, and determining the effective area of ​​each second rectangle based on the relationship between each second rectangle and the boundary of the area to be divided; obtaining the area areas of a plurality of required areas, and dividing the area to be divided into the plurality of required areas based on the area areas of the required areas and the effective areas of the second rectangles contained in the required areas. The present application has the effect of improving the efficiency of dividing the required areas.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of graphics processing, and in particular to a method, device, equipment and storage medium for region division based on area analysis. Background Art

[0002] In industries such as construction and fire protection, it is usually necessary to divide a known area into multiple demand areas, such as land segmentation, fire zone division, etc.

[0003] In the related art, when dividing the demand area, the operator usually draws it on AutoCAD, and then makes multiple adjustments to the divided demand area by measuring the area of ​​the drawn demand area to achieve the expected area of ​​the demand area.

[0004] Regarding the above-mentioned related technologies, the inventor believes that since there will be certain errors in manually drawing the demand area, when the area of ​​the demand area is not met, it needs to be redrawn. When one of the demand areas is changed, it will inevitably affect other demand areas. Especially when the number of demand areas to be divided is large, it is necessary to repeatedly modify and measure the area of ​​the multiple demand areas after division, which is inefficient. Summary of the invention

[0005] In order to improve the efficiency of dividing demand areas, the present application provides a method, device, equipment and storage medium for dividing areas based on area analysis.

[0006] In a first aspect, the present application provides a method for region division based on area analysis, which adopts the following technical solution: a method for region division based on area analysis, comprising: obtaining a boundary of a region to be divided, and determining a first rectangle containing the boundary of the region to be divided;

[0007] Divide the first rectangle into a plurality of second rectangles of equal size, and determine the effective area of ​​all the second rectangles in the first rectangle based on the relationship between each of the second rectangles and the boundary of the area to be divided;

[0008] The area of ​​a plurality of demand areas is obtained, and based on the area of ​​each demand area and the effective area of ​​the second rectangle included in each demand area, the area to be divided is divided into the plurality of demand areas.

[0009] By adopting the above technical solution, the area to be divided is divided into multiple second rectangles of equal size, and then based on the areas of multiple demand areas and the effective areas of the second rectangles contained in each demand area, the area to be divided is automatically divided. There is no need for manual repeated measurement and adjustment of the drawing area, which can improve the efficiency of operators in dividing the demand areas as needed.

[0010] Optionally, the acquiring a boundary of the area to be divided and determining a first rectangle containing the boundary of the area to be divided includes:

[0011] Obtain the boundary coordinates of the area to be divided, and obtain the maximum value x of the area to be divided in the x direction based on the boundary coordinates of the area to be divided max , minimum value x min and the maximum value y in the y direction max , minimum value y min , get the point coordinates (x max ,y max )、(x min ,y max )、(x max ,y min ) and (x min ,y min ), connect the point coordinates to obtain the first rectangle.

[0012] Optionally, dividing the first rectangle into a plurality of second rectangles of equal size, and determining the effective area of ​​each second rectangle based on a relationship between each second rectangle and a boundary of the area to be divided includes:

[0013] For any second rectangle, if the current second rectangle is completely located in the area to be divided, the effective area of ​​the current second rectangle is the area of ​​the current second rectangle; and / or,

[0014] If the current second rectangle intersects with the boundary of the area to be divided, the effective area of ​​the current second rectangle is the area of ​​the intersecting part; and / or if the current second rectangle is completely outside the boundary of the area to be divided, the effective area of ​​the current second rectangle is 0.

[0015] Optionally, dividing the area to be divided into the plurality of demand areas based on the area of ​​each demand area and the effective area of ​​the second rectangle contained in each demand area includes:

[0016] The multiple demand areas are traversed in sequence according to a preset traversal order until the differences in the relationship values ​​between the demand areas are all less than a preset threshold, thereby obtaining the multiple demand areas;

[0017] For traversal of any demand area, randomly obtain the moving direction of the current demand area, select a second rectangle from the second rectangles belonging to the current demand area as the current second rectangle, and select a second rectangle that moves along the moving direction and is adjacent to the current second rectangle as the rectangle to be divided;

[0018] If the rectangle to be divided already belongs to a certain required area, determine whether the relationship value of the required area to which the rectangle to be divided belongs is less than the relationship value of the current required area to which the current second rectangle belongs; if so, divide the rectangle to be divided into the current required area, otherwise do not process the rectangle to be divided;

[0019] If the rectangle to be divided does not belong to any required area and has a valid area, the rectangle to be divided is divided into the current required area, otherwise the rectangle to be divided is not processed;

[0020] The above steps are executed in a loop until all the second rectangles belonging to the current demand area are traversed, that is, the traversal of the current demand area is completed;

[0021] The relationship value of the demand area is calculated by the area of ​​the demand area and the effective area of ​​the second rectangle contained in the demand area.

[0022] By adopting the above technical solution, the relationship value of each demand area is determined by using the calculation formula of the area area of ​​the demand area and the effective area of ​​the second rectangle contained in the demand area. The rectangle to be divided in the demand area with a high relationship value is moved and expanded toward the rectangle to be divided in the demand area with a low relationship value. If the rectangle to be divided in the current demand area increases, that is, the demand area is expanded, the relationship value decreases; if the rectangle to be divided in the current demand area decreases, that is, the demand area is compressed, the relationship value increases; each demand area is iterated in turn until the difference between the relationship values ​​of each demand area is less than a predetermined threshold value, then the division of the demand area is automatically completed, and different schemes for dividing the demand area can be generated through multiple iterations for users to choose.

[0023] Optionally, the calculation formula of the relationship value of the demand area is:

[0024]

[0025] Where f represents the relationship value of the demand area; P i is the area coefficient of the i-th demand area, P i =a 0 +S i *C,S i is the area of ​​the i-th demand area, a 0 and C are adjustment parameters; ∑S n Represents the sum of the effective areas of the second rectangles contained in the i-th demand area.

[0026] Optionally, before dividing the area to be divided into the plurality of demand areas based on the area of ​​each demand area and the effective area of ​​the second rectangle contained in each demand area, the method further includes:

[0027] The area coordinates of the required area are obtained, and the second rectangle corresponding to the area coordinates is the second rectangle belonging to the current required area.

[0028] In a second aspect, the present application provides a region division device based on area analysis, which adopts the following technical solution: a region division device based on area analysis, comprising:

[0029] A first acquisition module is used to acquire the boundary of the area to be divided and determine a first rectangle containing the boundary of the area to be divided; a segmentation module is used to segment the first rectangle into a plurality of second rectangles of equal size and determine the effective area of ​​each second rectangle based on the relationship between each second rectangle and the boundary of the area to be divided;

[0030] The division module is used to obtain the area of ​​multiple demand areas, and divide the area to be divided into the multiple demand areas based on the area of ​​each demand area and the effective area of ​​the second rectangle contained in each demand area.

[0031] By adopting the above technical solution, the area to be divided is divided into multiple second rectangles of equal size, and then based on the areas of multiple demand areas and the effective areas of the second rectangles contained in each demand area, the area to be divided is automatically divided. There is no need for manual repeated measurement and adjustment of the drawing area, which can improve the efficiency of operators in dividing the demand areas as needed.

[0032] In a third aspect, the present application provides a region division device based on area analysis, comprising a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and execute any method in the first aspect.

[0033] In a fourth aspect, the present application provides a computer-readable storage medium, comprising a computer program that can be loaded by a processor and execute any method described in the first aspect.

[0034] In summary, the present application includes at least one of the following beneficial technical effects:

[0035] 1. The area to be divided is divided into multiple second rectangles of equal size, and then based on the areas of multiple demand areas and the effective areas of the second rectangles contained in each demand area, the area to be divided is automatically divided, without the need for manual repeated measurement and adjustment of the drawing area, which can improve the efficiency of operators in dividing the demand areas according to demand;

[0036] 2. Use the calculation formula of the area of ​​the demand area and the effective area of ​​the second rectangle contained in the demand area to determine the relationship value of each demand area. The rectangle to be divided in the demand area with a high relationship value is moved and expanded toward the rectangle to be divided in the demand area with a low relationship value. If the rectangle to be divided in the current demand area increases, that is, the demand area is expanded, the relationship value decreases; if the rectangle to be divided in the current demand area decreases, that is, the demand area is compressed, the relationship value increases; iterate each demand area in turn until the difference between the relationship values ​​of each demand area is less than the predetermined threshold, then the demand area division is automatically completed, and different schemes for dividing the demand area can be generated through multiple iterations for users to choose. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 It is a flowchart of a method for dividing a region based on area analysis in an embodiment of the present application.

[0038] Figure 2 It is a schematic diagram showing the relationship between the boundary of the area to be divided and the first rectangle in an embodiment of the present application.

[0039] Figure 3 It is a schematic diagram showing the effective area and effective boundary of the second rectangle in the embodiment of the present application.

[0040] Figure 4 It is a schematic diagram showing the first traversal of the second rectangle in the current demand area in an embodiment of the present application.

[0041] Figure 5 It is a schematic diagram showing a non-first traversal of the second rectangle in the current demand area in an embodiment of the present application.

[0042] Figure 6 It is a structural block diagram of a region division device 200 based on area analysis according to an embodiment of the present application.

[0043] Figure 7 It is a structural block diagram of an electronic device 300 according to an embodiment of the present application. DETAILED DESCRIPTION

[0044] The present application is further described in detail below in conjunction with the accompanying drawings.

[0045] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are 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.

[0046] In addition, the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can 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, unless otherwise specified, generally means that the associated objects before and after are in an "or" relationship.

[0047] The present application embodiment provides a method for dividing a region based on area analysis, such as Figure 1 As shown, the main process of the method is described as follows (steps S101 to S103):

[0048] Step S101, obtaining the boundary of the area to be divided, and determining a first rectangle containing the boundary of the area to be divided;

[0049] Specifically, first obtain the boundary coordinates of the area to be divided, and then obtain the maximum value x of the area to be divided in the x direction based on the boundary coordinates of the area to be divided max , minimum value x min and the maximum value y in the y direction max , minimum value y min , get the point coordinates (x max ,y max )、(x min ,y max )、(x max ,y min ) and (x min ,y min ), connect the point coordinates to obtain the first rectangle.

[0050] In the embodiment of the present application, the area to be divided can be a polygonal figure, a curved figure or a combination of the two. Of course, the area to be divided can be a regular figure such as a circle, a rectangle, a regular polygon, etc., or an irregular figure.

[0051] If the area to be divided input by the user is a polygon, it is necessary to first obtain the coordinates of each corner point of the area to be divided, and then obtain the boundary of the area to be divided according to the coordinates of each corner point. Figure 2 A schematic diagram showing the relationship between the boundary of the area to be divided and the first rectangle is shown. Figure 2 As shown in the figure, the area to be divided is an irregular pentagon, and the corner points of the pentagon are points a, b, c, d, and e. The coordinates of points a, b, c, d, and e are (0,7), (10,7), (0,2), (8,1), and (5,0), respectively; then the x coordinates of the five corner points are obtained. max =10, x min =0,y max =7,y min=0, combined with each other, we can get four point coordinates (0,7), (10,7), (0,0) and (10,0). These four point coordinates are points a, b, f and g respectively. After connecting them, we get the first rectangle abgf that contains the boundary of the pentagon.

[0052] If the area to be divided input by the user is a curve graphic, it is necessary to first convert the curve graphic into a polygonal graphic, and then obtain the first rectangle in the manner of determining the first rectangle by the polygonal graphic. Specifically, the Douglas-Peukcer algorithm can be used to convert the curve graphic into a polygonal graphic, and the accuracy of the conversion can be set by the user.

[0053] If the area to be divided input by the user is a figure combining polygons and curves, the curve part in the figure is first converted into a polygon part, and then formed into a new polygonal figure together with the original polygon part, and then the first rectangle is obtained in the same way as the above polygonal figure to determine the first rectangle.

[0054] Step S102, dividing the first rectangle into a plurality of second rectangles of equal size, and determining the effective areas of all the second rectangles in the first rectangle based on the relationship between each second rectangle and the boundary of the area to be divided;

[0055] Specifically, for any second rectangle, if the current second rectangle is completely located within the area to be divided, the effective area of ​​the current second rectangle is the area of ​​the current second rectangle; and / or, if the current second rectangle intersects with the boundary of the area to be divided, the effective area of ​​the current second rectangle is the area of ​​the intersecting part; and / or, if the current second rectangle is completely outside the boundary of the area to be divided, the effective area of ​​the current second rectangle is 0.

[0056] Below Figure 3 The effective area of ​​the second rectangle is specifically described by taking the second rectangles A to E in FIG.

[0057] like Figure 3 As shown, the first rectangle is divided into a plurality of second rectangles of equal size, and the shaded portion in the figure is the area to be divided.

[0058] If the second rectangle A is completely within the area to be divided abdec, then the effective area of ​​the second rectangle A is the area of ​​the second rectangle, and the boundary of the second rectangle A is the effective boundary of the second rectangle A. Figure 3 The second rectangle A is marked with a bold box.

[0059] If the second rectangle B intersects with the boundary line of the area to be divided abdec, then the effective area of ​​the second rectangle B is the area of ​​the intersection of the second rectangle B and the area to be divided, that is, Figure 3The area of ​​the shaded portion in the second rectangle B can be calculated by polygon intersection operation, and the boundary of the shaded portion in the second rectangle B is determined to be the effective boundary of the second rectangle B;

[0060] It is worth noting that the intersection also includes the situation where the boundary line of the area to be divided abdec intersects with the second rectangle at a point, such as Figure 3 If the second rectangle D intersects outside the boundary line of the area to be divided abdec, the effective area of ​​the second rectangle D is 0, and the second rectangle D has no effective boundary; if the second rectangle E intersects within the boundary line of the area to be divided abdec, the effective area of ​​the second rectangle E is the effective area of ​​the second rectangle, and the effective boundary is the effective boundary of the second rectangle E, see Figure 3 The second rectangle E is marked with a bold box.

[0061] If the second rectangle C is completely outside the area to be divided abdec, the effective area of ​​the second rectangle C is 0, and the second rectangle C has no effective boundary.

[0062] After determining the effective area and effective boundary of the second rectangle, a two-dimensional array C is established based on all the second rectangles in the first rectangle. [x][y] , for example: the second rectangle A is C 43 , which represents the third second rectangle in the fourth row of the first rectangle. Save the effective area and effective boundary information of all second rectangles in the two-dimensional array C [x][y] , then the area of ​​the region to be divided is the sum of the effective areas of all the second rectangles in the two-dimensional array.

[0063] Step S103 : acquiring the area of ​​multiple demand areas, and dividing the area to be divided into multiple demand areas based on the area of ​​each demand area and the effective area of ​​the second rectangle contained in each demand area.

[0064] Step S103 requires two levels of traversal. The first level of traversal is to traverse multiple demand areas in sequence in a loop according to the preset traversal order, that is, after traversing the first demand area, traverse the next demand area until the difference in the relationship value between each demand area is less than the preset threshold, that is, multiple demand areas are obtained; the preset traversal order can be the order of the area areas of the demand areas input by the user, or it can be a user-defined traversal order.

[0065] The second level traversal is a traversal of the second rectangle contained in each required area.

[0066] For traversing any demand area of ​​the second layer, randomly obtain the moving direction of the current demand area, select a second rectangle from the second rectangles belonging to the current demand area as the current second rectangle, and select a second rectangle that moves along the moving direction and is adjacent to the current second rectangle as the rectangle to be divided;

[0067] If the rectangle to be divided already belongs to a certain demand area, determine whether the relationship value of the demand area to which the rectangle to be divided belongs is less than the relationship value of the current demand area to which the current second rectangle belongs; if so, divide the rectangle to be divided into the current demand area, otherwise do not process the rectangle to be divided;

[0068] If the rectangle to be divided does not belong to any required area and has a valid area, the rectangle to be divided is divided into the current required area, otherwise the rectangle to be divided is not processed;

[0069] The above steps are executed in a loop until all second rectangles belonging to the current demand area are traversed, that is, the second layer traversal of the current demand area is completed, and the second layer traversal of the next demand area can be started.

[0070] It should be noted that, in the same second-layer traversal, the second rectangles belonging to the same required area all search for the rectangles to be divided in the same moving direction.

[0071] The relationship value of the demand area is calculated by the area of ​​the demand area and the effective area of ​​the second rectangle contained in the demand area.

[0072] Optionally, the relationship value of the requirement area is calculated as:

[0073]

[0074] Where f represents the relationship value of the demand area; P i is the area coefficient of the i-th demand area, P i =a 0 +S i *C, S i is the area of ​​the i-th demand area, a 0 and C are adjustment parameters; ∑S n Represents the sum of the effective areas of the second rectangles contained in the i-th demand area.

[0075] Before traversing the required areas, it is also necessary to determine the initial second rectangle of each required area traversed for the first time. Therefore, before step S103, the method further includes: obtaining the area coordinates of the required area, and the second rectangle corresponding to the area coordinates is the second rectangle belonging to the current required area.

[0076] Assume that the area to be divided needs to be divided into three demand areas A 1 , A2 and A 3 , then enter the area S of the three required areas respectively 1 , S 2 and S 3 ; If the user has location requirements for the required area, the area coordinates of the three required areas can be entered as a 1 、a 2 、a 3 , then the region coordinate a 1 The corresponding second rectangle belongs to the required area A 1 The first second rectangle, area coordinate a 2 The corresponding second rectangle belongs to the required area A 2 The first second rectangle, area coordinate a 3 The corresponding second rectangle belongs to the required area A 3 The first second rectangle; if the user has no location requirements for the required area, the regional coordinates b of each required area can be randomly generated 1 、b 2 、b 3 , that is, the first and second rectangles to which each demand area belongs are randomly divided. Specifically, a random algorithm can be used to randomly generate the region coordinates of each demand area, as long as the region coordinates are guaranteed to be located in the area to be divided.

[0077] Of course, the user may also input the area coordinates of part of the required area, and the remaining area coordinates are randomly generated, which is not specifically limited in this embodiment.

[0078] like Figure 4 As shown, the second rectangle 5 is the second rectangle corresponding to the area coordinates of the current demand area input by the user, and the second rectangle 5 is the initial second rectangle in the first traversal of the current demand area.

[0079] Below Figure 4 The first traversal of any demand area is described by taking the second rectangle 5 in FIG.

[0080] First, it is necessary to determine the moving direction of the current required area. The moving direction can be moving a second rectangle along the positive direction of the X-axis, along the negative direction of the X-axis, along the positive direction of the Y-axis, or along the negative direction of the Y-axis. Therefore, the area to be divided may be one of the second rectangle 1, the second rectangle 2, the second rectangle 3, and the second rectangle 4.

[0081] Assuming that the moving direction of the current demand area is moving along the positive direction of the Y axis, the second rectangle 1 is the rectangle to be divided. If the second rectangle 1 does not belong to any demand area including the current demand area, then it is determined whether the second rectangle 1 has a valid area. If the valid area of ​​the second rectangle 1 is 0, the second rectangle 1 is not processed. If the second rectangle 1 has a valid area, the second rectangle 1 is divided into the current demand area.

[0082] If the second rectangle 1 already belongs to any demand area, then determine whether the relationship value of the demand area to which the second rectangle 1 belongs is less than the relationship value of the demand area to which the second rectangle 5 belongs. If the relationship value of the demand area to which the second rectangle 1 belongs is less than the relationship value of the demand area to which the second rectangle 5 belongs, then the second rectangle 1 is divided into the current demand area.

[0083] If the relationship value of the demand area to which the second rectangle 1 belongs is not less than the relationship value of the demand area to which the second rectangle 5 belongs, no processing is performed, the first traversal of the current demand area ends, and the next demand area is traversed in a preset order.

[0084] Figure 5 A schematic diagram of the current demand area including the second rectangle 6, the second rectangle 7, the second rectangle 8 and the second rectangle 9 is shown. Figure 5 A non-first traversal of all second rectangles in any required area is described.

[0085] First of all, it is also necessary to confirm the moving direction of the current demand area, which is the same as the first traversal and will not be repeated here.

[0086] A second rectangle is randomly selected from the second rectangle 6, the second rectangle 7, the second rectangle 8 and the second rectangle 9 as the current second rectangle. Assuming that the second rectangle 6 is randomly selected as the current second rectangle and the moving direction is along the positive direction of the Y-axis, the second rectangle 10 is selected as the rectangle to be divided. As for whether the second rectangle 10 is divided into the current required area, the division method in the first traversal mentioned above can be used, which will not be described in detail here.

[0087] Then, randomly select one of the remaining three second rectangles as the current second rectangle, such as second rectangle 7. At this time, select second rectangle 11 as the rectangle to be divided according to the moving direction along the positive direction of the Y-axis. Repeat the above steps, and so on, until all second rectangles in the current required area (second rectangle 6, second rectangle 7, second rectangle 8 and second rectangle 9) are traversed, and then start traversing the next required area.

[0088] It should be noted that when the size of the second rectangle is set to be smaller, the number of second rectangles contained in the first rectangle is larger, and thus the accuracy of dividing each required area is higher; when the size of the second rectangle is set to be larger, the number of second rectangles contained in the first rectangle is smaller, and thus the speed of outputting the division of each required area is faster.

[0089] After each demand area is divided into the second rectangle, polygon Boolean operations are used to merge all the second rectangles of each demand area in the two-dimensional array, and the area to be divided is divided into multiple demand areas; in order to facilitate the distinction between the demand areas, different colors can be set for each demand area for display; if you want to divide the area to be divided into multiple demand area schemes for reference and selection, re-execute the above steps.

[0090] This method abandons the traditional manual operation method. By having operators divide the area according to demand, it effectively solves the problem of inefficiency in dividing the demand area. At the same time, it can also provide a variety of solutions for dividing the demand area for users to choose.

[0091] Figure 6 4 is a structural block diagram of a region division device 200 based on area analysis according to an embodiment of the present application.

[0092] like Figure 6 As shown, the area division device 200 based on area analysis mainly includes:

[0093] The first acquisition module 201 is used to acquire the boundary of the area to be divided and determine a first rectangle containing the boundary of the area to be divided; the segmentation module 202 is used to segment the first rectangle into a plurality of second rectangles of equal size and determine the effective area of ​​all the second rectangles in the first rectangle based on the relationship between each second rectangle and the boundary of the area to be divided;

[0094] The division module 203 is used to obtain the area of ​​multiple demand areas, and divide the area to be divided into multiple demand areas based on the area of ​​each demand area and the effective area of ​​the second rectangle included in each demand area.

[0095] As an optional implementation of this embodiment, the first acquisition module 201 is specifically used to acquire the boundary coordinates of the area to be divided, and acquire the maximum value x of the area to be divided in the x direction based on the boundary coordinates of the area to be divided. max , minimum value x min and the maximum value y in the y direction max , minimum value y min , get the point coordinates (x max ,y max )、(x min ,y max )、(x max ,y min ) and (xmin ,y min ), connect the point coordinates to obtain the first rectangle.

[0096] As an optional implementation of this embodiment, the segmentation module 202 is specifically used to, for any second rectangle, if the current second rectangle is completely located in the area to be divided, then the effective area of ​​the current second rectangle is the area of ​​the current second rectangle; and / or, if the current second rectangle intersects with the boundary of the area to be divided, then the effective area of ​​the current second rectangle is the area of ​​the intersection; and / or, if the current second rectangle is completely outside the boundary of the area to be divided, then the effective area of ​​the current second rectangle is 0.

[0097] As an optional implementation of this embodiment, the area division device 200 based on area analysis also includes a second acquisition module, which is used to obtain the area coordinates of the demand area before dividing the area to be divided into multiple demand areas based on the area area of ​​each demand area and the effective area of ​​the second rectangle contained in each demand area, and the second rectangle corresponding to the area coordinates is the second rectangle belonging to the current demand area.

[0098] As an optional implementation of this embodiment, the division module 203 is specifically used to loop through multiple demand areas in sequence according to a preset traversal order until the difference in the relationship value between each demand area is less than a preset threshold, that is, multiple demand areas are obtained; for the traversal of any demand area, the moving direction of the current demand area is randomly obtained, a second rectangle is selected from the second rectangles belonging to the current demand area as the current second rectangle, and a second rectangle that moves and is adjacent to the current second rectangle in the moving direction is selected as the rectangle to be divided; if the rectangle to be divided already belongs to a certain demand area, it is determined whether the relationship value of the demand area to which the rectangle to be divided belongs is less than the relationship value of the current demand area to which the current second rectangle belongs; if so, the rectangle to be divided is divided into the current demand area, otherwise the rectangle to be divided is not processed; if the rectangle to be divided does not belong to any demand area and has a valid area, the rectangle to be divided is divided into the current demand area, otherwise the rectangle to be divided is not processed; the above steps are executed repeatedly until all the second rectangles belonging to the current demand area are traversed, that is, the traversal of the current demand area is completed; wherein, the relationship value of the demand area is calculated by the area area of ​​the demand area and the valid area of ​​the second rectangle contained in the demand area.

[0099] Furthermore, the calculation formula of the relationship value of the demand area is:

[0100]

[0101] Where f represents the relationship value of the demand area; P i is the area coefficient of the i-th demand area, P i =a0 +S i *C,S i is the area of ​​the i-th demand area, a 0 and C are adjustment parameters; ∑S n Represents the sum of the effective areas of the second rectangles contained in the i-th demand area.

[0102] In one example, the module in any of the above devices can be one or more integrated circuits configured to implement the above methods, such as: one or more application specific integrated circuits (ASICs), or, one or more digital signal processors (DSPs), or, one or more field programmable gate arrays (FPGAs), or a combination of at least two of these integrated circuit forms.

[0103] For another example, when the modules in the device can be implemented in the form of a processing element scheduling program, the processing element can be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call a program. For another example, these modules can be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0104] Various objects such as various messages / information / equipment / network elements / systems / devices / actions / operations / processes / concepts that may appear in this application are named. It can be understood that these specific names do not constitute a limitation on the relevant objects. The names assigned may change with factors such as scenarios, contexts or usage habits. The understanding of the technical meaning of the technical terms in this application should be mainly determined from the functions and technical effects embodied / executed in the technical scheme.

[0105] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and modules described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0106] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0107] Figure 7 This is a structural block diagram of an electronic device 300 provided in an embodiment of the present application.

[0108] like Figure 7 As shown, the electronic device 300 includes a processor 301 and a memory 302 , and may further include one or more of an information input / information output (I / O) interface 303 and a communication component 304 .

[0109] The processor 301 is used to control the overall operation of the electronic device 300 to complete all or part of the steps of the area division method based on area analysis; the memory 302 is used to store various types of data to support the operation of the electronic device 300, and these data may include, for example, instructions for any application or method used to operate on the electronic device 300, and data related to the application. The memory 302 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0110] The I / O interface 303 provides an interface between the processor 301 and other interface modules, and the above-mentioned other interface modules can be keyboards, mice, buttons, etc. These buttons can be virtual buttons or physical buttons. The communication component 304 is used for wired or wireless communication between the electronic device 300 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G or 4G, or a combination of one or more of them, so the corresponding communication component 104 can include: Wi-Fi components, Bluetooth components, NFC components.

[0111] The communication bus 305 may include a path to transmit information between the above components. The communication bus 305 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus 305 may be divided into an address bus, a data bus, a control bus, etc.

[0112] The electronic device 300 can be implemented by one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), controllers, microcontrollers, microprocessors or other electronic components to execute the area division method based on area analysis given in the above embodiment.

[0113] The electronic device 300 may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc., and may also be servers, etc.

[0114] The present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned area division method based on area analysis are implemented.

[0115] The computer-readable storage medium may include: 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, and other media that can store program codes.

[0116] The terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not expressly listed, or also includes elements inherent to such process, method, article, or apparatus.

[0117] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of application involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the aforementioned application concept. For example, the above features are replaced with (but not limited to) technical features with similar functions applied in the present application.

Claims

1. A regional division method based on area analysis, It is characterized in that include: Obtaining a boundary of the area to be divided, and determining a first rectangle containing the boundary of the area to be divided; Divide the first rectangle into a plurality of second rectangles of equal size, and determine the effective area of ​​all the second rectangles in the first rectangle based on the relationship between each of the second rectangles and the boundary of the area to be divided; Acquire the area of ​​multiple demand areas, and divide the area to be divided into the multiple demand areas based on the area of ​​each demand area and the effective area of ​​the second rectangle included in each demand area; The step of dividing the first rectangle into a plurality of second rectangles of equal size and determining the effective area of ​​all the second rectangles in the first rectangle based on the relationship between each of the second rectangles and the boundary of the area to be divided comprises: For any second rectangle, if the current second rectangle is completely located in the area to be divided, the effective area of ​​the current second rectangle is the area of ​​the current second rectangle; and / or, If the current second rectangle intersects with the boundary of the area to be divided, the effective area of ​​the current second rectangle is the area of ​​the intersecting portion; and / or, If the current second rectangle is completely outside the boundary of the area to be divided, the effective area of ​​the current second rectangle is 0; The dividing the area to be divided into the plurality of demand areas based on the area of ​​each demand area and the effective area of ​​the second rectangle contained in each demand area comprises: The multiple demand areas are traversed in sequence according to a preset traversal order until the differences in the relationship values ​​between the demand areas are all less than a preset threshold, thereby obtaining the multiple demand areas; For traversal of any demand area, randomly obtain the moving direction of the current demand area, select a second rectangle from the second rectangles belonging to the current demand area as the current second rectangle, and select a second rectangle that moves along the moving direction and is adjacent to the current second rectangle as the rectangle to be divided; If the rectangle to be divided already belongs to a certain required area, determine whether the relationship value of the required area to which the rectangle to be divided belongs is less than the relationship value of the current required area to which the current second rectangle belongs; if so, divide the rectangle to be divided into the current required area, otherwise do not process the rectangle to be divided; If the rectangle to be divided does not belong to any required area and has a valid area, the rectangle to be divided is divided into the current required area, otherwise the rectangle to be divided is not processed; The above steps are executed in a loop until all the second rectangles belonging to the current demand area are traversed, that is, the traversal of the current demand area is completed; The relationship value of the demand area is calculated by the area of ​​the demand area and the effective area of ​​the second rectangle contained in the demand area; The calculation formula of the relationship value of the demand area is: ; in, Relationship value representing the demand area; For the The area coefficient of the demand area, , For the The area of ​​the demand area, and To adjust the parameters; Indicates The sum of the effective areas of the second rectangles contained in the required areas.

2. The method according to claim 1, It is characterized in that The obtaining of the boundary of the area to be divided and determining the first rectangle containing the boundary of the area to be divided comprises: Obtain the boundary coordinates of the area to be divided, and obtain the maximum value of the area to be divided in the x direction based on the boundary coordinates of the area to be divided , minimum and the maximum value in the y direction , minimum , get the point coordinates ( , )、( , )、( , )and( , ), connect the point coordinates to obtain the first rectangle.

3. The method according to claim 1, It is characterized in that Before dividing the area to be divided into the plurality of demand areas based on the area of ​​each demand area and the effective area of ​​the second rectangle contained in each demand area, the method further includes: The area coordinates of the required area are obtained, and the second rectangle corresponding to the area coordinates is the second rectangle belonging to the current required area.

4. A region division device based on area analysis, It is characterized in that include: A first acquisition module, used to acquire the boundary of the area to be divided, and determine a first rectangle containing the boundary of the area to be divided; a segmentation module, configured to segment the first rectangle into a plurality of second rectangles of equal size, and determine effective areas of all second rectangles in the first rectangle based on a relationship between each second rectangle and a boundary of the area to be segmented; A division module, used for obtaining the area of ​​multiple demand areas, and dividing the area to be divided into the multiple demand areas based on the area of ​​each demand area and the effective area of ​​the second rectangle contained in each demand area; The segmentation module is specifically used for, for any second rectangle, if the current second rectangle is completely located in the area to be divided, then the effective area of ​​the current second rectangle is the area of ​​the current second rectangle; and / or, if the current second rectangle intersects with the boundary of the area to be divided, then the effective area of ​​the current second rectangle is the area of ​​the intersection; and / or, if the current second rectangle is completely outside the boundary of the area to be divided, then the effective area of ​​the current second rectangle is 0; A second acquisition module is used to acquire the area coordinates of the demand area before dividing the area to be divided into multiple demand areas based on the area area of ​​each demand area and the effective area of ​​the second rectangle contained in each demand area, and the second rectangle corresponding to the area coordinates is the second rectangle belonging to the current demand area; The partitioning module is also specifically used to loop through multiple demand areas in sequence according to a preset traversal order until the difference in the relationship value between each demand area is less than a preset threshold value, that is, multiple demand areas are obtained; for the traversal of any demand area, the moving direction of the current demand area is randomly obtained, a second rectangle is selected from the second rectangles belonging to the current demand area as the current second rectangle, and a second rectangle that moves along the moving direction and is adjacent to the current second rectangle is selected as the rectangle to be divided; if the rectangle to be divided already belongs to a certain demand area, it is determined whether the relationship value of the demand area to which the rectangle to be divided belongs is less than the relationship value of the current demand area to which the current second rectangle belongs; if so, the rectangle to be divided is divided into the current demand area, otherwise the rectangle to be divided is not processed; If the rectangle to be divided does not belong to any demand area and has a valid area, the rectangle to be divided is divided into the current demand area, otherwise the rectangle to be divided is not processed; the above steps are executed repeatedly until all the second rectangles belonging to the current demand area are traversed, that is, the traversal of the current demand area is completed; wherein the relationship value of the demand area is calculated by the area area of ​​the demand area and the valid area of ​​the second rectangle contained in the demand area; The calculation formula of the relationship value of the demand area is: ;in, Relationship value representing the demand area; For the The area coefficient of the demand area, , For the The area of ​​the demand area, and To adjust the parameters; Indicates The sum of the effective areas of the second rectangles contained in the required areas.

5. An electronic device, It is characterized in that The method comprises a memory and a processor, wherein the memory stores a computer program which can be loaded by the processor and executes the method according to any one of claims 1 to 3.

6. A computer-readable storage medium, It is characterized in that A computer program is stored which can be loaded by a processor and execute the method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Building equipment management system based on building information model technology

    CN112232722A

  • Method for automatically dividing smoke-proof partitions of building

    CN113221205A