Automatic batch filling arrangement method, device, electronic device and storage medium

By calculating the boundary and object radius of the area to be filled, and the combined force is simulated and iteratively adjusting the object position, solving the problem of time-consuming and low efficiency of manual drawing, and an efficient method of automatically and evenly laying objects is realized.

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

Patent Information

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

AI Technical Summary

Technical Problem

In the prior art, manual drawing and determining the location of components in the area takes a long time, is inefficient, and is prone to errors.

Method used

By calculating the boundary of the area to be filled and the equivalent radius of the object to be arranged, the number of objects to be arranged is determined, and the combined force is simulated and iteratively adjusts the center coordinates of each object to achieve automatic uniform layout.

Benefits of technology

It improves the uniform layout efficiency of objects in the area without manual intervention, reduces error occurrence, and improves the drawing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114241030B_ABST
    Figure CN114241030B_ABST
Patent Text Reader

Abstract

The present application relates to an automatic batch filling and layout method, device, electronic device, and storage medium, which are applied to the field of computer technology. The method includes: obtaining the boundary of the area to be filled and the equivalent radius of the objects to be arranged; calculating the number N of objects to be arranged in the area to be filled based on the boundary of the area to be filled and the equivalent radius of the objects to be arranged; randomly placing N objects to be arranged in the area to be filled and obtaining the current center coordinates of each object to be arranged; based on the equivalent radius and the current center coordinates of each object to be arranged, sequentially calculating the resultant force exerted on each object to be arranged by the boundary of the area to be filled and other objects to be arranged, determining the new center coordinates of each object to be arranged, using the new center coordinates as the current center coordinates, and repeating this step until the number of iterations reaches a preset number, at which point the current center coordinates of the N objects to be arranged are determined as the target center coordinates. The present application has the effect of improving the efficiency of batch filling and layout.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of computers, and in particular to an automatic batch filling arrangement method, device, electronic device and storage medium. Background Art

[0002] Objects need to be evenly arranged in an area, and the entire area needs to be filled with the objects to be arranged. For example, when determining the fire sprinkler points of the fire protection zone, the water spray points of the greening, and the tree planting locations, manual measurement and drawing based on the measurement data are often required. Manual drawing is difficult and time-consuming. Once an error occurs during the drawing process, it needs to be redrawn, and the drawing efficiency is low.

[0003] With respect to the above-mentioned related technologies, the inventor believes that the method of determining the position of components within a region by manual drawing is time-consuming and inefficient. Summary of the Invention

[0004] In order to improve the efficiency of batch filling arrangement, the present application provides an automatic batch filling arrangement method, device, electronic device and storage medium.

[0005] In a first aspect, the present application provides an automatic batch filling arrangement method, which adopts the following technical solution:

[0006] An automatic batch filling arrangement method, comprising:

[0007] Get the boundary of the area to be filled and the equivalent radius of the objects to be arranged;

[0008] Calculating the number N of the objects to be arranged in the area to be filled based on the boundary of the area to be filled and the equivalent radius of the objects to be arranged;

[0009] Randomly placing N objects to be arranged into the area to be filled, and obtaining the current center coordinates of each object to be arranged;

[0010] Based on the boundary of the area to be filled, the equivalent radius of the objects to be arranged, and the current center coordinates of each object to be arranged, the resultant force exerted on each object to be arranged by the boundary of the area to be filled and the other objects to be arranged is calculated in sequence according to a preset order, and based on the resultant force and a preset unit force movement distance, the new center coordinates of each object to be arranged are determined, and the new center coordinates are used as the current center coordinates. This step is repeated until the number of iterations reaches a preset number, and the current center coordinates of the N objects to be arranged are determined as the target center coordinates.

[0011] By adopting the above technical solution, the required number of objects to be arranged is first determined based on the boundary of the area to be filled and the equivalent radius of the objects to be arranged. Then, the resultant force applied to each object to be arranged is simulated based on the distance between each object to be arranged and the other objects to be arranged and the boundary of the area to be filled. In this way, the new center coordinates of each object to be arranged are determined. Multiple cycles are repeated to ensure that all objects to be arranged are evenly arranged in the area to be filled. No manual intervention is required, and the efficiency is high.

