Automatic object association method and system

By performing multi-level division of the PCB canvas and determining the virtual interface area, cache and calculate the components that collide with the mouse, the problems of excessive resource consumption and software lag caused by matching the position of the components and mouse in the prior art are solved, and efficient component association and rapid response are achieved.

CN120046210APending Publication Date: 2025-05-27PRIMARIUS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411945752.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

In PCB design, the prior art requires matching all components in the canvas with the mouse position to find the associated components of the mouse position, resulting in excessive processing resources consumption and may cause software lag.

Method used

By dividing the canvas in multiple levels, a tree-like structure cell is formed, and each level cell contains component information. Determine the virtual interface area with the mouse position as the center, obtain the overlapping part of the area with the cell, and cache the components in the last level of overlapping cell. When the mouse moves, only the collision between the cache element and the mouse is calculated, and the collision element is associated.

Benefits of technology

By reducing the number of calculated component objects, the computing speed is improved, software lag is avoided, and user experience is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120046210A_ABST
    Figure CN120046210A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a system for automatically associating objects. The method comprises the following steps of: determining a virtual interface area by taking a mouse position at a certain moment as a center; sequentially obtaining overlapping cells of the virtual interface area and each level in the tree-shaped structure cells; and caching corresponding elements in the last level of overlapped cells. According to the method, the canvas is subjected to tree structure cell division, then a virtual interface area is determined by a mouse, and elements in the area are obtained through calculation of the virtual interface area and the cells and cached. When the mouse moves in the virtual interface area, only the collision positions of the cached elements and the mouse need to be calculated, and all the elements do not need to be calculated, so that the number of calculated element objects is reduced, the calculation speed is increased, and the condition of software jamming is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of software technology, and in particular, to a method and system for automatically associating objects. Background Art

[0002] When designing a PCB, a canvas will be displayed on the software window interface, and then components such as chips, capacitors, resistors, and wires can be placed on the canvas. The specific positions of the components and the wire routing can be designed on the canvas. During the PCB wiring process, it is necessary to modify the position of the component or the wire. At this time, the component needs to be selected, that is, the component object is associated. Since the mouse is in a moving state, in order to prompt the user about the association relationship between the mouse and the current layout component object, it is necessary to match all the components in the canvas with the mouse position to find the associated component at the mouse position. If there are too many components in the canvas, it will consume a large amount of processing resources and may cause the software to freeze. Summary of the Invention

[0003] Therefore, it is necessary to provide a method and system for automatically associating objects to solve the problem that the existing method needs to match all the components in the canvas with the mouse position to find the associated component at the mouse position, which will consume a large amount of processing resources and may cause the software to freeze.

[0004] To achieve the above object, the present invention provides a method for automatically associating objects, including the following steps:

[0005] The canvas currently containing components is divided into multiple levels from large to small, divided into a plurality of cells. Each level of cells is divided within the cells of the previous level. The first-level cells are divided within the entire canvas. The area of the last-level cells is smaller than the area of the smallest component unit. After the division, a tree-like structure of cells is formed, and the cells contain the component information therein.

[0006] Determine a virtual interface area centered on the mouse position at a certain moment.

[0007] Sequentially obtain the overlapping cells of each level in the tree-like structure of cells with the virtual interface area.

[0008] Cache the components corresponding to the overlapping cells of the last level.

[0009] When the mouse moves within the virtual interface area, obtain the collision situation between the components in the cache and the current mouse position.

[0010] Associate the components collided with by the mouse position.

[0011] Further, it is determined whether the current mouse position moves out of the virtual interface area. If it moves out of the virtual interface area, the virtual interface area is re-determined with the moved-out mouse position as the center, and then the overlapping cells are re-acquired and the corresponding components in the last-level overlapping cells are re-cached.

[0012] Further, the step of re-determining the virtual interface area with the moved-out mouse position as the center if it moves out of the virtual interface area includes:

[0013] If it moves out of the virtual interface area and the staying time exceeds a first preset time;

[0014] Then the virtual interface area is re-determined with the moved-out and staying mouse position as the center.

[0015] Further, the step of determining a virtual interface area with a mouse position at a certain moment as the center includes:

[0016] Determining a virtual interface area with the mouse position after the mouse position pauses for more than a second preset time as the center.

[0017] Further, when performing multi-level division, it also includes:

