Region division method and device, nonvolatile storage medium and electronic equipment
By determining the dynamic proportion data of the target object and iterating the centroid, the problem of inaccurate division of the target object display area in the existing technology is solved, and the accurate division of the target object priority and the convenience of user interaction are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUNAN HAPPLY SUNSHINE INTERACTIVE ENTERTAINMENT MEDIA CO LTD
- Filing Date
- 2026-01-27
- Publication Date
- 2026-05-12
AI Technical Summary
Existing technologies cannot accurately divide the display area according to the priority of the target object, resulting in inconvenience for user interaction.
By determining the dynamic ratio data and initial candidate points of the target object, the target candidate points are determined iteratively based on the centroid until the preset iteration termination condition is met, ensuring that the area deviation of the sub-region is less than the threshold, thus achieving accurate priority division of the target object.
It enables accurate division of the display area of the target object according to priority, improving the convenience of user interaction.
Smart Images

Figure CN122018736A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data visualization, and more specifically, to a method, apparatus, non-volatile storage medium, and electronic device for region partitioning. Background Technology
[0002] In related technologies, when determining the display area corresponding to each of multiple target objects, it is impossible to accurately divide the sub-area occupied by the target object in the display area according to the priority of the target object, resulting in a mismatch between the display priority of the sub-area and the target object, and inconvenient user interaction.
[0003] There is currently no effective solution to the above problems. Summary of the Invention
[0004] This application provides a method, apparatus, non-volatile storage medium, and electronic device for dividing a region, in order to at least solve the technical problem of inconvenient user interaction caused by the inability to accurately divide the display area of each target object according to the priority of the target object in related technologies.
[0005] According to one aspect of the embodiments of this application, a region division method is provided, comprising: determining dynamic ratio data of each target object in a target object set, and initial candidate points corresponding to the target objects in a target region, wherein the dynamic ratio is used to indicate the business load information or business capability information of the target objects; determining an initial sub-region corresponding to the initial candidate point based on the distance from a point in the target region to the initial candidate point; iteratively determining target candidate points based on the centroids in the initial sub-regions, and updating the sub-region corresponding to the target candidate point in the target region after each determination of a target candidate point, until a preset iteration termination condition is met, wherein the preset iteration termination condition includes that the deviation between the area of the sub-region and a preset area is less than a first preset threshold, the target candidate points and the dynamic ratio data are in one-to-one correspondence, and the preset area is the area determined based on the dynamic ratio data corresponding to the target candidate point and the area of the target region; and determining the sub-region that meets the preset iteration termination condition as the target sub-region.
[0006] Optionally, determining the target candidate point based on the centroid in the initial sub-region iteratively includes: in the first iteration, moving the initial candidate point a preset distance toward the centroid to obtain the target candidate point for the first iteration; in subsequent iterations, determining the first moving distance for the current iteration based on the deviation between the area of the sub-region determined in the previous iteration and the preset area, and determining the centroid in the sub-region of the previous iteration, wherein the length of the first moving distance is negatively correlated with the magnitude of the deviation; in the current iteration, moving the target candidate point determined in the previous iteration toward the centroid determined in the previous iteration by the first moving distance to obtain the target candidate point for the current iteration.
[0007] Optionally, the method further includes: before satisfying the preset iteration termination condition, determining noise points in the first region to be processed, wherein the noise points are points whose distance from the boundary of the region to be processed is not greater than a preset distance, and the first region to be processed includes an initial sub-region and a sub-region; deleting noise points in the initial sub-region to obtain the effective region corresponding to the first region to be processed; and determining the centroid of the effective region as the centroid of the region to be processed.
[0008] Optionally, the method further includes: before satisfying a preset iteration termination condition, determining a discrete region of the second region to be processed, wherein the discrete region is a region with an area not greater than a second preset threshold and a neighborhood connectivity detection result of no connected regions, and the second region to be processed includes an initial sub-region and a sub-region; determining the weight level of the second region to be processed in the target region and the weight level of the discrete region, wherein the weight level of the second region to be processed is positively correlated with the weight radius of the second region to be processed, and the weight level of the discrete region is the same as the weight level of the second region to be processed corresponding to the discrete region; and merging the discrete region and the target second region to be processed, wherein the target second region to be processed is a second region to be processed that is adjacent to the discrete region and has the same weight level.
[0009] Optionally, the method further includes: before satisfying the preset iteration termination condition, determining a third region to be processed, wherein the third region to be processed includes an initial sub-region and a sub-region whose aspect ratio of the minimum bounding rectangle is not less than a preset ratio; determining the centroid of the third region to be processed, and adjusting the third region to be processed according to the centroid and the minimum bounding rectangle until the aspect ratio of the minimum bounding rectangle of the third region to be processed is greater than the preset ratio.
[0010] Optionally, after determining the sub-region that meets the preset iteration termination condition as the target sub-region, the method further includes: determining the variation range between the first real-time proportional data set and the second real-time proportional data set, wherein the first real-time proportional data set is the real-time proportional data set before the change, and the second real-time proportional data set is the real-time proportional data set after the change; if the variation range is greater than the preset range, updating the centroid and weight of the target sub-region corresponding to the first real-time proportional data set by using a linear interpolation update method based on the first real-time proportional data set and the second real-time proportional data set.
[0011] Optionally, the preset iteration termination conditions also include: the movement distance of the first centroid position relative to the second centroid position is less than a preset movement distance, the proportion of sub-regions with discrete regions is less than a first preset proportion, and the proportion of sub-regions with a corridor shape is less than a second preset proportion. Here, discrete regions are regions whose area is not greater than a second preset threshold and whose neighborhood connectivity detection result is no connected regions, and sub-regions with a corridor shape include sub-regions whose aspect ratio of the minimum bounding rectangle is not less than a preset ratio.
[0012] According to another aspect of the embodiments of this application, a region division device is also provided, comprising: a first processing module, configured to determine dynamic ratio data of each target object in a target object set, and initial candidate points corresponding to the target objects in a target region, wherein the dynamic ratio is used to indicate the business load information or business capability information of the target objects; a second processing module, configured to determine an initial sub-region corresponding to the initial candidate point based on the distance from the point in the target region to the initial candidate point; a third processing module, configured to iteratively determine target candidate points based on the centroids in the initial sub-regions, and update the sub-regions corresponding to the target candidate points in the target region after each determination of a target candidate point, until a preset iteration termination condition is met, wherein the preset iteration termination condition includes that the deviation between the area of the sub-region and the preset area is less than a first preset threshold, the target candidate points and the dynamic ratio data are in one-to-one correspondence, and the preset area is the area determined based on the dynamic ratio data corresponding to the target candidate points and the area of the target region; and a fourth processing module, configured to determine the sub-regions that meet the preset iteration termination condition as target sub-regions.
[0013] According to another aspect of the embodiments of this application, a non-volatile storage medium is also provided, wherein a program is stored in the non-volatile storage medium, and the program controls the device where the non-volatile storage medium is located to execute a region partitioning method when it runs.
[0014] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory and a processor, wherein the processor is used to run a program stored in the memory, wherein the program executes a region partitioning method during runtime.
[0015] According to another aspect of the embodiments of this application, a computer program product is also provided, including a computer program that implements a region partitioning method when executed by a processor.
[0016] In this embodiment, dynamic ratio data of each target object in the target object set and initial candidate points corresponding to the target objects in the target region are used. The dynamic ratio is used to indicate the business load information or business capability information of the target objects. An initial sub-region corresponding to the initial candidate point is determined based on the distance from a point in the target region to the initial candidate point. Target candidate points are iteratively determined based on the centroid of the initial sub-region, and the sub-region corresponding to the target candidate point in the target region is updated after each determination until a preset iteration termination condition is met. The preset iteration termination condition includes that the deviation between the area of the sub-region and a preset area is less than a first preset threshold, and the target candidate points and dynamic ratio data... According to the one-to-one correspondence, the preset area is determined based on the dynamic ratio data corresponding to the target candidate point and the area of the target region. The method of determining the sub-region that meets the preset iteration termination condition as the target sub-region, by iteratively determining the target candidate point and the position and area of the sub-region corresponding to the target candidate point in the target region, achieves the purpose of accurately dividing the display area of each target object according to the priority of the target object. This achieves the technical effect of allowing the sub-region with higher business load information or business capability information and more likely to have interactive events to occupy a relatively larger area, thereby solving the technical problem of user interaction inconvenience caused by the inability to accurately divide the display area of each target object according to the priority of the target object in related technologies. Attached Figure Description
[0017] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0018] Figure 1 This is a schematic diagram of the structure of a computer terminal (mobile device) according to an embodiment of this application;
[0019] Figure 2 This is a flowchart illustrating a region division method provided according to an embodiment of this application;
[0020] Figure 3 This is a schematic diagram of an initial candidate point provided according to an embodiment of this application;
[0021] Figure 4 This is a schematic diagram of a target sub-region provided according to an embodiment of this application;
[0022] Figure 5 This is a flowchart illustrating a rendering and display process according to an embodiment of this application;
[0023] Figure 6 This is a schematic diagram of the structure of a rendering and display device according to an embodiment of this application;
[0024] Figure 7 This is a schematic diagram of a region division device provided according to an embodiment of this application. Detailed Implementation
[0025] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0026] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0027] Data visualization methods in related technologies have at least the following problems when dealing with dynamic proportional data and real-time data-driven scenarios (such as election voting, market share analysis, resource allocation, etc.):
[0028] Insufficient real-time and dynamic performance: Real-time processing and updating are inefficient, making it difficult to dynamically and intuitively reflect real-time changes in proportional indicators (such as vote share and market share); methods such as the Weighted CVT algorithm in related technologies are mostly executed offline, which cannot achieve smooth updates of dynamic time series, and visual jumps are prone to occur when data is updated.
[0029] The accuracy and rationality are lacking: the correlation between regional division and data weight is weak, the area of the region is difficult to strictly match the given weight target (such as the voting ratio), and unreasonable shapes such as "enclaves" (isolated small areas) and "long corridors" (narrow and thin areas) are prone to appear during dynamic changes, resulting in low geometric fullness.
[0030] Visual quality issues: Noise such as jagged edges and spikes exists at the boundaries of the area, resulting in discontinuous shapes, an unfulfilling visual effect, and affecting the user's intuitive perception of the data.
[0031] Limited applicability and generalization ability: Existing technologies are mostly applicable to static scenes or simple geometric shape division, lacking cross-scene generalization ability; and high-precision Voronoi solutions rely on complex geometry libraries, which are not suitable for lightweight scenarios such as web pages or real-time rendering.
[0032] Furthermore, while Voronoi diagrams and their variants, such as centroid Voronoi diagrams (CVTs) and weighted CVTs, have been applied in geometric modeling, image segmentation, and data visualization—for example, blurred edge-weighted CVT models are used for image processing, edge-weighted CVTs for classification and smoothing, and CVTs in general overlay spaces are used in computer graphics—these methods emphasize algorithmic analysis and applications, such as weighted CVTs on spherical images or GPU Voronoi diagrams with dynamically moving seeds. However, these techniques are primarily limited to static scenes or specific domains, such as biological image analysis or spatial queries, lacking integrated support for real-time data-driven proportional segmentation (such as voting or market share) and optimization for dynamically changing boundary smoothing.
[0033] To address the aforementioned issues, this application provides relevant solutions, which are detailed below.
[0034] According to an embodiment of this application, a method embodiment for region partitioning is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0035] The methods and embodiments provided in this application can be executed on mobile terminals, computer terminals, or similar computing devices. Figure 1 A hardware block diagram of a computer terminal (or mobile device) for implementing a region partitioning method is shown. Figure 1 As shown, the computer terminal 10 (or mobile device 10) may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) 102 (processor 102 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0036] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).
[0037] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the region partitioning method in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby implementing the aforementioned region partitioning method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0038] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0039] The display may be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10 (or mobile device).
[0040] Under the above operating environment, this application provides a region division method, such as... Figure 2As shown, the method includes the following steps:
[0041] Step S202: Determine the dynamic ratio data of each target object in the target object set, and the initial candidate point corresponding to the target object in the target area. The dynamic ratio is used to indicate the business load information or business capability information of the target object.
[0042] In some embodiments of this application, the sum of the dynamic ratio data is 1. The target object can be a specific electronic device such as a sensor, or an abstract conceptual object such as a voting object. The aforementioned workload information can be the load status of the device, and the workload capability information can be some quantitative indicators that reflect the workload capability or support level of the target object, such as the number of votes or the voting ratio.
[0043] For example, in the dynamic deployment scenario of sensor networks in smart factories, real-time monitoring of equipment status is required through multiple types of sensors (such as temperature, vibration, and smoke sensors). Different sensors have different configuration information such as sensing radius (e.g., smoke sensors have a larger sensing radius, while vibration sensors have a smaller sensing radius), and the monitoring coverage needs to be dynamically adjusted according to the equipment operating load (which can be reflected through dynamic proportional data, such as a surge in the number of devices in a certain area leading to an increase in the monitoring task load).
[0044] It's important to note that in dynamic sensor deployment scenarios, the target area is not the actual deployment area of the sensors. The area of the sub-region corresponding to each sensor within the target area reflects the ratio of the sensor's spatial resource allocation or other resource allocation to the total number of resources. The target area can be a visual display area, allowing for a direct and visual assessment of the resource allocation for each sensor by showcasing its corresponding sub-region.
[0045] Furthermore, sensor load reflects the monitoring workload (data processing, sub-device mounting) and system value associated with the sensor; higher load corresponds to a greater number of tasks and higher system value. Allocating a larger relative area to the sub-regions of high-load sensors effectively reflects the increased resource requirements of these sensors. When sensor load surges, the area of the corresponding sub-region also increases. With this increased sub-region area, the service efficiency of high-load sensors can be intuitively assessed through the morphological stability of the sub-region (internal loop repair effect), reflecting the supply-demand / capacity fit between the sensor and the monitored object.
[0046] In some embodiments of this application, the target area can be a rectangular area, or a circular, elliptical, or other shaped area.
[0047] The target audience can be the person being voted on, such as the contestants in a talent show. Alternatively, the target audience can be user needs or user opinions, such as various optional evaluation opinions for a particular film or television work.
[0048] Step S204: Determine the initial sub-region corresponding to the initial candidate point based on the distance from the point in the target region to the initial candidate point;
[0049] Optionally, the initial candidate points to which the points in the target area belong can be determined based on the distance from the points in the target area to the initial candidate points, thereby obtaining the initial sub-regions corresponding to each initial candidate point.
[0050] In some embodiments of this application, if the target area is a display area, the points in the target area can be pixels or the smallest display unit in the target area. Optionally, taking a rectangular display area as an example, the target area can be discretized into... A pixel grid (e.g., 200×150) is used to uniformly or randomly distribute initial candidate points on the pixel grid, resulting in an initial candidate point set. Then, based on the location of the initial candidate points, the initial sub-regions corresponding to each initial candidate point can be determined within the target region.
[0051] In some embodiments of this application, a point can be assigned to the nearest initial candidate point based on its distance from each initial candidate point in the target area. Furthermore, when calculating the distance between a point in the target area and each initial candidate point, the following weighted distance calculation formula can be used to calculate the weighted distance:
[0052]
[0053] In the above formula, Represents points within the target region. This represents the i-th initial candidate point. This represents the initial weight radius corresponding to the i-th initial candidate point.
[0054] As an optional implementation, when calculating the initial weight radius, the dynamic proportional data corresponding to each target object can be comprehensively considered. And scene-related attributes of these target objects. Scene-related attributes include the application scenario of these target objects and some key indicators in that scenario, such as the sensor sensing radius. Regional population density , DG confidence capacity CC, etc. Among the above dynamic proportional data, This represents the dynamic scale data corresponding to the i-th target. The initial weight radius can be calculated using the following formula:
[0055]
[0056] In the above formula, / These are the normalized scene auxiliary attributes (value range [0,1]), such as the sensor deployment scene. Substation planning scenario These parameters are all optional and default to 1.
[0057] Step S206: Based on the centroid of the initial sub-region, the target candidate point is determined iteratively, and the sub-region corresponding to the target candidate point in the target region is updated after each determination of the target candidate point until the preset iteration termination condition is met. The preset iteration termination condition includes that the deviation between the area of the sub-region and the preset area is less than the first preset threshold, the target candidate point and the dynamic ratio data are in one-to-one correspondence, and the preset area is the area determined based on the dynamic ratio data corresponding to the target candidate point and the area of the target region.
[0058] In the technical solution provided in step S206, the step of determining the target candidate point based on the centroid of the initial sub-region iteratively includes: in the first iteration, moving the initial candidate point a preset distance toward the centroid to obtain the target candidate point for the first iteration; in non-first iterations, determining the first moving distance for the current iteration based on the deviation between the area of the sub-region determined in the previous iteration and the preset area, and determining the centroid of the sub-region in the previous iteration, wherein the length of the first moving distance is negatively correlated with the magnitude of the deviation; in the current iteration, moving the target candidate point determined in the previous iteration toward the centroid determined in the previous iteration by the first moving distance to obtain the target candidate point for the current iteration.
[0059] In some embodiments of this application, each iteration in the above-described iterative process includes a two-stage processing flow: an inner closed loop and an outer closed loop. The inner closed loop processing flow includes centroid iteration and morphological pre-repair steps such as denoising centroid calculation, enclave repair, and corridor repair. The outer closed loop process includes steps such as weight radius update, area deviation calculation, oscillation coefficient calculation, and dynamic damping weight adjustment.
[0060] In some embodiments of this application, the inner closed-loop processing flow further includes: before satisfying the preset iteration termination condition, determining noise points in the first region to be processed, wherein the noise points are points whose distance from the boundary of the region to be processed is not greater than a preset distance, and the first region to be processed includes an initial sub-region and a sub-region; deleting the noise points in the initial sub-region to obtain the effective region corresponding to the first region to be processed; and determining the centroid of the effective region as the centroid of the region to be processed.
[0061] In some embodiments of the invention, the aforementioned preset distance can be set independently. For example, when the point is a pixel, the preset distance can be one pixel; when the point is the smallest display unit, the preset distance can be one display unit. The boundary of the area to be processed can be identified using the 4-neighborhood difference method.
[0062] By eliminating each first region to be processed Noise points within the range of "distance from the boundary ≤ preset distance" can be used to obtain the effective area. Then, the centroid of the effective region can be calculated according to the following formula, and the centroid of the effective region can be used as the centroid of the region to be processed, thereby avoiding centroid shift caused by boundary noise:
[0063]
[0064] As an optional approach, if the area of the effective region is smaller than the set minimum area, the centroid of the first region to be processed can be calculated directly instead of the centroid of the effective region. The area of the effective region refers to the set of effective pixels used for centroid calculation within the effective region, and the minimum area refers to the minimum set of effective pixels. In the case of the four-neighbor pixel model, the minimum area refers to a central pixel and its four adjacent pixels (top, bottom, left, and right), totaling five pixels. When using other models, the minimum area will also change accordingly. For example, in the hexagonal model, the number of adjacent pixels is 6, and the corresponding minimum area is 7 pixels. In the eight-neighbor model, the number of adjacent pixels is 8, and the corresponding minimum area is 9 pixels. If the number of effective pixels in a region is too small, the region will not be able to form a stable connected structure, indicating that the region is more likely to be an island, a spike, or noise.
[0065] In some embodiments of this application, the inner closed-loop processing flow further includes: before satisfying a preset iteration termination condition, determining a discrete region of the second region to be processed, wherein the discrete region is a region with an area not greater than a second preset threshold and a neighborhood connectivity detection result of no connected regions, and the second region to be processed includes an initial sub-region and a sub-region; determining the weight level of the second region to be processed in the target region and the weight level of the discrete region, wherein the weight level of the second region to be processed is positively correlated with the weight radius of the second region to be processed, and the weight level of the discrete region is the same as the weight level of the second region to be processed corresponding to the discrete region; and merging the discrete region and the target second region to be processed, wherein the target second region to be processed is a second region to be processed that is adjacent to the discrete region and has the same weight level.
[0066] In some embodiments of this application, the aforementioned discrete regions may also be referred to as enclaves. An enclave or discrete region refers to an isolated pixel block with a small area and no connectivity to the main region of its corresponding second region to be processed; its restoration requires consideration of both threshold adaptability and weight correlation. The second region to be processed is the largest region among the various unconnected regions belonging to the second region to be processed. If all parts of the second region to be processed are interconnected, then the main region of the second region to be processed is the second region to be processed itself.
[0067] In some embodiments of this application, the second preset threshold used in determining the discrete region can be dynamically adjusted according to the physical size of the grid, and the specific adjustment formula is as follows:
[0068] Second preset threshold = k × (grid side length)²
[0069] Where k is the scene coefficient corresponding to the resolution of the display area. For example, the threshold corresponding to a 3×3 grid is temporarily set to 9 pixels. Different resolution scenes are adapted through the coefficient k.
[0070] Optionally, when identifying discrete regions, in addition to area, an 8-neighborhood connectivity test can be used to identify isolated regions with a test result of 0 (indicating that they do not share an edge with the main region), ensuring that enclaves can be accurately located.
[0071] When merging enclaves, an enclave can be merged into the adjacent second processing region that has the closest Euclidean distance to the enclave and the same weight level. The weight level of the second processing region can be determined based on its weight radius. For example, it can be set to follow a descending order: the first 25% of weight radii correspond to high priority, the first 25% to the first 75% of weight radii correspond to medium priority, and the last 25% of weight radii correspond to low priority.
[0072] Optionally, if the weight levels of the adjacent regions of the enclave and the weight level of the enclave are different, the enclave can be merged into the second largest region to be processed among the adjacent regions, thereby minimizing the area ratio distortion caused by merging across weight levels.
[0073] In some embodiments of this application, the inner closed-loop processing flow further includes: determining a third region to be processed before satisfying a preset iteration termination condition, wherein the third region to be processed includes an initial sub-region and a sub-region whose aspect ratio of the minimum bounding rectangle is not less than a preset ratio; determining the centroid of the third region to be processed, and adjusting the third region to be processed according to the centroid and the minimum bounding rectangle until the aspect ratio of the minimum bounding rectangle of the third region to be processed is greater than the preset ratio.
[0074] In some embodiments of this application, the aforementioned preset ratio can be set independently, for example, it can be set to 3, and the type of the third area to be processed can be referred to as a corridor area. The process of identifying and processing the corridor area may include the following steps:
[0075] Step 1, Shape Determination: Determine the smallest bounding rectangle of the sub-region after rotation calibration. If the ratio of the longer side to the shorter side is ≥3 (e.g., a region 12 pixels long and 3 pixels wide, with an aspect ratio of 4), it is determined to be a corridor region.
[0076] The second step is centroid orientation offset: determine the direction of the long side, and offset the centroid towards the direction of the short side (the offset amount is 30% of the length of the short side), with a single movement distance ≤ 5% of the current weight radius.
[0077] The third step is to squeeze adjacent areas together: If the area is still a long corridor after the centroid is oriented and shifted, select the two adjacent areas with the longest shared boundary, and squeeze the narrow part by reducing the weight of the long corridor area and increasing the weight of the adjacent areas (adjusted by 5% each) to ensure that the area deviation is ≤5%.
[0078] Step 4, Morphological forced correction: If the area is still a corridor after the second and third steps, then erode the length along the long side and reduce the length by 10%; if the area deviation exceeds 5%, compensate through the outer closed-loop weight (the upper limit is 1.1 times the original weight).
[0079] Step 5, iterative verification: A single area can be repaired a maximum of 3 times. After each repair, the aspect ratio is rechecked. If it is less than 3, it is successful. If it still does not meet the standard after 3 times, it is marked as "acceptable in shape". Priority is given to ensuring the number of areas and the area ratio.
[0080] Step 6, Smooth Centroid Movement: Move the candidate point to the newly determined centroid position, and limit the distance of a single movement to ≤ This is to avoid the centroid crossing the boundary, which could cause drastic fluctuations in the region.
[0081] It should be noted that the specific values mentioned in the above steps are for illustrative purposes only and do not represent any limitations on the solution provided in this application. When actually implementing the solution provided in this application, specific numbers can be set according to actual needs.
[0082] In some embodiments of this application, in the outer closed-loop processing flow, the actual area of the sub-region can be determined after each iteration. and preset area The deviation is calculated, and based on this deviation, it is determined whether the iteration termination condition is met. If the iteration termination condition is not met, the oscillation coefficient is calculated based on the calculated deviation, and the dynamic damping weight is adjusted. Furthermore, in the above deviation calculation formula, This refers to the total area of the display area.
[0083] Optional, oscillation coefficient It can be used to quantify the correlation between centroid movement and area change. The calculation formula is as follows:
[0084]
[0085] In the above formula, To avoid a denominator of 0. Oscillation coefficient. The value range is [0,2], the numerator is the relative distance the center of mass moves, and the denominator is the relative change in area. A value >1 indicates high volatility. A value ≤1 indicates low oscillation. The subscript i represents the i-th displayed object.
[0086] After determining the oscillation coefficient, it can be used as a basis for further analysis. and area deviation This achieves dynamic adjustment of the weight step size in two dimensions, thereby cutting off the positive feedback loop of "centroid movement - weight adjustment". During the iteration process, the formula for determining the weight radius for the next iteration based on the oscillation coefficient and area deviation determined in the current iteration is as follows:
[0087]
[0088] In the above formula, the superscript t represents the iteration round. Indicated based on the oscillation coefficient and area deviation Determine the adjustment step size.
[0089] Optionally, the step size can be calculated as follows:
[0090] big deviation This allows them to quickly approach the target value.
[0091] medium deviation It can balance speed and stability;
[0092] small deviation It can suppress oscillations.
[0093] In some embodiments of this application, the weighted radius calculation formula can be modified to calibrate accuracy and compensate for boundary compression. The specific formula is as follows:
[0094]
[0095] It can be seen that in the above formula, when the centroid is close to the boundary of the sub-region ( When this is done, the weighted distance can be effectively amplified to restore the edge area. Additionally, in the above formula... This value is used to represent the scene complexity at the boundary, and the more complex the scene, the larger the value. For example, λ=0.8 is used for scenes with complex boundaries (such as irregular edges), and λ=0.3 is used for simple scenes.
[0096] In the above formula, This represents the updated coordinates of the i-th candidate point (centroid) after inner-loop optimization (centroid iteration and morphological pre-repair). During the iteration process, the candidate point is adjusted from its initial position \(s_i\) to a new position, denoted as \(s_i^{new}\), through centroid calculation, movement constraints, and other steps. This new position is used for subsequent recalculation of weighted distances and is the core reference point for region re-delineation.
[0097] and Indicates the i-th candidate point The shortest straight-line distance to the boundary of the sub-region. This parameter is used to determine whether the centroid is close to the boundary and participates in the boundary compensation calculation in the formula. This represents the final determined radius of the sub-region. Furthermore, the weighted distance can be amplified by introducing a coefficient λ to offset the compression effect of the boundary on the region area, ensuring the accuracy of the boundary region area.
[0098] Optional, based on After pre-calculating the weighted distance and pre-delineating the area, if the area deviation after pre-delineation is ≤0.5%, then = Otherwise, iterate and fine-tune according to the rule of "adjusting the weight by 5% for every 1% deviation" until the required accuracy is met. Afterwards, the adjusted weight can be used as the basis for further adjustments. Each pixel is reassigned to the candidate point with the smallest distance, generating a new region. .
[0099] Step S208: Determine the sub-region that meets the preset iteration termination condition as the target sub-region.
[0100] In some embodiments of this application, when the target area is a display area for displaying relevant information of the target object, when an interactive operation occurs, the preset object information of the voting object corresponding to the target object sub-area can be obtained based on the target sub-area where the interactive operation is located.
[0101] As an optional implementation, the number of rendering threads corresponding to a target sub-region, or the computing resources that each rendering thread can allocate, can be determined based on the size of the target sub-region corresponding to the target object. Allocating more rendering threads or more available rendering computing resources to larger target sub-regions, and fewer rendering threads or fewer available rendering computing resources to smaller target sub-regions, can effectively improve the utilization rate of computing resources during the rendering process and ensure that the rendering speed of each target sub-region within the target area remains as consistent as possible. The specific content rendered in each target sub-region can be set according to the target object corresponding to that target sub-region, such as a specific video or image selected by the target object.
[0102] In the technical solution provided in step S208, the preset iteration termination conditions further include: the moving distance of the first centroid position relative to the second centroid position is less than a preset moving distance, the proportion of sub-regions with discrete regions is less than a first preset proportion, and the proportion of sub-regions with a corridor shape is less than a second preset proportion. Among these, discrete regions are regions whose area is not greater than a second preset threshold and whose neighborhood connectivity detection result is no connected regions, and sub-regions with a corridor shape include sub-regions whose aspect ratio of the smallest bounding rectangle is not less than a preset ratio.
[0103] Optionally, the specific values of each preset value in the preset iteration termination condition can be set by the user. For example, the global area deviation can be set. For example, the distance between the centroids of two adjacent rounds should be ≤0.5 pixels, and the occurrence rate of enclaves / corridors should be ≤2%. In addition, to avoid occasional success in a single round, the iteration can be terminated if the iteration termination condition is met for multiple consecutive rounds (e.g., 5 rounds).
[0104] In some embodiments of this application, after determining that the sub-region satisfying the preset iteration termination condition is the target sub-region, the method further includes: determining the variation range between the first real-time proportional data set and the second real-time proportional data set, wherein the first real-time proportional data set is the real-time proportional data set before the change, and the second real-time proportional data set is the real-time proportional data set after the change; if the variation range is greater than the preset range, updating the centroid and weight of the target sub-region corresponding to the first real-time proportional data set by using a linear interpolation update method based on the first real-time proportional data set and the second real-time proportional data set.
[0105] Optionally, to achieve a dynamic visual transition, when the real-time dynamic scale data changes significantly, such as by more than 10%, 20-30 transition frames can be generated based on the performance of the device executing the method. Each transition frame updates its centroid and weights using linear interpolation according to the following formula, without performing region remapping:
[0106]
[0107]
[0108] α increases linearly from 0 to 1 to ensure a smooth visual transition.
[0109] In some embodiments of this application, a two-stage smoothing method can also be used to smooth the target sub-region. The two-stage smoothing process includes a light smoothing stage and a strong smoothing stage. In the light smoothing stage, a 3×3 neighborhood weighted voting method can be used, and the voting weight is negatively correlated with the "distance from the point to the new centroid". If the number of votes is ≥5, the label of the point is updated.
[0110] During the strong smoothing stage, a 5×5 median filter can be used and iterated several times (e.g., twice) to limit the offset of boundary pixels and avoid area distortion.
[0111] After determining the target sub-region, we can use GPU parallel computing to fill the region with color and use Canvas to draw the boundary to achieve millisecond-level rendering.
[0112] In some embodiments of this application, assuming the displayed object is the percentage of votes received by a candidate, the display area is discretized into 200 × 150 grid cells, and the number of candidates is 36, then it can be as follows: Figure 3 As shown, 36 candidate points are initialized in a 6×6 uniform distribution. Each candidate is assigned a unique color (colori) and an initial scale of 1 / 36. The number of pixels rendered in the Canvas for each grid cell can be set manually, for example, to 4×4.
[0113] The sub-regions corresponding to each candidate can then be determined according to the following process:
[0114] The first step is to input the voting array voteData[t][i], where each line represents the data from round t. This is assumed to be 50 rounds, and the data is normalized. Stored in currentVotes.
[0115] The second step is to calculate the weighted distance and partition the Weighted CVT.
[0116] In this step, it can be done according to the proportions. Calculate the initial radius weights:
[0117] For each cell (x, y) in the grid, calculate the weighted distance:
[0118]
[0119] Minimum The corresponding candidate number is assigned to this unit.
[0120] After completion, calculate the geometric centroid of each region:
[0121]
[0122] And Move to Location.
[0123] Optionally, this step can be repeated multiple times to achieve Lloyd relaxation.
[0124] The third step is adaptive radius feedback adjustment.
[0125] In this step, the actual number of pixels in each region can be counted. The target area is =
[0126] Updated formula:
[0127]
[0128] Where α = 0.8 (damping coefficient). This feedback forms a closed-loop control, causing the area to gradually approach the target proportion.
[0129] The fourth step is a two-stage smoothing correction.
[0130] This step includes two stages: light smoothing and strong smoothing. In the light smoothing stage, a 3×3 majority vote can be performed on each pixel; if ≥5 neighbors belong to the same region, the current pixel is updated to that class label.
[0131] During the strong smoothing stage, a 5×5 median filter can be applied to the results, repeated 3 times, to remove minor noise and smooth the boundaries.
[0132] Step 5: Dynamic interpolation and animation transition.
[0133] When the new round of voting data Upon arrival, linear interpolation can be performed using the following formula:
[0134]
[0135] The default transition time is 20 frames. The step size is 0.05, and Weighted CVT and smoothing are performed once per frame to ensure continuous changes in region shape without abrupt changes.
[0136] Step 6: Rendering and Output.
[0137] The results can be drawn onto an HTML5 Canvas, with each region filled with its own color and automatically anti-aliased borders. (Center point) The data is plotted as numbered dots, and the area error of the region is displayed in real time on the right panel along with the current leading candidate. The final result is as follows: Figure 4 As shown.
[0138] By employing dynamic ratio data of each target object in the target object set and initial candidate points corresponding to the target objects in the target region, where the dynamic ratio indicates the business load information or business capability information of the target object, and the sum of the dynamic ratio data is 1; based on the distance from the points in the target region to the initial candidate points, the initial candidate points to which the points in the target region belong are determined, thus obtaining an initial sub-region; target candidate points are iteratively determined based on the centroids in the initial sub-regions, and the sub-regions corresponding to the target candidate points in the target region are updated after each determination of a target candidate point, until a preset iteration termination condition is met, where the preset iteration termination condition includes the deviation between the area of the sub-region and the preset area being less than a first preset threshold, and the target candidate... The selected points and dynamic ratio data are in one-to-one correspondence. The preset area is determined based on the dynamic ratio data corresponding to the target candidate points and the area of the target region. The method of determining the sub-region that meets the preset iteration termination condition as the target sub-region is achieved by iteratively determining the target candidate points and the positions and areas of the sub-regions corresponding to the target candidate points in the target region. This achieves the goal of accurately dividing the display area of each target object according to the priority of the target object. This results in the technical effect of allowing sub-regions with higher business load information or business capability information and more likely to have interactive events to occupy a relatively larger area. This solves the technical problem of user interaction inconvenience caused by the inability to accurately divide the display area of each target object according to the priority of the target object in related technologies.
[0139] According to embodiments of this application, a method is also provided. Figure 5 The rendering and display process shown is as follows: Figure 5 As can be seen from this, the process includes the following steps:
[0140] Step S502: Discretize the display area into multiple grids and arrange initial candidate points;
[0141] Step S504: Normalize the received real-time data to obtain proportional data;
[0142] Step S506: Iteratively execute the steps of weighted distance partitioning, centroid update, and adaptive weight radius adjustment until the deviation between the final determined sub-region area and the target sub-region area meets the preset requirements;
[0143] Step S508: Perform a two-stage smoothing correction process on the final sub-region.
[0144] Step S510: After the real-time data changes, each sub-region is updated using dynamic interpolation and animation updates.
[0145] Step S512: Render and display the sub-region.
[0146] This application embodiment also provides a method such as Figure 6 The rendering and display device shown is used to perform, for example Figure 5 The rendering and display methods shown, and as Figure 2 The method of area division is shown. From Figure 6 As can be seen from the diagram, the device includes a data input module 60, a dynamic calculation module 62, an adaptive radius feedback module 64, a two-stage smoothing and boundary correction module 66, a dynamic animation and continuous interpolation module 68, and a rendering and output module 610.
[0147] This application provides a region division device. Figure 7 This is a schematic diagram of the device. From Figure 7 As can be seen from the diagram, the device includes: a first processing module 70, used to determine the dynamic ratio data of each target object in the target object set, and the initial candidate point corresponding to the target object in the target area, wherein the dynamic ratio is used to indicate the business load information or business capability information of the target object; a second processing module 72, used to determine the initial sub-region corresponding to the initial candidate point based on the distance from the point in the target area to the initial candidate point; a third processing module 74, used to iteratively determine the target candidate point based on the centroid in the initial sub-region, and update the sub-region corresponding to the target candidate point in the target area after each determination of the target candidate point, until a preset iteration termination condition is met, wherein the preset iteration termination condition includes that the deviation between the area of the sub-region and the preset area is less than a first preset threshold, the target candidate point and the dynamic ratio data are in one-to-one correspondence, and the preset area is the area determined based on the dynamic ratio data corresponding to the target candidate point and the area of the target area; and a fourth processing module 76, used to determine the sub-region that meets the preset iteration termination condition as the target sub-region.
[0148] In some embodiments of this application, the third processing module 74 determines the target candidate point based on the centroid of the initial sub-region iteratively, including: in the first iteration, moving the initial candidate point a preset distance toward the centroid to obtain the target candidate point for the first iteration; in non-first iterations, determining the first moving distance for the current iteration based on the deviation between the area of the sub-region determined in the previous iteration and the preset area, and determining the centroid of the sub-region in the previous iteration, wherein the length of the first moving distance is negatively correlated with the magnitude of the deviation; in the current iteration, moving the target candidate point determined in the previous iteration toward the centroid determined in the previous iteration by the first moving distance to obtain the target candidate point for the current iteration.
[0149] In some embodiments of this application, the third processing module 74 is further configured to: determine noise points in the first region to be processed before satisfying the preset iteration termination condition, wherein the noise points are points whose distance from the boundary of the region to be processed is not greater than a preset distance, and the first region to be processed includes an initial sub-region and a sub-region; delete the noise points in the initial sub-region to obtain the effective region corresponding to the first region to be processed; and determine the centroid of the effective region as the centroid of the region to be processed.
[0150] In some embodiments of this application, the third processing module 74 is further configured to: determine discrete regions of the second region to be processed before satisfying a preset iteration termination condition, wherein the discrete region is a region with an area not greater than a second preset threshold and a neighborhood connectivity detection result of no connected regions, and the second region to be processed includes an initial sub-region and a sub-region; determine the weight level of the second region to be processed in the target region and the weight level of the discrete region, wherein the weight level of the second region to be processed is positively correlated with the weight radius of the second region to be processed, and the weight level of the discrete region is the same as the weight level of the second region to be processed corresponding to the discrete region; merge the discrete region and the target second region to be processed, wherein the target second region to be processed is a second region to be processed that is adjacent to the discrete region and has the same weight level.
[0151] In some embodiments of this application, the third processing module 74 is further configured to: determine a third region to be processed before satisfying a preset iteration termination condition, wherein the third region to be processed includes an initial sub-region and a sub-region whose aspect ratio of the minimum bounding rectangle is not less than a preset ratio; determine the centroid of the third region to be processed, and adjust the third region to be processed according to the centroid and the minimum bounding rectangle until the aspect ratio of the minimum bounding rectangle of the third region to be processed is greater than the preset ratio.
[0152] In some embodiments of this application, after determining that the sub-region satisfying the preset iteration termination condition is the target sub-region, the fourth processing module 76 is further configured to: determine the variation range between the first real-time proportional data set and the second real-time proportional data set, wherein the first real-time proportional data set is the real-time proportional data set before the change, and the second real-time proportional data set is the real-time proportional data set after the change; if the variation range is greater than the preset range, update the centroid and weight of the target sub-region corresponding to the first real-time proportional data set by using a linear interpolation update method based on the first real-time proportional data set and the second real-time proportional data set.
[0153] In some embodiments of this application, the preset iteration termination conditions further include: the movement distance of the first centroid position relative to the second centroid position is less than a preset movement distance, the proportion of sub-regions with discrete regions is less than a first preset proportion, and the proportion of sub-regions with a corridor shape is less than a second preset proportion. Here, the discrete region is a region whose area is not greater than a second preset threshold and whose neighborhood connectivity detection result is no connected region, and the sub-region with a corridor shape includes a sub-region whose aspect ratio of the minimum bounding rectangle is not less than a preset ratio.
[0154] It should be noted that each module in the above-mentioned area partitioning device can be a program module (for example, a set of program instructions that implement a certain function) or a hardware module. For the latter, it can be manifested in the following forms, but is not limited to them: each of the above modules is manifested as a processor, or the functions of each of the above modules are implemented by a processor.
[0155] According to an embodiment of this application, a non-volatile storage medium is also provided, which stores a program. During program execution, the program controls the device containing the non-volatile storage medium to perform the following region partitioning method: determining dynamic ratio data for each target object in a target object set, and initial candidate points corresponding to the target objects in the target region, wherein the dynamic ratio is used to indicate the service load information or service capability information of the target objects; determining an initial sub-region corresponding to the initial candidate point based on the distance from a point in the target region to the initial candidate point; iteratively determining target candidate points based on the centroids in the initial sub-regions, and updating the sub-region corresponding to the target candidate point in the target region after each determination of a target candidate point, until a preset iteration termination condition is met, wherein the preset iteration termination condition includes a deviation between the area of the sub-region and a preset area being less than a first preset threshold, a one-to-one correspondence between target candidate points and dynamic ratio data, and a preset area being the area determined based on the dynamic ratio data corresponding to the target candidate point and the area of the target region; and determining the sub-region that meets the preset iteration termination condition as the target sub-region.
[0156] According to an embodiment of this application, an electronic device is also provided, including a memory and a processor. The processor is used to run a program stored in the memory, wherein the program executes the following region partitioning method during runtime: determining dynamic ratio data of each target object in a target object set, and initial candidate points corresponding to the target objects in a target region, wherein the dynamic ratio is used to indicate the business load information or business capability information of the target objects; determining an initial sub-region corresponding to the initial candidate point based on the distance from the point in the target region to the initial candidate point; iteratively determining target candidate points based on the centroids in the initial sub-regions, and updating the sub-region corresponding to the target candidate point in the target region after each determination of a target candidate point, until a preset iteration termination condition is met, wherein the preset iteration termination condition includes that the deviation between the area of the sub-region and the preset area is less than a first preset threshold, the target candidate points and the dynamic ratio data are in one-to-one correspondence, and the preset area is the area determined based on the dynamic ratio data corresponding to the target candidate point and the area of the target region; and determining the sub-region that meets the preset iteration termination condition as the target sub-region.
[0157] According to an embodiment of this application, a computer program product is also provided, including a computer program that, when executed by a processor, implements the following region division method: determining dynamic ratio data of each target object in a target object set, and initial candidate points corresponding to the target objects in a target region, wherein the dynamic ratio is used to indicate the business load information or business capability information of the target objects; determining an initial sub-region corresponding to the initial candidate point based on the distance from a point in the target region to the initial candidate point; iteratively determining target candidate points based on the centroids in the initial sub-regions, and updating the sub-region corresponding to the target candidate point in the target region after each determination of a target candidate point, until a preset iteration termination condition is met, wherein the preset iteration termination condition includes that the deviation between the area of the sub-region and a preset area is less than a first preset threshold, the target candidate points and the dynamic ratio data are in one-to-one correspondence, and the preset area is the area determined based on the dynamic ratio data corresponding to the target candidate point and the area of the target region; and determining the sub-region that meets the preset iteration termination condition as the target sub-region.
[0158] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0159] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0160] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0161] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0162] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to related technologies, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0163] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for dividing regions, characterized in that, include: Determine the dynamic ratio data of each target object in the target object set, and the initial candidate point corresponding to the target object in the target area, wherein the dynamic ratio is used to indicate the business load information or business capability information of the target object; The initial sub-region corresponding to the initial candidate point is determined based on the distance from a point in the target region to the initial candidate point; Target candidate points are determined iteratively based on the centroids in the initial sub-region, and the sub-regions corresponding to the target candidate points in the target region are updated after each determination of the target candidate points until a preset iteration termination condition is met. The preset iteration termination condition includes that the deviation between the area of the sub-region and the preset area is less than a first preset threshold, the target candidate points and the dynamic ratio data are in one-to-one correspondence, and the preset area is the area determined based on the dynamic ratio data corresponding to the target candidate points and the area of the target region. The sub-region that satisfies the preset iteration termination condition is identified as the target sub-region.
2. The region division method according to claim 1, characterized in that, Determining target candidate points based on the centroid iteration in the initial sub-region includes: In the first iteration, the centroid of the initial sub-region is determined as the target candidate point for the first iteration; In non-first iterations, based on the deviation between the area of the sub-region determined in the previous iteration and the preset area, the first moving distance of the current iteration is determined, and the centroid of the sub-region in the previous iteration is determined, wherein the length of the first moving distance is negatively correlated with the magnitude of the deviation value; In this iteration, the centroid determined in the previous iteration is used as the target candidate point.
3. The region division method according to claim 1, characterized in that, The method further includes: Before the preset iteration termination condition is met, noise points in the first processing region are determined, wherein the noise points are points whose distance from the boundary of the processing region is not greater than a preset distance, and the first processing region includes the initial sub-region and the sub-region; Delete the noise points in the initial sub-region to obtain the effective region corresponding to the first region to be processed; The centroid of the effective region is determined to be the centroid of the region to be processed.
4. The region division method according to claim 1, characterized in that, The method further includes: Before the preset iteration termination condition is met, a discrete region of the second region to be processed is determined, wherein the discrete region is a region with an area not greater than a second preset threshold and a neighborhood connectivity detection result of no connected regions, and the second region to be processed includes the initial sub-region and the sub-region; Determine the weight level of the second region to be processed in the target region and the weight level of the discrete region, wherein the weight level of the second region to be processed is positively correlated with the size of the weight radius of the second region to be processed, and the weight level of the discrete region is the same as the weight level of the second region to be processed corresponding to the discrete region; The discrete region and the target second region to be processed are merged, wherein the target second region to be processed is a second region to be processed that is adjacent to the discrete region and has the same weight level.
5. The region division method according to claim 1, characterized in that, The method further includes: Before the preset iteration termination condition is met, a third region to be processed is determined, wherein the third region to be processed includes an initial sub-region and a sub-region whose aspect ratio of the minimum bounding rectangle is not less than a preset ratio. Determine the centroid of the third region to be processed, and adjust the third region to be processed based on the centroid and the minimum bounding rectangle until the aspect ratio of the minimum bounding rectangle of the third region to be processed is greater than the preset ratio.
6. The region division method according to claim 1, characterized in that, After determining that the sub-region satisfying the preset iteration termination condition is the target sub-region, the method further includes: Determine the range of change between the first real-time proportional data set and the second real-time proportional data set, wherein the first real-time proportional data set is the real-time proportional data set before the change, and the second real-time proportional data set is the real-time proportional data set after the change; If the change is greater than a preset range, the centroid and weight of the target sub-region corresponding to the first real-time proportional data set are updated using a linear interpolation update method based on the first real-time proportional data set and the second real-time proportional data set.
7. The region division method according to claim 1, characterized in that, The preset iteration termination conditions also include: the movement distance of the first centroid position relative to the second centroid position is less than a preset movement distance, the proportion of sub-regions with discrete regions is less than a first preset proportion, and the proportion of sub-regions with a corridor shape is less than a second preset proportion. The discrete regions are regions with an area not greater than a second preset threshold and whose neighborhood connectivity detection result is no connected regions. The sub-regions with a corridor shape include sub-regions whose aspect ratio of the smallest bounding rectangle is not less than a preset ratio.
8. A region division device, characterized in that, include: The first processing module is used to determine the dynamic ratio data of each target object in the target object set, and the initial candidate point corresponding to the target object in the target area. The dynamic ratio is used to indicate the display priority of the target object. The second processing module is used to determine the initial sub-region corresponding to the initial candidate point based on the distance from the point in the target region to the initial candidate point; The third processing module is used to iteratively determine target candidate points based on the centroids in the initial sub-region, and update the sub-region corresponding to the target candidate point in the target region after each determination of the target candidate point, until a preset iteration termination condition is met. The preset iteration termination condition includes that the deviation between the area of the sub-region and the preset area is less than a first preset threshold, the target candidate points and the dynamic ratio data are in one-to-one correspondence, and the preset area is the area determined based on the dynamic ratio data corresponding to the target candidate point and the area of the target region. The fourth processing module is used to determine the sub-region that satisfies the preset iteration termination condition as the target sub-region.
9. A non-volatile storage medium, characterized in that, The non-volatile storage medium stores a program, wherein when the program is executed, it controls the device where the non-volatile storage medium is located to execute the region partitioning method according to any one of claims 1 to 7.
10. An electronic device, characterized in that, include: A memory and a processor, the processor being configured to run a program stored in the memory, wherein the program, when running, executes the region partitioning method according to any one of claims 1 to 7.
11. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the region division method according to any one of claims 1 to 7.