[0012] Optionally, the calculating the number N of objects to be arranged in the area to be filled based on the boundary of the area to be filled and the equivalent radius of the objects to be arranged includes:

[0013] Based on the boundary of the area to be filled, calculate the area S of the area to be filled B ;

[0014] Based on the equivalent radius of the object to be arranged, calculate the area S of the object to be arranged w ;

[0015] Based on the area S of the area to be filled B and the area S of the object to be arranged w , calculate the number N of objects to be arranged in the area to be filled.

[0016] Optionally, the calculation formula for the number N of objects to be arranged in the area to be filled is:

[0017] ,or, ;

[0018] Where C is the reduction coefficient.

[0019] Optionally, calculating the resultant force exerted on each object to be arranged by the boundary of the area to be filled and other objects to be arranged includes:

[0020] For any object to be arranged, if the object to be arranged intersects with the boundary of the area to be filled, the repulsive force f1 exerted on the object to be arranged by the boundary of the area to be filled is determined based on the equivalent radius of the object to be arranged and the distance between the center of the circle of the object to be arranged and the boundary of the area to be filled;

[0021] If the object to be arranged intersects with other objects to be arranged, determining the repulsive force f2 exerted on the object to be arranged by the intersecting objects to be arranged based on the equivalent radius of the object to be arranged and the center distance between the object to be arranged and the intersecting objects to be arranged;

[0022] The resultant force exerted on the object to be arranged by the boundary of the area to be filled and other objects to be arranged is the sum of the repulsive force f1 exerted on the object to be arranged by all intersecting boundaries of the area to be filled and the repulsive force f2 exerted on the object to be arranged by all intersecting objects to be arranged.

[0023] Optionally, the calculation formula for the repulsive force f1 exerted on the object to be arranged by the intersection boundary of the area to be filled is:

[0024] ;

[0025] The calculation formula for the repulsive force f2 exerted on the object to be arranged by the intersecting object to be arranged is:

[0026] ;

[0027] Where R is the equivalent radius of the object to be arranged, D1 is the distance between the center of the circle of the object to be arranged and the intersection boundary of the area to be filled, D2 is the distance between the center of the circle of the object to be arranged and the intersecting object to be arranged, v is the preset unit vector pointing to the center of the circle of the object to be arranged, d m The size of the force per unit distance is preset.

[0028] Optionally, a calculation formula for the resultant force exerted on the object to be arranged by the boundary of the area to be filled and other objects to be arranged is: ;

[0029] Among them, f 1i is the i-th repulsive force on the area to be filled that the object to be arranged is subjected to, f 2j is the j-th repulsive force exerted on the object to be arranged by other objects to be arranged, and p is the adjustment coefficient.

[0030] Optionally, determining the new center coordinates of each object to be arranged based on the resultant force and a preset unit force movement distance includes:

[0031] Based on the resultant force and the preset unit force movement distance, the movement distance L of the object to be arranged along the direction of the resultant force is calculated. The movement distance L is equal to the magnitude of the resultant force F multiplied by the preset unit force movement distance d. f ;

[0032] Based on the current center coordinates of the object to be arranged, the resultant force direction and the moving distance L, new center coordinates of the object to be arranged are determined.

[0033] In a second aspect, the present application provides an automatic batch filling arrangement device, which adopts the following technical solution:

[0034] An automatic batch filling arrangement device comprising:

[0035] A first acquisition module is used to obtain the boundary of the area to be filled and the equivalent radius of the object to be arranged;

[0036] a number calculation module, configured to calculate the number N of the objects to be arranged in the area to be filled based on the boundary of the area to be filled and the equivalent radius of the objects to be arranged;

[0037] A second acquisition module is configured to randomly place N objects to be arranged into the area to be filled, and obtain the current center coordinates of each object to be arranged;

