Automatic label arrangement method and system

By implementing automatic label arrangement methods and systems on electronic whiteboards, and automatically arranging and adjusting labels and guide lines, the problems of messy labels and time-consuming dragging are solved, and the research efficiency is improved.

CN120066641APending Publication Date: 2025-05-30THE 28TH RES INST OF CHINA ELECTRONICS TECH GROUP CORP
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510022046.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-07
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

On the electronic whiteboard, as the number of tags increases, the tags are overlapping and the guide lines are crisscrossed, making it difficult for researchers to quickly find the tag information they pay attention to, and it takes a lot of time to drag and adjust, which reduces the efficiency of the discussion.

Method used

Provide a tag automation orchestration method and system, automatically arrange tags through preset baselines, horizontal and vertical alignment, and automatically adjust the tag position. Specific steps include baseline setting, label layout calculation, label arrangement and guideline adjustment to ensure automatic label adjustment and horizontal alignment to avoid intersecting guidelines.

Benefits of technology

The automatic layout of labels and the automatic adjustment of guide lines are realized, the problems of messy overlapping labels and time-consuming dragging are solved, and the efficiency of the electronic whiteboard discussion process is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120066641A_ABST
    Figure CN120066641A_ABST
Patent Text Reader

Abstract

The invention discloses a label automatic arrangement method and system, and the method comprises the steps: presetting a baseline according to different screen widths and heights, calculating a lower side height according to the heights of all labels, calculating a left side distance and a top distance, and calculating a right side distance and a top distance according to the average position of all labels on a screen, and finally, screening out left and right lower-side label groups, automatically arranging the labels in the left and right lower-side label groups, automatically adjusting guide lines of the labels, ensuring that the guide lines are not intersected, and realizing automatic adjustment of label positions and transverse and longitudinal alignment. According to the method and the system, labels in a label group are automatically arranged, meanwhile, an initial point, an expansion point, an inflection point and a tail point are introduced for intersecting label guide lines, intersection of the guide lines is avoided by automatically adjusting the positions of the expansion point and the inflection point, and finally automatic adjustment and transverse and longitudinal alignment of the labels are achieved. The problems that in the electronic whiteboard discussion process, labels are disordered and overlapped, and manual dragging consumes time are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of human-computer interaction, and particularly relates to a method and system for automatic label arrangement. Background Art

[0002] When using an interactive electronic whiteboard for collaborative discussion, it is often necessary to mark important events and important targets on the whiteboard with labels with guiding lines. However, as the amount of information to be marked increases, the number of labels also increases, resulting in messy and overlapping labels and criss-crossing guiding lines. Participants in the discussion cannot quickly find the label information they are concerned about, and a large amount of time needs to be spent manually dragging and adjusting, reducing the discussion efficiency. Chinese Patent with Application No. 202210617685.9 provides a method for labeling electronic map labels and guiding lines, which mainly starts from obtaining the display parameters of the guiding lines based on the layout of the screen and the type of labels, and cannot be applied to the electronic whiteboard scenario. Therefore, how to achieve automatic label layout and automatic guiding lines on the electronic whiteboard is an urgent problem to be solved. Summary of the Invention

[0003] Object of the Invention: The technical problem to be solved by the present invention is to provide a method and system for automatic label arrangement in view of the deficiencies of the prior art, which automatically arranges labels according to a preset baseline, aligns horizontally and vertically, and automatically adjusts the label positions to solve the problems of messy and overlapping labels and the need for manual dragging.

[0004] Technical Solution: In the first aspect, an automatic label arrangement method is disclosed, including the following steps:

[0005] Step S1, baseline setting: Set the reserved sizes of the upper left, upper right, left, and right according to different screen widths and heights; and sort all labels according to their screen positions.

[0006] Step S2, label layout calculation: Calculate the lower height based on the heights of all labels, calculate the left spacing, the left top distance, the right spacing, and the right top distance based on the average position of all labels on the screen, and finally screen out the left, right, and lower label groups.

[0007] Step S3, arrange the labels within the left, right, and lower label groups, and calculate the screen position where the end point of the label is located.

