Work area generation method, device, mobile terminal, and storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHANGYAO INNOVATION TECH (SHENZHEN) CO LTD
- Filing Date
- 2026-04-24
- Publication Date
- 2026-08-07
AI Technical Summary
[0003]然而,当多个区域之间存在多个公共点时,现有技术难以准确判断区域是否可合并,也无法保证合并后形成的区域是唯一且闭合的,同时,多次切割、合并操作后,易出现数据冗余、拼接错误或无法闭合的问题,导致区域合并操作的稳定性差,难以满足移动终端场景下的区域编辑需求
1、通过切割确定第一特殊点(切割线与边界交点)、提取第二特殊点(子区域间坐标相同的公共点),系统性定位所有多区域共享的公共点,替代现有技术对公共点的简单识别;进一步检测特殊点交叉情况,将交叉的特殊点同步关联至对应子区域,建立多区域间公共点的强关联关系。基于该关联关系,可直接通过特殊点的归属、交叉状态清晰判断哪些区域存在公共关联、具备合并前提,从根源上解决多公共点下合并可性判断模糊的问题;
Smart Images

Figure CN122530355A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, mobile terminal, and storage medium for generating a work area. Background Technology
[0002] When managing work areas, existing mobile apps typically represent work areas as a closed set of connected points, allowing users to perform editing operations such as cutting and merging. Area cutting usually generates sub-regions by intersecting the cutting line with the area boundary, while area merging is based on common boundaries or points between areas. Some apps perform simple deduplication of common points or directly concatenate point sets during the operation to form a new area data structure.
[0003] However, when multiple regions have multiple common points, existing technologies struggle to accurately determine whether regions can be merged, and cannot guarantee that the merged region is unique and closed. Furthermore, after multiple cutting and merging operations, data redundancy, splicing errors, or failure to close the region can easily occur, resulting in poor stability of region merging operations and making it difficult to meet the region editing needs in mobile terminal scenarios. Summary of the Invention
[0004] To overcome the shortcomings of existing technologies, this invention provides a method, apparatus, mobile terminal, and storage medium for generating work areas. By defining special points for area cutting points and common points, and combining direction preservation rules and special point sinking strategies, deterministic processing of area cutting and merging is achieved, ensuring the uniqueness of the merging result, the clarity of the data structure, and support for multi-area and multi-editing scenarios.
[0005] A first aspect of this application provides a method for generating a work area, the method comprising: Receive the user-inputted work area, define the work area as a closed set of points connected end to end, and determine the construction direction of the closed set of points. A cutting operation is performed on the closed point set region based on a first special point to obtain a set of sub-regions; wherein, the first special point is the intersection of the cutting line and the boundary of the closed point set region; Extract points in the closed point set region that have the same coordinate information as the sub-region set, and use them as second special points; Detect whether the target special point intersects with other regions. If there is an intersection, the target special point is synchronously added to the other regions to obtain all regions containing the associated special point. The target special point is either the first special point or the second special point, and the other regions are the remaining sub-regions in the sub-region set other than the currently associated region of the target special point. Divide the first special point and the second special point into even points and odd points; Based on the even points and the odd points, determine the start and end points for merging any two adjacent regions to be merged in all regions containing the associated special points, and output the set of regions to be merged containing the start and end points for merging; The point set of the region to be merged is subjected to redundancy removal processing to obtain the redundancy-removed point set of the region to be merged. Based on the construction direction, the redundant point set to be merged is merged.
[0006] A second aspect of this application provides a work area generation apparatus, the apparatus comprising: The region construction module is used to receive the work region input by the user, define the work region as a closed set of points connected end to end, and determine the construction direction of the closed set of points. The region cutting module is used to perform a cutting operation on the closed point set region based on a first special point to obtain a set of sub-regions; wherein, the first special point is the intersection of the cutting line and the boundary of the closed point set region; The special point extraction module is used to extract points in the closed point set region that have the same coordinate information as the sub-region set, and use them as second special points; The special point synchronization module is used to detect whether the target special point intersects with other regions. If there is an intersection, the target special point is synchronously added to the other regions to obtain all regions containing the associated special points. The target special point is either the first special point or the second special point, and the other regions are the remaining sub-regions in the sub-region set other than the currently associated region of the target special point. The special point classification module is used to divide the first special point and the second special point into even points and odd points; The merge start and end point determination module is used to determine the merge start and end points of any two adjacent regions to be merged in all regions containing associated special points based on the even points and the odd points, and output a set of points of the regions to be merged containing the merge start and end points; The point set redundancy removal module is used to perform redundancy removal processing on the point set of the region to be merged, and obtain the point set of the region to be merged after redundancy removal. The region merging module is used to merge the redundant point set to be merged according to the construction direction.
[0007] A third aspect of this application provides a mobile terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the job area generation method.
[0008] A fourth aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described job area generation method.
[0009] In summary, the work area generation method, apparatus, mobile terminal, and storage medium provided in this application have at least one of the following beneficial effects: 1. By identifying the first special point (the intersection of the cutting line and the boundary) and extracting the second special point (common points with the same coordinates between sub-regions), this system systematically locates all common points shared by multiple regions, replacing the simple identification of common points in existing technologies. Furthermore, it detects the intersection of special points and synchronously associates the intersecting special points with their corresponding sub-regions, establishing a strong correlation between common points across multiple regions. Based on this correlation, the attribution and intersection status of special points can clearly determine which regions have common associations and meet the prerequisites for merging, fundamentally solving the problem of ambiguity in determining the feasibility of merging under multiple common points. 2. Special points are divided into even points and odd points. The starting and ending points of merging adjacent regions to be merged are determined based on the odd and even points. This defines a unique starting and ending point for the merging path, avoiding the problem of random merging paths and messy splicing under multiple common points. It ensures the uniqueness of the merging path from the perspective of topological principles and directly solves the problem that a unique closed region cannot be formed after merging. 3. Perform redundancy removal on the point sets to be merged, removing duplicate common points and invalid points to avoid point set redundancy leading to distorted closed regions; during merging, follow the construction direction of the initially defined closed point set to ensure that the merged point set is connected end to end and in a unified order, ultimately forming a standardized and unique closed working region. Attached Figure Description
[0010] Figure 1 This is a flowchart illustrating a method for generating a work area according to an embodiment of this application; Figure 2 This is a schematic diagram illustrating the selected state of a work area to be segmented, as shown in an embodiment of this application; Figure 3 This is a schematic diagram illustrating the generation of a dividing line in an embodiment of this application; Figure 4 This is a schematic diagram illustrating the result of a completed work area segmentation according to an embodiment of this application; Figure 5 This is a schematic diagram illustrating the result of merging work areas according to an embodiment of this application; Figure 6 This is a functional block diagram of a work area generation device shown in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of a mobile terminal shown in an embodiment of this application. Detailed Implementation
[0011] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0012] The following will clearly and completely describe the concept, specific structure, and technical effects of the present invention in conjunction with embodiments and accompanying drawings, so as to fully understand the purpose, features, and effects of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of them. Other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are all within the scope of protection of the present invention. Furthermore, all connections / linkages involved in the patent do not simply refer to direct contact between components, but rather to the ability to form a better connection structure by adding or reducing connecting accessories according to specific implementation conditions. The various technical features in this invention can be combined interactively without contradicting each other.
[0013] In addition to the lack of stability in region merging, existing technologies for region cutting and merging on the app side also suffer from issues such as inconsistent region orientation, lack of certainty in region merging capability, chaotic management of common points, and weak multi-region association and expansion capabilities. Specifically, firstly, the point set order of sub-regions generated after region cutting may change, leading to inconsistent clockwise or counterclockwise directions for sub-regions, increasing the complexity of subsequent processing. Secondly, existing technologies typically only simply determine whether points are the same, without further classifying common points, resulting in a large number of redundant or erroneous points in the region data after multiple regions and multiple cuts and merges. Thirdly, when new points formed after region cutting simultaneously intersect with other regions, existing technologies struggle to maintain the merging capability between regions, affecting subsequent region editing operations. Fourthly, in the presence of multiple common points, the starting and ending points of region merging are not unique, easily leading to incorrect splicing or inability to close the connection. Therefore, existing technologies are insufficient to meet the stability, consistency, and scalability requirements of region segmentation and merging in APP scenarios. A new method for generating work areas is needed, applicable to map editing and intelligent region management APPs on mobile terminals, including but not limited to intelligent device management APPs, map editing APPs, and region planning APPs. This method should fully realize region segmentation and merging based on specific points for the drawing, segmentation, and merging of map work areas. To facilitate understanding of the inventive concept of this application, the following description uses a mobile terminal APP as the execution subject to illustrate the work area generation method.
[0014] Reference Figure 1 The diagram shown is a flowchart illustrating a method for generating a work area according to an embodiment of this application. The method for generating a work area includes the following steps.
[0015] S11, Receive the job area input by the user, define the job area as a closed set of points connected end to end, and determine the construction direction of the closed set of points.
[0016] The mobile terminal APP (hereinafter referred to as APP) receives the sequence of vertex coordinates of the region clicked / drawn by the user on the screen, such as P1 (x1,y1), P2 (x2,y2), P3 (x3,y3), ..., Pn (xn,yn). The APP automatically connects the first and last vertices of the vertex sequence to form a closed set of vertices P1→P2→P3→...→Pn→P1, thus constructing a complete working region. The data structure of this working region is a closed set of vertices without branches or overlaps, which means that the working region can be defined as a closed set of vertices connected end to end.
[0017] The app also pre-assigns a unique construction direction for the closed point set region, such as clockwise or counterclockwise, and binds the direction attribute to the point set for storage. When the direction of the closed point set is defined as clockwise by default, the output is a closed point set region with a fixed clockwise direction; when the direction of the closed point set is defined as counterclockwise by default, the output is a closed point set region with a fixed counterclockwise direction.
[0018] By unifying the regional direction rules, the problems of chaotic clockwise / counterclockwise direction of sub-regions after region segmentation and high complexity of subsequent data processing are solved.
[0019] S12, Perform a cutting operation on the closed point set region based on the first special point to obtain a sub-region set.
[0020] When it's necessary to cut a closed point set region, the user can draw one or more cutting lines (straight line segments) within the app, where the dividing lines can be adjusted. The app calculates the coordinates of the intersection points between the cutting lines and the boundary of the closed point set region (also known as the original region) in real time. Using these intersection points as dividing nodes, the closed point set region is split into two or more independent sub-region point sets. The vertex order of each sub-region point set is traversed, strictly replicating the construction direction of the closed point set region without reversing or shuffling the vertex sequence. Multiple sub-regions with the same direction as the closed point set region are output, completing the cutting operation and obtaining a set of sub-regions with a unified direction. (Refer to...) Figures 2 to 4 As shown, taking Zone A as the selected dividing area as an example, users can draw a dividing line with their finger in the blank area, which will cross the map to generate a dividing line. Based on the confirmed dividing line, the area is divided into two, resulting in Zone A and Zone D.
[0021] Simultaneously, the intersection of the cutting line and the region boundary is designated as a special point (referred to as the first special point for easy distinction). This first special point serves as the natural connection point between the two sub-regions after the cut, and is assigned a unique identifier. This first special point is then inserted into the corresponding boundary position of each of the cut sub-regions, updating the point set data for all sub-regions, and outputting the sub-region point set carrying the special point.
[0022] By ensuring that the set of sub-regions generated after the region is cut maintains the same construction direction as the original region during the region cutting process, and by adding unified association nodes to the cut sub-regions, the problem of no common connection points and inability to identify the merging relationship after the cut sub-regions is solved, providing basic connection conditions for subsequent region merging.
[0023] S13, extract the points in the closed point set region that have the same coordinate information as the sub-region set, and use them as the second special points.
[0024] Traverse the coordinates of all vertices in the closed vertex set region and the set of sub-regions. Perform a precise coordinate comparison of all vertices based on the vertex coordinates (x and y values must be completely identical). Filter out overlapping points that exist in two or more sub-regions and have the same coordinate information. Mark these overlapping points as special points (referred to as second special points for easy distinction), and record the associated region number and coordinate information corresponding to the second special point. Output a list of special points and the corresponding associated region data.
[0025] By standardizing and unifying the definition of cross-regional public points, the problem of chaotic public point management caused by the lack of unified identification due to the simple judgment of whether the points are the same in the existing technology can be solved.
[0026] S14, detect whether the target special point intersects with other regions. If there is an intersection, the target special point is synchronously added to the other regions to obtain all regions containing the associated special point.
[0027] Wherein, the target special point is either the first special point or the second special point, and the other regions are the remaining sub-regions in the sub-region set other than the regions currently associated with the target special point.
[0028] Since special points are already written into the point set of their respective sub-regions, these sub-regions can be defined as the currently associated regions of the corresponding special points. In some embodiments, the app iterates through all special points (i.e., the first special point and the second special point) and checks whether each special point intersects or overlaps with other sub-regions outside the currently associated regions. If an intersection exists, the target special point is synchronously added to the point set of the corresponding intersection sub-region, and the list of associated regions of the target special point is updated to ensure that all intersecting sub-regions hold the exact same special point data, maintaining the merging capability between regions.
[0029] By performing cross-regional cross-detection, synchronous writing, and relationship update on all special points, the system ensures that each sub-region with cross-relationships holds completely consistent special point data. This solves the problem of weak multi-regional relationship expansion capability in existing technologies, avoids the loss of merging relationships when new intersections generated by cutting intersect with other regions, and supports the continuation of merging relationships in multi-region and multi-edit scenarios.
[0030] S15, divide the first special point and the second special point into even points and odd points.
[0031] In some embodiments, the app can count how many sub-regions each special point exists in, defining special points existing in an even number of sub-regions as even points and special points existing in an odd number of sub-regions as odd points. All special points are then tagged as even / odd points and bound to the point sets of the corresponding sub-regions.
[0032] By using quantitative classification, we can achieve refined management of common points, solve the problem of the lack of certainty in the merging of existing technology regions, and use the attribute rules of even / odd points to accurately determine the legality of region merging and the splicing logic.
[0033] S16, based on the even point and the odd point, determine the start and end points for merging any two adjacent regions to be merged in all regions containing the associated special points, and output the set of regions to be merged containing the start and end points for merging.
[0034] In some embodiments, the app arbitrarily selects two sub-regions that meet the merging condition (shared special points) as regions to be merged, and applies a special point sinking strategy to the point set of the regions to be merged. Specifically, all special points in the region to be merged are uniformly adjusted to the end of the point set, and sorted according to a preset rule, such as even points first and odd points last. Based on the distribution of special points after sinking, the first special point after sorting is determined as the unique merging starting point of the region to be merged, and the last special point after sorting is determined as the unique merging ending point of the region to be merged, thus preventing the problem of non-unique start and end points in scenarios with multiple common points, and outputting a region point set to be merged with unique merging start and end points.
[0035] By applying a special point sinking strategy to the point set of the merging region and sorting it in an orderly manner with even points first and odd points last, a unique merging start point and merging end point are determined based on the sorting result. This solves the core problems of existing technologies where the merging start and end points are not unique and the merging results are unstable. The sinking strategy fixes the merging connection position, fundamentally avoiding incorrect splicing and the inability to close regions.
[0036] S17, perform redundancy removal processing on the point set of the region to be merged to obtain the point set of the region to be merged after redundancy removal.
[0037] In some embodiments, after obtaining the set of points in the regions to be merged with unique start and end points, the APP traverses the set of points in the regions to be merged, identifies all even points and determines the number of even points. If the number of even points is greater than 1, only the first and last even points in the set of points to be merged are retained, and all redundant even points with identical coordinates between the first and last even points are deleted in batches, and the clean set of points in the regions to be merged after redundancy removal is output.
[0038] By performing even-point identification and redundancy cleanup on the point set to be merged, only the first and last even-points are retained and the duplicate even-points in the middle are deleted. This solves the problem of redundant point accumulation and data structure disorder after multiple rounds of cutting and merging in the existing technology, cleans up invalid duplicate points, avoids redundant points interfering with the splicing logic, and improves the cleanliness and processing efficiency of regional data.
[0039] S18, according to the construction direction, the set of points to be merged after redundancy removal is merged.
[0040] In some embodiments, after obtaining the unique start and end points of merging, the unique start and end points are used as connecting nodes. Following the set construction direction, any two adjacent sets of points in the redundant sets to be merged are sequentially spliced together. Specifically, during splicing, the connecting points serve as the docking hub, precisely aligning the end point of the first merged region with the start point of the second merged region. Throughout the process, the vertex order of the point sets remains completely consistent with the initial construction direction, without reversal or disruption of the vertex sequence, ensuring a unified direction during the splicing process.
[0041] After the splicing is complete, the newly generated region point set is automatically checked for closure. This involves traversing the coordinates of the first and last vertices of the point set and comparing their x and y coordinates to determine if the region point set is closed. If the check results indicate that the region point set is not closed, the app immediately locates the vertex sequence at the splicing connection point, corrects misaligned, missing, or out-of-order vertices, adjusts the order of vertices near the connection point, deletes duplicate vertices, and fills in missing connection vertices until the coordinates of the first and last vertices of the point set completely coincide. After correction, the app finally generates a new, branchless, and uniformly oriented closed working region, completing the merging operation. (Refer to...) Figure 5 As shown, taking Zone A and Zone D as two regions to be merged as an example, Zone A is obtained by merging Zone A and Zone D.
[0042] It should be noted that only the segmented regions can be merged and added together. Merging is only supported between adjacent regions and cross-region operations are not allowed. The app can only merge two adjacent regions in a single region merge operation.
[0043] By using a complete process of fixed connection points, limiting adjacent merging, unifying direction splicing, and automatic verification and correction, the merging process is guaranteed to be consistent in direction and accurate in splicing. This solves the problems of erroneous merging results and inability to close existing merging techniques, and achieves unique and stable regional merging results, supporting repeated editing of multiple regions.
[0044] Reference Figure 6 The diagram shown is a functional block diagram of the work area generation device according to an embodiment of this application.
[0045] In some embodiments, the job area generation device 60 may include multiple functional modules composed of computer program segments. The computer programs for each program segment of the job area generation device 60 may be stored in the memory of the mobile terminal and executed by at least one processor to perform (see details). Figure 1 (Description) The function of generating the work area. Based on the functions it performs, it can be divided into multiple functional modules. These functional modules may include: a region construction module 601, a region cutting module 602, a special point extraction module 603, a special point synchronization module 604, a special point classification module 605, a merging start and end point determination module 606, a point set redundancy removal module 607, and a region merging module 608. The module referred to in this application is a series of computer program segments that can be executed by at least one processor and perform a fixed function, stored in memory. In this embodiment, the functions of each module will be detailed in subsequent embodiments.
[0046] The region construction module 601 is used to receive the work region input by the user, define the work region as a closed set of points connected end to end, and determine the construction direction of the closed set of points.
[0047] The region cutting module 602 is used to perform a cutting operation on the closed point set region according to a first special point to obtain a sub-region set; the first special point is the intersection of the cutting line and the boundary of the closed point set region.
[0048] The special point extraction module 603 is used to extract points in the closed point set region that have the same coordinate information as the sub-region set as second special points.
[0049] The special point synchronization module 604 is used to detect whether the target special point intersects with other regions. If there is an intersection, the target special point is synchronously added to the other regions to obtain all regions containing the associated special points. The target special point is any one of the first special point and the second special point, and the other regions are the remaining sub-regions in the sub-region set other than the regions currently associated with the target special point.
[0050] The special point classification module 605 is used to divide the first special point and the second special point into even points and odd points.
[0051] The merge start and end point determination module 606 is used to determine the merge start and end points of any two adjacent regions to be merged in all regions containing associated special points based on the even points and the odd points, and output a set of points of the regions to be merged containing the merge start and end points.
[0052] The point set redundancy removal module 607 is used to perform redundancy removal processing on the point set of the region to be merged, so as to obtain the point set of the region to be merged after redundancy removal.
[0053] The region merging module 608 is used to merge the redundant point set of the region to be merged according to the construction direction.
[0054] It should be understood that the various variations and specific embodiments of the work area generation method provided in the above embodiments are also applicable to the work area generation device of this embodiment. Through the foregoing detailed description of the work area generation method, those skilled in the art can clearly understand the implementation method of the work area generation device in this embodiment. For the sake of brevity, it will not be described in detail here.
[0055] See Figure 7 The diagram shown is a schematic representation of the structure of a mobile terminal according to an embodiment of this application. In a preferred embodiment of this application, the mobile terminal 7 includes a memory 71, at least one processor 72, and at least one communication bus 73.
[0056] Those skilled in the art should understand that Figure 7 The structure of the mobile terminal shown does not constitute a limitation of the embodiments of this application. It can be a bus structure or a star structure. The mobile terminal 7 may also include more or fewer other hardware or software than shown, or different component arrangements.
[0057] In some embodiments, the mobile terminal 7 is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions. Its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), programmable gate arrays (FPGAs), digital processors, and embedded devices. The mobile terminal 7 may also include user equipment, which includes, but is not limited to, any electronic product capable of human-computer interaction with a user via a keyboard, mouse, remote control, touchpad, or voice control device, such as a personal computer, tablet computer, smartphone, or digital camera.
[0058] In the embodiments provided in this application, it should be understood that the disclosed methods, apparatus, computer-readable storage media, and mobile terminals can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple components or modules may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings or direct couplings or communication connections may be indirect couplings or communication connections between devices, components, or modules through some interfaces, and may be electrical, mechanical, or other forms.
[0059] The components described as separate parts may or may not be physically separate. The components shown as components may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the components can be selected to achieve the purpose of this embodiment according to actual needs.
[0060] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing module, or each component can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0061] If the integrated module is implemented as a software functional module 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 the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. 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 the present invention. The aforementioned storage medium includes: USB flash drive, portable hard drive, read-only memory (ROM). Various media that can store program code, such as only memory, random access memory (RAM), magnetic disks or optical disks.
[0062] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.
[0063] In the above embodiments, 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.
[0064] The above is a detailed description of the preferred embodiments of the present invention. However, the present invention is not limited to the embodiments described. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. All such equivalent modifications or substitutions are included within the scope defined by the claims of this application.
Claims
1. A method for generating a work area, characterized in that, The method includes: Receive the user-inputted work area, define the work area as a closed set of points connected end to end, and determine the construction direction of the closed set of points. A cutting operation is performed on the closed point set region based on a first special point to obtain a set of sub-regions; wherein, the first special point is the intersection of the cutting line and the boundary of the closed point set region; Extract points in the closed point set region that have the same coordinate information as the sub-region set, and use them as second special points; Detect whether the target special point intersects with other regions. If there is an intersection, the target special point is synchronously added to the other regions to obtain all regions containing the associated special point. The target special point is either the first special point or the second special point, and the other regions are the remaining sub-regions in the sub-region set other than the currently associated region of the target special point. Divide the first special point and the second special point into even points and odd points; Based on the even points and the odd points, determine the start and end points for merging any two adjacent regions to be merged in all regions containing the associated special points, and output the set of regions to be merged containing the start and end points for merging; The point set of the region to be merged is subjected to redundancy removal processing to obtain the redundancy-removed point set of the region to be merged. Based on the construction direction, the redundant point set to be merged is merged.
2. The method for generating a work area according to claim 1, characterized in that, The step of performing a cutting operation on the closed point set region based on the first special point to obtain a set of sub-regions includes: Receive the cutting line input by the user, calculate the intersection point of the cutting line and the boundary of the closed point set region, and determine the intersection point as the first special point; The closed point set region is divided into the sub-region set based on the first special point; wherein the point set order of each sub-region is consistent with the construction direction of the closed point set region.
3. The method for generating a work area according to claim 1, characterized in that, The even point is a special point that exists in an even number of regions simultaneously, and the odd point is a special point that exists in an odd number of regions simultaneously.
4. The method for generating a work area according to claim 1, characterized in that, The step of determining the start and end points for merging any two regions to be merged in all regions containing associated special points based on the even points and the odd points includes: All special points in the set of points to be merged are moved to the end of the set of points to be merged, and all special points are sorted in a preset order. Based on the special points after the arrangement, the unique starting point and ending point of the merged point set of the region to be merged are determined as the merge start and end points.
5. The method for generating a work area according to claim 4, characterized in that, The merging start and end points include a unique merging start point and a unique merging end point; wherein, the unique merging start point is the first special point among the arranged special points, and the unique merging end point is the last special point among the arranged special points.
6. The method for generating a work area according to claim 1, characterized in that, The step of performing redundancy removal processing on the point set of the region to be merged includes: Traverse the set of points in the region to be merged and obtain the number of all even points in the set of points in the region to be merged. When the number of even points is greater than 1, retain the first and last even points in the point set of the region to be merged, and delete all redundant even points that are the same between the first and last even points.
7. The method for generating a work area according to claim 1, characterized in that, The step of merging the redundant-free point set of regions to be merged according to the construction direction includes: The starting and ending points of the merging are determined as the connection points. According to the construction direction, any two adjacent sets of points to be merged in the set of points to be merged after redundancy removal are sequentially spliced together. Verify whether the spliced region point set is closed at both ends; When there is an unclosed set of points, the vertex order of the connection positions of the unclosed set of points is corrected to generate a new closed working region consistent with the construction direction.
8. A work area generation device, characterized in that, The device includes: The region construction module is used to receive the work region input by the user, define the work region as a closed set of points connected end to end, and determine the construction direction of the closed set of points. The region cutting module is used to perform a cutting operation on the closed point set region based on a first special point to obtain a set of sub-regions; wherein, the first special point is the intersection of the cutting line and the boundary of the closed point set region; The special point extraction module is used to extract points in the closed point set region that have the same coordinate information as the sub-region set, and use them as second special points; The special point synchronization module is used to detect whether the target special point intersects with other regions. If there is an intersection, the target special point is synchronously added to the other regions to obtain all regions containing the associated special points. The target special point is either the first special point or the second special point, and the other regions are the remaining sub-regions in the sub-region set other than the currently associated region of the target special point. The special point classification module is used to divide the first special point and the second special point into even points and odd points; The merge start and end point determination module is used to determine the merge start and end points of any two adjacent regions to be merged in all regions containing associated special points based on the even points and the odd points, and output a set of points of the regions to be merged containing the merge start and end points; The point set redundancy removal module is used to perform redundancy removal processing on the point set of the region to be merged, and obtain the point set of the region to be merged after redundancy removal. The region merging module is used to merge the redundant point set to be merged according to the construction direction.
9. A mobile terminal, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the job area generation method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the job area generation method according to any one of claims 1 to 7.