Layout method and device of machine vision task flow chart, electronic equipment and storage medium

By displaying the hot zone of the module in the machine vision task flow chart, the problem of messy module location is solved, and efficient and intuitive layout optimization is achieved, suitable for complex scenarios.

CN120508277APending Publication Date: 2025-08-19HANGZHOU HIKROBOT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510592219.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-08
Publication Date
2025-08-19

AI Technical Summary

Technical Problem

In machine vision task flowchart design, the lack of constraints on module locations leads to disorderly layouts, especially when there are many modules and complex relationships, it is difficult for users to efficiently adjust the module location to meet their needs.

Method used

Through the start movement operation of the receiving module, the allowed hot zones are displayed, and the hot zones are dynamically generated according to the position of the module in the canvas, limiting the module's placement range and providing intuitive placement guidance.

Benefits of technology

It improves the intuitiveness and efficiency of machine vision task flow chart layout, reduces repeated trial and error and time costs caused by insufficient experience, and is suitable for scenarios with large number of modules and complex relationships.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120508277A_ABST
    Figure CN120508277A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a layout method and device of a machine vision task flow chart, electronic equipment and a storage medium, an area allowing placement of a first module is displayed by responding to a movement starting operation for the first module, namely, a hot area is displayed, the method can improve the intuition of the layout of the machine vision task flow chart, and the user experience is improved. The problem of disordered flow chart layout caused by repeated trial and error and random drag and drop due to insufficient user experience is avoided, and the method is suitable for scenes with a large number of modules and complex relations. Meanwhile, due to the fact that the hot area corresponding to the first module is displayed, the placement range of the modules is limited, a user is helped to rapidly know the placement positions of the modules meeting the service logic, the time cost generated by repeatedly adjusting the positions of the modules is reduced, and then the efficiency of optimizing the layout of the machine vision task flow chart is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of machine vision technology, and in particular to a layout method, device, electronic device, and storage medium for a machine vision task flow chart. Background Art

[0002] In the flowchart design process, related technologies often allow users to freely arrange modules on the canvas by dragging and dropping them to facilitate user-defined design requirements. This design approach, which relies entirely on user control, lacks constraints on module placement, leading to a chaotic and disorganized overall layout. This problem is particularly severe when dealing with complex business logic, as the number of modules increases, and the chaotic layout becomes more serious. To optimize the flowchart layout, users need to adjust the module positions. However, with traditional methods, users can only rely on empirical judgment each time they adjust the module position. Due to their lack of experience, they need to repeatedly move modules and observe whether the flowchart layout meets their requirements. If not, they need to move the modules back to their original positions. This repetitive operation is inefficient. Especially when the number of flowchart modules reaches dozens or even hundreds, due to the complex relationships between modules, it is difficult for users to accurately judge the impact of moving a module on the overall layout, which increases the difficulty of operation and makes the problem of inefficiency even more serious. Summary of the Invention

[0003] The purpose of the embodiments of the present application is to provide a method, device, electronic device, and storage medium for layout of a machine vision task flowchart to improve the efficiency of machine vision task flowchart layout. The specific technical solution is as follows:

[0004] In a first aspect, an embodiment of the present application provides a method for laying out a machine vision task flow chart, the method comprising:

[0005] Receiving a start move operation for a first module; the first module indicates a machine vision task to be performed;

[0006] In response to the start move operation, a hot zone corresponding to the first module is displayed according to the current position of the first module on the canvas; the hot zone indicates an area where the first module is allowed to be placed.

[0007] In a possible implementation, displaying a hot zone corresponding to the first module according to the current position of the first module on the canvas includes:

[0008] If the first module is adjacent to a blank grid point, a hot zone corresponding to the first module is displayed at the blank grid point; wherein the canvas includes a plurality of grids, and the grids are used to adsorb machine vision task modules;

[0009] or,

[0010] If the first module covers the second module and there is a preceding connection line to the second module, then the hot zone corresponding to the first module is displayed near the second module;

[0011] or,

[0012] If the first module covers the first connection line between modules, displaying the hot zone corresponding to the first module on the first connection line;

[0013] or,

[0014] In response to the first module covering the third module and the third module having no preceding connection line, the hot zone corresponding to the first module is not displayed.

[0015] In one possible implementation, the method further includes:

[0016] When the hot zone is displayed, in response to the end of the move operation on the first module, placing the first module at the location of the hot zone;

[0017] In a case where the hot zone is not displayed, in response to the end of the move operation on the first module, the first module is restored to its initial position.

[0018] In a possible implementation, displaying the hot zone corresponding to the first module on the first connection line includes:

[0019] If the first connecting line is a straight line segment, a hot zone corresponding to the first module is displayed at a position on the first connecting line that is a first preset distance away from the first starting point module; wherein the first starting point module is a module located at the starting point of the first connecting line;

[0020] or,

[0021] If the first connecting line is a right-angle connecting line, and the first module covers a first sub-segment of the right-angle connecting line, a hot zone corresponding to the first module is displayed at a position on the first sub-segment that is a second preset distance away from the first starting point module;

[0022] or,

[0023] If the first connection line is a right-angle connection line and the first module covers other sub-segments of the right-angle connection line, the hot zone corresponding to the first module is displayed at the end module; wherein the end module is the module located at the end point of the first connection line.

[0024] In one possible implementation, the method further includes:

[0025] If the first module covers the first connection line, a second connection line is displayed between the first starting point module and the hot zone corresponding to the first module, and a third connection line is displayed between the hot zone corresponding to the first module and the end point module.

[0026] In one possible implementation, the method further includes:

[0027] If the first module covers the first connection, setting the first connection to an invisible state;

[0028] In response to the first module no longer covering the first connection line, the hot zone, the second connection line, and the third connection line corresponding to the first module are deleted, and the first connection line is set to a visible state.

[0029] In a possible implementation, displaying a hot zone corresponding to the first module at a position near the second module includes:

[0030] Displaying a hot zone corresponding to the first module at a third preset distance in a first direction of the second module, wherein the first direction is a direction from the second module to the first module;

[0031] or,

[0032] A hot zone corresponding to the first module is displayed at the location of the second module.

[0033] In one possible implementation, the method further includes:

[0034] If the first module covers the second module and there is a preceding connection line for the second module, the second module is set to an invisible state, and a fourth module is displayed at a fourth preset distance in the second direction of the second module, and a fourth connection line between the second starting module and the hot zone corresponding to the first module is displayed, and a fifth connection line between the second starting module and the fourth module is displayed, wherein the second direction is the opposite direction of the first direction, the fourth module is the same as the second module, and the second starting module is the module located at the starting point of the preceding connection line;

[0035] In response to the first module no longer covering the second module, the hot zone, the fourth module, the fourth connection line, and the fifth connection line corresponding to the first module are deleted, and the second module is set to a visible state.

[0036] In one possible implementation, the method further includes:

[0037] In the case of displaying a hot zone, moving a fifth module to a position that does not overlap with the hot zone; wherein the fifth module is a module in the canvas that overlaps with the hot zone;

[0038] In response to the movement of the fifth module, a sixth module is moved to a position not overlapping with the fifth module, wherein the sixth module is a module in the canvas that overlaps with the fifth module.

[0039] In one possible implementation, the method further includes:

[0040] In response to the copy-paste operation or the generate operation, determining a size of a rectangular area containing all seventh modules as a target size, and determining a target position, wherein the target position is a paste position indicated by the copy-paste operation or a generate position indicated by the generate operation, and the seventh module is a module copied by the copy-paste operation or a module generated by the generate operation;

[0041] Determine a rectangular area located at the target position and having a size equal to the target size as the target rectangular area;

[0042] Move the eighth module outside the target rectangular area; wherein the eighth module is a module that overlaps with the seventh module within the target rectangular area;

[0043] In response to the movement of at least one of the eighth modules, a ninth module is moved to a position that does not overlap with the moved eighth module; wherein the ninth module is a module in the canvas that overlaps with the moved eighth module.

[0044] In one possible implementation, the method further includes:

[0045] In response to the movement of any module, if the current position of the moved module is outside the canvas, the canvas is expanded so that the current position of the moved module is within the canvas.

[0046] In one possible implementation, the method further includes:

[0047] In response to the movement of any module, a module closest to a third direction is searched among all modules that have moved, as the critical module; wherein the third direction is a positive direction of a column direction, and / or a negative direction of the column direction, and / or a positive direction of a row direction, and / or a negative direction of the row direction;

[0048] If the moving direction of the critical module is the third direction, determining whether the current position of the critical module after the movement exceeds the boundary of the canvas in the third direction;

[0049] If the current position of the moved module is outside the canvas, the canvas is expanded, including:

[0050] If the current position of the moved critical module exceeds the boundary of the canvas in the third direction, the canvas is expanded in the third direction.

[0051] In one possible implementation, the method further includes:

[0052] In response to the grid spacing adjustment operation on the canvas, calculating new physical coordinates of each module according to the adjusted spacing and the grid coordinates of each module;

[0053] Move each module to the new physical coordinates.

[0054] In a possible implementation, the grid spacing adjustment operation is a work area switching operation, and the method further includes:

[0055] In response to the working area switching operation, determining the working area to which the working area switching operation is switched as a target working area;

[0056] A distance pre-configured for the target working area is determined as the adjusted distance.

[0057] In a second aspect, an embodiment of the present application provides a layout device for a machine vision task flow chart, the device comprising:

[0058] A first receiving module is configured to receive a start movement operation for a first module, wherein the first module indicates a machine vision task to be performed;

[0059] The first display module is configured to display a hot zone corresponding to the first module according to the current position of the first module on the canvas in response to the start moving operation; the hot zone indicates an area where the first module is allowed to be placed.

[0060] In a possible implementation, the first display module includes:

[0061] Displaying a first submodule, for displaying a hot zone corresponding to the first module at a blank grid point if the first module is adjacent to the blank grid point; wherein the canvas includes a plurality of grids, and the grids are used to adsorb machine vision task modules;

[0062] or,

[0063] Displaying a second submodule, for displaying a hot zone corresponding to the first module at a position near the second module if the first module covers the second module and there is a preceding connection line to the second module;

[0064] or,

[0065] Displaying a third submodule, configured to display a hot zone corresponding to the first module on a first connection line between modules if the first module covers the first connection line between modules;

[0066] or,

[0067] The fourth submodule is displayed, and is used for not displaying the hot zone corresponding to the first module in response to the first module covering the third module and the third module having no preceding connection line.

[0068] In a possible implementation, the device further includes:

[0069] a first moving module, configured to place the first module at a location where the hot zone is located in response to an end movement operation on the first module when the hot zone is displayed;

[0070] The second moving module is configured to restore the first module to its initial position in response to an end of the moving operation on the first module without displaying the hot zone.

[0071] In a possible implementation, the display third submodule includes:

[0072] A first display unit is configured to display a hot zone corresponding to the first module at a position on the first connecting line that is a first preset distance away from the first starting point module if the first connecting line is a straight line segment; wherein the first starting point module is a module located at the starting point of the first connecting line;

[0073] or,

[0074] a second display unit configured to display a hot zone corresponding to the first module at a position on the first sub-segment that is a second preset distance from the first starting point module if the first connecting line is a right-angle connecting line and the first module covers a first sub-segment of the right-angle connecting line;

[0075] or,

[0076] Display a third unit, used to display the hot zone corresponding to the first module at the end module if the first connection line is a right-angle connection line and the first module covers other sub-segments of the right-angle connection line; wherein the end module is the module located at the end point of the first connection line.

[0077] In a possible implementation, the device further includes:

[0078] The second display module is configured to display a second connection line between the first starting module and the hot zone corresponding to the first module, and to display a third connection line between the hot zone corresponding to the first module and the end module if the first module covers the first connection line.

[0079] In a possible implementation, the device further includes:

[0080] a first setting module, configured to set the first connection line to an invisible state if the first module covers the first connection line;

[0081] The first deleting module is configured to delete the hot zone, the second connection, and the third connection corresponding to the first module in response to the first module no longer covering the first connection, and set the first connection to a visible state.

[0082] In a possible implementation, the display second submodule includes:

[0083] A fourth display unit is configured to display a hot zone corresponding to the first module at a third preset distance in a first direction of the second module, wherein the first direction is a direction from the second module to the first module;

[0084] or,