[0018] If a certain cell in the upper level does not contain a component, the cell is not divided into the next level.

[0019] Further, the area of the penultimate-level cell is larger than the area of the smallest component unit.

[0020] Further, the step of sequentially obtaining the overlapping cells of each level between the virtual interface area and the cells in the tree structure includes:

[0021] If no component is found in the overlapping unit of the upper level obtained, the next-level cells of the cell without a component are no longer obtained.

[0022] Further, the component has a priority, and the component with the highest priority collided with by the associated mouse position is associated.

[0023] Further, the associated components are highlighted.

[0024] The present invention provides an automatic association system for objects. The automatic association system stores computer program instructions, and the computer program instructions, when executed by a processor, implement the method described in any one of the embodiments of the present invention.

[0025] Different from the prior art, the above technical solution can improve the efficiency of subsequent component search by dividing the canvas into a tree - structured cell. And by determining a virtual interface area with the mouse, the components within the area are obtained through calculation with the cells and cached. When the mouse moves within the virtual interface area, only the collision positions between the cached components and the mouse need to be calculated, rather than calculating all components, thereby reducing the number of component objects to be calculated, improving the operation speed, and avoiding software lag. Brief Description of the Drawings

[0026] Figure 1 It is a flowchart of the method according to an embodiment of the present invention;

[0027] Figure 2 It is a schematic diagram of the first - level division of the canvas according to the present invention;

[0028] Figure 3 It is a schematic diagram of the next - level division of the canvas according to the present invention;

[0029] Figure 4 It is a schematic diagram of drawing a virtual interface area with the mouse within the canvas according to the present invention;

[0030] Figure 5 It is a schematic diagram of regenerating a virtual interface area after the mouse moves out of the previous virtual interface area within the canvas according to the present invention.

[0031] Explanation of Reference Numerals in the Drawings:

[0032] 1. Canvas,

[0033] 2. Component,

[0034] 3. Virtual interface area. Detailed Description of the Embodiment

[0035] To describe in detail the technical content, structural features, achieved objectives and effects of the technical solution, the following is a detailed description in conjunction with specific embodiments and accompanied by the drawings.

[0036] Referring to "embodiment" in this context means that the specific features, structures or characteristics described in connection with the embodiment can be included in at least one embodiment of the present application. The term "embodiment" appearing at various positions in the specification does not necessarily refer to the same embodiment, nor is it particularly limited to its independence or relevance to other embodiments. In principle, in the present application, as long as there is no technical contradiction or conflict, the technical features mentioned in each embodiment can be combined in any way to form corresponding implementable technical solutions.

[0037] Unless otherwise defined, the technical terms used herein have the same meanings as those commonly understood by those skilled in the technical field to which this application belongs; the use of relevant terms herein is only for describing specific embodiments and is not intended to limit this application.

[0038] In the description of this application, the term "and / or" is an expression used to describe the logical relationship between objects, indicating that there can be three relationships. For example, A and / or B means: there is A, there is B, and there is both A and B at the same time. In addition, the character " / " herein generally represents an "or" logical relationship between the associated objects before and after.

[0039] In this application, terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual quantitative, primary-secondary, or sequential relationships between these entities or operations.

[0040] Without further limitation, in this application, the expressions such as "including", "comprising", "having" or other similar expressions used in a statement are intended to cover non-exclusive inclusion. These expressions do not exclude that there may be additional elements in the process, method or product including the said elements, so that the process, method or product including a series of elements may not only include those defined elements, but also include other elements not explicitly listed, or also include elements inherent to such process, method or product.

[0041] The same as the understanding in the "Patent Examination Guidelines", in this application, expressions such as "greater than", "less than", "exceeding" are understood not to include the number itself; expressions such as "above", "below", "within" are understood to include the number itself. In addition, in the description of the embodiments of this application, the meaning of "a plurality of" is two or more (including two), and similar expressions related to "many" are understood in the same way, such as "multiple groups", "multiple times", etc., unless otherwise specifically defined.

[0042] In the description of the embodiments of this application, the spatially related expressions used, such as "center", "longitudinal", "transverse", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "perpendicular", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc., the indicated orientation or positional relationship is based on the orientation or positional relationship shown in the specific embodiment or the drawing, and is only for the convenience of describing the specific embodiments of this application or for the convenience of the reader's understanding, rather than indicating or implying that the device or component referred to must have a specific position, a specific orientation, or be constructed or operated in a specific orientation, and therefore cannot be understood as a limitation to the embodiments of this application.