[0038] The iterative module is used to calculate, in a preset order, the resultant force exerted on each object to be arranged by the boundary of the area to be filled and other objects to be arranged based on the boundary of the area to be filled, the equivalent radius of the objects to be arranged, and the current center coordinates of each object to be arranged; determine the new center coordinates of each object to be arranged based on the resultant force and a preset unit force movement distance; use the new center coordinates as the current center coordinates; repeat this step until the number of iterations reaches a preset number, and determine the current center coordinates of the N objects to be arranged as the target center coordinates.

[0039] By adopting the above technical solution, the required number of objects to be arranged is first determined based on the boundary of the area to be filled and the equivalent radius of the objects to be arranged. Then, the resultant force applied to each object to be arranged is simulated based on the distance between each object to be arranged and the other objects to be arranged and the boundary of the area to be filled. In this way, the new center coordinates of each object to be arranged are determined. Multiple cycles are repeated to ensure that all objects to be arranged are evenly arranged in the area to be filled. No manual intervention is required, and the efficiency is high.

[0040] In a third aspect, the present application provides an electronic device, which adopts the following technical solution:

[0041] An electronic device comprises a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and execute the automatic batch filling arrangement method according to any one of the first aspects.

[0042] In a fourth aspect, the present application provides a computer-readable storage medium, which adopts the following technical solution:

[0043] A computer-readable storage medium stores a computer program that can be loaded by a processor and execute the automatic batch filling arrangement method according to any one of the first aspects. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 It is a flowchart of an automatic batch filling arrangement method according to an embodiment of the present application.

[0045] Figure 2 This is a schematic diagram of the boundary of an area to be filled in an embodiment of the present application.

[0046] Figure 3 This is a structural block diagram of an automatic batch filling arrangement device according to an embodiment of the present application.

[0047] Figure 4 This is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0048] The present application is further described in detail below with reference to the accompanying drawings.

[0049] Figure 1 A schematic flow chart of an automatic batch filling arrangement method provided in an embodiment of the present application.

[0050] like Figure 1 As shown, the main process of the method is described as follows (steps S101 to S104):

[0051] Step S101: Obtain the boundary of the area to be filled and the equivalent radius of the objects to be arranged.

[0052] In this embodiment, the area to be filled can be a polygon, a curved line, or a combination of the two. Of course, the area to be filled can be a regular shape, such as a circle, rectangle, or regular polygon, or an irregular shape. The user inputs the coordinates of the corner points using a mouse, keyboard, or touch screen on a smart terminal to obtain the boundary of the area to be filled.

[0053] If the area to be filled input by the user is a polygon, it is necessary to first obtain the coordinates of each corner point of the area to be filled, and then obtain the boundary of the area to be filled based on the coordinates of the corner points. Figure 2 This is a schematic diagram of the boundary of a region to be filled provided in an embodiment of the present application. Figure 2 As shown, the area to be filled is an irregular hexagon, and the corner points of the hexagon are a, b, c, d, e and f. Then input the coordinates of the six corner points. The coordinates of points a, b, c, d, e and f are (1,6) (7,6) (8,3) (5,3) (4,0) (0,0) respectively. Connect the six corner points to get the boundary of the area to be filled.

[0054] In this embodiment, when the shape of the object to be arranged is close to a circle or an irregular shape, in order to facilitate the calculation of the area of ​​the object to be arranged, the object to be arranged is equivalent to a circle. The equivalent radius refers to using the radius of the circle to represent the radius of the object to be arranged. During the calculation, only the planar state data of the object to be arranged is calculated.

[0055] Step S102 : calculating the number N of objects to be arranged in the area to be filled based on the boundary of the area to be filled and the equivalent radius of the objects to be arranged.

[0056] Specifically, based on the boundary of the area to be filled, the area S of the area to be filled is calculated. B , based on the equivalent radius of the object to be arranged, calculate the area S of the object to be arranged w ; Then based on the area S of the area to be filled B and the area S of the object to be arranged w , calculate the number N of objects to be arranged in the area to be filled.