[0085] The fifth unit is displayed, and is used to display a hot zone corresponding to the first module at the position where the second module is located.

[0086] In a possible implementation, the device further includes:

[0087] a second setting module, configured to, if the first module covers the second module and a preceding connection line exists for the second module, set the second module to an invisible state, display a fourth module at a fourth preset distance in a second direction from the second module, display a fourth connection line between the second starting module and the hot zone corresponding to the first module, and display a fifth connection line between the second starting module and the fourth module, wherein the second direction is the opposite direction of the first direction, the fourth module is the same as the second module, and the second starting module is the module located at the starting point of the preceding connection line;

[0088] The second deleting module is configured to delete the hot zone, the fourth module, the fourth connection line, and the fifth connection line corresponding to the first module in response to the first module no longer covering the second module, and set the second module to a visible state.

[0089] In a possible implementation, the device further includes:

[0090] a third moving module, configured to move a fifth module to a position that does not overlap with the hot zone when the hot zone is displayed; wherein the fifth module is a module in the canvas that overlaps with the hot zone;

[0091] The fourth moving module is configured to move the sixth module to a position not overlapping with the fifth module in response to the movement of the fifth module, wherein the sixth module is a module in the canvas that overlaps with the fifth module.

[0092] In a possible implementation, the device further includes:

[0093] a position determination module, configured to, in response to a copy-paste operation or a generate operation, determine a size of a rectangular area containing all seventh modules as a target size, and determine a target position, wherein the target position is a paste position indicated by the copy-paste operation or a generate position indicated by the generate operation, and the seventh module is a module copied by the copy-paste operation or a module generated by the generate operation;

[0094] an area determination module, configured to determine a rectangular area located at the target position and having a size equal to the target size as a target rectangular area;

[0095] a fifth moving module, configured to move an eighth module outside the target rectangular area; wherein the eighth module is a module that overlaps with the seventh module within the target rectangular area;

[0096] The sixth moving module is configured to move the ninth module to a position that does not overlap with the moved eighth module in response to movement of at least one of the eighth modules; wherein the ninth module is a module in the canvas that overlaps with the moved eighth module.

[0097] In a possible implementation, the device further includes:

[0098] The first expansion module is configured to respond to the movement of any module and, if the current position of the moved module is outside the canvas, expand the canvas so that the current position of the moved module is within the canvas.

[0099] In a possible implementation, the device further includes:

[0100] a second expansion module, configured to, in response to the movement of any module, search among all modules that have moved a module that is closest to a third direction as a critical module; wherein the third direction is a positive direction of a column direction, and / or a negative direction of the column direction, and / or a positive direction of a row direction, and / or a negative direction of the row direction;

[0101] a third expansion module, configured to determine, if the critical module moves in the third direction, whether the current position of the critical module after movement exceeds the boundary of the canvas in the third direction;

[0102] The first expansion module includes:

[0103] The first submodule is expanded, and is configured to expand the canvas in the third direction if the current position of the critical module after movement exceeds the boundary of the canvas in the third direction.

[0104] In a possible implementation, the device further includes:

[0105] a first adjustment module, configured to, in response to a grid spacing adjustment operation on the canvas, calculate new physical coordinates of each module according to the adjusted spacing and the grid coordinates of each module;

[0106] The seventh moving module is used to move each module to a new physical coordinate.

[0107] In a possible implementation, the grid spacing adjustment operation is a work area switching operation, and the apparatus further includes:

[0108] a second adjustment module, configured to, in response to the working area switching operation, determine the working area to which the working area switching operation is switched as a target working area;

[0109] The third adjustment module is configured to determine a distance pre-configured for the target working area as the adjusted distance.

[0110] According to a third aspect, an electronic device is provided, including:

[0111] memory for storing computer programs;

[0112] The processor is configured to implement any of the methods described in the first aspect when executing a program stored in the memory.

[0113] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any method described in the first aspect is implemented.

[0114] Beneficial effects of the embodiments of the present application:

[0115] The layout method, device, electronic device and storage medium of the machine vision task flowchart provided in the embodiment of the present application, by responding to the start movement operation for the first module, displays the area where the first module is allowed to be placed, that is, displays the hot zone. This method can improve the intuitiveness of the layout of the machine vision task flowchart, avoid the problem of messy flowchart layout caused by repeated trial and error and random drag and drop due to insufficient user experience, and is suitable for scenarios with a large number of modules and complex relationships. At the same time, since the hot zone corresponding to the first module is displayed, the placement range of the module is limited, helping users to quickly know the module placement position that conforms to the business logic, reducing the time cost caused by repeatedly adjusting the module position, and thus improving the efficiency of the machine vision task flowchart layout.

[0116] Of course, it is not necessary to achieve all the advantages described above at the same time when implementing any product or method of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0117] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other embodiments can also be obtained based on these drawings.

[0118] Figure 1 A first flow chart of a method for arranging a machine vision task flow chart according to an embodiment of the present application;

[0119] Figure 2a A schematic diagram of overlapping conflict confirmation provided in an embodiment of the present application;

[0120] Figure 2b A first schematic diagram of the module connection relationship provided in an embodiment of the present application;

[0121] Figure 2c A second schematic diagram of the module connection relationship provided in an embodiment of the present application;

[0122] Figure 3a This is a first schematic diagram of serial connection between modules provided in an embodiment of the present application;

[0123] Figure 3b A second schematic diagram of serial connection between modules provided in an embodiment of the present application;

[0124] Figure 3c A second flow chart of the method for arranging a machine vision task flow chart provided in an embodiment of the present application;

[0125] Figure 4a A third schematic diagram of serial connection between modules provided in an embodiment of the present application;

[0126] Figure 4b A fourth schematic diagram of serial connection between modules provided in an embodiment of the present application;

[0127] Figure 4c A fifth schematic diagram of serial connection between modules provided in an embodiment of the present application;

[0128] Figure 5a A third flow chart of the machine vision task flow chart layout method provided in an embodiment of the present application;

[0129] Figure 5b A fourth schematic diagram of serial connection between modules provided in an embodiment of the present application;

[0130] Figure 6a This is a first schematic diagram of parallel connection between modules provided in an embodiment of the present application;

[0131] Figure 6b A second schematic diagram of parallel connection between modules provided in an embodiment of the present application;

[0132] Figure 6c A fourth flow chart of the machine vision task flow chart layout method provided in an embodiment of the present application;

[0133] Figure 7a A fifth flow chart of the machine vision task flow chart layout method provided in an embodiment of the present application;

[0134] Figure 7b A third schematic diagram of parallel connection between modules provided in an embodiment of the present application;

[0135] Figure 8a A first schematic diagram of the distributed crowding among modules provided in an embodiment of the present application;

[0136] Figure 8b A second schematic diagram of the distributed crowding among modules provided in the embodiment of the present application;

[0137] Figure 8c A sixth flow chart of the machine vision task flow chart layout method provided in an embodiment of the present application;

[0138] Figure 8d A third schematic diagram of the distributed crowding among modules provided in the embodiment of the present application;

[0139] Figure 9a A seventh flow chart diagram of the machine vision task flow chart layout method provided in an embodiment of the present application;

[0140] Figure 9b A fourth schematic diagram of distributed crowding among modules provided in an embodiment of the present application;

[0141] Figure 10 This is a schematic diagram of an eighth flow chart of the machine vision task flow chart layout method provided in an embodiment of the present application;

[0142] Figure 11 A schematic diagram of canvas expansion provided in an embodiment of the present application;

[0143] Figure 12a A first schematic diagram of grid spacing adjustment provided in an embodiment of the present application;

[0144] Figure 12b A second schematic diagram of grid spacing adjustment provided in an embodiment of the present application;

[0145] Figure 12c A third schematic diagram of grid spacing adjustment provided in an embodiment of the present application;

[0146] Figure 13 A schematic diagram of the structure of a machine vision task flow chart layout device provided in an embodiment of the present application;

[0147] Figure 14 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0148] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field based on this application are within the scope of protection of this application.

[0149] The present application embodiment provides a layout method for a machine vision task flow chart, see Figure 1 , Figure 1 The first flow chart of the method for arranging a machine vision task flow chart provided in an embodiment of the present application includes:

[0150] S101: Receive a start movement operation for a first module.

[0151] The first module indicates the machine vision task to be performed.

[0152] S102 : In response to starting the move operation, displaying a hot zone corresponding to the first module according to the current position of the first module on the canvas.

[0153] The hot zone indicates an area where the first module is allowed to be placed.

[0154] By applying the above embodiment, in response to the start movement operation for the first module, the area where the first module is allowed to be placed, that is, the hot zone, is displayed. This method can improve the intuitiveness of the layout of the machine vision task flowchart, avoid the problem of messy flowchart layout caused by repeated trial and error and random drag and drop due to insufficient user experience, and is particularly suitable for scenarios with a large number of modules and complex relationships. At the same time, since the hot zone corresponding to the first module is displayed, the placement range of the module is limited, helping users quickly know the placement position of the module that conforms to the business logic, reducing the time cost caused by repeatedly adjusting the module position, and thus improving the efficiency of the machine vision task flowchart layout.

[0155] In addition, the visual guidance of hot zones lowers the user's operating threshold. Even users who lack knowledge of machine vision task flowchart design can optimize the layout of machine vision task flowcharts through the intuitive display of hot zones, thereby solving the inefficiency and layout confusion caused by experience dependence, repeated corrections and global complexity in the traditional free drag and drop mode, and realizing intelligent and efficient optimization of the machine vision task flowchart layout.

[0156] The above steps S101 and S102 are described below:

[0157] In step S101, the first module is any module in the canvas, which can be one module or multiple modules. The user can input a start move operation on the first module by using a mouse or a designated key on the keyboard, and the user can also trigger the start move operation by other means such as touch, voice, etc.

[0158] For example, taking the first module as module A, and the user inputting the start moving operation on the first module through the mouse, when the user selects module A by clicking the left mouse button in the canvas and starts dragging, the canvas system captures the click and drag events as the input signal of "start moving operation".

[0159] In step S102 , the canvas system may obtain information such as the grid coordinates and physical coordinates of the first module currently located on the canvas in real time as the current position of the first module on the canvas.

[0160] After obtaining the current position of the first module on the canvas, a hot zone is dynamically generated according to predefined layout conditions, such as dependencies, logical relationships, and space avoidance rules between modules.

[0161] For example, if module A needs to be connected to module B, the predefined hot zone corresponding to module A is only displayed near module B.

[0162] When displaying hot zones, the hot zones can be superimposed on the canvas in the form of semi-transparent color blocks, grid lines, etc., to visually prompt the user where the module can be placed.

[0163] In one possible embodiment, when displaying the hotspot corresponding to the first module, after obtaining the current position of the first module on the canvas, the area where the first module is located on the canvas can be determined based on the position, and the hotspot is displayed in that area. For example, the canvas can be divided into an upper left area, an upper right area, a lower left area, and a lower right area. When the area where the first module is located is the upper left area, the hotspot corresponding to the first module is displayed in the upper left area of the canvas.

[0164] In another possible embodiment, to further optimize the presentation effect of the machine vision task flowchart and enhance the simplicity, clarity, and intuitiveness of the layout, the positional relationship between the first module and other modules and connections can be determined based on the current position of the first module on the canvas, and differentiated hot zone display rules can be flexibly set. Specifically, the aforementioned step S102 includes:

[0165] S1021: If the first module is adjacent to a blank grid point, display the hot zone corresponding to the first module at the blank grid point.

[0166] The canvas includes multiple grids, which are used to adsorb machine vision task modules.

[0167] or,

[0168] S1022: If the first module covers the second module and there is a preceding connection line to the second module, a hot zone corresponding to the first module is displayed at a position near the second module.

[0169] or,

[0170] S1023: If the first module covers the first connection line between modules, display the hot zone corresponding to the first module on the first connection line.

[0171] or,

[0172] S1024: In response to the first module covering the third module and the third module having no preceding connection line, the hot zone corresponding to the first module is not displayed.