[0008] Step S4, deduce the inflection point position based on the initial point and end point positions of the current label, and form the guiding line of the label from the initial point, inflection point, and end point; add extension points between the inflection points and end points of the intersecting guiding lines, and adjust the inflection point positions until the guiding lines do not intersect.

[0009] Preferably, in step S1, set the upper left reserved size LT on the screen canvas Space, the reserved size RT on the upper right Space , the reserved size LM on the left Space , the reserved size RM on the right Space , the current screen height H Screen and width W Screen , and sort the tags according to the longitude of all tags to obtain the sorted tag group V sort .

[0010] Preferably, the tag layout calculation in step S2 includes:

[0011] S21. Calculate the average X-direction position of all tags as P AveX and the average Y-direction position as P AveY . According to the average X-direction position P AveX divide the tag group V sort into a temporary left tag group V Lsort and a temporary right tag group V Rsort . At the same time, calculate the total height H Lall of the tags in all temporary left tag groups, the quantity nLeftSize, and the total height H Rall of the tags in the temporary right tag group, the quantity nRightSize; calculate the lower side height H all according to the height H Veg = H all × PerNum, where PerNum represents the ratio of the lower side height to the height of all tags. Set PerMum so that H Veg ≤ H Screen * 0.4; judge whether to use the lower side space of the screen canvas to arrange the tags according to whether H all is greater than H Screen * 2. If H all is greater than H Screen * 2, then use the lower side space;

[0012] S22. Calculate the left top margin LeftTopS and the left spacing LeftS of all tags in the temporary left tag group V Lsort ;

[0013] S23. Calculate the right top margin RightTopS and the right spacing RightS of all tags in the temporary right tag group V Rsort ;

[0014] S24. According to the left top margin, the left spacing, the right top margin, and the right spacing, traverse and calculate the heights where all tags are located to judge which tag group the tags finally belong to, namely the left tag group V' LSort , the right tag group V' RSort , and the lower side tag group V' BSort .

[0015] Preferably, in step S3, the labels in the left, right, and lower label groups are arranged respectively, and the screen positions of the end points where the labels are located are calculated, including:

[0016] S31. According to the maximum width LeftMaxW of the labels in the left label group V’ LSort , and the initial point screen position (LX’m, LY’m) of the m-th left label, calculate the screen position (EndLX m , EndLY m ) of the end point of the m-th left label, where m represents the left label index, 1 ≤ m ≤ nMSize, and nMSize represents the number of labels in the left label group V’ LSort ;

[0017] S32. According to the maximum width RightMaxW of the labels in the right label group V’ RSort , and the initial point screen position (RX’ n , RY’ n ) of the n-th right label, calculate the screen position (EndRX n , EndRY n ) of the end point of the n-th right label, where n represents the right label index, 1 ≤ n ≤ nNSize, and nNSize represents the number of labels in the right label group V’ RSort ;

[0018] S33. According to the initial point screen position (BX’ BSort , BY’ l ) of the l-th label in the lower label group V’ l , calculate the screen position (EndBX l , EndBY l ) of the end point of the l-th label, where l represents the lower label index, 1 ≤ l ≤ nBSize, and nBSize represents the number of labels in the lower label group V’ BSort .

[0019] Preferably, in step S4, the inflection point position is deduced based on the initial point and end point positions of the current label, and a guiding line of the label is formed by the initial point, inflection point, and end point. Extension points are added between the inflection points and end points of the intersecting guiding lines, and the inflection point positions are adjusted until the guiding lines do not intersect, including:

[0020] S41. Set the inflection point position of the guiding line according to the initial point position and end point position of the label, and form a label guiding line by the initial point, inflection point, and end point;

[0021] S42. Determine whether the guiding lines of the labels intersect. If they do not intersect, execute S44;

[0022] S43. Adjust the positions of the intersecting label guiding lines, add extension points, adjust the inflection point positions, form new guiding lines, and execute step S42 to determine whether they intersect. If they do not intersect, execute S44;

[0023] S44. Draw guiding lines for the non-intersecting labels.

[0024] Preferably, in step S22, calculating the top margin LeftTopS of all labels in the temporary left label group V Lsort includes setting the top margin LeftTopS according to the ratio of the total height H of the labels in all temporary left label groups Lall to the screen height H Screen ;