[0057] When the objects to be arranged are not allowed to overlap each other, ; When the objects to be arranged are allowed to overlap each other, ;

[0058] Where C is the reduction coefficient.

[0059] In this embodiment, the reduction factor is introduced for the following reasons:

[0060] (1) The objects to be arranged are circles. If they are arranged in sequence without overlapping, there will be gaps between the circles, that is, there are areas in the area to be filled that are not covered by the circles. The reduction coefficient is introduced to allow a certain amount of overlap, thereby eliminating the gaps and ensuring that all areas are covered; (2) A universal case is that for rectangular or irregularly shaped objects to be arranged, circles can be used to replace them, that is, rectangular or irregularly shaped objects to be arranged are placed in the circle. At this time, although there is actually no overlap between the objects to be arranged, there will be overlap between the circles after conversion. Therefore, a reduction coefficient needs to be introduced to use the circle to calculate the area and number of objects to be arranged.

[0061] The reduction coefficient is set according to actual needs before the program is started. If it is not set, it can be set to 0.8 by default. No specific limitation is made here.

[0062] Step S103: randomly place N objects to be arranged into the area to be filled, and obtain the current center coordinates of each object to be arranged.

[0063] Step S104: Based on the boundary of the area to be filled, the equivalent radius of the objects to be arranged, and the current center coordinates of each object to be arranged, the resultant force exerted on each object to be arranged by the boundary of the area to be filled and other objects to be arranged is calculated in sequence according to a preset order, and based on the resultant force and the preset unit force movement distance, the new center coordinates of each object to be arranged are determined, and the new center coordinates are used as the current center coordinates. This step is repeated until the number of iterations reaches the preset number, and the current center coordinates of the N objects to be arranged are determined as the target center coordinates.

[0064] Among them, the preset order is to sort the N objects to be arranged after they are randomly placed in the area to be filled. For example, according to the order of entering the area to be filled, the first object to be arranged to enter the area to be filled is marked as 1, and the last object to be arranged to enter the area to be filled is marked as N, and then calculated in order from 1 to N or from N to 1.

[0065] In this embodiment, the number of iterations is set as needed. If coverage is not completed within the preset number of times, the number of iterations is increased; or, infinite iterations are set and an end button is set. After complete coverage, the iteration is stopped by clicking the end button.

[0066] When the distance between two objects to be arranged is less than the distance between the centers of the circles, a repulsive force is generated. The N objects to be arranged in the area to be filled interact with each other. After a certain period of time, the arrangement of the objects to be arranged in the area to be filled tends to be balanced, and the arrangement is completed.

[0067] Specifically, for any object to be arranged, if the object to be arranged intersects with the boundary of the area to be filled, the repulsive force f1 exerted on the object to be arranged by the boundary of the area to be filled is determined based on the equivalent radius of the object to be arranged and the distance between the center of the circle of the object to be arranged and the boundary of the area to be filled. If the object to be arranged intersects with other objects to be arranged, the repulsive force f2 exerted on the object to be arranged by the intersecting object to be arranged is determined based on the equivalent radius of the object to be arranged and the center distance between the object to be arranged and the intersecting object to be arranged. .

[0068] Where R is the equivalent radius of the object to be arranged, D1 is the distance between the center of the circle of the object to be arranged and the intersection boundary of the area to be filled, D2 is the distance between the center of the circle of the object to be arranged and the intersecting object to be arranged, v is the preset unit vector pointing to the center of the circle of the object to be arranged, d m is the size of the preset unit distance force, d m Before the program is started, it needs to be preset according to actual needs. If it is not set, it can be defaulted to 1. No specific limitation is made here.