[0173] Applying the above embodiment, when the first module is adjacent to a blank grid point, a hot zone is displayed at the blank grid point, and clear operation prompts are provided in the blank area around the module, so that users can quickly identify and perform interactive operations related to the module. If the first module covers the second module with a preceding connection line, a hot zone is displayed near the second module, taking into account the business logic and data flow represented by the connection line between modules, to ensure that during the module layout adjustment process, even if the module positions overlap, the user can still clearly see the hot zone associated with the covered module, so as to accurately grasp the logical relationship between modules and avoid operational errors or logical confusion due to module overlap. When the first module covers the first connection line between modules, a hot zone is displayed on the connection line, and the hot zone is directly associated with the connection line, which helps users accurately grasp the connection relationship between modules when adjusting the module layout. When the first module covers the third module without a preceding connection, the hot zone is not displayed, which avoids the display of useless hot zones when modules with no actual business logic association overlap, reduces redundant information on the interface, makes the interface more concise and clear, reduces user operation interference, and improves user operation efficiency and experience. Overall, this method flexibly sets differentiated hot zone display rules by judging the positional relationship between the first module and other modules and connections. By dynamically adjusting the hot zone display rules according to the module position, it can adapt to the operation requirements in different layout scenarios, ensuring that the machine vision task flow chart provides users with a more convenient and efficient operation experience while displaying clear logic, thereby improving the efficiency and experience of users when performing machine vision task module layout and interactive operations.

[0174] The specific display rules of the hot zone have been described in the above steps S1021 to S1024. Based on these rules, the system can display or not display the hot zone according to the different positions of the first module in the canvas, and provide interactive guidance for the precise placement of subsequent modules. Based on this, in the case of displaying the hot zone, after receiving the end movement operation for the first module, the first module is placed at the position where the hot zone is located, so as to ensure that the module is accurately placed at the appropriate logical connection point or position. In the case of not displaying the hot zone, after receiving the end movement operation for the first module, the first module is restored to the initial position of the first module, thereby avoiding the module being placed in an inappropriate position and destroying the rationality of the logic of the machine vision task flow chart, and further ensuring the accuracy of the layout of the machine vision task module.

[0175] Since modules often already exist in the current canvas, when displaying hot zones, there may be overlap with existing modules. In this case, the existing modules need to be moved. After the position of one module is adjusted, the user also needs to adaptively adjust the positions of other modules. Furthermore, as the positions of other modules are adjusted, the user may also need to adaptably adjust the positions of more modules so that there are no overlapping modules in the canvas. Based on this, in a possible embodiment, in order to improve the efficiency of optimizing the layout of the machine vision task flow chart, the system can automatically identify modules that overlap with the displayed hot zones and automatically move them to non-overlapping positions. Specifically:

[0176] When the hot zone is displayed, the fifth module is moved to a position that does not overlap with the hot zone.

[0177] Among them, the fifth module is a module that overlaps with the hot zone in the canvas.

[0178] In response to the movement of the fifth module, move the sixth module to a position that does not overlap with the fifth module, wherein the sixth module is a module that overlaps with the fifth module in the canvas;

[0179] Continue to search for modules that overlap with the moved sixth module, move the modules that overlap with the moved sixth module to a position where they do not overlap with the moved sixth module, and so on, until there are no overlapping modules in the canvas.

[0180] If only one hot zone is displayed in the canvas, a fifth module that overlaps with the hot zone is determined and moved to a position that does not overlap with the hot zone.

[0181] If multiple hotspots are displayed on the canvas, starting with the first of the displayed hotspots, for each hotspot, determine the fifth module that overlaps with each displayed hotspot and move it to a position where it does not overlap with the hotspot. This process continues in this manner until all overlapping modules are determined and moved, eliminating any overlapping modules on the canvas.

[0182] Taking the movement of the fifth module as an example, in a possible embodiment, the determination of the fifth module and the movement of the fifth module may be simultaneously achieved through one algorithm module.

[0183] In another possible embodiment, two algorithm modules can be set, one algorithm module is used to determine the fifth module, and the other algorithm module is used to move the fifth module. Since the fifth module is determined in order to determine the fifth module that is squeezed out from the displayed hot zone, the process of determining the fifth module is the process of implementing the squeezing algorithm. Based on this, the aforementioned algorithm module can be referred to as the squeezing algorithm module. For the convenience of description below, the squeezing algorithm module will be referred to as the squeezing algorithm. And in the case of displaying the hot zone, it is necessary to place the first module at the position where the hot zone is located. Therefore, moving the fifth module to a position that does not overlap with the hot zone is to move the fifth module to a position that does not overlap with the first module after the move. For the convenience of description, the following will take the example of moving the fifth module to a position that does not overlap with the first module after the move as an example.

[0184] After the fifth module is moved, all overlapping modules are determined in the same manner and moved until there are no overlapping modules in the canvas.

[0185] When the fifth module is moved, each fifth module may be moved one by one, or a plurality of fifth modules may be moved simultaneously.

[0186] It is understandable that when the first module is moved, the position of the first module after the move is known. Therefore, after knowing the position of the first module after the move, the fifth module that overlaps with the moved first module can be determined, without having to determine the fifth module that overlaps with the first module after the move. Based on this, in one possible embodiment, the first module can be moved first, and then the fifth module that overlaps with the moved first module can be determined. In another possible embodiment, the fifth module that overlaps with the moved first module can also be determined before moving the first module.

[0187] For example, assume that there are three modules in the canvas: module A, module B, and module C. Initially, the modules do not overlap with each other.

[0188] Method 1: If the user wants to move module A, they can first move module A downward. After module A moves downward, traverse modules B and C to check whether they overlap with the moved module A.

[0189] Method 2: If the user wants to move module A, before module A actually moves, the virtual position and range of module A after it moves are calculated based on module A's current position and the user-specified movement direction and distance. Then, the algorithm traverses modules B and C to check whether they overlap with the virtual range of module A after it moves.

[0190] The following will describe how to determine the fifth module that overlaps with the first module after the move and the downstream module of the first module according to the crowding algorithm, taking the first module in the start move operation for the first module as module 1 as an example, see Figure 2a , Figure 2a A schematic diagram of overlapping conflict confirmation provided in an embodiment of the present application, wherein the method includes:

[0191] S201 , after detecting that the module 1 has moved, calculating the longitudinal offset Y and the lateral offset X of the module 1 according to the position information of the module 1 before and after the movement.

[0192] In this example, when determining the second module using the crowding algorithm, the input parameters of the crowding algorithm are the original position information of module 1, the longitudinal offset Y of module 1, and the lateral offset X of module 1. After obtaining the original position information of module 1, the longitudinal offset Y of module 1, and the lateral offset X of module 1, the position information of the position to which module 1 will be moved can be obtained, and thus the module overlapping with module 1 can be determined.

[0193] In another possible embodiment, the input parameter of the crowding algorithm may also be the position information of module 1 after movement.

[0194] S202 , searching for all modules connected in series after module 1 along a direction parallel to the inter-module connection line; searching for all modules connected in parallel with module 1 along a direction perpendicular to the inter-module connection line.

[0195] See also Figure 2b , Figure 2b The first schematic diagram of the module connection relationship provided in the embodiment of the present application is as follows: Figure 2b As shown, module 2 and module 3 are modules connected in series after module 1, and module 4 is a module connected in series before module 1. Figure 2c , Figure 2c The second schematic diagram of the module connection relationship provided in the embodiment of the present application is as follows: Figure 2c As shown, module 3 and module 4 are modules connected in parallel with module 1.

[0196] S203: Obtain all associated connection modules.

[0197] The associated connection modules include all modules connected in series after module 1 and all modules connected in parallel with module 1.

[0198] S204. Among all the calculated associated connection modules and other unassociated module sets A in the canvas, determine the set of placeholder modules B that have overlapping conflicts with the moved module 1 along the direction parallel to the connection lines between the modules; and calculate the target placeholder of module 1 after movement, and the set of placeholder modules B that have overlapping conflicts with the moved module 1 along the direction perpendicular to the connection lines between the modules.

[0199] Among them, the set of other unrelated modules A is the upstream module of module 1, or a set of modules on the canvas that have no connection relationship with module 1.

[0200] S205: Obtain placeholder module set B, return to step S202, and obtain the associated connection modules of each module in placeholder module set B;

[0201] S206, continue to determine the placeholder modules until the placeholder module set B is empty;

[0202] S207, obtaining module set C.

[0203] The module set C is the set of all modules in the canvas that are affected by the movement of module 1.

[0204] S208 , moving modules in module set C to eliminate overlap, and determining module set C according to a crowding algorithm until the number of module set C is zero.

[0205] The GetNeedMoveModules algorithm includes a link module acquisition sub-algorithm (GetLinkModules) and a placeholder module acquisition sub-algorithm (IsContainsObstacle). Steps S202 and S203 are dependent on the link module acquisition sub-algorithm, while steps S204, S205, and S206 are dependent on the placeholder module acquisition sub-algorithm.

[0206] The above describes how to position the fifth module after the first module initiates a move, and how to implement a corresponding movement strategy to ensure no overlapping modules on the canvas. However, in real-world applications, the root cause of module position changes, and the subsequent need for layout adjustments, primarily comes from the user's adjustment of module positions.

[0207] Specifically, taking the adjustment of the position of module 2 as an example, when the user wants to move module 2 to the position where the connection line between modules was originally located, in this case, serial occupation between modules will be triggered to achieve a canvas without overlapping modules. Among them, serial occupation refers to the occupation of modules in a direction parallel to the module connection line, and the aforementioned step S1023 will trigger serial occupation between modules. When the user wants to move module 2 to the position where the module is located, or the position on both sides of the module, in this case, parallel occupation between modules will be triggered to achieve a canvas without overlapping modules. Among them, both sides of the module refer to the two sides located on the vertical center line of the module. Parallel occupation refers to the occupation of modules in a direction perpendicular to the module connection line, and the aforementioned step S1022 will trigger parallel occupation between modules. When the user copies and pastes module 2 or the module set to which module 2 belongs, in this case, occupation between modules will also be triggered to achieve a canvas without overlapping modules.

[0208] To more clearly illustrate the layout method of the machine vision task flow chart provided in the embodiment of the present application, the following will explain the three aspects of module congestion caused by serial connection between modules, module congestion caused by parallel connection between modules, and module congestion caused by copying and pasting modules:

[0209] 1. Inter-module serial connection

[0210] See also Figure 3a , Figure 3a This is a first schematic diagram of serial connection between modules provided in an embodiment of the present application. A first starting module 300 is connected to an end module 302 via a first line 301. When a user drags a first module 303 onto the first line 301, i.e., when the first module 303 covers the first line 301 between modules, a hotspot 304 corresponding to the first module 303 is displayed on the first line 301, and a second line 305 pointing from the first starting module 300 to the hotspot 304 is displayed, as well as a third line 306 pointing from the hotspot 304 to the end module 302.

[0211] See also Figure 3b , Figure 3b In the second schematic diagram of the serial encroachment between modules provided in the embodiment of the present application, when the first module 303 is suspended on the first connection line 301, in response to the termination of the suspension of the first module 303, that is, receiving the end movement operation for the first module 303, the third module 303 is moved to the hot zone 304, that is, the first module 303 is placed at the position where the hot zone 304 is located.

[0212] For details, see Figure 3c , Figure 3c A second flow chart of the method for arranging a machine vision task flow chart provided in an embodiment of the present application includes:

[0213] S301: If a first module covers a first connection line between modules, a hot zone corresponding to the first module is displayed on the first connection line.

[0214] S302 , displaying a second connection line between the first starting point module and the hot zone corresponding to the first module, and displaying a third connection line between the hot zone corresponding to the first module and the end point module.

[0215] Applying the above embodiment, when the first module overlaps the first connection, the hot zone corresponding to the first module is displayed on the first connection, and the connection lines (second and third lines) between it and the original modules (first starting module and end module) are displayed, intuitively presenting a visual preview of the potential connection relationship, helping the user to predict the results of the module movement. After the first module stops floating, it is automatically moved to the location of the hot zone, and the optimized path connection is intelligently updated and drawn. This maintains the neatness of the canvas and the logical coherence between modules, avoiding intersections or confusion caused by manual adjustments, and ultimately achieving a canvas layout that meets the user's operational intentions without causing module overlap and connection confusion.

[0216] In the process of the user moving the first module, in order to prevent the layout confusion caused by the hot zone, the second connection line and the third connection line displayed on the canvas due to accidental touch by the user, in a possible embodiment, the hot zone, the second connection line and the third connection line can be displayed after the user enters a confirmation instruction through the keyboard or mouse.