[0025] Reset the left reserved size LM according to the difference between the screen height H Screen and the total height H of the labels in all temporary left label groups Lall , and calculate all temporary left spacings LeftS; space

[0026] In step S23, calculating the right top margin RightTopS of all labels in the temporary right label group V Rsort includes setting the top margin RightTopS according to the ratio of the total height H of the labels in all temporary right label groups Rall to the screen height H Screen ;

[0027] Reset the right reserved size RM according to the difference between the screen height H Screen and the total height H of the labels in all temporary right label groups Rall , and calculate all temporary right spacings RightS. Space

[0028] Preferably, step S24 includes:

[0029] Traverse the temporary left labels, and calculate whether the screen position of the label exceeds H according to the left top margin, left spacing, and the height of the temporary left label Veg to determine whether the label ultimately belongs to the left label group V' LSort or the lower label group V' BSort ;

[0030] Traverse and calculate the temporary right labels, and calculate whether the screen position of the label exceeds H according to the right top margin, right spacing, and the height of the temporary right label Veg to determine whether the label ultimately belongs to the right label group V' RSort or the lower label group V' BSort ;

[0031] For the determined left label group V'​​LSort , the right - hand tag group V' RSort and the bottom - hand tag group V' BSort Sort by the longitude of the tags to obtain the final result: the left - hand tag group V' containing nMSize tags LSort and the attributes of each left - hand tag; the right - hand tag group V' containing nNSize tags RSort and the attributes of each right - hand tag; the bottom - hand tag group V' containing nBSize tags BSort and the attributes of each bottom - hand tag.

[0032] Preferably, step S31 includes:

[0033]

[0034] where PosY m represents the Y - direction position of the upper - left corner of the m - th tag, LH' m-1 represents the height of the (m - 1) - th tag, LW' m represents the width of the m - th tag, LX' m and LY' m represent the X - direction position and Y - direction position of the initial point of the m - th tag on the screen respectively;

[0035] Step S32 includes:

[0036]

[0037] where PosY b represents the Y - direction position of the upper - left corner of the n - th tag;

[0038] Step S33 includes:

[0039]

[0040] where PosY l represents the Y - direction position of the upper - left corner of the l - th tag, and PosX l represents the X - direction position of the upper - left corner of the l - th tag.

[0041] Preferably, step S43 includes:

[0042] Divide the section between the inflection point and the end point into 4 segments of 0.2, 0.3, 0.5, and 0.7, denoted as Δ t , 1 ≤ t ≤ 4, and add extension points LinePt t =(RX' n +Δ t ×(EndRX n -RX' n ),RY' n), then the inflection point position is adjusted to (RX’ n +Δ t ×(EndRX n -RX’ n ), EndRY n ).

[0043] In a second aspect, a label automatic layout system is disclosed, including:

[0044] A baseline setting module, configured to set the reserved sizes of the upper left, upper right, left, and right according to different screen widths and heights; and sort all labels according to the screen positions where the initial points are located.

[0045] A label layout calculation module, configured to calculate the lower height according to the heights of all labels, calculate the left spacing, top distance, right spacing, and top distance according to the average positions of all labels, and finally screen out the left, right, and lower label groups.

[0046] A label arrangement module, configured to arrange the left, right, and lower label groups respectively, calculate the screen positions where the labels are located, and obtain the screen positions of the end points according to the screen positions of the initial points of the labels.

[0047] A label guiding line adjustment module, configured to deduce the inflection point position according to the initial point and end point positions of the current label, and form the guiding line of the label with the initial point, inflection point, and end point. Add extension points between the inflection points and end points of the intersecting guiding lines, and adjust the inflection point position until the guiding lines do not intersect.

[0048] Beneficial effects: This patent focuses on the electronic whiteboard discussion scenario that requires a large number of labels as annotations. Through a label automatic layout method and system, the labels in the discussion process are uniformly organized, the left, right, and lower label groups are screened out from the labels within the screen according to the baseline preset according to the screen width and height, the labels within the label groups are automatically arranged, and at the same time, for the intersecting label guiding lines, the initial point, extension point, inflection point, and end point are introduced. By automatically adjusting the positions of the extension point and inflection point, the intersection between the guiding lines is avoided, and finally, the labels are automatically adjusted and horizontally and vertically aligned, solving the problems of messy overlap of labels and time-consuming manual dragging in the electronic whiteboard discussion process. Brief Description of the Drawings