[0069] In this embodiment, there are three positional situations between the object to be arranged and the boundary of the area to be filled and other objects to be arranged: separation, tangency and intersection. When judging the positional situation of the boundary between the object to be arranged and the area to be filled, it is necessary to obtain the vertical distance from the center of the circle of the object to be arranged to the boundary line. When the vertical distance between the object to be arranged and the boundary of the area to be filled is greater than the radius of the object to be arranged, it means that the object to be arranged is separated from the boundary of the area to be filled, and there is no force between the object to be arranged and the boundary of the area to be filled; when the vertical distance between the object to be arranged and the boundary of the area to be filled is equal to the radius of the object to be arranged, it means that the object to be arranged is tangent to the boundary of the area to be filled. According to the calculation formula It can be seen that the repulsive force exerted on the object to be arranged by the boundary of the area to be filled is zero; when the vertical distance between the object to be arranged and the boundary of the area to be filled is less than the radius of the object to be arranged, it means that the object to be arranged intersects with the boundary of the area to be filled. According to the calculation formula It can be seen that the object to be arranged is subject to a repulsive force exerted by the boundary of the area to be filled. Therefore, it is necessary to calculate the repulsive force only when the vertical distance between the object to be arranged and the boundary of the area to be filled is less than the radius of the object to be arranged.

[0070] Similarly, when judging the position of the object to be arranged and other objects to be arranged, it is necessary to obtain the center distance between the object to be arranged and the other objects to be arranged. When the center distance between the object to be arranged and the other objects to be arranged is greater than the sum of the radius of the object to be arranged and the other objects to be arranged, it means that the object to be arranged is separated from the other objects to be arranged, and there is no force between the object to be arranged and the other objects to be arranged; when the center distance between the object to be arranged and the other objects to be arranged is equal to the sum of the radius of the object to be arranged and the other objects to be arranged, it means that the object to be arranged is tangent to the other objects to be arranged. According to the calculation formula It can be seen that the repulsive force exerted on the object to be arranged by other objects to be arranged is zero; when the center distance between the object to be arranged and other objects to be arranged is less than the sum of the radius of the object to be arranged and other objects to be arranged, it means that the object to be arranged intersects with other objects to be arranged. According to the calculation formula It can be seen that the object to be arranged is subjected to a repulsive force exerted by other objects to be arranged. Therefore, it is necessary to calculate the repulsive force only when the center distance between the object to be arranged and the other objects to be arranged is less than the sum of the radii of the object to be arranged and the other objects to be arranged.

[0071] In this embodiment, the resultant force F exerted on the object to be arranged by the boundary of the area to be filled and other objects to be arranged is the sum of the repulsive force f1 exerted on the object to be arranged by all intersecting boundaries of the area to be filled and the repulsive force f2 exerted on the object to be arranged by all intersecting objects to be arranged.

[0072] Optional, ; Among them, f 1i is the i-th repulsive force on the area to be filled that the object to be arranged is subjected to, f 2j is the jth repulsive force exerted on the object to be arranged by other objects to be arranged, and p is the adjustment coefficient.

[0073] Among them, p needs to be preset according to actual needs before the program is started. If it is not set, it can be defaulted to 0.3, and no specific limitation is made here.

[0074] In this embodiment, the position distribution of the objects to be arranged may be as follows:

[0075] (1) If the object to be arranged only intersects with the boundary of the area to be filled, it is only necessary to calculate the resultant force of the repulsive forces exerted on the object to be arranged by all the intersecting boundaries of the area to be filled; (2) If the object to be arranged only intersects with other objects to be arranged, it is only necessary to calculate the resultant force of the repulsive forces exerted on the object to be arranged by all the other intersecting objects to be arranged; (3) If the object to be arranged intersects with both the boundary of the area to be filled and other objects to be arranged, it is necessary to calculate the resultant force of the repulsive forces exerted on the object to be arranged by all the intersecting boundaries of the area to be filled and all the other intersecting objects to be arranged.

[0076] Specifically, based on the current center coordinates of the object to be arranged, the direction of the resultant force, and the moving distance L, determining the new center coordinates of the object to be arranged includes: calculating the moving distance L of the object to be arranged along the direction of the resultant force based on the resultant force and the preset unit force moving distance, where the moving distance L is equal to the magnitude of the resultant force F multiplied by the preset unit force moving distance d f ; Based on the current center coordinates of the object to be arranged, the direction of the resultant force and the moving distance L, determine the new center coordinates of the object to be arranged.