[0217] In another possible embodiment, in order to reduce user workload and improve user experience, a response time threshold may be set. Specifically, the aforementioned step S301 includes:

[0218] Step 3011: When the duration of time that the first module covers the first connection reaches the first duration threshold, the hot zone corresponding to the first module is displayed on the first connection, and the second connection line from the first starting module to the hot zone and the third connection line from the hot zone to the end module are displayed.

[0219] The first duration threshold can be set by professional staff based on work experience or industry regulations. Specifically, if real-time response is required, a smaller duration threshold can be set, such as 0.01s, 0.02s, or 0.001s. If the canvas is required to be neat, a larger duration threshold can be set, such as 0.1s, 0.2s, or 0.3s. These are not specifically limited here.

[0220] For example, a connection timer is embedded during canvas control initialization to monitor module movement events. When the user hovers the mouse over the first connection, the connection timer begins counting. Only when the mouse remains on the first connection for a period exceeding a first threshold will the connection timer be triggered to display the hotspot corresponding to the first module, the second connection, and the third connection, preventing unnecessary display of modules and connections due to accidental touches or brief user pauses.

[0221] By applying the above embodiment, by setting a duration threshold to trigger the generation and display of modules and their connections, the accuracy of interaction and the user experience are effectively improved. The hot zone and corresponding connection corresponding to the first module are displayed only when the first module is suspended on the first connection for a duration that reaches the threshold. This avoids false triggering and interface clutter during user operation, ensures that layout adjustments are not made until the user clearly understands the operation intention, and effectively maintains the neatness of the canvas.

[0222] For example, when a canvas control is initialized, a pre-installed serial timer is embedded. Due to the serial timer, the serial timer begins timing in response to the mouse hovering over the first connection. When the mouse covers the first connection, the hotspot, second connection, and third connection corresponding to the first module are displayed. Therefore, when the hotspot, second connection, and third connection corresponding to the first module are displayed, the first connection cannot be directly deleted. Based on this, in one possible embodiment, to improve the neatness of the canvas and optimize the layout, the first connection is set to invisible when the first module covers the first connection.

[0223] Specifically, the transparency of the first connection line may be set to 0, or the color of the first connection line may be set to the same color as the background, or other methods may be used to make the first connection line invisible, which are not specifically limited here.

[0224] By applying the above embodiment, the first connection line is set to be invisible to avoid visual interference caused by the crossing or overlapping of multiple connections in the covering state, reduce visual clutter, highlight the second connection line and the third connection line, and make the logic between modules (such as the association between the hot zone corresponding to the first module and the upstream module and the downstream module) clearer, thereby improving the simplicity of the layout in the canvas of the hot zone corresponding to the first module, the second connection line and the third connection line display stage, and at the same time avoiding the waste of resources caused by maintaining the state of the first connection line and handling hierarchical conflicts with other connections.

[0225] When the first module covers the first connection line, the hot zone, second connection line, and third connection line corresponding to the first module will be displayed on the first connection line. Therefore, the user can intuitively see the result of the module movement. If the user is satisfied with the result after moving the module, the first module can stop covering the first connection line, that is, release the mouse and move the first module to the position of the hot zone corresponding to the first module. If the user is not satisfied with the result after moving the module, the first module can be moved away from the first connection line, that is, the first module no longer covers the first connection line, and the hot zone, second connection line, and third connection line corresponding to the displayed first module are deleted, and the invisible first connection is set to be visible.

[0226] In the above embodiment, when the first module covers the first connection, the first connection is hidden. After the user terminates the hover interaction, the visibility of the first connection is restored. This allows for timely removal of unsatisfactory interaction products, such as the hotspot, second connection, and third connection corresponding to the first module, while preventing redundant hotspots and connections from occupying system resources. By redisplaying the first connection, the original logical connection between modules is maintained.

[0227] When the first module is overlaid on the first connection line, it will trigger a series squeeze. However, due to different layouts, the connection lines between modules may be straight lines or right-angled lines. In order to optimize the layout, when displaying the hot zone corresponding to the first module, it is necessary to further determine the display position of the hot zone corresponding to the first module based on the connection line where the first module is located. Specifically:

[0228] When the first connecting line is a straight line segment, the aforementioned step S301 includes:

[0229] Step 3012: If the first connecting line is a straight line segment, display a hot zone corresponding to the first module at a position on the first connecting line that is a first preset distance away from the first starting point module.

[0230] The first preset distance may be set to a corresponding value according to different layout requirements, and may be specifically set by professional staff based on work experience or industry regulations.

[0231] For example, see Figure 4a , Figure 4a A third schematic diagram of serial encroachment between modules provided in an embodiment of the present application takes the first preset distance as the length of one module as an example, the first connecting line 301 is a straight line segment, and a hot zone 304 is displayed on the first connecting line 301 at a position at a first preset distance from the first starting point module 300.

[0232] By applying the above embodiment, a hot zone corresponding to the first module is displayed on the first connecting line and at a first preset distance from the first starting point module. By using a fixed-distance parameterized layout, the consistency and predictability of the positions of the modules in the canvas are ensured, the logical confusion caused by random layout is avoided, and the canvas layout is optimized.

[0233] When the first connecting line is a right-angle connecting line, the aforementioned step S301 includes:

[0234] Step 3013: If the first connection line is a right-angle connection line and the first module covers the first sub-segment of the right-angle connection line, a hot zone corresponding to the first module is displayed at a position on the first sub-segment that is a second preset distance away from the first starting point module.

[0235] Among them, the second preset distance can be set to a corresponding value according to different layout requirements. It can be specifically set by professional staff based on work experience or industry regulations, and is not specifically limited here.

[0236] For example, see Figure 4b , Figure 4b The fourth schematic diagram of the serial occupation between modules provided in the embodiment of the present application takes the second preset distance as the length of a grid as an example. The first connecting line 301 is a right-angle connecting line. When the first module covers the first sub-segment, the hot zone 304 corresponding to the first module is displayed on the first connecting line 301 at a position at the second preset distance from the first starting point module 300.

[0237] Step 3014: If the first connection line is a right-angle connection line and the first module covers other sub-segments of the right-angle connection line, the hot zone corresponding to the first module is displayed at the end module.

[0238] For example, see Figure 4c , Figure 4c This is a fifth schematic diagram of serial encroachment between modules provided in an embodiment of the present application. The first connection line 301 is a right-angle connection line. When the first module covers other sub-segments except the first sub-segment, the hot zone 304 corresponding to the first module is displayed at the end module 302.

[0239] Applying the above embodiment, if the first module covers the first sub-segment, the hot zone corresponding to the first module is displayed at the first preset distance from the first starting point module; if the first module covers other sub-segments, the hot zone corresponding to the first module is displayed at the end point module. According to the different floating positions of the first module, different display strategies for the hot zones corresponding to the first module are adopted, providing users with clear and intuitive interactive feedback, allowing users to quickly understand the relationship between modules and layout changes, improving user experience, and the setting of this rule enables the layout of each module on the canvas to comply with the same principle, making the layout of each module in the canvas more tidy.

[0240] In order to more clearly explain the process of displaying and deleting modules and connections when triggering serial crowding between modules, the following will be further explained with the help of the flow chart. Figure 5a , Figure 5a This is a third flow chart of a method for arranging a machine vision task flowchart provided in an embodiment of the present application, the method comprising:

[0241] S501, triggering a response; that is, when the canvas control is initialized, a serial timer is pre-embedded to monitor the movement event of the drag module. When the mouse position reaches the connection line, the first time threshold is maintained and then the serial timer is started, which is equivalent to the aforementioned step 3011.

[0242] S502, displaying a straight line hotspot; the serial timer first determines whether the line dragged into the current module is a straight line. If it is a straight line, a hotspot is displayed at a grid point below the module at the source of the line, and subsequent operations are performed, which is equivalent to the aforementioned step 3012. The displayed hotspot is the aforementioned display of the fourth module.

[0243] S503, display the inflection line hot zone; if the line dragged in by the module is an inflection line (right-angle connection line), if the line dragged in by the module is the first segment line, then the hot zone is displayed at a grid point below the module at the source of the line, consistent with the straight line hot zone; if the line dragged in by the module is not the first segment line, then the hot zone is displayed at the position of the module at the end of the line, which is equivalent to the aforementioned steps 3013 and 3014.

[0244] S504, drawing temporary hot zone connections; after drawing the hot zone, temporary lines are drawn between the first and last modules of the original connection and the hot zone, which is equivalent to drawing the second and third connections mentioned above.

[0245] S505, lock the original connection; the connection between the original modules cannot be disconnected because the mouse relies on this line to connect the timer response, so the size and position of the original connection are locked, and its transparency is set to 0, so that it cannot be seen on the canvas, which is equivalent to setting the first connection to invisible as mentioned above.

[0246] S506, record the rollback area; modifications to temporary connections and original connections must be recorded in the rollback area. When the dragged module moves outside the serial timer response area, a rollback operation should be performed. That is, when displaying the hot area, second connection, and fourth connection corresponding to the first module, the relevant information of the hot area, second connection, and fourth connection corresponding to the first module is recorded.

[0247] S507, clearing the rollback area: When the mouse is released after the chain animation is triggered, a module insertion operation is performed between the modules, the new module is placed at the hot zone position, and the rollback area is cleared. That is, after the first module is moved to the hot zone corresponding to the first module, the relevant information of the hot zone, the second connection, and the fourth connection corresponding to the first module is deleted.

[0248] As mentioned above, the chain squeeze can be divided into the first segment squeeze of the broken line (the first segment squeeze of the right-angle connecting line) and the first segment squeeze of the non-broken line (the first segment squeeze of the straight line segment), see Figure 5b , Figure 5b This is a fourth schematic diagram of inter-module serial crowding provided in an embodiment of the present application, which is a schematic diagram of serial shifting in the case of serial crowding.

[0249] When the first segment of the broken line is occupied, the steps for shifting the first segment of the broken line include:

[0250] S11, draw the hot zone just below the connection source module;

[0251] S12, detecting whether there is a module occupying the hot zone position;

[0252] S13, detecting whether there are modules occupying the left and right sides of the hot zone;

[0253] S14, the placeholder module moves downward;

[0254] S15, the left and right placeholder modules are offset to the left and right.

[0255] When the first segment of a non-broken line is occupied, the steps for shifting the first segment of the non-broken line include:

[0256] S16, draw a hot zone at the target module;

[0257] S17, the target module shifts downward.

[0258] 2. Parallel connection between modules

[0259] See also Figure 6a , Figure 6a This is a first schematic diagram of parallel occupation of modules provided in an embodiment of the present application. When the user drags the first module 303 to the position of the second module 600, that is, the first module 303 covers the second module 600, the hot zone 601 corresponding to the first module 303 is displayed near the second module 600, and the fourth line 603 between the second starting module 602 and the hot zone 601 corresponding to the first module 303 is displayed, and the fifth line 605 between the second starting module 602 and the fourth module 604 is displayed.

[0260] The fourth module 604 is the same as the second module 600 , and the second starting point module 602 is a module located at the starting point of the preceding connection line.

[0261] A hot zone 601 corresponding to the first module is displayed near the second module 600, including:

[0262] The hot zone 601 corresponding to the first module 303 is displayed at a third preset distance in the first direction of the second module 600. Alternatively, the hot zone 601 corresponding to the first module 303 is displayed at the position where the second module 600 is located.

[0263] The first direction is the direction from the second module 600 to the first module 303. The figure only illustrates the case where the hot zone 601 corresponding to the first module 303 is displayed at the location of the second module 600. When the hot zone 601 corresponding to the first module 303 is displayed at a third preset distance in the first direction from the second module 600, the third preset distance should be greater than the length of one grid and can be set by professional staff based on work experience or industry regulations, and is not specifically limited here.

[0264] See also Figure 6b , Figure 6b The second schematic diagram of parallel occupation of modules provided in the embodiment of the present application shows that when the first module 303 covers the second module 600, in response to the first module 303 terminating the covering, the first module 303 is moved to the hot zone 601.

[0265] For details, see Figure 6c , Figure 6c This is a fourth flow chart of a method for arranging a machine vision task flowchart provided in an embodiment of the present application, the method comprising:

[0266] S601: If the first module covers the second module and there is a preceding connection line to the second module, a hot zone corresponding to the first module is displayed at a position near the second module.