[0049] The following further specific description of the present invention is made in conjunction with the drawings and specific embodiments, and the above and / or other advantages of the present invention will become clearer.

[0050] Figure 1 is the schematic diagram of the processing flow of the present invention;

[0051] Figure 2 is one of the schematic diagrams of the screen preset baseline

[0052] Figure 3 It is the second schematic diagram of the screen preset baseline;

[0053] Figure 4 It is the schematic diagram of three points of the label;

[0054] Figure 5 It is the schematic diagram of the segmentation of the label guiding line;

[0055] Figure 6 It is the schematic diagram of the label extension point; Specific implementation mode

[0056] Next, embodiments of the present invention will be described with reference to the accompanying drawings.

[0057] Refer to Figure 1 , the first embodiment of the present application discloses a label automatic layout method, which specifically includes the following steps:

[0058] Step S1, baseline setting: According to different screen resolutions, set the reserved sizes of the upper left, upper right, and left sides, and sort the labels according to the screen positions where the label initial points are located.

[0059] Step S2, label layout calculation: Calculate the lower side height according to the heights of all labels, calculate the left side spacing, top distance, right side spacing, and top distance according to the average positions of all labels, and finally screen out the left, right, and lower side label groups.

[0060] Step S3, label arrangement: Arrange the labels in the left, right, and lower side label groups respectively, and calculate the screen positions where the end points of the labels are located.

[0061] Step S4, label guiding line adjustment: Calculate the inflection point position based on the initial point and end point positions of the current label, and form the guiding line of the label with the initial point, inflection point, and end point. Add extension points between the inflection points and end points of the intersecting guiding lines, and adjust the inflection point positions until the guiding lines do not intersect.

[0062] Next, the main processes of each step will be specifically introduced:

[0063] Step S1, baseline setting

[0064] According to different screen resolutions, set the reserved sizes of the upper left, upper right, left, and right sides, specifically:

[0065] Step S11, as Figure 2 shown, on the screen canvas (the upper left corner of the canvas is the screen pixel initial point (0,0)), set the reserved size of each label from the screen canvas according to the left and right sides of the screen where the label is located (the reserved size indicates that the position of the label on the canvas cannot be less than this value from the edge of the screen canvas): the upper left reserved size of the label on the left side of the canvas is LTSpace , with a left reserved size LM Space , the upper right reserved size RT of the label on the right side of the canvas Space , and a right reserved size RM Space , the current screen height H Screen and width W Screen , where LT Space , RT Space , LM Space , RM Space are thresholds that the positions of each label on the screen canvas must follow, with initial values of 100 screen pixels each, and can be adjusted according to actual needs.

[0066] Step S12: Record the total number of labels as nSize, nSize > 0. Sort the labels according to the longitudes of all nSize labels to obtain the sorted label group V sort = {Table 1 , Table 2 , …, Table i , …, Table nSize}, 1 ≤ i ≤ nSize, where the attributes of each label (initial point screen X-direction position, initial point screen Y-direction position, width, height) are Table i = {X i , Y i , W i , H i}.

[0067] Step S2: Label layout calculation

[0068] Calculate the left spacing and top distance, and calculate the right spacing and top distance based on the average positions of all labels. Finally, filter out the left, right, and bottom labels. The specific steps are as follows:

[0069] Step S21: Calculate the average positions of all nSize labels, including calculating the average X-direction position P AveX and the average Y-direction position P AveY . The average X-direction position is The average Y-direction position is

[0070] Compare the X-direction position of each label with the average P AveX and divide the label group V sort into nLeftSize temporary left label groups V Lsort = {LTable 1 , LTable 2 , ……, LTable j}, 1 ≤ j ≤ nLeftSize, where the attribute of each temporary left label is LTable j = {LX j 、LY j 、LW j 、LH j}}, and LX j ≤ P AveX ; nRightSize temporary right label groups V Rsort = {RTable 1 、RTable 2 、…、RTable k}, 1 ≤ k ≤ nRightSize, where the attribute of each temporary right label is RTable k = {RX k 、RY k 、RW k 、RH k}, and RX k > P AveX . At the same time, calculate the sum of the heights H Lall of all temporary left labels and the sum of the heights H Rall of all temporary right labels. Among them, the calculation of the height of all temporary left labels is 1 ≤ j ≤ nLeftSize, and the height of all temporary right labels is 1 ≤ k ≤ nRightSize. Then the size of the height of all labels is: H all = H Lall + H Rall .