[0043] Unless otherwise clearly specified or defined, in the description of the embodiments of the present application, terms such as "installed", "connected", "linked", "fixed", "set", etc. shall be understood in a broad sense. For example, the "connection" may be a fixed connection, a detachable connection, or an integral setting; it may be a mechanical connection, an electrical connection, or a communication connection; it may be directly connected, or indirectly connected through an intermediate medium; it may be the communication inside two components or the interaction relationship between two components. For those skilled in the art to which the present application pertains, the specific meanings of the above terms in the embodiments of the present application may be understood according to specific circumstances.

[0044] Please refer to Figures 1 to 5 , the present invention provides an automatic association method for objects, including the following steps: Step S101: Multilevel partition the current canvas containing components from large to small in sequence into multiple cells. Each level of cells is partitioned within the cells of the previous level. The first-level cells are partitioned within the entire canvas. The area of the last-level cells is smaller than the area of the smallest component unit. After partitioning, a tree-like structure of cells is formed, and the cells contain the component information therein. As Figure 2 and Figure 3 shown, a chip component 2 is included on the canvas 1. The components may also include other devices such as resistors and capacitors, and may also be pad vias and wires, etc. These components are the objects that need to be associated and selected. Multiple components can be placed on the canvas, and these components can be stacked or not stacked. The first-level cells are first partitioned on the canvas 1. As Figure 2 shown, it can be partitioned into four regions A, B, C, and D. The present invention only needs to completely partition the canvas, that is, the partitioned cells cover the entire canvas. The present invention does not limit the number of partitioned cells. As Figure 2 it can be partitioned in a 2X2 manner, or in a more grid partition such as 4X6, and preferably the cells can be square, and in some embodiments can also be hexagonal, etc. The present invention does not limit this. When partitioning, if a part of a certain component is inside a cell, the information of the component, such as identification information, is recorded in the cell. As Figure 2 shown, both cell A and cell C have the chip component 2.

[0045] After the first-level partitioning is completed, the cells completed in the first-level partitioning are partitioned again. As Figure 3As shown, in the same way as the first-level division, the first-level cells are further divided into 2X2. Cell A can be divided into four regions AA, AB, AC, and AD. Similarly, for the next-level division, all the cells of the previous level need to be divided. If there is an overlapping part between a component and a cell during the division, then the cell contains the information of that component. For example, cells AC, AD, CA, and CB contain the information of component 2. Then, the division is carried out in sequence until the cells of the last level are reached. The cells of the last level satisfy the condition that the area of the cell is smaller than the area of the smallest component unit, so that it can be ensured that each component can be found in the cells of the last level. After the division, a tree-like structure of cells is formed. That is, A in the first level, and then AA, AB, AC, and AD in the second level are the branches of A in the first level, and AAA, AAB, AAC, and AAD in the third level are the branches of AA in the second level, and so on.

[0046] Then, enter step S102 to determine a virtual interface area centered on the mouse position at a certain moment; as Figure 4 shown, a virtual interface area 3 is generated around the mouse position. Figure 4 For the sake of easy illustration, the virtual interface area 3 here is shown by a dotted line. Actually, it is invisible and not displayed. It can be calculated in the program background. After the virtual interface area is determined, if the mouse is still within this area, actually the virtual interface area does not change and is static. Here, a certain moment is the moment when it just starts, which can be set by the program. For example, when the canvas is initially opened and the mouse position is at the center of the canvas, the mouse position at the initial moment can be used as the center to determine a virtual interface area. Or after placing a component, since after placing the component, the system needs to re-perform step S101 to update the component information corresponding to the cells. Then, a virtual interface area is determined centered on the mouse position at this moment after placing the component. The present application does not limit the shape of the virtual interface area. In a preferred embodiment, it has the same shape as the cell. Of course, it can also be circular, rectangular, square, or equilateral hexagon, etc. Preferably, the center of the virtual interface area is the mouse position. In some embodiments, it can also not be at the center, as long as the mouse position is inside the virtual interface area.