[0077] In this embodiment, d m ,p,d f Both are used to control the filling effect and speed of the objects to be arranged in the area to be filled. The larger the value, the faster the objects to be arranged will be arranged.

[0078] In this embodiment, during each iteration, the resultant force acting on each object to be arranged needs to be calculated and moved in a preset order. Specifically, after the resultant force of the current object to be arranged is calculated, if it needs to be moved, it is moved based on the resultant force, and then the resultant force of the next object to be arranged is calculated. This process is repeated until the resultant force of all objects to be arranged is calculated and moved. At this point, one iteration ends and the next iteration is performed.

[0079] If four objects to be arranged need to be placed in the area to be filled, first calculate the resultant force of the repulsive forces exerted on object 1 to be arranged by other objects to be arranged and / or the boundary of the area to be filled, and calculate the moving distance along the direction of the resultant force. Move object 1 to be arranged in the direction of the resultant force and the moving distance. After the movement is completed, calculate the resultant forces of objects 2 to be arranged, objects 3 to be arranged, and objects 4 to be arranged in sequence and move them. After all the moves are completed, one iteration ends and the next iteration is performed until the preset number of times is reached, and the current center coordinates of all objects to be arranged in the area to be filled are output.

[0080] It should be noted that there is a situation where the object to be arranged does not move. In this case, the resultant repulsive force exerted on the object to be arranged by other objects to be arranged and / or the boundary of the area to be filled is zero.

[0081] Figure 3 This is a structural block diagram of an automatic batch filling arrangement device 200 provided in an embodiment of the application.

[0082] like Figure 3 As shown, the automatic batch filling arrangement device 200 mainly includes:

[0083] The first acquisition module 201 is used to acquire the boundary of the area to be filled and the equivalent radius of the objects to be arranged.

[0084] The number calculation module 202 is configured to calculate the number N of objects to be arranged in the area to be filled based on the boundary of the area to be filled and the equivalent radius of the objects to be arranged.

[0085] The second acquisition module 203 is configured to randomly place N objects to be arranged into the area to be filled, and acquire the current center coordinates of each object to be arranged.

[0086] The iteration module 204 is used to calculate the resultant force exerted on each object to be arranged by the boundary of the area to be filled and the other objects to be arranged in a preset order based on the boundary of the area to be filled, the equivalent radius of the objects to be arranged, and the current center coordinates of each object to be arranged, and determine the new center coordinates of each object to be arranged based on the resultant force and the preset unit force movement distance, and use the new center coordinates as the current center coordinates. This step is repeated until the number of iterations reaches the preset number, and the current center coordinates of the N objects to be arranged are determined as the target center coordinates.

[0087] As an optional implementation of this embodiment, the quantity calculation module 202 is specifically configured to calculate the area S of the area to be filled based on the boundary of the area to be filled. B ; Based on the equivalent radius of the object to be arranged, calculate the area S of the object to be arranged w ; Based on the area S of the area to be filled B and the area S of the object to be arrangedw , calculate the number N of objects to be arranged in the area to be filled.

[0088] As an optional implementation manner of this embodiment, the iteration module 204 is specifically used to, for any object to be arranged, if the object to be arranged intersects with the boundary of the area to be filled, determine the repulsive force f1 exerted on the object to be arranged by the intersecting boundary of the area to be filled based on the equivalent radius of the object to be arranged and the distance between the center of the circle of the object to be arranged and the intersecting boundary of the area to be filled; if the object to be arranged intersects with other objects to be arranged, determine the repulsive force f2 exerted on the object to be arranged by the intersecting objects to be arranged based on the equivalent radius of the object to be arranged and the distance between the center of the circle of the object to be arranged and the intersecting objects to be arranged; the resultant force exerted on the object to be arranged by the boundary of the area to be filled and the other objects to be arranged is the sum of the repulsive forces f1 exerted on the object to be arranged by all the intersecting boundaries of the area to be filled and the repulsive forces f2 exerted on the object to be arranged by all the intersecting objects to be arranged.