[0071] According to whether H all is greater than H Screen * 2 (i.e., twice the screen height), determine whether to use the lower space of the screen canvas to arrange the labels. If H all is greater than H Screen * 2, then use the lower space, as shown in Figure 3 . If the lower space is used, set the lower height threshold to H Veg = H all × PerNum, where the initial value of PerNum is 0.2, and adjust the value of PerNum to ensure that H Veg ≤ H Screen * 0.4.

[0072] Step S22, calculation of the left spacing and the top distance.

[0073] Calculate the top margin LeftTopS of all labels in the temporary left label group V Lsort :

[0074]

[0075] Reset the left reserved size LM Space , calculate the spacing LeftS of all temporary left labels:

[0076]

[0077] Among them, the value of MainHeight is defaulted to 40 screen pixel sizes; the value of TipsPace is defaulted to 100 screen pixel sizes.

[0078] Step S23, Calculate the right spacing and top distance.

[0079] Calculate the top edge distance RightTopS of all labels in the temporary right label group V Rsort :

[0080]

[0081] Reset the right reserved size RM Space , calculate the spacing RightS of all temporary right labels:

[0082]

[0083] Among them, the value of MainHeight is defaulted to 40 screen pixel sizes; the value of TipsPace is defaulted to 100 screen pixel sizes.

[0084] Step S24, Screen the left, right and lower sides.

[0085] Traverse and calculate the temporary left label LTable j , calculate whether the screen position where the label is located exceeds H Veg to judge whether the label finally belongs to the left label group V’ LSort or the lower label group V’ BSort .

[0086]

[0087] Among them, LeftH j represents the Y-direction position of the upper left corner of the j-th label.

[0088] Traverse and calculate the temporary right label RTable k , calculate whether the screen position where the label is located exceeds H Veg to judge whether the label finally belongs to the right label group V’ RSort or the lower label group V’ BSort .

[0089]

[0090] Among them, RightH k represents the Y - direction position of the upper - left corner of the k - th label.

[0091] For the determined left - hand label group V’ LSort , right - hand label group V’ RSort and bottom - hand label group V’ BSort , sort them according to the X - direction position of the labels to obtain the final result: The left - hand label group V’ LSort ={LTable’ 1 , LTable’ 2 , …, LTable’ m , …}, where 1 ≤ m ≤ nMSize, and the attributes of each left - hand label (initial point screen X - direction position, initial point screen Y - direction position, width, height) are LTable’ m ={LX ’ m , LY’ m , LW’ m , LH’ m}; The right - hand label group V’ RSort ={RTable’ 1 , RTable’ 2 , …, RTable’ n , …}, where 1 ≤ n ≤ nNSize, and the attributes of each right - hand label (initial point screen X - direction position, initial point screen Y - direction position, width, height) are RTable’ m ={RX’ n , RY’ n , RW’ n , RH’ n}; The nBSize bottom - hand label groups V’ BSort ={BTable’ 1 , BTable’ 2 , …, BTable’ l , …}, where 1 ≤ l ≤ nBSize, and the attributes of each bottom - hand label (initial point screen X - direction position, initial point screen Y - direction position, width, height) are BTable i ={BX’ l , BY’ l , BW’ l , BH’ l}.

[0092] Step S3: Label Arrangement

[0093] Arrange the left - hand, right - hand, and bottom - hand label groups respectively, calculate the screen positions where the labels are located, and obtain the screen coordinates of the end points according to the end - point screen positions of the labels.

[0094] Step S31, arrange on the left side. Compare and obtain the left label group V' LSort The maximum width of all labels in LeftMaxW is based on the mth left label LTable' m The initial screen position (LX' m ,LY' m ), calculate the screen position of the label's tail point (EndLX m ,EndLY m ):

[0095]

[0096] Among them, PosY m Indicates the Y position of the upper left corner of the mth label.