[0047] Then, in step S103, the overlapping cells of each level in the tree-like structure cells with the virtual interface area are obtained in sequence; that is, all the cells in each level that overlap with the virtual interface area are obtained. As Figure 3 shown, the virtual interface area 3 overlaps with the first-level cell AB, and then continue to obtain the next level, which is AD and BC. This embodiment is described with two levels, and the other more levels are similar to these two levels.

[0048] Then, in step S104, the components corresponding to the overlapping cells of the last level are cached. AsFigure 4 As shown, the corresponding components in the last-level overlapping cells are two thickened wires, that is, these two wires are cached.

[0049] Then, in step S105, when the mouse moves within the virtual interface area, the collision situation between the components in the cache and the current mouse position is obtained, and in step S106, the component collided with the mouse position is associated. The collision means that the mouse position falls within the range of the component area. As Figure 4 shown, if the component collided with by the current mouse position is the lower wire, then the lower wire is the associated object. If the mouse moves, as long as the mouse is within the virtual interface area, only the collision position between the cached components and the mouse needs to be calculated, rather than calculating all the components. For example, Figure 4 if there is also a component in cell DB, there is no need to calculate the collision between the mouse and this component, thereby reducing the number of component objects to be calculated, improving the operation speed, and avoiding software lag.

[0050] In some embodiments, it is necessary to update the virtual interface area. By determining whether the current mouse position moves out of the virtual interface area, if it moves out of the virtual interface area, the virtual interface area is re-determined with the moved-out mouse position as the center, and then the overlapping cells are re-obtained and the corresponding components in the last-level overlapping cells are re-cached. As Figure 5 shown, the mouse moves out of the original virtual interface area and moves to a position above component 2. Then, with this mouse position, the virtual interface area 3 is re-determined. At this time, the virtual interface area 3 is located at the position of component 2. Then, the overlapping cells AC, AD, CA, and CB are re-obtained, and the corresponding component cached in the last-level overlapping cells is component 2. When the mouse collides with component 2, component 2 is used as the associated object component. In this way, when the mouse moves within the virtual interface area, there is no need to perform collision judgment with the components outside the virtual interface area (such as the two wires on the right), thereby reducing the number of component objects to be calculated, improving the operation speed, and avoiding software lag.

[0051] To avoid the situation of a large processing load caused by re-determining the virtual interface area when the mouse moves quickly, the step of if it moves out of the virtual interface area, the virtual interface area is re-determined with the moved-out mouse position as the center includes: if it moves out of the virtual interface area and stays for more than a first preset time; then the virtual interface area is re-determined with the moved-out and staying mouse position as the center. The first preset time here can be from 300 MS to 700 MS, preferably a time such as 500 MS. In this way, after moving out, the mouse stays for a preset time, and then the virtual interface area can be re-determined, and then the overlapping cells are re-obtained and the corresponding components in the last-level overlapping cells are re-cached. The amount of computation is reduced, and software lag is avoided.

[0052] At the beginning, a virtual interface area can be determined in the following manner: A virtual interface area is determined with the mouse position after the mouse position pauses for more than a second preset time as the center. That is, when there is no virtual interface area yet, after the mouse moves into the canvas, the first virtual interface area can start to be determined after the mouse stays for the second preset time. This second preset time can be the same as or different from the first preset time. For example, it can be less than the first preset time.

[0053] As mentioned above, the multi-level division of the present invention can actually improve the time for component search. In some embodiments, in order to further improve the component search time, when performing the multi-level division, it further includes: If a certain cell in the upper level does not contain a component, the cell is not divided into the next level. In this way, cells without components will not be divided anymore. For example, Figure 2 and Figure 3 in the canvas, since component 2 is only in A and C in the first level, and there are no components in B and D, B and D are not divided into the next level. In this way, in Figure 4 the virtual interface area 3 only overlaps with B in the first level and there is no BC in the second level, reducing the computational amount of the judgment of the overlap between BC and the virtual interface area 3 and improving the operation speed.

[0054] The last-level cell of the present invention only needs to be slightly smaller than the smallest component area. The smallest component can be a via, for example, and the area only needs to be slightly smaller than the via. At this time, the area of the penultimate-level cell is larger than the area of the smallest component unit. This can reduce the number of cell levels and improve the operation speed.