[0089] As an optional implementation of this embodiment, the iteration module 204 is specifically configured to calculate the movement distance L of the object to be arranged along the direction of the resultant force based on the resultant force and the preset unit force movement distance. The movement distance L is equal to the magnitude of the resultant force F multiplied by the preset unit force movement distance d. f ; Based on the current center coordinates of the object to be arranged, the direction of the resultant force and the moving distance L, determine the new center coordinates of the object to be arranged.

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

[0091] 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 capable of calling programs. For another example, these modules can be integrated together and implemented in the form of a system-on-a-chip (SOC).

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

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

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

[0095] 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 above-mentioned automatic batch filling arrangement method; the memory 302 is used to store various types of data to support the operation of the electronic device 300. Such data may include, for example, instructions for any application or method operating on the electronic device 300, as well as application-related data. The memory 302 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as one or more of 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.

[0096] The I / O interface 303 provides an interface between the processor 301 and other interface modules, which may be a keyboard, a mouse, buttons, etc. These buttons may 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 thereof, therefore, the corresponding communication component 104 may include: Wi-Fi components, Bluetooth components, NFC components.

[0097] The electronic device 300 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to execute the automatic batch filling arrangement method given in the above embodiment.

[0098] Communication bus 305 may include a path for transmitting information between the aforementioned components. Communication bus 305 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, for example. Communication bus 305 may be divided into an address bus, a data bus, a control bus, and the like.

[0099] 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., as well as fixed terminals such as digital TVs, desktop computers, etc., and may also be servers, etc.

[0100] 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 automatic batch filling arrangement method are implemented.

[0101] 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, etc., which can store program codes.

[0102] 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 comprises a list of elements includes not only those elements but also other elements not expressly listed or inherent to such process, method, article, or apparatus.

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

Claims

1. An automatic batch filling arrangement method, characterized in that: include: Get the boundary of the area to be filled and the equivalent radius of the objects to be arranged; Calculating the number N of the objects to be arranged in the area to be filled based on the boundary of the area to be filled and the equivalent radius of the objects to be arranged; Randomly placing N objects to be arranged into the area to be filled, and obtaining the current center coordinates of each object to be arranged; Based on the boundary of the area to be filled, the equivalent radius of the objects to be arranged, and the current center coordinates of each object to be arranged, calculating the resultant force exerted on each object to be arranged by the boundary of the area to be filled and other objects to be arranged in a preset order, and determining the new center coordinates of each object to be arranged based on the resultant force and a preset unit force movement distance, taking the new center coordinates as the current center coordinates, repeating the steps of calculating the resultant force and determining the new center coordinates until the number of iterations reaches a preset number, and determining the current center coordinates of the N objects to be arranged as the target center coordinates; Calculating the resultant force exerted on each object to be arranged by the boundary of the area to be filled and other objects to be arranged includes: For any object to be arranged, if the object to be arranged intersects with the boundary of the area to be filled, the repulsive force f1 exerted on the object to be arranged by the boundary of the area to be filled is determined based on the equivalent radius of the object to be arranged and the distance between the center of the circle of the object to be arranged and the boundary of the area to be filled; If the object to be arranged intersects with other objects to be arranged, determining the repulsive force f2 exerted on the object to be arranged by the intersecting objects to be arranged based on the equivalent radius of the object to be arranged and the center distance between the object to be arranged and the intersecting objects to be arranged; The resultant force exerted on the object to be arranged by the boundary of the area to be filled and other objects to be arranged is the sum of the repulsive force f1 exerted on the object to be arranged by all intersecting boundaries of the area to be filled and the repulsive force f2 exerted on the object to be arranged by all intersecting objects to be arranged; The calculation formula of the repulsive force f1 exerted by the intersection boundary of the area to be filled on the object to be arranged is: ; The calculation formula for the repulsive force f2 exerted on the object to be arranged by the intersecting object to be arranged is: ; Where R is the equivalent radius of the object to be arranged, D1 is the distance between the center of the circle of the object to be arranged and the intersection boundary of the area to be filled, D2 is the distance between the center of the circle of the object to be arranged and the intersecting object to be arranged, v is the preset unit vector pointing to the center of the circle of the object to be arranged, d m is the size of the preset unit distance force; Determining the new center coordinates of each object to be arranged based on the resultant force and the preset unit force movement distance includes: Based on the resultant force and the preset unit force movement distance, the movement distance L of the object to be arranged along the direction of the resultant force is calculated. The movement distance L is equal to the magnitude of the resultant force F multiplied by the preset unit force movement distance d. f ; Based on the current center coordinates of the object to be arranged, the resultant force direction and the moving distance L, new center coordinates of the object to be arranged are determined.