[0097] Step S32, right side arrangement. Compare and obtain the right side label group V' RSort The maximum width of all labels in RightMaxW is based on the nth right label RTable' n The screen position of the initial point (RX' n ,RY' n ), calculate the screen position of the label's end point (EndRX n ,EndRY n ):

[0098]

[0099] Among them, PosY n Indicates the Y position of the upper left corner of the nth label.

[0100] Step S33, arrange the lower side. According to the lower label group V' BSort The lth label in BTablel' l The screen position of the initial point (BX' l ,BY' l ), calculate the screen position of the label's end point (EndBX l ,EndNY l ):

[0101]

[0102] Among them, PosY l Indicates the Y position of the upper left corner of the lth label, PosX l Indicates the X-direction position of the upper left corner of the lth label.

[0103] Step S4: Label guide line adjustment

[0104] Calculate the inflection point position based on the initial point and end point positions of the current label. The guiding line of the label is composed of the initial point, the inflection point, and the end point. Add extension points between the inflection point and the end point of the intersecting guiding lines, and adjust the inflection point position until the guiding lines do not intersect.

[0105] Take the right label group V’ RSort as an example:

[0106] Step S41: Set the positions of the initial point, inflection point, and end point of the guiding line to (RX’ n ,RY’ n ), (RX’ n ,EndRY n ), and (EndRX n ,EndRY n ) respectively according to the initial point screen position (RX’ n ,RY’ n ) and the end point screen position (EndRX n ,EndRY n ) of the label. The guiding line of the label is composed of these three points, as shown in Figure 4 .

[0107] Step S42: Determine whether the guiding lines of the labels intersect. If not, directly execute step four.

[0108] Step S43: Adjust the positions of the intersecting guiding lines of the labels. Divide the section between the inflection point and the end point into four segments of 0.2, 0.3, 0.5, and 0.7, denoted as Δ t , 1 ≤ t ≤ 4. As shown in Figure 5 , add extension points LinePt t =(RX’ n +Δ t ×(EndRX n -RX’ n ),RY’ n ) in each segment in turn. Then adjust the inflection point position to (RX’ n +Δ t ×(EndRX n -RX’ n ),EndRY n ). As shown in Figure 6 , add an extension point at the 0.5 segment and adjust the inflection point position to form a new guiding line, and at the same time execute step two to determine whether they intersect. If not, execute step four.

[0109] Step S44: Label drawing.

[0110] Similarly, the positions of the guiding lines of the labels in the left label group V' LSort and the lower label group V’ BSort can be adjusted.

[0111] The second embodiment of the present application discloses a label automatic layout system, including:

[0112] A baseline setting module, configured to set the reserved sizes of the upper left, upper right, left, and right according to different screen widths and heights; and sort all labels according to the screen positions where the initial points are located.

[0113] A label layout calculation module, configured to calculate the lower side height according to the heights of all labels, calculate the left side spacing, top distance, right side spacing, and top distance according to the average positions of all labels, and finally screen out the left, right, and lower side label groups.

[0114] A label arrangement module, configured to arrange the left, right, and lower side label groups respectively, calculate the screen positions where the labels are located, and obtain the screen positions of the end points according to the screen positions of the initial points of the labels.

[0115] A label guiding line adjustment module, configured to deduce the inflection point positions according to the initial point and end point positions of the current label, and form the guiding line of the label from the initial point, inflection point, and end point. Add extension points between the inflection points and end points of the intersecting guiding lines, and adjust the inflection point positions until the guiding lines do not intersect.

[0116] It should be understood that the label automatic layout system in the embodiments of the present invention can implement all the technical solutions in the above method embodiments, and the functions of its respective functional modules can be specifically implemented according to the methods in the above method embodiments. The specific implementation process can refer to the relevant descriptions in the above embodiments and will not be elaborated here.

[0117] The present invention also provides a computer device, including: one or more processors; a memory; and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the one or more processors, and when the programs are executed by the processors, the steps of the flight safety warning method based on the global grid as described above are implemented.

[0118] The present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the flight safety warning method based on the global grid as described above are implemented.

[0119] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program codes.

[0120] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present invention. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in one Figure 1 flow or multiple flows and / or blocks Figure 1 block or multiple blocks.