[0055] In order to improve the component search time, optimization can also be performed during the search. Specifically, the step of sequentially obtaining the overlapping cells of each level in the tree-like structure cell with the virtual interface area includes: If no component is found in the overlapping cell of the upper level obtained, the next-level cell of the cell without the component is no longer obtained. In this way, if there is no component in the upper level, there is no need to search for the next level, improving the speed of component acquisition.

[0056] Since components may be stacked, in order to select components one by one, the components have priorities, and the component with the highest priority collided with by the associated mouse position is associated. Here, the component placed at the top has the highest priority, and the priority gradually decreases from top to bottom. In this way, the component with the highest priority can be selected and an association relationship can be established.

[0057] After the component is associated with the mouse, the associated component can be highlighted. In this way, the user can obtain the component object associated with the current mouse position through the highlighted component, and then click to select the component for editing operations. Of course, a prompt message can also be popped up during highlighting, such as popping up component information, to facilitate the user to understand the associated object information.

[0058] The present invention also provides an automatic association system for objects. The system stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented. The system of this embodiment can improve the efficiency of subsequent component search by dividing the canvas into tree-structured cells. And by determining a virtual interface area through the mouse, the components within the area are obtained through calculation with the cells and cached. When the mouse moves within the virtual interface area, only the collision positions of the cached components and the mouse need to be calculated, rather than calculating all the components, thereby reducing the number of component objects to be calculated, improving the operation speed, and avoiding software freezing.

[0059] It should be noted that although the above embodiments have been described in this article, the patent protection scope of the present invention is not limited thereby. Therefore, based on the innovative concept of the present invention, the changes and modifications made to the embodiments described in this article, or the equivalent structural or equivalent process transformations made by using the content of the specification and drawings of the present invention, directly or indirectly applying the above technical solutions to other related technical fields, are all included in the patent protection scope of the present invention.

Claims

1. An automatic association method for objects, characterized in that: The steps include: The canvas containing the components is divided into multiple levels from large to small, and divided into multiple cells. Each level of cells is divided within the cells of the previous level. The first level of cells is divided within the entire canvas. The area of ​​the last level of cells is smaller than the smallest component unit area. After division, a tree-structured cell is formed, and the cell contains the component information. Determine a virtual interface area with the mouse position at a certain moment as the center; Sequentially obtain overlapping cells of the virtual interface area and each level of cells in the tree structure; Cache the corresponding components in the last level of overlapping cells; When the mouse moves in the virtual interface area, the collision status between the components in the cache and the current mouse position is obtained; Associates the component that the mouse position collides with.

2. The automatic object association method according to claim 1, characterized in that: It is determined whether the current mouse position moves out of the virtual interface area. If so, the virtual interface area is re-determined with the mouse position after the mouse moves out as the center, and then the overlapping cells are re-acquired and the corresponding components in the last level of overlapping cells are re-cached.

3. The automatic object association method according to claim 2, characterized in that: If the mouse moves out of the virtual interface area, re-determining the virtual interface area with the mouse position after the mouse moves out as the center includes: If the user moves out of the virtual interface area and the duration of the stay exceeds a first preset time; Then, the virtual interface area is re-determined with the position of the mouse after it is moved out and remains as the center.

4. The automatic object association method according to claim 1, characterized in that: Determining a virtual interface area with the mouse position at a certain moment as the center includes: A virtual interface area is determined with the mouse position after the mouse position is paused for more than the second preset time as the center.

5. The automatic object association method according to claim 1, characterized in that: The multi-level division also includes: If a cell at the previous level does not contain any components, the cell will not be divided into the next level.

6. The automatic object association method according to claim 1, characterized in that: The area of ​​the second-to-last level unit cell is larger than the area of ​​the smallest component unit cell.

7. The automatic object association method according to claim 1, characterized in that: The step of sequentially obtaining overlapping cells of each level between the virtual interface area and the tree structure cells includes: If it is found that there is no component in the overlapping cell of the previous level, the next level cell of the cell without the component will not be obtained.

8. The automatic object association method according to claim 1, characterized in that: The components contain priorities, and the highest priority component that the mouse position collides with is associated.

9. The automatic object association method according to any one of claims 1 to 8, characterized in that: Highlight the associated components.

10. An automatic association system for objects, characterized in that: The automatic association system stores computer program instructions, which implement the method according to any one of claims 1 to 9 when executed by a processor.