[0267] S602, set the second module to an invisible state, and display the fourth module at a fourth preset distance in the second direction of the second module, and display the fourth connection line between the second starting module and the hot zone corresponding to the first module, and display the fifth connection line between the second starting module and the fourth module.

[0268] The second direction is the opposite direction of the first direction. The fourth preset distance should be greater than the length of one grid, and can be set by professional staff based on work experience or industry regulations, and is not specifically limited here.

[0269] Applying the above embodiment, when the first module covers the second module and there is a preceding connection line in the second module, the hot zone corresponding to the first module is displayed near the second module, and the connection line between the hot zone and the upstream module of the second module (the fourth connection line), as well as the connection line (the fifth connection line) between the upstream module of the second module and the pseudo module (the fourth module) of the second module are displayed, intuitively presenting a visual preview of the potential connection relationship, helping users to predict the results after the module is moved. At the same time, the optimized path connection is intelligently updated and drawn to maintain the neatness of the canvas and the logical coherence between modules, avoiding intersections or confusion caused by manual adjustments, and ultimately achieving a canvas layout that meets the user's operation intentions and does not cause module overlap and connection confusion.

[0270] Similar to the aforementioned serial encroachment between modules, in the process of the user moving the first module, in order to prevent the canvas from displaying the hot zone, fourth module, fourth connection and fifth connection corresponding to the first module due to accidental touch by the user, resulting in layout confusion, in a possible embodiment, the hot zone, fourth module, fourth connection and fifth connection corresponding to the first module can be displayed after the user enters a confirmation command through any control method such as keyboard, mouse, touch, voice, etc.

[0271] In another possible embodiment, in order to reduce user workload and improve user experience, a response time threshold may be set. Specifically, the aforementioned step S601 includes:

[0272] Step 6011: When the duration of the first module covering the second module reaches a second duration threshold and there is a preceding connection line to the second module, a hot zone corresponding to the first module is displayed near the second module.

[0273] The setting of the second duration threshold is the same as the setting of the first duration threshold, which will not be described in detail here.

[0274] For example, a ParallelTimer is embedded during canvas control initialization to monitor module movement events. When the user hovers the mouse over a module, the ParallelTimer begins counting. Only when the mouse remains over a module for a duration exceeding a second threshold will the ParallelTimer trigger a response, displaying the hotspot corresponding to the first module, the fourth module, the fourth connection, and the fifth connection. This prevents unnecessary display of modules and connections due to accidental touches or brief user pauses.

[0275] By applying the above embodiment, by setting a duration threshold to trigger hotspot display, module generation, and inter-module connection display, the accuracy of interaction and user experience are effectively improved. When the first module overlaps the second module for a duration threshold, the hotspot, fourth module, fourth connection, and fifth connection corresponding to the first module are displayed. This avoids false triggering and interface clutter during user operation, ensures that layout adjustments are made only after the user clearly understands the operation intention, and effectively maintains the neatness of the canvas.

[0276] For example, when a canvas control is initialized, a parallel timer is embedded. Since the parallel timer is set, it starts timing in response to the mouse hovering over the second module. When the mouse hovers over the second module, the hot zone, fourth module, fourth connection, and fifth connection corresponding to the first module are displayed. Therefore, when the hot zone, fourth module, fourth connection, and fifth connection corresponding to the first module are displayed, the second module cannot be directly deleted. Based on this, in one possible embodiment, to improve the neatness of the canvas and optimize the layout, if the duration that the first module covers the second module reaches a second duration threshold, the second module is set to invisible.

[0277] Specifically, the transparency of the second module may be set to 0, or the color of the second module may be set to the same color as the background, or other methods may be used to make the second module invisible, which are not specifically limited here.

[0278] By applying the above embodiment, the second module is set to be invisible to avoid visual interference caused by overlapping multiple modules in the covering state, reduce visual clutter, highlight the hot zone and the fourth module, make the logic between modules clearer, and improve the simplicity of the layout in the canvas of the hot zone, fourth module, fourth connection and fifth connection display stage corresponding to the first module. At the same time, it can also avoid the waste of resources caused by maintaining the status of the second module and processing overlap with other modules.

[0279] When the first module covers the second module and there is a preceding connection line in the second module, the hot zone corresponding to the first module will be displayed at the second module, the fourth module will be displayed on the side of the second module, and the fourth and fifth connections will be displayed. Therefore, the user can intuitively see the result after the module is moved. If the user is satisfied with the result after moving the module, the first module can be stopped from covering the second module, that is, the first module is moved to the position where the hot zone of the first module is located. If the user is not satisfied with the result after moving the module, the first module can be moved away from the second module, that is, the first module no longer covers the second module, and the hot zone, fourth module, fourth connection, and fifth connection corresponding to the first module are deleted, and the second module is set to a visible state.

[0280] In the above embodiment, when a first module covers a second module and a preceding connection exists with the second module, the second module is hidden. After the user terminates the hover interaction, the visibility of the second module is restored. This allows for the timely removal of unsatisfactory interaction artifacts, such as the hotspot, fourth module, fourth connection, and fifth connection corresponding to the first module, while preventing redundant hotspots, modules, and connections from occupying system resources. By redisplaying the second module, the original logical connections between modules are maintained.

[0281] In order to more clearly explain the process of displaying and deleting modules and connections when parallel connection between modules is triggered, the following will be further explained with the help of the flow chart. Figure 7a , Figure 7a A fifth flow chart of a method for arranging a machine vision task flow chart provided in an embodiment of the present application includes:

[0282] S701, triggering a response; that is, when the canvas control is initialized, a parallel timer will be pre-buried to monitor the movement event of the drag module. When the mouse position reaches the module, it will maintain the second time threshold and then respond to the start of the parallel timer, which is equivalent to the aforementioned step 6011.

[0283] S702: Parallel to the left or to the right; if the mouse is on the left side of a module, then the hot zone is displayed on the left side of the module; if the mouse is on the right side of a module, then the hot zone is displayed on the right side of the module. This is equivalent to the above step S601.

[0284] S703: Lock the original module and draw a dummy module. Because the mouse relies on this line to respond to the parallel timer, the original module cannot be disconnected. Therefore, the transparency of the original module is set to 0, maintaining its position. A dummy module is drawn to replace it, creating a positional offset and temporarily connecting it. This is equivalent to step S602 above. The dummy module of the second module is the fourth module.

[0285] S704, record the rollback area; record both the dummy module and the temporary connection in the rollback area. When the dragged module moves out of the timer response area, a rollback operation should be performed. That is, when displaying the hot area, fourth module, fourth connection, and fifth connection corresponding to the first module, the relevant information of the hot area, fourth module, fourth connection, and fifth connection corresponding to the first module is recorded.

[0286] S705, clearing the rollback area: When the mouse is released after the parallel animation is triggered, a new module is placed at the hot zone location and the rollback area is cleared. That is, after the first module is moved to the hot zone corresponding to the first module, the relevant information of the hot zone, the fourth module, the fourth connection, and the fifth connection corresponding to the first module is deleted.

[0287] Parallel crowding can be divided into left-half crowding and right-half crowding, see Figure 7b , Figure 7bThis is a third schematic diagram of parallel crowding between modules provided in an embodiment of the present application, which is a schematic diagram of parallel shifting in the case of parallel crowding.

[0288] In the case of left half area crowding, the steps of left half area shifting include:

[0289] S21, the suspended module moves one square to the right;

[0290] S22, detecting whether there is a module position shift on the right side;

[0291] S23, a hot zone is drawn one grid to the left of the original suspended module;

[0292] S24, detect whether there is a module occupying the left side of the hot zone, and shift it to the left;

[0293] In the case of right half area crowding, the steps of right half area shift include:

[0294] S25, the suspended module moves one square to the left;

[0295] S26, detecting whether there is a module position shift on the left side;

[0296] S27, a hot zone is drawn one grid to the right of the original suspended module;

[0297] S28, detect whether there is a module occupying the right side of the hot zone, and shift it to the right.

[0298] 3. Module crowding caused by module copying and pasting

[0299] See also Figure 8a , Figure 8a This is a first schematic diagram of the distributed squeezing between modules provided in an embodiment of the present application. The seventh module is the module copied by the copy-paste operation. For example, the seventh module includes modules 800 and 801. The size of rectangular area 802 encompassing modules 800 and 801 is determined as the target size. A target rectangular area 803 is determined, located at the paste position indicated by the copy-paste operation and having the target size.

[0300] See also Figure 8b , Figure 8bIn the second schematic diagram of the distributed occupation of modules provided in the embodiment of the present application, in order to avoid the overlap of the pasted modules 800 and 801 with the modules in the target rectangular area 803, the modules 804 and 805 in the target rectangular area 803 need to be moved outside the target rectangular area 803. When moving the modules 804 and 805 outside the target rectangular area 803, the modules 804 and 805 can be moved to the same side of the target rectangular area 803, or to different sides of the target rectangular area 803. The situation of moving the modules 804 and 805 to different sides will be explained below and will not be repeated here. Figure 8b Here, only the example of moving the modules 804 and 805 to the same side of the target rectangular area 803 is taken.

[0301] For details, see Figure 8c , Figure 8c A sixth flow chart of a method for arranging a machine vision task flow chart provided in an embodiment of the present application includes:

[0302] S801 , in response to a copy-paste operation or a generate operation, determining a size of a rectangular area including all seventh modules as a target size, and determining a target position.

[0303] The target position is the paste position indicated by the copy and paste operation, or the generation position indicated by the generation operation, and the seventh module is the module copied by the copy and paste operation, or the module generated by the generation operation.

[0304] S802: Determine a rectangular area located at a target position and having a target size as a target rectangular area.

[0305] S803: Move the eighth module outside the target rectangular area.

[0306] The eighth module is a module that overlaps with the seventh module within the target rectangular area.

[0307] S804 , in response to the movement of at least one eighth module, move the ninth module to a position that does not overlap with the moved eighth module.

[0308] The ninth module is a module in the canvas that overlaps with the moved eighth module.

[0309] Applying the above embodiment, when the user performs a module copy and paste operation or a generate operation, the circumscribed rectangular area of the copied module or the generated module (the seventh module) is automatically identified, and the size of the circumscribed rectangular area is obtained, and the paste position indicated by the copy and paste operation or the generate position indicated by the generate operation is obtained, and a target rectangular area at the paste position or the generate position that completely matches the size of the circumscribed rectangular area is determined, and then the eighth module in the area that may overlap and conflict with the copied module or the generated module is actively migrated outside the area, thereby avoiding the layout confusion problem caused by module overlap in traditional operations. In the face of complex scenarios with dense module layouts, no additional user intervention is required, and the modules can be made non-overlapping and the layout neat and reasonable, saving user time and energy, and providing users with a smooth and convenient operating experience. In addition, the positional relationship between multiple modules can be adjusted at the same time through the copy and paste operation, and new modules can be generated through the generate operation, thereby improving the user experience.

[0310] In a possible embodiment, in the process of moving the eighth module outside the target rectangular area, all modules may be moved to the same direction of the target rectangular area.

[0311] In another possible embodiment, to further optimize the layout within the canvas, during the process of moving the eighth module outside the target rectangular area, at least two different eighth modules are moved to different directions within the target rectangular area. Specifically, the eighth module located within the target rectangular area and in the first column is moved to a first direction within the target rectangular area, and the eighth module located within the target rectangular area but not in the first column is moved to a second direction within the target rectangular area. The first direction is a direction parallel to the column, and the second direction is a direction perpendicular to the column.

[0312] For example, see Figure 8d , Figure 8d The third schematic diagram of the distributed occupation of modules provided in the embodiment of the present application still takes the modules located in the target rectangular area 803 as an example, including module 804 and module 805. Module 804 is located in the first column. When moving, module 804 will be moved outside the target rectangular area 803 in a direction parallel to the column, and module 805 will be moved outside the target rectangular area 803 in a direction perpendicular to the column.

[0313] In order to more clearly explain the process of module movement when modules are squeezed between modules due to copying and pasting, the following will be further explained with the help of the flow chart. Figure 9a , Figure 9a The seventh flow chart of the machine vision task flow chart layout method provided in the embodiment of the present application includes:

[0314] S901: Define the module rectangular area. Calculate the leftmost, topmost, rightmost, and bottommost points of the original copy area. Draw a rectangle starting at the point with coordinates (leftmost, topmost) and ending at the point with coordinates (rightmost, bottommost). This is equivalent to determining the rectangular area 802 in step S801.