[0121] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means that implement the functions specified in one Figure 1 flow or multiple flows and / or blocks Figure 1 block or multiple blocks.

[0122] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one Figure 1 flow or multiple flows and / or blocks Figure 1 block or multiple blocks.

[0123] The present invention provides a method and system for label automation orchestration. There are many methods and approaches to specifically implement this technical solution. The above description is only the preferred embodiment of the present invention. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present invention. Each component not clearly defined in this embodiment can be implemented by existing technologies.

Claims

1. A label automatic arrangement method, characterized in that: The following steps are involved: Step S1, baseline setting, according to different screen widths and heights, set the reserved sizes of the upper left, upper right, left, and right; and sort all labels according to the screen positions; Step S2, label layout calculation, calculate the bottom height according to the height of all labels, calculate the left spacing and the left top distance, the right spacing and the right top distance according to the average position of all labels on the screen, and finally filter out the left and right bottom label groups; Step S3, arranging the labels in the left, right and bottom label groups, and calculating the screen position of the tail point of the label; Step S4, calculate the inflection point position according to the initial point and the tail point position of the current label, and form the guide line of the label by the initial point, the inflection point and the tail point; add an extension point between the inflection point and the tail point of the intersecting guide line, and adjust the inflection point position until the guide lines do not intersect.

2. The method for automatic label arrangement according to claim 1, characterized in that: The baseline setting in step S1 includes: setting the upper left reserved size LT on the screen canvas Space , upper right reserved size RT Space , the left reserved size LM Space , the reserved size on the right is RM Space , remember the current screen height is H Screen , width W Screen , sort the tags according to their screen positions, and obtain the sorted tag group V sort .

3. The method for automatic label arrangement according to claim 2, characterized in that: The label layout calculation in step S2 includes: S21, calculating the average X-direction position of all labels as P AveX and the average Y position is P AveY , according to the average X-direction position P AveX Set the label group V sort Divided into temporary left label group V Lsort and temporary right tab group V Rsort , and calculate the total height H of all labels in the temporary left label group Lall , the number nLeftSize and the total height H of the labels in the temporary right label group Rall , quantity nRightSize; according to the height H of all labels all Calculate the lower side height H Veg =H all ×PerNum, PerNum means the ratio of the lower height to the height of all labels. Set PerNum so that H Veg ≤H Screen *0.4; according to H all Is it greater than H Screen *2 Determine whether to use the lower space of the screen canvas to arrange the labels. If H all Greater than H Screen *2, the lower space is used; S22, calculate the temporary left label group V Lsort The left top margin LeftTopS and left spacing LeftS of all labels; S23, calculate the temporary right label group V Rsort The right top margin RightTopS and right spacing RightS of all labels; S24, according to the left top margin, the left spacing, the right top margin, and the right spacing, traverse and calculate the heights of all labels to determine whether the label finally belongs to the left label group V' LSort , right label group V' RSort、 Lower label group V' BSort .

4. The method for automatic label arrangement according to claim 3, characterized in that: According to step S3, the following steps are included: S31, according to the left label group V' LSort The maximum width of the middle label LeftMaxW, and the initial screen position of the mth left label (LX' m LY' m ), calculate the screen position of the end point of the mth left label (EndLX m , EndLY m ), m represents the left label index, 1≤m≤nMSize, nMSize represents the left label group V' LSort The number of labels in ; S32, according to the right label group V' RSort The maximum width of the middle label RightMaxW and the initial screen position of the nth right label (RX' n , RY' n ), calculate the screen position of the end point of the nth right label (EndRX n , EndRY n ), n represents the right label index, 1≤n≤nNSize, nNSize represents the right label group V' RSort The number of labels in ; S33, according to the lower label group V' BSort The initial screen position of the lth label (BX' l ,BY l '), calculate the screen position of the end point of the lth label (EndBX l , EndBY l ), l represents the lower label index, 1≤l≤nBSize, nBSize represents the lower label group V' BSort The number of labels in .