2. The method according to claim 1, characterized in that Calculating the number N of objects to be arranged in the area to be filled based on the boundary of the area to be filled and the equivalent radius of the objects to be arranged includes: Based on the boundary of the area to be filled, calculate the area S of the area to be filled B ; Based on the equivalent radius of the object to be arranged, calculate the area S of the object to be arranged w ; Based on the area S of the area to be filled B and the area S of the object to be arranged w , calculate the number N of objects to be arranged in the area to be filled.

3. The method according to claim 2, characterized in that The calculation formula for the number N of objects to be arranged in the area to be filled is: ,or, ; Where C is the reduction coefficient.

4. An automatic batch filling arrangement device, characterized in that: include: A first acquisition module is used to obtain the boundary of the area to be filled and the equivalent radius of the object to be arranged; a number calculation module, configured to calculate the number N of the objects to be arranged in the area to be filled based on the boundary of the area to be filled and the equivalent radius of the objects to be arranged; A second acquisition module is configured to randomly place N objects to be arranged into the area to be filled, and obtain the current center coordinates of each object to be arranged; an iterative module, configured to calculate, in a preset order, the resultant force exerted on each object to be arranged by the boundary of the area to be filled and the other objects to be arranged based on the boundary of the area to be filled, the equivalent radius of the objects to be arranged, and the current center coordinates of each object to be arranged; determine, based on the resultant force and a preset unit force movement distance, the new center coordinates of each object to be arranged; use the new center coordinates as the current center coordinates; repeat the steps of calculating the resultant force and determining the new center coordinates until the number of iterations reaches a preset number, and determine the current center coordinates of the N objects to be arranged as the target center coordinates; The iteration module is specifically configured to determine, for any object to be arranged, if the object to be arranged intersects with the boundary of the area to be filled, a repulsive force f1 exerted on the object to be arranged by the boundary of the area to be filled based on the equivalent radius of the object to be arranged and the distance between the center of the circle of the object to be arranged and the boundary of the area to be filled; If the object to be arranged intersects with other objects to be arranged, determining the repulsive force f2 exerted on the object to be arranged by the intersecting objects to be arranged based on the equivalent radius of the object to be arranged and the center distance between the object to be arranged and the intersecting objects to be arranged; The resultant force exerted on the object to be arranged by the boundaries of the area to be filled and other objects to be arranged is the sum of the repulsive force f1 exerted on the object to be arranged by all intersecting boundaries of the area to be filled and the repulsive force f2 exerted on the object to be arranged by all intersecting objects to be arranged; The iteration module is further specifically used to calculate the moving distance L of the object to be arranged along the direction of the resultant force based on the resultant force and the preset unit force moving distance. The moving distance L is equal to the magnitude of the resultant force F multiplied by the preset unit force moving distance d. f ; Based on the current center coordinates of the object to be arranged, the direction of the resultant force and the moving distance L, determine the new center coordinates of the object to be arranged.

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

6. A computer-readable storage medium, 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

  • A primitive filling method and system based on a dynamic boundary group sequence

    CN109767479A

  • Building automatic arrangement method, device and equipment and storage medium

    CN111177834A