MOM service domain-oriented component automatic positioning method, device and equipment and medium
By calculating the intention distance and positioning edge direction matching between components and combining the overlap, automatic alignment of components in the MOM platform canvas is achieved, solving the problems of misalignment and overlap, and improving modeling efficiency and user experience.
Patent Information
- Application Number
- CN202510772264.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-11
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2045-06-11
AI Technical Summary
The canvas of the existing MOM platform is prone to misalignment, overlap, and misalignment during component dragging, affecting modeling efficiency and user experience.
By calculating the intention distance, positioning edge direction matching and overlap between components, the target component is generated and a visual shadow is generated at the target anchor point to achieve automatic alignment of components.
It improves the precise alignment of components on the canvas, reduces the time users spend on manual adjustments, and improves operational efficiency and user interaction perception.
Smart Images

Figure CN120631333A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology and provides a method, apparatus, device and medium for automatically locating components in a MOM business domain. Background Art
[0002] The Manufacturing Operation Management (MOM) platform is an integrated management system designed to optimize every aspect of the production process, thereby improving manufacturing efficiency, reducing costs, enhancing product quality, and enabling flexible production scheduling. In current MOM platform business domain modeling and process design practices, dragging and placing components within a visual canvas is a fundamental and frequently used interactive operation.
[0003] However, existing platforms' canvases are mostly static and free-to-place, lacking effective positioning and alignment mechanisms. Components are prone to misalignment, overlap, and misalignment during dragging, severely impacting modeling efficiency and user experience. Therefore, an automatic component positioning method that adapts to business semantics and enhances intelligent drag-and-drop responsiveness is urgently needed. Summary of the Invention
[0004] The present application provides a method, apparatus, device and medium for automatically positioning components in a MOM business domain, which are used to solve problems such as misalignment, overlap and misalignment that easily occur during the dragging and layout of components.
[0005] In a first aspect, the present application provides a method for automatically positioning components for a MOM business domain, which is applied to a canvas of a MOM platform; the canvas includes a plurality of draggable components; the method comprises: In response to a user dragging operation on a designated component, calculating an intended distance between a plurality of static components on the canvas and the designated component; Calculating the positioning edge direction matching degree between the multiple static components and the designated component; the positioning edge direction matching degree is used to reflect the matching degree between the boundary direction of the static component and the dragging direction; Calculating the overlap between the plurality of static components and the designated component; Performing a normalized weighted summation on the intention distance, the positioning edge direction matching degree, and the overlap degree, and determining the component with the highest score as the target component; Determining a target anchor point according to the target component; A visual shadow is generated at the target anchor point. When the designated component is dragged into a preset range of the shadow, its center point is automatically aligned to the target anchor point and the coordinates are updated.
[0006] Optionally, the step of calculating the intention distance between the plurality of static components and the designated component includes: Fitting the moving trajectory of the center point of the specified component to generate a main trend line; Calculating perpendicular distances between a plurality of static components and the main trend line, and calculating Euclidean distances between the plurality of static components and the last point in the moving trajectory; constructing an intention vector according to the vertical line distance and the Euclidean distance, and generating an intention distribution trend line through principal component analysis; The distance between the multiple static components and the intention distribution trend line is used as the intention distance.
[0007] Optionally, the step of constructing an intention vector according to the vertical line distance and the Euclidean distance and generating an intention distribution trend line through principal component analysis includes: constructing an intention vector for each static component according to the perpendicular distance and the Euclidean distance; Constructing an intent matrix according to the intent vectors of the plurality of static components; Calculating the covariance matrix of the intention matrix and extracting the eigenvector corresponding to the maximum eigenvalue; The centroid point of the intention vector in the intention matrix and the eigenvector are combined to generate an intention distribution trend line.
[0008] Optionally, the step of performing a normalized weighted summation on the intention distance, the positioning edge direction matching degree, and the overlap degree, and determining the component with the highest score as the target component includes: Sorting the plurality of static components in descending order of the intention distances to obtain a ranking; The ranking, the positioning edge direction matching degree, and the overlap degree are normalized and weighted and summed, and the component with the highest score is determined as the target component; the weight coefficients of the ranking and the positioning edge direction matching degree are positive numbers, and the weight coefficient of the overlap degree is negative number.
[0009] Optionally, the calculating the positioning edge direction matching degree between the multiple static components and the designated component includes: Calculate the direction angle of the line between the center point of each static component and the center point of the specified component; Traversing the four boundary edges of each static component to determine the positioning edge that intersects with the connecting line; Determining a directional median of the positioning edge according to a preset angle range of the positioning edge; The absolute deviation between the direction angle and the direction median is determined as the positioning edge direction matching degree between each static component and the designated component.
[0010] Optionally, determining a target anchor point according to the target component includes: The target anchor point is determined within a preset angle range of the positioning edge of the target component; if the positioning edge of the target component is the length of the target component, the distance between the center point of the target component and the target anchor point = (the height of the target component + the height of the designated component) / 2; if the positioning edge of the target component is the height of the target component, the distance between the center point of the target component and the target anchor point = (the length of the target component + the length of the designated component) / 2.
[0011] Optionally, calculating the overlap between the multiple static components and the designated component includes: Calculate the horizontal overlap width between each static component and the specified component; Calculate the vertical overlap height between each static component and the designated component; The product of the overlapping width and the overlapping height is used as the degree of overlap between the plurality of static components and the designated component.
[0012] In a second aspect, the present application provides a component automatic positioning device for a MOM business domain, which is arranged in a canvas of a MOM platform; the canvas includes a plurality of draggable components; the device includes: a distance calculation module, configured to calculate an intended distance between a plurality of static components on the canvas and the designated component in response to a user dragging operation on the designated component; A matching degree calculation module is used to calculate the positioning edge direction matching degree between the multiple static components and the specified component; the positioning edge direction matching degree is used to reflect the matching degree between the boundary direction of the static component and the dragging direction; An overlap calculation module, configured to calculate the overlap between the plurality of static components and the designated component; a component determination module, configured to perform a normalized weighted summation of the intention distance, the positioning edge direction matching degree, and the overlap degree, and determine the component with the highest score as the target component; An anchor point determination module, used to determine a target anchor point according to the target component; The alignment module is used to generate a visual shadow at the target anchor point, and when the designated component is dragged into a preset range of the shadow, automatically align its center point to the target anchor point and update the coordinates.
[0013] In a third aspect, the present application provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the automatic component positioning method for the MOM business domain described in the first aspect.
[0014] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and a processor executes the computer program to implement the automatic component positioning method for the MOM business domain described in the first aspect.
[0015] Compared with the prior art, the present invention has the following advantages: The present application provides a component automatic positioning method for a MOM business domain, which is applied to a canvas of a MOM platform; the canvas includes a plurality of draggable components; the method includes: in response to a user's dragging operation on a specified component, calculating the intended distance between multiple static components on the canvas and the specified component; calculating the positioning edge direction matching degree between the multiple static components and the specified component; the positioning edge direction matching degree is used to reflect the degree of matching between the boundary direction of the static component and the dragging direction; calculating the overlap between the multiple static components and the specified component; performing a normalized weighted summation of the intention distance, the positioning edge direction matching degree and the overlap degree, and determining the component with the highest score as the target component; determining a target anchor point based on the target component; generating a visual shadow at the target anchor point, and when the specified component is dragged into a preset range of the shadow, automatically aligning its center point to the target anchor point and updating the coordinates.
[0016] It can be seen that this application can accurately determine the position of the target component and the target anchor point through the comprehensive calculation of the intention distance, the positioning edge direction matching degree and the overlap degree, thereby ensuring that the components are accurately aligned on the canvas. The introduction of the overlap degree can ensure the rationality of the space between the components and avoid occlusion and conflict. And through automatic alignment and positioning technology, the time and energy of users to manually adjust and position components can be effectively reduced, thereby improving operational efficiency. And by generating a visual shadow at the target anchor point, the interactive perception of the user interface is enhanced. This visual feedback mechanism improves the user's sense of control and response speed of the platform's operations, making the entire operation process smoother. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0018] Figure 1 A schematic diagram of the computer device structure of the hardware operating environment involved in the embodiment of the present application; Figure 2 A flow chart of a method for automatically locating components in a MOM business domain according to an embodiment of the present application; Figure 3 A schematic diagram of the direction angle provided in the embodiment of the present application; Figure 4 A schematic diagram of a target anchor point provided in an embodiment of the present application; Figure 5 Another flow chart of a method for automatically locating components in a MOM business domain provided in an embodiment of the application; Figure 6 A schematic diagram of the structure of a component automatic positioning device for the MOM business domain provided in an embodiment of the present application.
[0019] Markings in the figure: 101 - processor, 102 - communication bus, 103 - network interface, 104 - user interface, 105 - memory. DETAILED DESCRIPTION
[0020] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application. Unless there is a conflict, the embodiments in the present application and the features in the embodiments can be combined with each other in any way. In addition, although a logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.
[0021] In order to solve the problems of dislocation, overlap, misalignment, etc. that components are prone to during dragging and layout, the embodiment of the present application provides a component automatic positioning method for MOM business domain, which can be executed by a computer device. Figure 1 , is a schematic diagram of the computer device structure of the hardware operating environment involved in the embodiment of the present application.
[0022] like Figure 1As shown, the computer device may include: a processor 101, such as a central processing unit (CPU), a communication bus 102, a user interface 104, a network interface 103, and a memory 105. The communication bus 102 is used to enable communication between these components. The user interface 104 may include a display and an input unit such as a keyboard. The user interface 104 may include a standard wired interface or a wireless interface. The network interface 103 may include a standard wired interface or a wireless interface (such as a wireless fidelity (WI-FI) interface). The memory 105 may be a high-speed random access memory (RAM) or a stable non-volatile memory (NVM), such as a disk storage device. The memory 105 may also be a storage device independent of the processor 101.
[0023] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0024] like Figure 1 As shown, the memory 105 as a storage medium may include an operating system, a network communication module, a user interface module, and a component automatic positioning device oriented to the MOM business domain.
[0025] exist Figure 1 In the computer device shown, the network interface 103 is mainly used for data communication with the network server; the user interface 104 is mainly used for data interaction with the user; the processor 101 and the memory 105 in the computer device of the present invention can be set in the computer device, and the computer device calls the component automatic positioning device for the MOM business domain stored in the memory 105 through the processor 101, and executes the component automatic positioning method for the MOM business domain provided in the embodiment of the present application.
[0026] Figure 1 The computer device is installed with a MOM platform, which provides a visual canvas containing several draggable components. A component is a functional unit in the MOM platform that encapsulates a specific business capability. By graphically dragging and connecting components on the canvas, services can be quickly built, such as data query services, data conversion services, process control services, etc.
[0027] During the initialization phase, the MOM platform constructs a two-dimensional Cartesian grid model based on the current container's visible area dimensions, with the lower-left corner as the origin. The positive X-axis extends to the right, and the positive Y-axis extends upward. The coordinate axes are discretized into a minimum granularity of p = (wx∙ix, wy∙iy). This granularity is controlled by the base pixel width and height (ix and iy) and the scaling factor (wx and wy), and can be dynamically adjusted to support adaptive grid accuracy. In a dynamic canvas, the edges array is defined as the connection relationship between components in the canvas, and the nodes array is defined as the detailed information of each component in the canvas.
[0028] Each component has geometric and logical properties, as shown in Table 1: Table 1 Component properties
[0029] It should be noted that each component is a rectangle, and the circumscribed rectangle is the four sides corresponding to the component.
[0030] Please refer to Figure 2 , is a flow chart of automatic component positioning for MOM business domain provided by the embodiment of the present application, based on Figure 1 The computer equipment shown is Figure 2 The following describes a component automatic positioning method for MOM business domain.
[0031] S201 : In response to a user dragging operation on a designated component, calculating an intended distance between a plurality of static components on a canvas and the designated component.
[0032] During the specific implementation process, when the user drags a specified component on the canvas, the MOM platform can calculate the intention distance between multiple static components on the canvas and the specified component in real time, where multiple static components refer to static components in the canvas other than the specified component.
[0033] In a possible embodiment, the step of calculating the intention distance between the plurality of static components and the designated component includes: Fit the moving trajectory of the center point of the specified component to generate a main trend line; calculate the vertical distance between multiple static components and the main trend line, as well as the Euclidean distance between multiple static components and the last point in the moving trajectory; construct an intention vector based on the vertical distance and Euclidean distance, and generate an intention distribution trend line through principal component analysis; and use the distance between multiple static components and the intention distribution trend line as the intention distance.
[0034] In the specific implementation process, first, when the user drags the specified component, the moving trajectory of the center point of the specified component can be recorded in real time, and a trajectory point set T={p1, p2, …, pt}, p i =(x i , y i ), where p i Indicates the coordinates of the center point at the i-th moment, x i Indicates the horizontal coordinate, y i Represents the vertical coordinate. The trajectory point set describes the moving direction and target intention of the specified component. The weighted least squares method can be used to calculate the points in the trajectory point set (p1, p2, …, p t ) is fitted to obtain a main trend line, the formula is as follows: fline(x)=ax+b Where fline(x) represents the main trend line, x represents the point on the main trend line, and a and b are fitting parameters.
[0035] Secondly, based on this main trend line, the spatial relationship between each static component and the main trend line can be determined, including the vertical distance and the Euclidean distance. The vertical distance refers to the shortest distance between the center point of each static component and the main trend line, which is used to measure its alignment in the direction of the drag path. The Euclidean distance refers to the distance between the center point of each static component and the current landing point (that is, the last point P in the trajectory set). t ) between them.
[0036] Then, the intention vector of each static component can be constructed based on the perpendicular distance and the Euclidean distance, as follows: Φ j =(d j _line, d j _target) Among them, Φ j represents the intention vector of the jth static component, d j _line represents the vertical distance between the jth static component and the main trend line, d j _target represents the Euclidean distance between the jth static component and the current landing point.
[0037] Next, these intention vectors can be reduced in dimension through principal component analysis (PCA) to fit a distribution trend curve that reflects the user's potential operation intention. This distribution trend curve represents the regional trend of where the user may want the component to be located.
[0038] Finally, the distance between the center point of each static component and the distribution trend curve can be calculated as the intention distance between each static component and the designated component.
[0039] In the embodiments of this application, by fitting the movement trajectory of a specified component and calculating the distance between the static component and the main trend line and the end point of the trajectory, the actual spatial distribution and interaction intent between components can be more accurately reflected, rather than simply using point-to-point distances. This helps to more rationally understand the layout relationship between components. Furthermore, by extracting the main trends using intent vectors and principal component analysis, it is possible to capture the underlying intent and dynamic changes in component layout, improving the ability to predict and respond to user operation behaviors.
[0040] In a possible embodiment, the steps of constructing an intent vector based on the vertical distance and the Euclidean distance and generating an intent distribution trend line through principal component analysis include: Based on the vertical distance and Euclidean distance, the intention vector of each static component is constructed. Based on the intention vectors of multiple static components, the intention matrix is constructed. The covariance matrix of the intention matrix is calculated, and the eigenvector corresponding to the maximum eigenvalue is extracted. The centroid point and eigenvector of the intention vector in the intention matrix are combined to generate the intention distribution trend line.
[0041] In the specific implementation process, first, the intention matrix can be constructed based on the intention vectors of multiple static components, that is, the two-dimensional feature space matrix Φ∈R n×2 .
[0042] Secondly, the intention matrix Φ can be standardized and its covariance matrix can be calculated to solve the eigenvector V1=[v x , v y ] T , the eigenvector is the main direction in the intention space.
[0043] The average of the intent vectors for multiple static components can then be used to determine the center of mass Φ_=(d_line, d_target). For example, if the intent vectors for three static components are: Φ_= [(3, 5), (4, 6), (5, 7)], then d_line=(3+4+5) / 3=4, d_target=(5+6+7) / 3=6, and the center of mass is Φ_=(4,6).
[0044] Finally, we can combine the feature vector and the center of mass of the intent vector Φ_=(d_line, d_target) to establish the intent distribution trend line through the point-to-point method. The intent distribution trend line is the distribution trend of the user's possible intent, and the formula is as follows:
[0045] Where, fintent(x) represents the intention distribution trend line, x represents the point on the intention distribution trend line, d_line and d_target represent the horizontal and vertical coordinates of the centroid point respectively, and vx and v y They represent the directional components of the two feature dimensions, namely the vertical distance (i.e., the distance from the component to the main trend line) and the Euclidean distance (i.e., the distance from the component to the last point in the trajectory set) in the feature vector, and are used to characterize the main change direction in the component intention space.
[0046] In the embodiment of the present application, the use of two distances, perpendicular distance and Euclidean distance, to construct the intent vector can more accurately capture the relative position relationship and potential interaction intention of each static component. By extracting the maximum eigenvalue and the corresponding eigenvector in the intent matrix, it is possible to perform dimensionality reduction on high-dimensional data and extract the most representative intent vector, thereby reducing redundancy while maintaining key information and improving data processing efficiency. The trend line generated by combining the centroid point in the intent matrix with the principal component vector can effectively capture the behavioral trend of a specified component.
[0047] S202: Calculate the positioning edge direction matching degree between the plurality of static components and the designated component.
[0048] The positioning edge direction matching degree is used to reflect the matching degree between the boundary direction of the static component and the dragging direction.
[0049] In a possible embodiment, the specific steps of S202 include: Calculate the azimuth angle of the line connecting the center point of each static component and the center point of the specified component; traverse the four boundary edges of each static component to determine the positioning edges that intersect with the line; determine the median direction of the positioning edges based on the preset angle range of the positioning edges; and determine the absolute deviation between the azimuth angle and the median direction as the positioning edge directional matching degree between each static component and the specified component.
[0050] In the specific implementation process, each static component defines its boundary orientation anchor point set, and each edge e∈{up, down, left, right} has a preset angle range [θ emin ,θ emax ], the preset angle range is determined by the triangle of the two end points and the center point. Direction angle θ m This is the angle between the horizontal line and the line connecting the center point of each static component and the center point of the specified component. If the direction angle falls within the preset angle range of a static component's edge, that edge is considered to be responsive to the current drag action and is determined to be the positioning edge intersecting the connecting line.
[0051] Please refer to Figure 3 , is a schematic diagram of the direction angle provided in the embodiment of the present application. The upper rectangular box represents the static component, and the preset angle range of the lower side of the static component is [θ emin ,θ emax], the rectangular box below represents the specified component, and the direction angle between the line between the center points of the two rectangular boxes and the horizontal line is θ m , the bottom of the static component satisfies: θ emin ≤θ m ≤θ emax , the bottom edge of the static component is determined as the positioning edge.
[0052] Calculate the median direction of the positioning edge using the following formula: θ emid =(θ emin +θ emax ) / 2 Among them, θ emid represents the median direction of the positioning edge, θ emin Indicates the minimum value of the angular range of the positioning edge, θ emax Indicates the maximum value of the angular range of the positioning edge.
[0053] Calculate the absolute deviation between the direction angle and the median direction using the following formula:
[0054] Among them, DirectionScore represents the matching degree of the positioning edge direction, θ m Indicates the direction angle of the line connecting the center point of the static component and the center point of the specified component. When DirectionScore → 0, it means that the current drag direction is highly consistent with the positioning direction of the edge.
[0055] In the embodiments of this application, the matching degree between the direction angle and the positioning edge direction can more accurately determine the spatial relationship between the dragged component and the static component, avoiding misjudgments caused by simple distance judgment, thereby achieving more reasonable automatic component alignment. The positioning edge direction matching degree reflects the directional consistency between the drag direction and the static component boundary, ensuring that the direction of automatic alignment is reasonable and meets the user's operational intent, making the interface layout more consistent with human visual habits and interaction logic.
[0056] S203: Calculate the overlap between the multiple static components and the specified component.
[0057] The overlap degree is used to reflect the spatial overlap area between the quantified static component and the specified component.
[0058] In a possible embodiment, the specific steps of S203 include: Calculate the horizontal overlapping width between each static component and the specified component; calculate the vertical overlapping height between each static component and the specified component; and use the product of the overlapping width and the overlapping height as the degree of overlap between the multiple static components and the specified component.
[0059] In the specific implementation process, each component can use its spatial coordinate range to define a rectangular area. The coordinate range of the area is: horizontal direction: x∈[x1,x2]; vertical direction: y∈[y1,y2]; where (x1,y1) is the coordinate of the upper left corner of the component, and (x2,y2) is the coordinate of the lower right corner of the component.
[0060] Calculate the horizontal overlap width between static component A and specified component B using the following formula:
[0061] Among them, woverlap represents the overlap width, x A1 and x A2 Represents the horizontal range of the static component A, x B1 and x B2 Indicates the horizontal range of the specified component B. min is the minimum function, min(x A2 ,x B2 ) represents the right boundary of the horizontal range, max is the maximum value function, max(x A1 ,x B1 ) represents the left edge of the horizontal range. The difference between the two is the horizontal overlap width. If there is no horizontal intersection, the horizontal overlap width is 0.
[0062] Calculate the vertical overlap height between static component A and specified component B using the following formula:
[0063] Among them, hoverlap represents the overlapping height, y A1 and y A2 Indicates the vertical range of the static component A, y B1 and y B2 Indicates the vertical range of the specified component B. min is the minimum function, min(y A2 ,y B2 ) represents the upper boundary of the vertical range, max is the maximum value function, max(y A1 ,y B1 ) represents the lower boundary of the vertical range. The difference between the two is the vertical overlap height. If there is no vertical intersection, the vertical overlap height is 0.
[0064] When there is overlap in both horizontal and vertical directions, the degree of overlap can be calculated by multiplying the overlap width and the overlap height:
[0065] Where CollisionAvoid represents the degree of overlap, woverlap represents the overlap width, and hoverlap represents the overlap height. If CollisionAvoid > 0, an overlap conflict is considered to exist.
[0066] S204: Perform normalized weighted summation on the intention distance, positioning edge direction matching degree, and overlap degree, and determine the component with the highest score as the target component.
[0067] In a possible embodiment, the specific steps of S204 include: Sort the components in descending order of intention distance to obtain the ranking of multiple static components; perform normalized weighted summation on the ranking, positioning edge direction matching, and overlap, and determine the component with the highest score as the target component; the weight coefficients of the ranking and positioning edge direction matching are positive, and the weight coefficient of the overlap is negative.
[0068] In the specific implementation process, first, the intention distance is sorted from large to small to obtain the ranking of multiple static components.
[0069] Then, the ranking, positioning edge direction matching and overlap are normalized according to the following formula:
[0070] Among them, min(c j ) represents the minimum value of the jth static component in the ranking, positioning edge direction matching and overlap, max(c j ) represents the maximum value of the jth static component in the ranking, positioning edge direction matching and overlap, X t (c j ) represents the tth parameter value of the jth static component, i.e., the ranking, positioning edge direction matching or overlap. t ′(c j ) represents the t-th normalized parameter value of the j-th static component, that is, the normalized ranking rank, the normalized positioning edge direction matching degree or the normalized overlap degree.
[0071] Finally, the normalized ranking, normalized positioning edge direction matching, and normalized overlap are weighted and summed, and the component with the highest score is determined as the target component. The specific calculation formula is as follows:
[0072] Among them, S j represents the score of the j-th static component, represents the normalized ranking of the jth static component, represents the normalized positioning edge direction matching degree of the jth static component, represents the normalized overlap of the jth static component. λ1 represents the weight coefficient for ranking, λ2 represents the weight coefficient for the alignment direction match, and λ3 represents the weight coefficient for the overlap. λ1 and λ2 are positive numbers, while λ3 is negative.
[0073] In the embodiments of the present application, a smaller intention distance indicates a higher match between the static component and the target, thus a higher ranking and a higher score for the static component. A greater positioning edge direction match means that the static component is more consistent with the expected direction requirements in layout or position, thus a higher score for the static component. A smaller overlap indicates that there is sufficient space between the static component and other components, without causing interference or occlusion, thus a higher score for the static component. Optimization selection is performed based on components with high scores, ensuring that the design meets the target requirements while maintaining sufficient available space and efficient alignment.
[0074] S205: Determine the target anchor point according to the target component.
[0075] In a possible embodiment, the specific steps of S205 include: The target anchor point is determined within the preset angle range of the positioning edge of the target component; if the positioning edge of the target component is the length of the target component, the distance between the center point of the target component and the target anchor point = (the height of the target component + the height of the specified component) / 2; if the positioning edge of the target component is the height of the target component, the distance between the center point of the target component and the target anchor point = (the length of the target component + the length of the specified component) / 2.
[0076] Please refer to Figure 4 , which is a schematic diagram of the target anchor point provided in an embodiment of the present application. The upper rectangular box A represents the target component with the highest score. The center points of the four rectangular boxes A1, A2, A3, and A4 around it represent the four anchor points respectively. The lower rectangular box B represents the designated component. The arrow indicates the drag direction of the designated component B. The lower edge of the target component A is the positioning edge. The drag direction of the designated component B falls within the preset angle range of the lower edge of the target component A. Therefore, the center point of the lower rectangular box A1 is the target anchor point. The distance between the center point of the target component A and the target anchor point = (the height of the target component A + the height of the designated component B) / 2.
[0077] S206 : Generate a visual shadow at the target anchor point. When the designated component is dragged into the preset range of the shadow, automatically align its center point to the target anchor point and update the coordinates.
[0078] During the specific implementation process, after determining the target anchor point, a translucent shadow is generated at the target anchor point. Through visual positioning, when the user drags the specified component into the preset range of the shadow, an automatic alignment action is performed to align the center point of the specified component with the target anchor point, and a position update event is triggered to update the actual coordinates of the specified component and the layout status of the entire canvas.
[0079] Please refer to Figure 5 , which is another flow chart of the component automatic positioning method for the MOM business domain provided in the application embodiment.
[0080] S501: Drag components.
[0081] When a specified component on the canvas is dragged, the MOM platform will execute the component automatic positioning algorithm for the MOM business domain provided in this application.
[0082] S502: Fitting a path trend line.
[0083] The intent distribution trend line is generated by fitting, and the intent distance between multiple static components and the intent distribution trend line is calculated.
[0084] S503: Angle positioning anchor point matching.
[0085] Calculates the alignment matching between multiple static components and a specified component.
[0086] S504: Avoid overlapping.
[0087] Computes the overlap between multiple static components and a specified component.
[0088] S505: Locate the anchor point.
[0089] The intention distance, positioning edge direction matching degree and overlap degree are normalized and weighted summed, and the component with the highest score is determined as the target component. Based on the target component, the target anchor point is determined.
[0090] S506: Automatic positioning of components.
[0091] Generates a visual shadow at the target anchor point.
[0092] S507: UI feedback and positioning action execution.
[0093] When the specified component is dragged into the preset range of the shadow, its center point is automatically aligned to the target anchor point and the coordinates are updated.
[0094] In summary, the present application provides a component automatic positioning method for the MOM business domain. This method realizes dynamic prediction of user operation intentions through trajectory trend line fitting and component positioning candidate point sorting, and combines the component boundary positioning anchor point direction with the drag path angle for high-precision matching, thereby generating an intelligent positioning response effect, and introducing an overlapping penalty mechanism to ensure the spatial rationality between components and avoid occlusion and conflict. This method has the advantages of not relying on static grids, dynamically generating positioning points, and intelligently reasoning about dragging intentions. In actual effect, it can achieve a layout experience similar to "dynamic grid positioning", and is more flexible and scalable. It is suitable for business modeling scenarios that require high visual interaction, such as MOM platforms.
[0095] Based on the same invention concept, please refer to Figure 6 The present application also provides a component automatic positioning device for the MOM business domain, which is set in the canvas of the MOM platform; the canvas includes a plurality of draggable components; the device includes: a distance calculation module, configured to calculate the intended distance between the plurality of static components on the canvas and the specified component in response to a user dragging operation on the specified component; The matching degree calculation module is used to calculate the positioning edge direction matching degree between multiple static components and the specified component; the positioning edge direction matching degree is used to reflect the matching degree between the boundary direction of the static component and the dragging direction; An overlap calculation module, used for calculating the overlap between multiple static components and a specified component; The component determination module is used to perform a normalized weighted summation of the intention distance, positioning edge direction matching degree, and overlap degree, and determine the component with the highest score as the target component; An anchor point determination module, used to determine the target anchor point according to the target component; The alignment module is used to generate a visual shadow at the target anchor point. When the specified component is dragged into the preset range of the shadow, its center point is automatically aligned to the target anchor point and the coordinates are updated.
[0096] It should be noted that the processor in this embodiment corresponds one-to-one to each step in the component automatic positioning method for the MOM business domain in the aforementioned embodiment. Therefore, the specific implementation of this embodiment can refer to the implementation of the aforementioned component automatic positioning method for the MOM business domain, which will not be repeated here.
[0097] Based on the same inventive concept, the present application also provides a computer device, which includes a processor, a memory, and a computer program stored in the memory. When the computer program is executed by the processor, it implements the aforementioned component automatic positioning method for the MOM business domain.
[0098] Based on the same inventive concept, the present application also provides a computer storage medium on which a computer program is stored. When the computer program is executed by a processor, the computer program implements the aforementioned method for automatically locating components for the MOM business domain.
[0099] In some embodiments, the computer-readable storage medium may be a memory device such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface mount memory, optical disk, or CD-ROM; or various devices including any one or any combination of the above memories. The computer may be various computing devices including smart terminals and servers.
[0100] In some embodiments, executable instructions may be in the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0101] As an example, executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinating files (e.g., files storing one or more modules, subroutines, or code portions).
[0102] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.
[0103] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or system 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 system. 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 system comprising the element.
[0104] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0105] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better embodiment. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as a read-only memory / random access memory, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a multimedia terminal device (which can be a mobile phone, a computer, a television receiver, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0106] The above are only preferred embodiments of the present application and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A component automatic positioning method for MOM business domain, characterized in that: Applied to the canvas of the MOM platform; The canvas includes a plurality of draggable components; the method includes: In response to a user dragging operation on a designated component, calculating an intended distance between a plurality of static components on the canvas and the designated component; Calculating the positioning edge direction matching degree between the multiple static components and the designated component; the positioning edge direction matching degree is used to reflect the matching degree between the boundary direction of the static component and the dragging direction; Calculating the overlap between the plurality of static components and the designated component; Performing a normalized weighted summation on the intention distance, the positioning edge direction matching degree, and the overlap degree, and determining the component with the highest score as the target component; Determining a target anchor point according to the target component; A visual shadow is generated at the target anchor point. When the designated component is dragged into a preset range of the shadow, its center point is automatically aligned to the target anchor point and the coordinates are updated.
2. The method according to claim 1, wherein The step of calculating the intention distance between the plurality of static components and the designated component comprises: Fitting the moving trajectory of the center point of the specified component to generate a main trend line; Calculating perpendicular distances between a plurality of static components and the main trend line, and calculating Euclidean distances between the plurality of static components and the last point in the moving trajectory; constructing an intention vector according to the vertical line distance and the Euclidean distance, and generating an intention distribution trend line through principal component analysis; The distance between the multiple static components and the intention distribution trend line is used as the intention distance.
3. The method according to claim 2, wherein The steps of constructing an intention vector according to the vertical line distance and the Euclidean distance and generating an intention distribution trend line through principal component analysis include: constructing an intention vector for each static component according to the perpendicular distance and the Euclidean distance; Constructing an intent matrix according to the intent vectors of the plurality of static components; Calculating the covariance matrix of the intention matrix and extracting the eigenvector corresponding to the maximum eigenvalue; The centroid point of the intention vector in the intention matrix and the eigenvector are combined to generate an intention distribution trend line.
4. The method according to claim 1, wherein The step of performing normalized weighted summation on the intention distance, the positioning edge direction matching degree, and the overlap degree, and determining the component with the highest score as the target component includes: Sorting the plurality of static components in descending order of the intention distances to obtain a ranking; The ranking, the positioning edge direction matching degree, and the overlap degree are normalized and weighted and summed, and the component with the highest score is determined as the target component; the weight coefficients of the ranking and the positioning edge direction matching degree are positive numbers, and the weight coefficient of the overlap degree is negative number.
5. The method according to claim 1, wherein The calculating the positioning edge direction matching degree between the plurality of static components and the designated component includes: Calculate the direction angle of the line between the center point of each static component and the center point of the specified component; Traversing the four boundary edges of each static component to determine the positioning edge that intersects with the connecting line; Determining a directional median of the positioning edge according to a preset angle range of the positioning edge; The absolute deviation between the direction angle and the direction median is determined as the positioning edge direction matching degree between each static component and the designated component.
6. The method according to claim 5, wherein The determining of a target anchor point according to the target component includes: The target anchor point is determined within a preset angle range of the positioning edge of the target component; if the positioning edge of the target component is the length of the target component, the distance between the center point of the target component and the target anchor point = (the height of the target component + the height of the designated component) / 2; if the positioning edge of the target component is the height of the target component, the distance between the center point of the target component and the target anchor point = (the length of the target component + the length of the designated component) / 2.
7. The method according to claim 1, wherein The calculating the overlap between the plurality of static components and the designated component includes: Calculate the horizontal overlap width between each static component and the specified component; Calculate the vertical overlap height between each static component and the designated component; The product of the overlapping width and the overlapping height is used as the degree of overlap between the plurality of static components and the designated component.
8. A component automatic positioning device for MOM business domain, characterized in that: Set up in the canvas of the MOM platform; The canvas includes a plurality of draggable components; the device includes: a distance calculation module, configured to calculate an intended distance between a plurality of static components on the canvas and the designated component in response to a user dragging operation on the designated component; A matching degree calculation module is used to calculate the positioning edge direction matching degree between the multiple static components and the specified component; the positioning edge direction matching degree is used to reflect the matching degree between the boundary direction of the static component and the dragging direction; An overlap calculation module, configured to calculate the overlap between the plurality of static components and the designated component; a component determination module, configured to perform a normalized weighted summation of the intention distance, the positioning edge direction matching degree, and the overlap degree, and determine the component with the highest score as the target component; An anchor point determination module, used to determine a target anchor point according to the target component; The alignment module is used to generate a visual shadow at the target anchor point, and when the designated component is dragged into a preset range of the shadow, automatically align its center point to the target anchor point and update the coordinates.
9. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and the processor executes the computer program to implement the component automatic positioning method for the MOM business domain according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and the processor executes the computer program to implement the component automatic positioning method for the MOM business domain according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method, system and equipment for generating visualized webpage and storage medium
CN108415706A
Web page drag component positioning method, storage medium, electronic apparatus and system
CN109213409A
Automatic adsorption alignment method and device for graph dragging, computer equipment and medium
CN114816192A
Docking operation method for component, and terminal
WO2022160727A1
Alignment of element blocks
WO2022238410A1