5. The method for automatic label arrangement according to claim 4, characterized in that: Step S4 includes: S41, setting the inflection point position of the guide line according to the initial point position and the tail point position of the label, and forming the label guide line by the initial point, the inflection point and the tail point; S42, determining whether the guide lines of each label intersect with each other, if not, executing S44; S43, adjusting the positions of the intersecting label guide lines, adding extension points, adjusting the positions of the inflection points, forming new guide lines, and executing step S42 to determine whether they intersect, and if not, executing S44; S44. Draw guide lines for non-intersecting labels.

6. The method for automatic label arrangement according to claim 5, characterized in that: In step S22, a temporary left label group V is calculated. Lsort The top margin of all labels in the LeftTopS group includes the total height H of all labels in the temporary left label group. Lall With screen height H Screen Set the top margin LeftTopS according to the proportion; According to the screen height H Screen The total height H of all labels in the temporary left label group Lall The difference resets the left reserved size LM Space , calculate all temporary left spacings LeftS; In step S23, the temporary right label group V is calculated. Rsort The right top margin of all the labels in the right tab group is included according to the total height H of all the labels in the temporary right tab group. Rall With screen height H Screen Set the top margin RightTopS according to the proportion; According to the screen height H Screen The total height H of all temporary right label groups Rall The difference resets the right reserved size RM Space , calculate all temporary right spacings RightS.

7. The method for automatic label arrangement according to claim 6, characterized in that: Step S24 includes: Traverse the temporary left label and calculate whether the screen position of the label exceeds H according to the left top margin, left spacing and the height of the temporary left label. Veg To determine whether the label finally belongs to the left label group V' LSort Or the lower label group V' BSort ; Traverse and calculate the temporary right label, and calculate whether the screen position of the label exceeds H according to the right top margin, right spacing and the height of the temporary right label. Veg To determine whether the label finally belongs to the label group V' on the right RSort Or the lower label group V' BSort ; For the determined left label group V' LSort , right label group V' RSort And the lower label group V' BSort Sort by the longitude of the label to get the final result: the left label group V' containing nMSize labels LSort and the properties of each left label; a right label group V' containing nNSize labels RSort and properties of each right label; the lower label group V' containing nBSize labels BSort and properties for each lower side label.

8. The method for automatic label arrangement according to claim 7, characterized in that: Step S31 includes: Among them, PosY m Indicates the Y position of the upper left corner of the mth label, LH' m-1 Indicates the height of the m-1th label, LW' m Indicates the width of the mth label, LX' m and LY' m They represent the initial point screen X-direction position and the initial point screen Y-direction position of the mth label respectively; Step S32 includes: Among them, PosY n Indicates the Y-direction position of the upper left corner of the nth label; Step S33 includes: Among them, PosY l Indicates the Y position of the upper left corner of the lth label, PosX l Indicates the X-direction position of the upper left corner of the lth label.

9. The method for automatic label arrangement according to claim 8, characterized in that: Step S43 includes: The area between the inflection point and the tail point is divided into 4 segments of 0.2, 0.3, 0.5 and 0.7, which are respectively denoted as Δ t , 1≤t≤4, add extension points LinePt in each segment in turn t =(RX' m +Δ t ×(EndRX n -RX' n ), RY' n ), the inflection point position is adjusted to (RX' n +Δ t ×(EndRX n -RX' n ), EndRY n ).

10. A label automatic arrangement system, applied to a label automatic arrangement method according to any one of claims 1 to 9, characterized in that: include: The baseline setting module is used to set the reserved sizes of the upper left, upper right, left, and right sides according to different screen widths and heights; And sort all labels according to the screen positions taken by the initial points; The label layout calculation module is used to calculate the bottom height according to the height of all labels, calculate the left spacing and top distance, right spacing and top distance according to the average position of all labels, and finally filter out the left and right bottom label groups; The label arrangement module is used to arrange the left, right and bottom label groups respectively, calculate the screen position of the label, and obtain the screen position of the tail point according to the screen position of the initial point of the label; The label guide line adjustment module is used to calculate the inflection point position based on the initial point and tail point positions of the current label, and the label guide line is composed of the initial point, inflection point and tail point; an extension point is added between the inflection point and tail point of the intersecting guide lines, and the inflection point position is adjusted until the guide lines do not intersect.

Citation Information

Patent Citations

  • Electronic map label and guide line labeling method, system and equipment and storage medium

    CN115048168A