[0315] S902: Define the target placement rectangle. Calculate the leftmost, topmost, rightmost, and bottommost points of the original copy area. Draw a rectangle starting at the point with coordinates (leftmost, topmost) and ending at the point with coordinates (rightmost, bottommost). This is equivalent to determining the target rectangular area 803 in step S801.

[0316] S903, the original first column module in the target placement rectangle is moved downward; the offset of the first column module is calculated, and the minimum vertical coordinate (minVer) of the original first column module is first calculated. The offset of the first column module is calculated by the following formula (1):

[0317] Offset1=targetRect.Height-(minVer-targetRect.Y)+1...Formula (1)

[0318] Among them, Offset1 is the offset of the first column module, targetRect.Height is the height of the target placement rectangle, minVer is the minimum vertical coordinate value of the original first column module, and targetRect.Y is the vertical coordinate of the origin of the target placement rectangle.

[0319] S904, the second column starts to move to the right; calculate the right offset from the second column, first get the minimum X coordinate (minimum Horizontal, minHor) of the original module in the target placement rectangle starting from the second column, and then the offset of the module in the second column is calculated by the following formula (2):

[0320] Offset2=targetRect.Width-(minHor-targetRect.X)+2...Formula (2)

[0321] Among them, Offset2 is the offset of the second column module, targetRect.Width is the width of the target placement rectangle, minHor is the minimum horizontal coordinate value of the original first column module, and targetRect.X is the horizontal coordinate of the origin of the target placement rectangle.

[0322] S905, searching for a horizontal space on the left side of the target placement rectangle; detecting a column of the target placement rectangle, detecting whether the existing module is adjacent to the module to be placed in the first column of the target placement rectangle on the left and right; if so, shifting the module one space to the left.

[0323] Copying and pasting a module and placing it in the position of an existing module will trigger the displacement of the existing module. Figure 9b , Figure 9b This is a fourth schematic diagram of the decentralized inter-module crowding provided in an embodiment of the present application, which is a schematic diagram of copy and paste shifting in the case of inter-module crowding caused by copying and pasting modules.

[0324] Figure 9b In the example, the pasting area is the target rectangular area 803, also known as the target placement rectangle. The original first-column module within the target placement rectangle is moved downward, while other modules are moved rightward, outside the target placement rectangle. If a module within one grid point to the left of the first column has a left- or right-dependent placeholder with the pasted module, that module is moved leftward.

[0325] In actual applications, the default initial size of the canvas is 200X200 grid points. When the module is moved to the edge of the canvas, in a possible embodiment, the position of the module can be adjusted so that it can be located within the canvas.

[0326] In another possible embodiment, in order to reduce the workload of manual adjustment by the user, when the module is moved to the edge of the canvas, the canvas will be expanded. Specifically:

[0327] In response to the movement of any module in the canvas, if the current position of the moved module is outside the canvas, the canvas is expanded so that the current position of the moved module is within the canvas.

[0328] Applying this embodiment, when any module on the canvas moves outside the canvas, the canvas automatically expands to ensure the module remains completely within the canvas. This achieves adaptive canvas expansion and improves the user experience, allowing users to freely move modules without interruption. The canvas dynamically adapts to the direction of module movement, adaptively expanding and allocating space on demand, preventing module out-of-bounds logic anomalies.

[0329] In a possible embodiment, the canvas may be expanded as a whole, specifically, both the horizontal and vertical sides may be expanded.

[0330] In another possible embodiment, in order to increase the flexibility of canvas expansion and improve user experience, the canvas may be expanded in the direction where the module exceeds the canvas boundary. Specifically:

[0331] In response to the movement of any module in the canvas, a module closest to the third direction is found among all the modules that have moved, and is used as a critical module.

[0332] If the moving direction of the critical module is the third direction, then determining whether the critical module after movement exceeds the boundary of the canvas in the third direction;

[0333] If the moved critical module exceeds the border of the canvas in the third direction, the canvas is expanded in the third direction.

[0334] The third direction is a possible moving direction of the first module due to the occurrence of the crowding, including the positive direction of the column direction, and / or the negative direction of the column direction, and / or the positive direction of the row direction, and / or the negative direction of the row direction.

[0335] In one possible embodiment, all modules move in the same direction, in which case the third direction is one of them. In another possible embodiment, each module moves in different directions, in which case the third direction is multiple of them.

[0336] By applying the above embodiment, in complex scenarios such as batch movement of multiple modules, the direction in which the module exceeds the canvas is calculated, and the canvas is expanded in the direction in which the module exceeds the canvas boundary. This can improve the smoothness of operation, reduce the resource waste of global expansion of the canvas, increase the flexibility of canvas expansion, and thus improve the user experience.

[0337] To explain the canvas expansion process more clearly, the following flowchart is used for further explanation. Figure 10 , Figure 10 The eighth flow chart of the machine vision task flow chart layout method provided in the embodiment of the present application includes:

[0338] S1001, obtain the offset and module list; obtain the module list of all modules to be moved and the offset of each module.

[0339] S1002, calculate whether to expand the canvas to the left; when the offset of the horizontal coordinate (offsetX) is less than 0, calculate whether to expand the canvas to the left, obtain the minimum horizontal coordinate (MinX) of the module to be moved, and if the sum of the minimum horizontal coordinate and the offset of the horizontal coordinate is less than the horizontal coordinate of the canvas origin, the left expansion amount of the canvas is calculated by the following formula (3):

[0340] Expansion quantity1=MinX+offsetX-OrignalPoint.X+1......Formula (3)

[0341] Where, Expansion quantity1 is the left expansion of the canvas, MinX is the minimum horizontal coordinate of the module to be moved, offsetX is the offset of the horizontal coordinate, and OrignalPoint.X is the horizontal coordinate of the origin of the canvas.

[0342] S1003, calculate whether to expand the canvas to the right; when offsetX is greater than 0, calculate whether to expand the canvas to the right, obtain the maximum horizontal coordinate (MaxX) of the module to be moved, and if the sum of the maximum horizontal coordinate and the offset of the horizontal coordinate is greater than the sum of the horizontal coordinate of the canvas origin and the canvas width, the right expansion amount of the canvas is calculated by the following formula (4):

[0343] Expansion quantity2=MinX+offsetX-(OrignalPoint.X+Canvas Width)+1...Formula (4)

[0344] Among them, Expansion quantity2 is the right expansion amount of the canvas, MinX is the minimum horizontal coordinate of the module to be moved, offsetX is the offset of the horizontal coordinate, OrignalPoint.X is the horizontal coordinate of the canvas origin, and Canvas Width is the canvas width.

[0345] S1004: Calculate whether to expand the canvas downward. When the offset of the vertical coordinate (offsetY) is greater than 0, calculate whether to expand the canvas downward and obtain the maximum vertical coordinate (MaxY) of the module to be moved. If the sum of the maximum vertical coordinate and the offset of the vertical coordinate is greater than the sum of the horizontal coordinate of the canvas origin and the canvas height, the downward expansion amount of the canvas is calculated using the following formula (5):

[0346] Expansion quantity3=MaxY+offsetY-(OrignalPoint.Y+Canvas Height)+1...Formula (5)

[0347] Among them, Expansion quantity3 is the expansion amount of the lower side of the canvas, MaxY is the maximum vertical coordinate of the module to be moved, of fsetY is the offset of the vertical coordinate, OrignalPoint.Y is the vertical coordinate of the origin of the canvas, and Canvas Height is the height of the canvas.

[0348] S1005, updating the origin coordinates. When the canvas expands, the origin coordinates need to be updated. If the canvas expands to the left, the horizontal coordinate of the canvas origin after expansion is the difference between the horizontal coordinate of the original canvas origin and the amount of expansion on the left side of the canvas. If the canvas expands to the right, the horizontal coordinate of the canvas origin after expansion is the sum of the horizontal coordinate of the original canvas origin and the amount of expansion on the right side of the canvas. If the canvas expands downward, the vertical coordinate of the canvas origin after expansion is the difference between the vertical coordinate of the original canvas origin and the amount of expansion on the bottom side of the canvas.

[0349] S1006, update the canvas size; the new canvas width and height are equal to the original width and height plus the horizontal and vertical expansion amounts.

[0350] See also Figure 11 , Figure 11 The schematic diagram of canvas expansion provided in the embodiment of the present application shows that there are two types of modules that move within the canvas. One type is modules that are affected by movement. For these modules, the set of modules to be moved is determined, and the horizontal offset X and vertical offset Y are calculated. The other type is modules that are actively moved, including modules that are directly placed, copied and pasted, or selected and dragged. For these modules, the set of modules to be moved also needs to be determined. The horizontal offset X and vertical offset Y of these modules are both 0.

[0351] After determining the set of modules to be moved, the horizontal offset X, and the vertical offset Y, the canvas expansion is calculated based on the offsets, specifically including:

[0352] When the horizontal offset is less than 0, expand the canvas to the left. The steps include:

[0353] S31, obtaining the minimum horizontal coordinate of the module to be moved;

[0354] S32, calculating the horizontal expansion amount of the canvas;

[0355] S33, the horizontal coordinate of the original origin of the canvas is updated;

[0356] S34, horizontal grid point quantity expansion;

[0357] S35, canvas element update.

[0358] When the horizontal offset is greater than or equal to 0, expand the canvas to the right. The steps include:

[0359] S41, obtaining the maximum horizontal coordinate of the module to be moved;

[0360] S42, calculating the horizontal expansion amount of the canvas;

[0361] S43, the horizontal coordinate of the original origin of the canvas is updated;

[0362] S44, horizontal grid point quantity expansion;

[0363] S45, canvas element update.

[0364] When the vertical offset is greater than or equal to 0, expand the canvas downward. The steps include:

[0365] S51, obtaining the maximum vertical coordinate of the module to be moved;

[0366] S52, calculating the vertical expansion amount of the canvas;

[0367] S53, the vertical coordinate of the original origin of the canvas is updated;

[0368] S54, expansion of vertical grid points;

[0369] S55, canvas element update.

[0370] As modules are dynamically added and moved within the canvas, the canvas size automatically adjusts to accommodate all modules. However, simply expanding the canvas size cannot meet the layout requirements of complex scenarios. For example, when the module density is high, fine-tuning the canvas by adjusting the grid spacing is necessary. Based on this, in one possible embodiment, a dynamic grid spacing adjustment mechanism is introduced to allow users to adjust the grid spacing according to their needs. Specifically:

[0371] In response to the grid spacing adjustment operation on the canvas, calculating the new physical coordinates of each module according to the adjusted spacing and the grid coordinates of each module;

[0372] Move each module to the new physical coordinates.

[0373] Specifically, users can adjust the grid spacing in the canvas to any spacing according to their needs. The system can also pre-set multiple grid spacing options, such as normal canvas, 40 vertical grid spacing canvas, 60 vertical grid spacing canvas, 80 vertical grid spacing canvas, etc. For canvases with different grid spacing, the total number of vertical grids in the canvas defaults to 200, the total number of horizontal grids in the canvas also defaults to 200, and the upper left vertex coordinates default to (-100, 0).

[0374] Applying the above embodiment, when the user adjusts the grid spacing of the canvas, the physical coordinates corresponding to each module are automatically calculated through the current grid coordinates of the module and the new grid spacing, and the module is moved to the new position in real time. The user can adjust the grid spacing to meet his or her own personalized needs for canvas layout, and the user does not need to worry about the module position being messed up when adjusting the grid spacing. The module coordinates and positions will be automatically converted and updated, reducing the workload and tediousness of manual adjustment by the user.

[0375] In another possible embodiment, the user may also be allowed to adjust the grid spacing in the canvas by switching the work area. Specifically, the aforementioned grid spacing adjustment operation is a work area switching operation. The method further includes:

[0376] In response to the work area switching operation, determining the work area to which the work area switching operation is switched as a target work area;

[0377] Determining a pre-configured spacing for the target working area as the adjusted spacing, and calculating new physical coordinates of each module according to the adjusted spacing and the grid coordinates of each module;

[0378] Move each module to the new physical coordinates.

[0379] Among them, the workspace includes single-process workspace, group module workspace and full-process workspace.

[0380] By allowing users to adjust the canvas grid spacing by switching workspaces, the above embodiment effectively improves the flexibility and adaptability of canvas layout. Specifically, in response to the user's workspace switching operation, the target workspace is identified and the pre-configured grid spacing is dynamically applied. Physical position changes are calculated in real time based on the grid coordinates of each module, and module positions are moved in an orderly manner. Users can quickly adapt to design requirements with different grid spacing by switching workspaces, avoiding repeated manual adjustments to the grid spacing.

[0381] For example, see Figure 12a , Figure 12a This is a first schematic diagram of the grid spacing adjustment provided in the embodiment of the present application. In the figure, modules 1, 2, and 3 are located on the canvas before the grid spacing is adjusted. Figure 12b , Figure 12b This is a second schematic diagram of grid spacing adjustment provided in an embodiment of the present application. In the figure, module 1, module 2, and module 3 are located on the canvas after the grid spacing is adjusted.

[0382] The following section explains the underlying logic behind canvas grid spacing adjustments. To facilitate understanding, let's first explain the composition of the canvas:

[0383] The data source of the canvas is divided into three levels: solution, process, and group module. Each level independently manages its own canvas properties. In other words, each solution, process, and group module independently has the origin coordinates (OriginalPoint), coordinate type (CoordinateType), grid configuration, etc. of the canvas. Among them, the coordinate type is the defined coordinate system type, such as absolute coordinates, relative coordinates, etc. The grid configuration includes the total number of vertical grid points (VerticalGridNumber), the number of horizontal grid points (HorizontalGridNumber), etc. When a solution, process, or group module is exported, its unique canvas properties (origin coordinates, grid configuration, etc.) will be saved together.

[0384] Similar to the three-layer structure of the canvas data source, the canvas decoration layer is also divided into scheme decorator, process decorator and group module decorator, which are used to manage the visual or interactive characteristics of the canvas, such as background, grid line style, zoom ratio, etc.

[0385] In order to avoid additional memory overhead when users adjust the canvas grid spacing and to make user operations richer, more convenient and faster, the decoration layer and the data source can be associated through the decoration layer data source (Decorator Source). That is, the solution canvas, process canvas and group module canvas are the same object, and the display properties corresponding to the data source rendered by the control layer, such as width, height, grid spacing, and origin point, are bound to the decoration layer properties. When switching the process canvas, that is, switching the decoration layer of the canvas, the canvas controls change their display form according to the changes in the data source, that is, when the user adjusts the canvas grid spacing, the canvas object being operated is only one, and after the grid spacing is adjusted, only the canvas grid spacing will be changed. For other parameters of the canvas, the new canvas obtained after changing the canvas grid spacing will inherit all of them.

[0386] When you adjust the canvas grid spacing, the canvas will be redrawn. The grid coordinates of the modules in the canvas remain unchanged, but the actual physical coordinates will change. You need to calculate the physical coordinates based on the current grid coordinates and redraw them. The connections between modules will also change position as the physical coordinates of the modules change. Figure 12c , Figure 12c This is a third schematic diagram of grid spacing adjustment provided in an embodiment of the present application. The canvas includes a data source, a decoration layer, and a control layer responsible for rendering business objects in the data source into visual controls, such as rectangles, lines, etc.

[0387] Because the decoration layer and data source are linked through the Decorator Source, the actual physical coordinates of the module will change after the canvas grid spacing is adjusted, which means that the module's position will change on the decoration layer. After the module's actual physical coordinates change, the control layer is triggered. The control layer converts the module's current grid coordinates into its actual physical coordinates on the canvas. The control layer then renders and displays the module according to the determined physical coordinates, resulting in the module controls after the canvas grid spacing is adjusted.

[0388] Corresponding to the aforementioned machine vision task flow chart layout method, the present application embodiment also provides a machine vision task flow chart layout device, see Figure 13 , Figure 13 A schematic diagram of the structure of a machine vision task flow chart layout device provided in an embodiment of the present application includes:

[0389] A first receiving module 1301 is configured to receive a start movement operation for a first module, wherein the first module indicates a machine vision task to be performed;

[0390] The first display module 1302 is configured to display a hot zone corresponding to the first module according to the current position of the first module on the canvas in response to the start move operation; the hot zone indicates an area where the first module is allowed to be placed.

[0391] By applying the above embodiment, in response to the start movement operation for the first module, the area where the first module is allowed to be placed, that is, the hot zone, is displayed. This method can improve the intuitiveness of the layout of the machine vision task flowchart, avoid the problem of messy flowchart layout caused by repeated trial and error and random drag and drop due to insufficient user experience, and is suitable for scenarios with a large number of modules and complex relationships. At the same time, since the hot zone corresponding to the first module is displayed, the placement range of the module is limited, helping users quickly know the placement position of the module that conforms to the business logic, reducing the time cost caused by repeatedly adjusting the module position, and thus improving the efficiency of optimizing the layout of the machine vision task flowchart.

[0392] In addition, the visual guidance of hot zones lowers the user's operating threshold. Even users who lack knowledge of machine vision task flowchart design can optimize the layout of machine vision task flowcharts through the intuitive display of hot zones, thereby solving the inefficiency and layout confusion caused by experience dependence, repeated corrections and global complexity in the traditional free drag and drop mode, and realizing intelligent and efficient optimization of the machine vision task flowchart layout.

[0393] In a possible implementation, the first display module includes:

[0394] Displaying a first submodule, for displaying a hot zone corresponding to the first module at a blank grid point if the first module is adjacent to the blank grid point; wherein the canvas includes a plurality of grids, and the grids are used to adsorb machine vision task modules;

[0395] or,

[0396] Displaying a second submodule, for displaying a hot zone corresponding to the first module at a position near the second module if the first module covers the second module and there is a preceding connection line to the second module;

[0397] or,

[0398] Displaying a third submodule, configured to display a hot zone corresponding to the first module on a first connection line between modules if the first module covers the first connection line between modules;

[0399] or,

[0400] The fourth submodule is displayed, and is used for not displaying the hot zone corresponding to the first module in response to the first module covering the third module and the third module having no preceding connection line.

[0401] In a possible implementation, the device further includes:

[0402] a first moving module, configured to place the first module at a location where the hot zone is located in response to an end movement operation on the first module when the hot zone is displayed;

[0403] The second moving module is configured to restore the first module to its initial position in response to an end of the moving operation on the first module without displaying the hot zone.

[0404] In a possible implementation, the display third submodule includes:

[0405] A first display unit is configured to display a hot zone corresponding to the first module at a position on the first connecting line that is a first preset distance away from the first starting point module if the first connecting line is a straight line segment; wherein the first starting point module is a module located at the starting point of the first connecting line;

[0406] or,

[0407] a second display unit configured to display a hot zone corresponding to the first module at a position on the first sub-segment that is a second preset distance from the first starting point module if the first connecting line is a right-angle connecting line and the first module covers a first sub-segment of the right-angle connecting line;

[0408] or,

[0409] Display a third unit, used to display the hot zone corresponding to the first module at the end module if the first connection line is a right-angle connection line and the first module covers other sub-segments of the right-angle connection line; wherein the end module is the module located at the end point of the first connection line.

[0410] In a possible implementation, the device further includes:

[0411] The second display module is configured to display a second connection line between the first starting module and the hot zone corresponding to the first module, and to display a third connection line between the hot zone corresponding to the first module and the end module if the first module covers the first connection line.

[0412] In a possible implementation, the device further includes:

[0413] a first setting module, configured to set the first connection line to an invisible state if the first module covers the first connection line;

[0414] The first deleting module is configured to delete the hot zone, the second connection, and the third connection corresponding to the first module in response to the first module no longer covering the first connection, and set the first connection to a visible state.

[0415] In a possible implementation, the display second submodule includes:

[0416] A fourth display unit is configured to display a hot zone corresponding to the first module at a third preset distance in a first direction of the second module, wherein the first direction is a direction from the second module to the first module;

[0417] or,

[0418] The fifth unit is displayed, and is used to display a hot zone corresponding to the first module at the position where the second module is located.

[0419] In a possible implementation, the device further includes:

[0420] a second setting module, configured to, if the first module covers the second module and a preceding connection line exists for the second module, set the second module to an invisible state, display a fourth module at a fourth preset distance in a second direction from the second module, display a fourth connection line between the second starting module and the hot zone corresponding to the first module, and display a fifth connection line between the second starting module and the fourth module, wherein the second direction is the opposite direction of the first direction, the fourth module is the same as the second module, and the second starting module is the module located at the starting point of the preceding connection line;

[0421] The second deleting module is configured to delete the hot zone, the fourth module, the fourth connection line, and the fifth connection line corresponding to the first module in response to the first module no longer covering the second module, and set the second module to a visible state.

[0422] In a possible implementation, the device further includes:

[0423] a third moving module, configured to move a fifth module to a position that does not overlap with the hot zone when the hot zone is displayed; wherein the fifth module is a module in the canvas that overlaps with the hot zone;

[0424] The fourth moving module is configured to move the sixth module to a position not overlapping with the fifth module in response to the movement of the fifth module, wherein the sixth module is a module in the canvas that overlaps with the fifth module.

[0425] In a possible implementation, the device further includes:

[0426] a position determination module, configured to, in response to a copy-paste operation or a generate operation, determine a size of a rectangular area containing all seventh modules as a target size, and determine a target position, wherein the target position is a paste position indicated by the copy-paste operation or a generate position indicated by the generate operation, and the seventh module is a module copied by the copy-paste operation or a module generated by the generate operation;

[0427] an area determination module, configured to determine a rectangular area located at the target position and having a size equal to the target size as a target rectangular area;

[0428] a fifth moving module, configured to move an eighth module outside the target rectangular area; wherein the eighth module is a module that overlaps with the seventh module within the target rectangular area;

[0429] The sixth moving module is configured to move the ninth module to a position that does not overlap with the moved eighth module in response to movement of at least one of the eighth modules; wherein the ninth module is a module in the canvas that overlaps with the moved eighth module.

[0430] In a possible implementation, the device further includes:

[0431] The first expansion module is configured to respond to the movement of any module and, if the current position of the moved module is outside the canvas, expand the canvas so that the current position of the moved module is within the canvas.

[0432] In a possible implementation, the device further includes:

[0433] a second expansion module, configured to, in response to the movement of any module, search among all modules that have moved a module that is closest to a third direction as a critical module; wherein the third direction is a positive direction of a column direction, and / or a negative direction of the column direction, and / or a positive direction of a row direction, and / or a negative direction of the row direction;

[0434] a third expansion module, configured to determine, if the critical module moves in the third direction, whether the current position of the critical module after movement exceeds the boundary of the canvas in the third direction;

[0435] The first expansion module includes:

[0436] The first submodule is expanded, and is configured to expand the canvas in the third direction if the current position of the critical module after movement exceeds the boundary of the canvas in the third direction.

[0437] In a possible implementation, the device further includes:

[0438] a first adjustment module, configured to, in response to a grid spacing adjustment operation on the canvas, calculate new physical coordinates of each module according to the adjusted spacing and the grid coordinates of each module;

[0439] The seventh moving module is used to move each module to a new physical coordinate.

[0440] In a possible implementation, the grid spacing adjustment operation is a work area switching operation, and the apparatus further includes:

[0441] a second adjustment module, configured to, in response to the working area switching operation, determine the working area to which the working area switching operation is switched as a target working area;

[0442] The third adjustment module is configured to determine a distance pre-configured for the target working area as the adjusted distance.

[0443] The present application also provides an electronic device, such as Figure 14 Shown, including:

[0444] Memory 1401, used for storing computer programs;

[0445] The processor 1402 is configured to execute the program stored in the memory 1401 and implement the following steps:

[0446] Receiving a start move operation for a first module; the first module indicates a machine vision task to be performed;

[0447] In response to the start move operation, a hot zone corresponding to the first module is displayed according to the current position of the first module on the canvas; the hot zone indicates an area where the first module is allowed to be placed.

[0448] Furthermore, the electronic device may further include a communication bus and / or a communication interface, and the processor 1402, the communication interface, and the memory 1401 communicate with each other via the communication bus.

[0449] The communication bus mentioned in the electronic device mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is used in the figure, but this does not mean that there is only one bus or only one type of bus.

[0450] The communication interface is used for communication between the above electronic device and other devices.

[0451] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk memory. Alternatively, the memory may be at least one storage device located away from the processor.

[0452] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.

[0453] In another embodiment provided by the present application, a computer-readable storage medium is also provided, which stores a computer program. When the computer program is executed by a processor, the steps of any of the above-mentioned machine vision task flowchart layout methods are implemented.

[0454] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any one of the machine vision task flowchart layout methods in the above embodiments.

[0455] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a solid-state drive (SSD).

[0456] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.

[0457] Each embodiment in this specification is described in a related manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiment is generally similar to the method embodiment, so the description is relatively simple. For related parts, refer to the description of the method embodiment.

[0458] The above description is only a preferred embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application are included in the scope of protection of the present application.

Claims

1. A layout method for a machine vision task flow chart, characterized in that: The method comprises: Receiving a start move operation for a first module; the first module indicates a machine vision task to be performed; In response to the start move operation, a hot zone corresponding to the first module is displayed according to the current position of the first module on the canvas; the hot zone indicates an area where the first module is allowed to be placed.

2. The method according to claim 1, characterized in that The displaying a hot zone corresponding to the first module according to the current position of the first module on the canvas includes: If the first module is adjacent to a blank grid point, a hot zone corresponding to the first module is displayed at the blank grid point; wherein the canvas includes a plurality of grids, and the grids are used to adsorb machine vision task modules; or, If the first module covers the second module and there is a preceding connection line to the second module, then the hot zone corresponding to the first module is displayed near the second module; or, If the first module covers the first connection line between modules, displaying the hot zone corresponding to the first module on the first connection line; or, In response to the first module covering the third module and the third module having no preceding connection line, the hot zone corresponding to the first module is not displayed.

3. The method according to claim 2, characterized in that The method further comprises: When the hot zone is displayed, in response to the end of the move operation on the first module, placing the first module at the location of the hot zone; In a case where the hot zone is not displayed, in response to the end of the move operation on the first module, the first module is restored to its initial position.

4. The method according to claim 2, characterized in that The displaying of the hot zone corresponding to the first module on the first connection line includes: If the first connecting line is a straight line segment, a hot zone corresponding to the first module is displayed at a position on the first connecting line that is a first preset distance away from the first starting point module; wherein the first starting point module is a module located at the starting point of the first connecting line; or, If the first connecting line is a right-angle connecting line, and the first module covers a first sub-segment of the right-angle connecting line, a hot zone corresponding to the first module is displayed at a position on the first sub-segment that is a second preset distance away from the first starting point module; or, If the first connection line is a right-angle connection line and the first module covers other sub-segments of the right-angle connection line, the hot zone corresponding to the first module is displayed at the end module; wherein the end module is the module located at the end point of the first connection line.

5. The method according to claim 2, characterized in that The method further comprises: If the first module covers the first connection line, a second connection line is displayed between the first starting point module and the hot zone corresponding to the first module, and a third connection line is displayed between the hot zone corresponding to the first module and the end point module.

6. The method according to claim 5, characterized in that The method further comprises: If the first module covers the first connection, setting the first connection to an invisible state; In response to the first module no longer covering the first connection line, the hot zone, the second connection line, and the third connection line corresponding to the first module are deleted, and the first connection line is set to a visible state.

7. The method according to claim 2, characterized in that The displaying a hot zone corresponding to the first module at a position near the second module includes: Displaying a hot zone corresponding to the first module at a third preset distance in a first direction of the second module, wherein the first direction is a direction from the second module to the first module; or, A hot zone corresponding to the first module is displayed at the location of the second module.

8. The method according to claim 7, characterized in that The method further comprises: If the first module covers the second module and there is a preceding connection line for the second module, the second module is set to an invisible state, and a fourth module is displayed at a fourth preset distance in the second direction of the second module, and a fourth connection line between the second starting module and the hot zone corresponding to the first module is displayed, and a fifth connection line between the second starting module and the fourth module is displayed, wherein the second direction is the opposite direction of the first direction, the fourth module is the same as the second module, and the second starting module is the module located at the starting point of the preceding connection line; In response to the first module no longer covering the second module, the hot zone, the fourth module, the fourth connection line, and the fifth connection line corresponding to the first module are deleted, and the second module is set to a visible state.

9. The method according to claim 2, characterized in that The method further comprises: In the case of displaying a hot zone, moving a fifth module to a position that does not overlap with the hot zone; wherein the fifth module is a module in the canvas that overlaps with the hot zone; In response to the movement of the fifth module, a sixth module is moved to a position not overlapping with the fifth module, wherein the sixth module is a module in the canvas that overlaps with the fifth module.

10. The method according to claim 1, characterized in that The method further comprises: In response to a copy-paste operation or a generate operation, determining a size of a rectangular area containing all seventh modules as a target size, and determining a target position, wherein the target position is a paste position indicated by the copy-paste operation or a generate position indicated by the generate operation, and the seventh module is a module copied by the copy-paste operation or a module generated by the generate operation; Determine a rectangular area located at the target position and having a size equal to the target size as the target rectangular area; Move the eighth module outside the target rectangular area; wherein the eighth module is a module that overlaps with the seventh module within the target rectangular area; In response to the movement of at least one of the eighth modules, a ninth module is moved to a position that does not overlap with the moved eighth module; wherein the ninth module is a module in the canvas that overlaps with the moved eighth module.

11. The method according to any one of claims 1 to 10, characterized in that: The method further comprises: In response to the movement of any module, if the current position of the moved module is outside the canvas, the canvas is expanded so that the current position of the moved module is within the canvas.

12. The method according to claim 11, characterized in that The method further comprises: In response to the movement of any module, a module closest to a third direction is searched among all modules that have moved, as the critical module; wherein the third direction is a positive direction of a column direction, and / or a negative direction of the column direction, and / or a positive direction of a row direction, and / or a negative direction of the row direction; If the moving direction of the critical module is the third direction, determining whether the current position of the critical module after the movement exceeds the boundary of the canvas in the third direction; If the current position of the moved module is outside the canvas, the canvas is expanded, including: If the current position of the moved critical module exceeds the boundary of the canvas in the third direction, the canvas is expanded in the third direction.

13. The method according to claim 1, wherein The method further comprises: In response to the grid spacing adjustment operation on the canvas, calculating new physical coordinates of each module according to the adjusted spacing and the grid coordinates of each module; Move each module to the new physical coordinates.

14. The method according to claim 13, characterized in that The grid spacing adjustment operation is a work area switching operation, and the method further includes: In response to the working area switching operation, determining the working area to which the working area switching operation is switched as a target working area; A distance pre-configured for the target working area is determined as the adjusted distance.

15. A layout device for a machine vision task flow chart, characterized in that: The device comprises: A first receiving module is configured to receive a start movement operation for a first module, wherein the first module indicates a machine vision task to be performed; The first display module is configured to display a hot zone corresponding to the first module according to the current position of the first module on the canvas in response to the start moving operation; the hot zone indicates an area where the first module is allowed to be placed.

16. The device according to claim 15, characterized in that The first display module includes: Displaying a first submodule, for displaying a hot zone corresponding to the first module at a blank grid point if the first module is adjacent to the blank grid point; wherein the canvas includes a plurality of grids, and the grids are used to adsorb machine vision task modules; or, Displaying a second submodule, for displaying a hot zone corresponding to the first module at a position near the second module if the first module covers the second module and there is a preceding connection line to the second module; or, Displaying a third submodule, configured to display a hot zone corresponding to the first module on a first connection line between modules if the first module covers the first connection line between modules; or, Displaying a fourth submodule, configured to not display the hot zone corresponding to the first module in response to the first module covering the third module and the third module having no preceding connection line; The device further comprises: a first moving module, configured to place the first module at a location where the hot zone is located in response to an end movement operation on the first module when the hot zone is displayed; a second moving module, configured to restore the first module to its initial position in response to an end of the moving operation on the first module without displaying the hot zone; The display third submodule includes: A first display unit is configured to display a hot zone corresponding to the first module at a position on the first connecting line that is a first preset distance away from the first starting point module if the first connecting line is a straight line segment; wherein the first starting point module is a module located at the starting point of the first connecting line; or, a second display unit configured to display a hot zone corresponding to the first module at a position on the first sub-segment that is a second preset distance from the first starting point module if the first connecting line is a right-angle connecting line and the first module covers a first sub-segment of the right-angle connecting line; or, Displaying a third unit, for displaying a hot zone corresponding to the first module at an end module if the first connection line is a right-angle connection line and the first module covers other sub-segments of the right-angle connection line; wherein the end module is a module located at the end of the first connection line; The device further comprises: a second display module configured to display a second connection line between the first starting point module and the hot zone corresponding to the first module, and to display a third connection line between the hot zone corresponding to the first module and the end point module if the first module covers the first connection line; The device further comprises: a first setting module, configured to set the first connection line to an invisible state if the first module covers the first connection line; a first deleting module, configured to delete the hot zone, the second connection, and the third connection corresponding to the first module in response to the first module no longer covering the first connection, and set the first connection to a visible state; The second display submodule includes: A fourth display unit is configured to display a hot zone corresponding to the first module at a third preset distance in a first direction of the second module, wherein the first direction is a direction from the second module to the first module; or, A fifth display unit is configured to display a hot zone corresponding to the first module at a location where the second module is located; The device further comprises: a second setting module, configured to, if the first module covers the second module and a preceding connection line exists for the second module, set the second module to an invisible state, display a fourth module at a fourth preset distance in a second direction from the second module, display a fourth connection line between the second starting module and the hot zone corresponding to the first module, and display a fifth connection line between the second starting module and the fourth module, wherein the second direction is the opposite direction of the first direction, the fourth module is the same as the second module, and the second starting module is the module located at the starting point of the preceding connection line; a second deleting module, configured to, in response to the first module no longer covering the second module, delete the hot zone, the fourth module, the fourth connection line, and the fifth connection line corresponding to the first module, and set the second module to a visible state; The device further comprises: a third moving module, configured to move a fifth module to a position that does not overlap with the hot zone when the hot zone is displayed; wherein the fifth module is a module in the canvas that overlaps with the hot zone; a fourth moving module, configured to move a sixth module to a position not overlapping with the fifth module in response to the movement of the fifth module, wherein the sixth module is a module in the canvas that overlaps with the fifth module; The device further comprises: a position determination module, configured to, in response to a copy-paste operation or a generate operation, determine a size of a rectangular area containing all seventh modules as a target size, and determine a target position, wherein the target position is a paste position indicated by the copy-paste operation or a generate position indicated by the generate operation, and the seventh module is a module copied by the copy-paste operation or a module generated by the generate operation; an area determination module, configured to determine a rectangular area located at the target position and having a size equal to the target size as a target rectangular area; a fifth moving module, configured to move an eighth module outside the target rectangular area; wherein the eighth module is a module that overlaps with the seventh module within the target rectangular area; a sixth moving module, configured to move a ninth module to a position that does not overlap with the moved eighth module in response to movement of at least one of the eighth modules; wherein the ninth module is a module in the canvas that overlaps with the moved eighth module; The device further comprises: a first expansion module, configured to, in response to the movement of any module, expand the canvas so that the current position of the moved module is located within the canvas if the current position of the moved module is located outside the canvas; The device further comprises: a second expansion module, configured to, in response to the movement of any module, search among all modules that have moved a module that is closest to a third direction as a critical module; wherein the third direction is a positive direction of a column direction, and / or a negative direction of the column direction, and / or a positive direction of a row direction, and / or a negative direction of the row direction; a third expansion module, configured to determine, if the critical module moves in the third direction, whether the current position of the critical module after movement exceeds the boundary of the canvas in the third direction; The first expansion module includes: an expansion first submodule, configured to expand the canvas in the third direction if the current position of the moved critical module exceeds the boundary of the canvas in the third direction; The device further comprises: a first adjustment module, configured to, in response to a grid spacing adjustment operation on the canvas, calculate new physical coordinates of each module according to the adjusted spacing and the grid coordinates of each module; The seventh moving module is used to move each module to a new physical coordinate; The grid spacing adjustment operation is a work area switching operation, and the device further includes: a second adjustment module, configured to, in response to the working area switching operation, determine the working area to which the working area switching operation is switched as a target working area; The third adjustment module is configured to determine a distance pre-configured for the target working area as the adjusted distance.

17. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the method according to any one of claims 1 to 14 when executing a program stored in a memory.

18. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 14 is implemented.