Information labeling method and device, computer device, and readable storage medium

By segmenting the annotation lines in electronic maps by curvature and breakpoints, the granularity of annotation is refined. Based on the target character configuration strategy matched to each small range of annotation lines, the problem of text angle reversal and overlap in traditional electronic map annotation is solved, achieving higher annotation accuracy and adaptability.

CN121330120BActive Publication Date: 2026-05-12BEIJING INSTITUTE OF SURVEYING AND MAPPING
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING INSTITUTE OF SURVEYING AND MAPPING
Filing Date
2025-08-20
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

In traditional electronic map annotation technology, the angle of the text used to annotate special locations on roads is easily reversed and the names overlap, resulting in poor annotation accuracy.

Method used

By acquiring the annotation line to be annotated, it is divided into multiple second annotation lines according to the curvature and breakpoint segmentation strategy, and the character configuration strategy, including the character center position and tilt angle, is determined based on the angle information of each second annotation line for annotation.

Benefits of technology

It improves the accuracy of annotations, avoids inconsistencies between the marking logic of special road locations and road conditions, and enhances the adaptability and clarity of annotations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121330120B_ABST
    Figure CN121330120B_ABST
Patent Text Reader

Abstract

The application relates to an information labeling method and device, computer equipment and a readable storage medium. The method comprises the following steps: obtaining a first annotation line to be labeled and characters to be labeled; performing breakpoint segmentation on the first annotation line according to the curvature and breakpoint segmentation strategy of the first annotation line, so as to obtain a plurality of second annotation lines; for each second annotation line, target character configuration strategy corresponding to the characters to be labeled is determined based on the angle information of the second annotation line and a horizontal line; the target character configuration strategy comprises a character center configuration position and a character tilt angle matched with the characters to be labeled in each second annotation line; and each character to be labeled corresponding to each second annotation line is labeled according to the character center configuration position and the character tilt angle, so as to obtain a labeling result. The method can improve the accuracy of information labeling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electronic map annotation technology, and in particular to an information annotation method, apparatus, computer equipment, and readable storage medium. Background Technology

[0002] With the development of electronic map technology, electronic maps can be updated more promptly than paper maps, allowing users to travel according to more accurate routes. Before an electronic map is launched and released, the annotation lines in the electronic map need to be marked.

[0003] In traditional technology, automatic annotation software is used to automatically annotate electronic maps. The automatic annotation software determines the annotation position and font angle of the roads to be annotated as annotation conditions through pre-configured annotation logic, and then annotates them on the electronic map according to the annotation conditions to obtain the annotation results.

[0004] However, in current traditional technologies, because the overall annotation logic of the roads to be annotated is fixed in the pre-configured system, there are chaotic phenomena such as inverted annotation text angles and overlapping names in special locations of the roads, which leads to poor accuracy of annotation. Summary of the Invention

[0005] Therefore, it is necessary to provide an information annotation method, apparatus, computer equipment, and readable storage medium to address the aforementioned technical problems.

[0006] Firstly, this application provides an information annotation method, including:

[0007] Get the first annotation line and the character to be annotated;

[0008] Based on the curvature of the first annotation line and the breakpoint segmentation strategy, the first annotation line is segmented into multiple second annotation lines.

[0009] For each of the second annotation lines, a target character configuration strategy is determined based on the angle information between the second annotation line and the horizontal line; the target character configuration strategy includes the character center configuration position and character tilt angle that match the character to be annotated in each of the second annotation lines;

[0010] The characters to be annotated are annotated according to the character center configuration position and the character tilt angle, and the annotation results are obtained.

[0011] In one embodiment, the step of segmenting the first annotation line according to the curvature and breakpoint segmentation strategy of the first annotation line to obtain a plurality of second annotation lines includes:

[0012] The curvature of each of the first annotation lines is determined based on the first annotation line and the corresponding end-to-end line of the first annotation line;

[0013] If the curvature is greater than a preset curvature threshold and the length of the first annotation line on the graph is greater than a first length threshold, or if the curvature is less than or equal to the preset curvature threshold and the length on the graph is greater than a second length threshold, the target breakpoint corresponding to the first annotation line is determined according to the breakpoint segmentation strategy, and the first annotation line is segmented according to the target breakpoint to obtain multiple second annotation lines.

[0014] In one embodiment, for the first annotation line whose curvature is less than or equal to a preset curvature threshold, a target breakpoint corresponding to the first annotation line is determined according to a breakpoint segmentation strategy, and breakpoint segmentation is performed based on the target breakpoint to obtain multiple second annotation lines, including:

[0015] Determine the maximum vertical distance between each preset coordinate in the first annotation line and the corresponding first and last line connecting the first annotation line;

[0016] If the maximum vertical distance is greater than the preset segmentation threshold, the coordinates corresponding to the maximum vertical distance are determined as the target breakpoint of the first annotation line, and the first annotation line is segmented to obtain multiple new first annotation lines.

[0017] Determine the maximum vertical distance between each preset coordinate in each new first annotation line and the corresponding end-to-end line of the new first annotation line;

[0018] Multiple second annotation lines are obtained until the maximum vertical distance is less than or equal to the preset segmentation threshold.

[0019] In one embodiment, determining the target character configuration strategy corresponding to the character to be annotated based on the angle information between the second annotation line and the horizontal line for each of the second annotation lines includes:

[0020] For each of the second annotation lines, the center positions of the first character and the last character are determined based on the character to be annotated and the preset character size;

[0021] Based on the center positions of the first and last characters, the target annotation line corresponding to the second annotation line is determined, and the counterclockwise angle between the horizontal line and the target annotation line is determined as the angle information.

[0022] The target character configuration strategy corresponding to the character to be labeled is determined based on the angle information.

[0023] In one embodiment, determining the target character configuration strategy corresponding to the character to be annotated based on the angle information between the second annotation line and the horizontal line for each of the second annotation lines includes:

[0024] For each of the second annotation lines, the storage order and annotation order corresponding to the target annotation line of the second annotation line are determined based on a preset angle threshold and the angle information;

[0025] The target character configuration strategy corresponding to each character to be annotated is determined based on the storage order and the annotation order.

[0026] In one embodiment, determining the storage order and annotation order of the target annotation line corresponding to each of the second annotation lines based on a preset angle threshold and the angle information includes:

[0027] For each of the second annotation lines, if the angle information is less than a preset angle threshold, the storage order is determined to be forward storage; if the angle information is greater than or equal to the preset angle threshold, the storage order is determined to be reverse storage.

[0028] If the angle information is less than the first angle threshold, the annotation order is determined to be from small to large ordinate values; if the angle information is greater than or equal to the preset angle threshold, the annotation order is determined to be from large to small ordinate values.

[0029] In one embodiment, before obtaining the first annotation line and the character to be annotated, the method further includes:

[0030] Obtain the geographic coordinates and scale of the initial annotation lines in the map data;

[0031] Based on the scale, the geographic coordinates are mapped to image coordinates to obtain the first annotation line.

[0032] In one embodiment, obtaining the first annotation line and the character to be annotated includes:

[0033] Obtain the original annotation lines and the road classification of the original annotation lines;

[0034] The original annotation line is divided according to the road grade to obtain the first annotation line after preliminary division.

[0035] Secondly, this application also provides an information annotation device, comprising:

[0036] The first acquisition module is used to acquire the first annotation line to be labeled and the character to be labeled.

[0037] The segmentation module is used to segment the first annotation line according to the curvature and the breakpoint segmentation strategy of the first annotation line to obtain multiple second annotation lines;

[0038] The determination module is used to determine, for each of the second annotation lines, the target character configuration strategy corresponding to the character to be annotated based on the angle information between the second annotation line and the horizontal line; the target character configuration strategy includes the character center configuration position and character tilt angle that match the character to be annotated in each of the second annotation lines;

[0039] The annotation module is used to annotate each of the characters to be annotated corresponding to each of the second annotation lines according to the character center configuration position and the character tilt angle, so as to obtain the annotation result.

[0040] In one embodiment, the segmentation module is specifically used to determine the curvature of each of the first annotation lines based on the first annotation line and the corresponding end-to-end line of the first annotation line;

[0041] If the curvature is greater than a preset curvature threshold and the length of the first annotation line on the graph is greater than a first length threshold, or if the curvature is less than or equal to the preset curvature threshold and the length on the graph is greater than a second length threshold, the target breakpoint corresponding to the first annotation line is determined according to the breakpoint segmentation strategy, and the first annotation line is segmented according to the target breakpoint to obtain multiple second annotation lines.

[0042] In one embodiment, the segmentation module is specifically used to determine the maximum vertical distance between each preset coordinate in the first annotation line and the corresponding end-to-end line of the first annotation line;

[0043] If the maximum vertical distance is greater than the preset segmentation threshold, the coordinates corresponding to the maximum vertical distance are determined as the target breakpoint of the first annotation line, and the first annotation line is segmented to obtain multiple new first annotation lines.

[0044] Determine the maximum vertical distance between each preset coordinate in each new first annotation line and the corresponding end-to-end line of the new first annotation line;

[0045] Multiple second annotation lines are obtained until the maximum vertical distance is less than or equal to the preset segmentation threshold.

[0046] In one embodiment, the determining module is specifically used to determine the center position of the first character and the center position of the last character for each of the second annotation lines, based on the character to be annotated and the preset character size;

[0047] Based on the center positions of the first and last characters, the target annotation line corresponding to the second annotation line is determined, and the counterclockwise angle between the horizontal line and the target annotation line is determined as the angle information.

[0048] The target character configuration strategy corresponding to the character to be labeled is determined based on the angle information.

[0049] In one embodiment, the determining module is specifically used to determine the storage order and annotation order of the target annotation line of each second annotation line based on a preset angle threshold and the angle information;

[0050] The target character configuration strategy corresponding to each character to be annotated is determined based on the storage order and the annotation order.

[0051] In one embodiment, the determining module is specifically used for each of the second annotation lines to determine the storage order as forward storage if the angle information is less than a preset angle threshold, and to determine the storage order as reverse storage if the angle information is greater than or equal to the preset angle threshold.

[0052] If the angle information is less than the first angle threshold, the annotation order is determined to be from small to large ordinate values; if the angle information is greater than or equal to the preset angle threshold, the annotation order is determined to be from large to small ordinate values.

[0053] In one embodiment, the device further includes:

[0054] The second acquisition module is used to acquire the geographic coordinates and scale of the initial annotation lines in the map data;

[0055] Based on the scale, the geographic coordinates are mapped to image coordinates to obtain the first annotation line.

[0056] In one embodiment, the first acquisition module is specifically used to acquire the original annotation lines and the road grade of the original annotation lines;

[0057] The original annotation line is divided according to the road grade to obtain the first annotation line after preliminary division.

[0058] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0059] Get the first annotation line and the character to be annotated;

[0060] Based on the curvature of the first annotation line and the breakpoint segmentation strategy, the first annotation line is segmented into multiple second annotation lines.

[0061] For each of the second annotation lines, a target character configuration strategy is determined based on the angle information between the second annotation line and the horizontal line; the target character configuration strategy includes the character center configuration position and character tilt angle that match the character to be annotated in each of the second annotation lines;

[0062] The characters to be annotated are annotated according to the character center configuration position and the character tilt angle, and the annotation results are obtained.

[0063] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0064] Get the first annotation line and the character to be annotated;

[0065] Based on the curvature of the first annotation line and the breakpoint segmentation strategy, the first annotation line is segmented into multiple second annotation lines.

[0066] For each of the second annotation lines, a target character configuration strategy is determined based on the angle information between the second annotation line and the horizontal line; the target character configuration strategy includes the character center configuration position and character tilt angle that match the character to be annotated in each of the second annotation lines;

[0067] The characters to be annotated are annotated according to the character center configuration position and the character tilt angle, and the annotation results are obtained.

[0068] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:

[0069] Get the first annotation line and the character to be annotated;

[0070] Based on the curvature of the first annotation line and the breakpoint segmentation strategy, the first annotation line is segmented into multiple second annotation lines.

[0071] For each of the second annotation lines, a target character configuration strategy is determined based on the angle information between the second annotation line and the horizontal line; the target character configuration strategy includes the character center configuration position and character tilt angle that match the character to be annotated in each of the second annotation lines;

[0072] The characters to be annotated are annotated according to the character center configuration position and the character tilt angle, and the annotation results are obtained.

[0073] The aforementioned information method, apparatus, computer equipment, and readable storage medium acquire a first annotation line and a character to be annotated; the first annotation line is segmented into multiple second annotation lines based on its curvature and a breakpoint segmentation strategy; for each second annotation line, a target character configuration strategy corresponding to the character to be annotated is determined based on the angle information between the centerline of the second annotation line and the horizontal line; the target character configuration strategy includes the character center configuration position and character tilt angle corresponding to each character to be annotated; each character to be annotated corresponding to each second annotation line is annotated according to the character center configuration position and character tilt angle to obtain the annotation result. This method, by segmenting the first annotation line into second annotation lines, refines the granularity of the annotation analysis of the first annotation line to be annotated. Matching the target character configuration strategy with the second annotation lines of smaller granularity enables flexible matching of the annotation logic for the same road to be annotated, and matches the target character configuration strategy to each small range of second annotation lines. This avoids inconsistencies between the marking logic at special road locations and the road state, improves the adaptability of the target character configuration strategy to each second annotation line, and thus improves the accuracy of annotation. Attached Figure Description

[0074] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0075] Figure 1 This is a flowchart illustrating an information annotation method in one embodiment;

[0076] Figure 2 This is a schematic diagram of a segmentation process based on curvature in one embodiment;

[0077] Figure 3 This is a flowchart illustrating the segmentation of the first annotation line in one embodiment;

[0078] Figure 4 This is a schematic diagram of the first annotation line after segmentation in one embodiment;

[0079] Figure 5 This is a schematic diagram of an electronic map after information annotation based on the segmented second annotation line in one embodiment;

[0080] Figure 6This is a schematic diagram of an electronic map after information annotation based on the segmented second annotation line in one embodiment;

[0081] Figure 7 This is a flowchart illustrating the process of determining a target character configuration strategy in one embodiment;

[0082] Figure 8 This is a schematic diagram of target annotation lines with different angle information in one embodiment;

[0083] Figure 9 This is a flowchart illustrating the process of determining a target character configuration strategy based on storage order and annotation order in one embodiment.

[0084] Figure 10 This is a flowchart illustrating the process of determining the storage order and annotation order based on angle information in one embodiment;

[0085] Figure 11 This is a schematic diagram of the process of converting geographic coordinates into image coordinates in one embodiment;

[0086] Figure 12 This is a schematic diagram illustrating the process of initially segmenting the original annotation lines based on road grade in one embodiment;

[0087] Figure 13 This is a schematic diagram of an electronic map after annotation based on the first annotation line after preliminary segmentation in one embodiment;

[0088] Figure 14 This is a schematic diagram of an electronic map after annotation based on the first annotation line after preliminary segmentation in one embodiment;

[0089] Figure 15 This is a structural block diagram of an information annotation device in one embodiment;

[0090] Figure 16 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0091] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0092] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.

[0093] In one embodiment, such as Figure 1 As shown, an information annotation method is provided. This embodiment illustrates the application of this method to a terminal. It is understood that this method can also be applied to a server, and further to a system including both a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0094] Step 102: Obtain the first annotation line and the character to be annotated.

[0095] In this embodiment, the terminal reads the input map data to be labeled. The map data includes a first annotation line, which can be the center line of each road frame in the map, or it can be a linear annotation such as a river, subway line, or railway that needs to be labeled. The first annotation line is composed of a series of polylines (a basic graphic element) of coordinate points. Each coordinate point contains an x-coordinate and a y-coordinate, that is, each coordinate point contains an X-axis coordinate and a Y-axis coordinate.

[0096] The characters to be labeled can be the road name, river name, subway name, or railway name corresponding to each first annotation line to be labeled, and each first annotation line to be labeled has its corresponding character to be labeled. For example, the characters to be labeled can be Romanized languages ​​such as English, French, or Italian.

[0097] Step 104: Based on the curvature of the first annotation line and the breakpoint segmentation strategy, the first annotation line is segmented into multiple second annotation lines.

[0098] In this embodiment of the application, the first annotation line corresponding to the road to be annotated is taken as an example. The roads in the map include various situations. For example, if the road corresponding to the first annotation line is a mountain road, the first annotation line has a large curvature. Then, the terminal determines the segment that needs to be segmented in the first annotation line according to the curvature of the first annotation line and the breakpoint segmentation strategy to refine the granularity of the first annotation line, and performs segmentation processing on the first annotation line to obtain multiple second annotation lines.

[0099] After the terminal divides the first annotation line, it obtains multiple second annotation lines, which enables the separate annotation processing of various complex situations in the first annotation line. That is, each second annotation line after division is regarded as a segment of the first annotation line, which simplifies the processing of various complex situations. If the road conditions in this segment only require one annotation method, then the terminal only needs to annotate the information in the same annotation method for this segment.

[0100] In an exemplary embodiment, the first annotation line includes a first road segment running north-south of a certain length and a second road segment running east-west of a certain length. The first road segment should be labeled with the characters facing right, and the second road segment should be labeled with the characters facing upwards. If a traditional annotation method is used, and the first annotation line identifies one of the annotation methods, there may be instances of text being reversed in the global annotation of the first annotation line. However, in this embodiment, the terminal uses the curvature and breakpoint segmentation strategy of the first annotation line to segment the first and second road segments. Subsequently, corresponding annotation methods are matched to the first and second road segments respectively, achieving a finer granularity of information annotation and ensuring the degree of matching between the annotation methods and each part of the first annotation line.

[0101] Step 106: For each second annotation line, determine the target character configuration strategy corresponding to the character to be annotated based on the angle information between the second annotation line and the horizontal line.

[0102] The target character configuration strategy includes the character center configuration position and character tilt angle that match the characters to be annotated in each second annotation line.

[0103] In this embodiment, the terminal performs independent analysis on each second annotation line, matching a corresponding target character configuration strategy for each second annotation line to determine the character center configuration position and character tilt angle of the character to be annotated in each second annotation line. In map annotation, to ensure the character to be annotated matches the second annotation line (e.g., road, river, etc.) on the map, the terminal uses the angle between the second annotation line and the horizontal line to reflect its tilt direction and degree. Furthermore, the terminal determines the target character configuration strategy based on this angle information, thus obtaining a target character configuration strategy that matches the second annotation line.

[0104] In one exemplary embodiment, the annotation line can be a straight line, a curve, or have different lengths and degrees of curvature. The character center configuration position is matched to the specific shape of the second annotation line, and is most suitable for placing the center position of the character to be annotated. For example, for a straight second annotation line, the characters to be annotated can be evenly distributed; while on a curved annotation line, the spacing and position of the characters to be annotated will be adjusted according to the curvature. At the same time, it is necessary to ensure that the direction of the beginning of the character to be annotated is perpendicular to the center line of the second annotation line to ensure that the character to be annotated fits closely to the second annotation line.

[0105] Step 108: Label each character to be labeled according to the character center configuration position and character tilt angle, and obtain the labeling result.

[0106] In this embodiment, after determining the target character configuration strategy, the terminal accurately marks the character to be labeled on the corresponding second annotation line according to the character center configuration position and character tilt angle corresponding to the target character configuration strategy, thus obtaining the labeling result. The character center configuration position determines the specific placement position of the character on the map, while the character tilt angle determines the rotation direction of the character, making the character to be labeled match the second annotation line, thereby improving the quality of the electronic map.

[0107] Specifically, the terminal is pre-configured with programming libraries that support graphic drawing, such as Matplotlib (a 2D plotting library based on the Python programming language) or QGIS (Quantum GIS, a free desktop GIS software) for Geographic Information System. For each second annotation line, after determining the target character configuration strategy for the character to be annotated corresponding to each second annotation line, the terminal calculates the position and rotation angle of each letter in the character to be annotated based on the character center configuration position and character tilt angle, and draws each letter onto the graphical interface. Thus, the terminal can systematically configure and generate the position and rotation angle of each letter of the annotation line annotation on the English map, thereby achieving the accuracy and aesthetics of the annotation line annotation.

[0108] In an optional embodiment, the basic principles of annotation line annotation in the information annotation method are provided:

[0109] 1. Basic principles of annotation lines

[0110] Clear and easy to read: Notes should be clear and concise, avoiding overcrowding or overlap.

[0111] Uniform format: Annotations of the same type should maintain a consistent font, size, and color.

[0112] 2. The position of the annotation line

[0113] Annotation lines are usually placed at the center or near the endpoints of the annotation line to ensure that the annotation does not overlap with other map features.

[0114] In complex urban areas, annotation lines may need to be repositioned or have their font size adjusted to avoid overcrowding.

[0115] 3. To facilitate reading the drawing, each annotation line is generally paired with a set of English annotations. When the drawing is long or divided by higher annotation lines, multiple sets of English annotations can be configured. The spacing between each set of English annotations is generally the same, and the spacing between each set of English annotations is generally more than three times the spacing between each set of English words.

[0116] 4. The spacing between annotations of the same group of English words is generally the same, generally greater than twice the width of the font character (too dense) and less than 12 times the font size (too wide a spacing makes it difficult for readers to recognize the annotation lines, and also takes into account that at least one group of English annotations can be displayed on the computer screen) (English annotations are calculated as squares, and each English character requires one font size); due to English conventions, the spacing between each letter in a word is 0, and no spacing is added.

[0117] 5. When annotating with English annotation lines, the orientation of the first character of each word should be perpendicular to the center line of the annotation line, generally with the first character facing upwards. When the center line of the annotation line is close to a north-south direction, the first character should face right. There is no distinction between flat and elongated fonts for English annotations. Because the characters within the same word follow the rule of being perpendicular to the center line of the annotation line, there may be a situation where the annotation overlaps diagonally. Therefore, the angle between the characters in the annotation line segment corresponding to the word annotation should not be less than a target threshold, which can be between 130° and 150°.

[0118] In the above information annotation method, the second annotation line is obtained by segmenting the first annotation line into breakpoints. This refines the granularity of the annotation analysis of the first annotation line to be annotated. The second annotation line with a smaller granularity is matched with the target character configuration strategy, which realizes flexible matching of the annotation logic for the same road to be annotated. The target character configuration strategy is matched for each small range of second annotation lines, avoiding inconsistencies between the marking logic of special road locations and the road status. This improves the adaptability of the target character configuration strategy and each second annotation line, thereby improving the accuracy of annotation.

[0119] In one exemplary embodiment, such as Figure 2 As shown, step 104 includes steps 202 to 206. Wherein:

[0120] Step 202: Determine the curvature of each first annotation line based on the first annotation line and the corresponding end-to-end line.

[0121] In this embodiment, the first annotation line is a polyline composed of a series of coordinate points. The terminal first determines the starting and ending points of the first annotation line and connects them to obtain the start-end line corresponding to the first annotation line. Then, the terminal calculates the length of the start-end line in the map coordinate system based on the coordinates of the starting and ending points, and then obtains the curvature of the first annotation line based on the length of the start-end line and the length of the first annotation line on the map. The curvature We obtain it through the following formula (1):

[0122] (1)

[0123] in, The length of the first annotation line on the graph. The length of the line connecting the beginning and end.

[0124] Step 204: If the curvature of the first annotation line is greater than the preset curvature threshold and the length on the graph is greater than the first length threshold, or the curvature of the first annotation line is less than or equal to the preset curvature threshold and the length on the graph is greater than the second length threshold, determine the target breakpoint corresponding to the first annotation line according to the breakpoint segmentation strategy, and perform breakpoint segmentation on the first annotation line according to the target breakpoint to obtain multiple second annotation lines.

[0125] The first length threshold is used to characterize whether there are potential annotable segments in the first annotation line; the second length threshold is used to characterize whether the length of the first annotation line is too long and requires annotation in multiple segments.

[0126] In this embodiment, when the curvature of the first annotation line is greater than a preset curvature threshold (e.g., the preset curvature threshold is 1.3) and the on-graph length of the first annotation line is greater than a first length threshold, it indicates that although the first annotation line is excessively curved, the on-graph length indicates the existence of segments and positions suitable for annotation. That is, there are segments in the first annotation line that are longer than the overall length of the data to be annotated. Therefore, the terminal needs to further determine whether the first annotation line needs to be segmented according to the breakpoint segmentation strategy to refine the granularity of the annotation line, resulting in multiple second annotation lines, making each segment more suitable for character annotation.

[0127] If the curvature of the first annotation line is greater than a preset curvature threshold (e.g., the preset curvature threshold is 1.3) and the length of the first annotation line on the graph is less than or equal to a first length threshold, it indicates that the first annotation line is too curved and there are no segments or positions on the graph that can be annotated, making it unsuitable for annotation. In this case, the terminal will not annotate the first annotation line whose curvature is greater than the preset curvature threshold and whose length on the graph is less than or equal to the first length threshold.

[0128] When the curvature of the first annotation line is less than the preset curvature threshold and the length of the first annotation line on the graph is greater than the second length threshold, it indicates that the first annotation line not only has a small degree of local curvature, but also has an excessive length on the graph. If it is annotated alone, the density of annotation information will be too low, affecting the efficiency of the reader's lookup. Therefore, the terminal still needs to segment the first annotation line of this type. Thus, the terminal determines the target breakpoint corresponding to the first annotation line according to the breakpoint segmentation strategy, and performs breakpoint segmentation according to the target breakpoint to obtain multiple second annotation lines.

[0129] If the curvature of the first annotation line is less than or equal to the preset curvature threshold and the length on the map is less than or equal to the second length threshold, it means that although the curvature of the first annotation line is small, the length on the map is not too long. Even if it is annotated alone, it will not cause the density of annotation information to be too small. Therefore, the terminal will not perform breakpoint segmentation on the first annotation line of this type, and at the same time, it can improve the efficiency of annotating the map data to be labeled.

[0130] The terminal divides the first annotation line into multiple second annotation lines based on the target breakpoint. This avoids making annotations at locations with significant curvature within the first annotation line. Furthermore, dividing the first annotation line into multiple second annotation lines and then making annotations according to these second annotation lines increases the density of annotation information and improves the efficiency of reader access.

[0131] In this embodiment, the curvature of each first annotation line is determined based on the first annotation line and its connecting line, which quantifies the degree of curvature of the annotation line and provides basic data for subsequent processing. Different strategies are adopted for different curvature conditions. For first annotation lines with curvature less than or equal to a preset curvature threshold, the terminal determines the target breakpoint and segments them according to the breakpoint segmentation strategy, refining the granularity of the annotation lines so that each segmented second annotation line is more suitable for character annotation. For first annotation lines with curvature greater than the preset curvature threshold, no segmentation is performed. At the same time, when the annotation line has a large length on the map and a large degree of local curvature, segmentation is performed, which effectively improves the accuracy of annotation, makes map annotation clearer, and improves the readability of map information.

[0132] In one exemplary embodiment, such as Figure 3 As shown, step 204 includes steps 302 to 308. Wherein:

[0133] Step 302: Determine the maximum vertical distance between each preset coordinate in the first annotation line and the corresponding end-to-end line of the first annotation line.

[0134] In this embodiment, the terminal obtains the first and last connecting lines corresponding to the first annotation line according to the same principle as in step 202. The first annotation line contains pre-set coordinate points. For each pre-set coordinate point, the terminal calculates the vertical distance from that coordinate point to the first and last connecting lines. The vertical distance refers to the length of the perpendicular line drawn from the coordinate point to the first and last connecting lines. The terminal then compares all the calculated vertical distances from the pre-set coordinate points to the first and last connecting lines and finds the maximum value. This maximum value is taken as the maximum vertical distance between each pre-set coordinate in the first annotation line and the corresponding first and last connecting lines.

[0135] Step 304: If the maximum vertical distance is greater than the preset segmentation threshold, the coordinates corresponding to the maximum vertical distance are determined as the target breakpoint of the first annotation line, and the first annotation line is segmented to obtain multiple new first annotation lines.

[0136] In this embodiment of the application, the preset segmentation threshold is a pre-set standard value used as the basis for determining whether the annotation line needs to be segmented. If the maximum vertical distance is greater than the preset segmentation threshold, it means that the curvature of the first annotation line is too large and needs to be segmented for annotation. If the maximum vertical distance is less than or equal to the preset segmentation threshold, it means that the curvature of the first annotation line is relatively gentle, and the terminal can annotate the first annotation line in the same annotation method.

[0137] Therefore, if the maximum vertical distance of the first annotation line is greater than the preset segmentation threshold, it indicates that the first annotation line is significantly curved in some places and is not suitable for annotation as a whole. In this case, the terminal determines the coordinate point corresponding to the maximum vertical distance as the target breakpoint of the first annotation line. This target breakpoint represents the location of the greatest curvature in the annotation line. Furthermore, the terminal divides the first annotation line into multiple parts using the target breakpoint as the boundary. Each part becomes a new first annotation line, thus splitting the highly curved annotation line into several relatively straight parts for more appropriate subsequent annotation.

[0138] Step 306: Determine the maximum vertical distance between each preset coordinate in each new first annotation line and the corresponding end-to-end line of the new first annotation line.

[0139] In this embodiment, after segmentation in step 304, the terminal obtains multiple new first annotation lines. For each new first annotation line, the terminal repeats the operation of step 302, that is, firstly, the starting point and ending point of the new first annotation line are determined, and then they are connected to obtain a new beginning-end line. The vertical distance from each preset coordinate point in the new first annotation line to the new beginning-end line is calculated, and then the maximum vertical distance among these vertical distances is found to further evaluate the curvature of each new first annotation line in order to determine whether further segmentation is needed.

[0140] Step 308 continues until the maximum vertical distance is less than or equal to the preset segmentation threshold, resulting in multiple second annotation lines.

[0141] In this embodiment, for each new first annotation line, the terminal repeatedly performs steps 306 and 304, that is, continuously calculates the maximum vertical distance and compares it with a preset segmentation threshold. If the maximum vertical distance is still greater than the preset segmentation threshold, the target breakpoint is determined and segmentation continues. When the maximum vertical distance of all new first annotation lines is less than or equal to the preset segmentation threshold, it indicates that the curvature of the new first annotation lines is within an acceptable range and no further segmentation is needed. At this point, the terminal determines the annotation lines obtained after multiple segmentations as the final multiple second annotation lines. By analyzing the annotations through the second annotation lines, the map annotations can be made clearer and more accurate.

[0142] In one exemplary embodiment, such as Figure 4 As shown, the first annotation line is The terminal will first Connect the points to obtain a line connecting the beginning and end. Then, the terminal determines the first annotation line. The perpendicular distance to the line connecting the beginning and end This is the maximum vertical distance, and the terminal determines this maximum vertical distance. If the value exceeds the preset segmentation threshold, the terminal will... As the target breakpoint, and with the first annotation line as... The segments are divided to obtain the new first annotation line. and Furthermore, the terminal applies the same principle to the new first annotation line. and The two sections are divided separately to obtain the new first annotation line. , , and At this point, the maximum vertical distance between each new first annotation line and the line connecting the beginning and end is less than the preset segmentation threshold, and the terminal will divide the new first annotation lines... , , and This is designated as the second annotation line.

[0143] In one exemplary embodiment, such as Figure 5 and Figure 6 As shown, by dividing the first annotation line with excessive curvature into a second annotation line, it is possible to break at the inflection point of the first annotation line with greater curvature and configure only one segment of annotation.

[0144] In this embodiment, the target breakpoint is determined by the maximum vertical distance and the preset segmentation threshold. This allows for segmentation at locations with excessive curvature, enabling the division of highly curved annotation lines into relatively straight parts. The same analysis is then performed on each of the segmented parts to divide the first annotation line into the smallest divisible granularity, which serves as the basis for information annotation and improves the accuracy of information annotation.

[0145] In one exemplary embodiment, such as Figure 7 As shown, step 106 includes steps 702 to 706. Wherein:

[0146] Step 702: For each second annotation line, determine the center position of the first character and the center position of the last character based on the character to be annotated and the preset character size.

[0147] In this embodiment, the terminal performs independent annotation configuration analysis for each second annotation line to determine the data to be annotated corresponding to each second annotation line. First, the terminal analyzes the annotation configuration of each second annotation line, including the number of annotation groups, word spacing, and group spacing, and determines the center position of the first character and the center position of the last character based on the character to be annotated and the preset character size.

[0148] Taking English-type characters to be annotated as an example, the characters to be annotated (i.e., annotations) are the names of objects such as roads, rivers, or railways to which the current second annotation line belongs. Specifically, the terminal obtains the character width through a preset character size, and the distance between words in the same group of characters to be annotated. Generally, it is 1-2 times the width of the character, representing the distance between words in the same map to be labeled. If the value is relatively fixed, then the length of a set of characters to be annotated is... It is a fixed value, and is calculated using the following formula (2):

[0149] (2)

[0150] In addition, there should be a certain gap on both sides of a group of characters to be annotated. gap The minimum length on a graph for a set of characters to be labeled is 6 times the character distance, and the minimum is 2 times the character distance. It is obtained from the following formula (3):

[0151] (3)

[0152] When the on-graphic distance of the second annotation line is less than the shortest length of the characters to be annotated in a complete set of English annotations within that second annotation line, the terminal determines that the character to be annotated will not be configured. Therefore, the normal on-graphic length of a set of characters to be annotated... Calculate according to the following formula (4):

[0153] (4)

[0154] When the distance on the second annotation line is on the graph When the length of the characters to be annotated is greater than the shortest length of a complete set of English annotations in the second annotation line. And smaller than normal length When the value is twice that of the target character, the terminal determines to configure a set of English annotations, that is, determines to configure a set of characters to be annotated. The annotations are arranged in the geometric center of the line. If the length is fixed, the terminal needs to be recalculated according to the following formula (5). :

[0155] (5)

[0156] The distance on the graph of the character to be labeled The normal length of a set of characters to be labeled When the length is more than twice that of the character set, the terminal can be configured with multiple groups of characters to be annotated, and the number of groups can be specified. Calculate according to the following formula 6:

[0157] (6)

[0158] The terminal then determines the length of a set of characters to be annotated using the following formula (7). :

[0159] (7)

[0160] Finally, the terminal determines the center position of the first character according to the fixed-length extraction functions of the following formulas (8) and (9). Center position of the suffix character :

[0161] (8)

[0162] (9)

[0163] Step 704: Determine the target annotation line corresponding to the second annotation line based on the center position of the first character and the center position of the last character, and determine the counterclockwise angle between the horizontal line and the target annotation line as the angle information.

[0164] In this embodiment of the application, the terminal will center the first character. Center position of the suffix character Connect them, and the resulting straight line will serve as the target annotation line corresponding to the second annotation line. Then, the terminal will use... Using the horizontal line as a reference, calculate the angle between the horizontal line and the target annotation line, rotating counterclockwise. This angle is then defined as the angle information. This angle information reflects the degree of inclination of the target annotation line relative to the horizontal line. Subsequently, the orientation of the character to be annotated is determined by the perpendicularity of the letterhead and the center line of the second annotation line, and the angle information is used to determine the tilting method of the character to be annotated.

[0165] For example, such as Figure 8 As shown, with AB' and AB1' as target annotation lines and B1B as a horizontal line, α1 and α2 are the angle information corresponding to AB' and AB1', respectively.

[0166] Step 706: Determine the target character configuration strategy corresponding to the character to be annotated based on the angle information.

[0167] In this embodiment of the application, since the annotation header and the center line are perpendicular, the angle information will affect the rotation, arrangement and other configuration of the characters. Therefore, different angle information is pre-set in the terminal to correspond to different character configuration methods.

[0168] Then, based on the angle information, the terminal selects a suitable strategy from the pre-set character configuration strategies as the target character configuration strategy. For example, if the angle information α is close to 0° or 180°, the target character configuration strategies may be arranged horizontally; if the angle α is around 90°, the target character configuration strategies may be arranged vertically.

[0169] In this embodiment, the angle information is determined by the angle between the target annotation line and the horizontal line, and the target character configuration strategy corresponding to the character to be annotated is determined by the angle information. This ensures that the character to be annotated can be displayed on the second annotation line in an appropriate manner, thereby improving the readability and aesthetics of the annotation.

[0170] In one exemplary embodiment, such as Figure 9 As shown, step 106 includes steps 902 to 904. Wherein:

[0171] Step 902: For each second annotation line, determine the storage order and annotation order corresponding to the target annotation line of the second annotation line based on the preset angle threshold and angle information.

[0172] In this embodiment, the terminal pre-sets storage and annotation orders corresponding to different types of target annotation lines. The terminal matches the storage and annotation orders according to the target annotation lines. The terminal also matches the storage and annotation orders corresponding to the target annotation lines of the second annotation line based on different preset angle threshold ranges where the angle information of the target annotation lines falls. The storage order relates to the storage method for characters to be annotated in the computer system; different storage orders may affect the efficiency of subsequent data reading and processing. The annotation order refers to the arrangement order of characters to be annotated when actually annotating on a map.

[0173] For example, when the angle information is within a small range, it means that the direction of the target annotation line is from left to right, which conforms to the reading order from left to right. In this case, the terminal can store the character to be annotated corresponding to the second annotation line in a positive direction and determine that the annotation order is also positive. That is, when annotating information later, the characters to be annotated can be annotated in the order from left to right. When the angle information is large, it means that the direction of the target annotation line is not from left to right. That is, if the storage and annotation are performed according to the requirements of left to right, character tops facing up and perpendicular to the center line of the second annotation line, the text will be reversed. Therefore, the terminal adjusts the storage order and annotation order for the second annotation line with larger angle information to meet the requirements of reading habits.

[0174] Step 904: Determine the target character configuration strategy corresponding to each character to be annotated based on the storage order and annotation order.

[0175] In this embodiment, the target annotation line reflects the arrangement direction of the characters to be annotated. The direction of the target annotation line is quantified by angle information. Target annotation lines with different tilt angles require different character configuration strategies. For example, when the target annotation line is close to horizontal, the characters may be configured in a horizontal arrangement; when the target annotation line has a certain tilt angle, the characters may need to be rotated and arranged in the tilt direction to ensure that the character heads are facing upwards and perpendicular to the center line of the second annotation line.

[0176] Therefore, after obtaining the center positions of the first and last characters in the second annotation line, the terminal also needs to determine the positions of each character to be annotated in the middle. Then, the terminal summarizes and analyzes the storage order and annotation order, mapping them to the character center configuration position and character tilt angle corresponding to each character to be annotated, thus forming the target character configuration strategy. The character center configuration position clarifies the specific placement position of each character on the map, while the character tilt angle determines the rotation angle of the character to ensure that the character's top is facing upwards and perpendicular to the center line of the second annotation line, thereby avoiding situations where the text is reversed or the order of the annotated characters is reversed when annotating target annotation lines with special angle information.

[0177] In this embodiment, based on preset angle thresholds and angle information, a corresponding storage order and annotation order are matched for the target annotation line of each second annotation line. The storage and annotation order are flexibly adjusted according to the interval of the angle information to ensure that the annotation conforms to reading habits. Then, the target character configuration strategy is determined based on the storage order and annotation order, and the two are summarized and analyzed to map into the character center configuration position and character tilt angle. Appropriate character configuration methods are adopted for target annotation lines with different tilt angles, avoiding the problem of text reversal or character order reversal when annotating at special angles, thereby improving the accuracy of information annotation in electronic maps.

[0178] In one exemplary embodiment, such as Figure 10 As shown, step 902 includes steps 1002 to 1004. Wherein:

[0179] Step 1002: For each second annotation line, if the angle information is less than the preset angle threshold, the storage order is determined to be forward storage; if the angle information is greater than or equal to the preset angle threshold, the storage order is determined to be reverse storage.

[0180] The preset angle threshold can be 85°.

[0181] In this embodiment of the application, for each second annotation line, the storage order characterizes the arrangement order of each character to be annotated in the target annotation line corresponding to the second annotation line. For example, annotation line 1 consists of a series of coordinate points, each coordinate point corresponding to a character to be annotated. Annotation line 1 consists of coordinate points... Coordinates Coordinates Composition, its coordinate string identifier is Then, by reversing the order of the stored coordinate strings, we obtain the result. .

[0182] For each second annotation line, the terminal determines the storage order based on a comparison between the angle information and a preset angle threshold. If the angle information is less than the preset angle threshold, it indicates that the tilt angle of the annotation line is small, and the storage order is determined to be forward storage to ensure that the annotation configuration is based on the forward coordinate string. By storing the coordinate string in a forward direction, the terminal can ensure that it configures according to the forward storage order. If the angle information is greater than or equal to the preset angle threshold, it indicates that the tilt angle of the annotation line is large, and the coordinate string of the annotation line needs to be stored in reverse order to ensure the correctness of subsequent annotations.

[0183] Step 1004: If the angle information is less than the first angle threshold, the annotation order is determined to be from small to large ordinate values; if the angle information is greater than or equal to the preset angle threshold, the annotation order is determined to be from large to small ordinate values.

[0184] In this embodiment, the terminal determines the annotation order based on a comparison between angle information and a preset angle threshold. When the angle information is less than the preset angle threshold, it indicates that the annotation line is relatively gentle, and the terminal determines the annotation order to be from small to large for both the horizontal and vertical coordinate values, i.e., from the lower left to the upper right. When the angle information is greater than or equal to the preset angle threshold, it indicates that the annotation line is nearly vertical, and the terminal determines the annotation order to be from small to large for the horizontal coordinate values, but from large to small for the vertical coordinate values, i.e., from the upper left to the lower right. Therefore, the terminal selects the most suitable annotation order based on the different tilt angles of the annotation lines to ensure the readability and accuracy of the annotations.

[0185] In one specific embodiment, there can be multiple preset angle thresholds, including a first angle threshold and a second angle threshold. For example, the first angle threshold is 85° and the second angle threshold is 95°. In this case, the preset angle threshold α in the terminal corresponds to the intervals 0≤α<85°, 85°≤α≤95°, and 95°<α≤180°. For the interval 0≤α<85°, the terminal determines the storage order as forward storage and the annotation order as the direction from smallest to largest horizontal coordinate value, starting from... and middle The smaller the value, the more... The annotations are configured in the direction of larger values, i.e., the annotation order is from left to right, with the top of the text facing upwards; for the interval 85°≤α≤95°, the terminal determines the storage order to be reversed, and the annotation order is determined to be in the direction of decreasing vertical coordinate values, with annotations starting from... and In the context of the Y-coordinate system, annotations are configured from top to bottom, with the first character pointing to the right, starting with the largest Y-value and moving towards the smallest. For the interval 95° < α ≤ 180°, the terminal determines the storage order to be reversed and the annotation order to be from smallest to largest horizontal coordinate value. and middle The smaller the value, the more... The annotations are configured in the direction with the larger value, that is, the annotation order is from left to right, with the top of the character facing upwards.

[0186] For example, such as Figure 8 As shown, if the angle between road AB' and the horizontal line is α1 (0°≤α1<85°), then the coordinate string does not need to be stored in reverse; if the angle between road AB1' and the horizontal line is α2 (95°≤α2<180°), then the coordinate string needs to be stored in reverse.

[0187] In this embodiment, by comparing the angle information with the first angle threshold, annotation lines with small tilt angles are stored forward, while those with large tilt angles are stored backward. This ensures that the annotation configuration follows the correct coordinate string order, improving the accuracy of the annotation configuration. Furthermore, based on the comparison results of the angle information with the first and second angle thresholds, the annotation order is determined to be from left to right for nearly horizontal annotation lines and from top to bottom for nearly vertical annotation lines. By selecting the most suitable annotation order according to the different tilt angles of the annotation lines, the accuracy of information labeling is ensured.

[0188] In one exemplary embodiment, such as Figure 11 As shown, before step 102, the method further includes steps 1102 to 1104. Wherein:

[0189] Step 1102: Obtain the geographic coordinates and scale of the initial annotation lines in the map data.

[0190] In this embodiment, the terminal extracts the geographic coordinates and scale information of the initial annotation line from the map data. Geographic coordinates are a coordinate system using latitude and longitude to accurately represent a location on Earth, and they determine the specific location of the initial annotation line on the Earth's surface. The scale is the proportional relationship between distances on the map and actual ground distances, reflecting the degree to which the map scales the actual geographic space. Different maps may have different scales, and the size of the scale directly affects the level of detail and the range of the map.

[0191] Step 1104: Map geographic coordinates to image coordinates based on the scale to obtain the first annotation line.

[0192] In this embodiment, since geographic coordinates are based on the latitude and longitude system of the Earth's surface, the terminal needs to convert geographic information into coordinates on the computer screen or map image, i.e., image coordinates, in the visualization of the map. The terminal then performs a mapping conversion from geographic coordinates to image coordinates. Specifically, the terminal converts the actual geographic distance into pixel distances on the image using a scale. Based on the scale, the relative position of the geographic coordinates in the image is first calculated. For example, if the scale is 1:10000, it means that one unit of distance on the map represents 10,000 units of distance on the actual ground. When converting geographic coordinates to image coordinates, the terminal performs scaling and translation operations on the geographic coordinates according to this scale to obtain the image coordinates. Then, based on the image coordinates, the first annotation line is obtained. The initial annotation line is a representation in image space. This first annotation line can be directly used for the visualization of the map, ensuring that the annotation information on the map is accurately presented in the image coordinate system.

[0193] In this embodiment, by using a scale for mapping conversion, geographic coordinates can be accurately converted into image coordinates, allowing annotation lines to be displayed in the image. This enables the first annotation line to exist in a form more suitable for computer processing, facilitating subsequent map analysis, annotation configuration, and other operations, thereby improving the accuracy of information labeling.

[0194] In one exemplary embodiment, such as Figure 12 As shown, step 202 includes steps 1202 to 1204. Wherein:

[0195] Step 1202: Obtain the original annotation lines and the road grade of the original annotation lines.

[0196] In this embodiment of the application, in business scenarios related to geographic information systems and map drawing, the original annotation lines are lines on the map used to mark specific geographic information (e.g., road names). Road grades, on the other hand, are a way of classifying roads. Different road grades may represent different attributes such as road importance and traffic capacity. For example, highways, national roads, provincial roads, and county roads may each correspond to different road grades.

[0197] The terminal obtains the original annotation lines and their corresponding road grades from map data, which serve as the basis for subsequent processing. The information of the original annotation lines may include geometric information such as their coordinates on the map, while the road grade information provides the basis for subsequent segmentation operations.

[0198] Step 1204: Divide the original annotation line according to the road grade to obtain the first annotation line after preliminary division.

[0199] In this embodiment, the terminal determines the hierarchical relationship between different original annotation lines and whether there are any intersections based on the road level information of the original annotation lines. For annotation lines that need to be disconnected, the terminal divides the annotation line into different segments at the intersection or meeting point, which serve as the first annotation line. When a lower-level original annotation line encounters a higher-level original annotation line, the terminal needs to disconnect the lower-level original annotation line; when original annotation lines of the same level intersect, the original annotation lines also need to be disconnected.

[0200] The decision to add a annotation to the first annotation line can be further based on a comparison between the annotation length and the length of the annotation line on the diagram. If the annotation length is less than a certain proportion of the annotation line length, it is annotated; otherwise, it is not annotated. Figure 13 and Figure 14 As shown, by dividing roads into different levels, the annotations on the map can be made clearer and more reasonable, avoiding mutual interference between annotations and improving the readability and accuracy of the map after information annotation.

[0201] In this embodiment, by breaking lower-level original annotation lines that encounter higher-level annotation lines, and also breaking original annotation lines that intersect at the same level, the layout of annotation lines on the map becomes more reasonable and orderly. This segmentation avoids mutual interference and overlap between annotation lines, improving the clarity and readability of map annotations.

[0202] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.

[0203] Based on the same inventive concept, this application also provides an information annotation apparatus for implementing the information annotation method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more information annotation apparatus embodiments provided below can be found in the limitations of the information annotation method described above, and will not be repeated here.

[0204] In one exemplary embodiment, such as Figure 15 As shown, an information annotation device 1500 is provided, including: a first acquisition module 1501, a segmentation module 1502, a determination module 1503, and an annotation module 1504, wherein:

[0205] The first acquisition module 1501 is used to acquire the first annotation line to be labeled and the character to be labeled.

[0206] The segmentation module 1502 is used to segment the first annotation line according to the curvature and the breakpoint segmentation strategy of the first annotation line to obtain multiple second annotation lines;

[0207] The determination module 1503 is used to determine the target character configuration strategy corresponding to the character to be annotated for each second annotation line based on the angle information between the second annotation line and the horizontal line; the target character configuration strategy includes the character center configuration position and character tilt angle that match the character to be annotated in each second annotation line;

[0208] The annotation module 1504 is used to annotate each character to be annotated corresponding to each second annotation line according to the character center configuration position and character tilt angle, and obtain the annotation result.

[0209] In one embodiment, the segmentation module 1502 is specifically used to determine the curvature of each first annotation line based on the first annotation line and the corresponding end-to-end line of the first annotation line;

[0210] If the curvature is greater than the preset curvature threshold and the length of the first annotation line on the graph is greater than the first length threshold, or the curvature is less than or equal to the preset curvature threshold and the length on the graph is greater than the second length threshold, the target breakpoint corresponding to the first annotation line is determined according to the breakpoint segmentation strategy, and the first annotation line is segmented according to the target breakpoint to obtain multiple second annotation lines.

[0211] In one embodiment, the segmentation module 1502 is specifically used to determine the maximum vertical distance between each preset coordinate in the first annotation line and the corresponding end-to-end line of the first annotation line;

[0212] If the maximum vertical distance is greater than the preset segmentation threshold, the coordinates corresponding to the maximum vertical distance are determined as the target breakpoint of the first annotation line, and the first annotation line is segmented to obtain multiple new first annotation lines.

[0213] Determine the maximum vertical distance between each preset coordinate in each new first annotation line and the corresponding first and last line connecting the new first annotation line;

[0214] Multiple second annotation lines are obtained until the maximum vertical distance is less than or equal to the preset segmentation threshold.

[0215] In one embodiment, the determining module 1503 is specifically used to determine the center position of the first character and the center position of the last character for each second annotation line, based on the character to be annotated and the preset character size.

[0216] The target annotation line corresponding to the second annotation line is determined based on the center position of the first character and the center position of the last character, and the counterclockwise angle between the horizontal line and the target annotation line is determined as the angle information.

[0217] The target character configuration strategy corresponding to the character to be annotated is determined based on the angle information.

[0218] In one embodiment, the determining module 1503 is specifically used to determine the storage order and annotation order of the target annotation line of each second annotation line based on a preset angle threshold and angle information.

[0219] The target character configuration strategy for each character to be annotated is determined based on the storage order and annotation order.

[0220] In one embodiment, the preset angle threshold includes a first angle threshold and a second angle threshold, wherein the first angle threshold is less than the second angle threshold;

[0221] The determination module 1503 is specifically used for each second annotation line. If the angle information is less than the preset angle threshold, the storage order is determined to be forward storage; if the angle information is greater than or equal to the preset angle threshold, the storage order is determined to be reverse storage.

[0222] If the angle information is less than the first angle threshold, the annotation order is determined to be from small to large ordinate values. If the angle information is greater than or equal to the preset angle threshold, the annotation order is determined to be from large to small ordinate values.

[0223] In one embodiment, the information labeling device 1500 further includes:

[0224] The second acquisition module is used to acquire the geographic coordinates and scale of the initial annotation lines in the map data;

[0225] The geographic coordinates are mapped to image coordinates based on the scale, resulting in the first annotation line.

[0226] In one embodiment, the first acquisition module 1501 is specifically used to acquire the original annotation lines and the road grade of the original annotation lines;

[0227] The original annotation lines are divided according to the road grade to obtain the first annotation line after preliminary division.

[0228] Each module in the aforementioned information labeling device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0229] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 16As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements an information annotation method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0230] Those skilled in the art will understand that Figure 16 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0231] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0232] Get the first annotation line and the character to be annotated;

[0233] The first annotation line is divided into multiple second annotation lines by dividing it into breakpoints based on the curvature and breakpoint segmentation strategy of the first annotation line.

[0234] For each second annotation line, a target character configuration strategy is determined based on the angle information between the second annotation line and the horizontal line. The target character configuration strategy includes the character center configuration position and character tilt angle that match the character to be annotated in each second annotation line.

[0235] The characters to be annotated are annotated according to the character center configuration position and character tilt angle, and the annotation results are obtained.

[0236] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0237] The curvature of each first annotation line is determined based on the first annotation line and the line connecting the first and last ends of the first annotation line.

[0238] If the curvature is greater than the preset curvature threshold and the length of the first annotation line on the graph is greater than the first length threshold, or the curvature is less than or equal to the preset curvature threshold and the length on the graph is greater than the second length threshold, the target breakpoint corresponding to the first annotation line is determined according to the breakpoint segmentation strategy, and the first annotation line is segmented according to the target breakpoint to obtain multiple second annotation lines.

[0239] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0240] Determine the maximum vertical distance between each preset coordinate in the first annotation line and the corresponding first and last line connecting the first annotation line;

[0241] If the maximum vertical distance is greater than the preset segmentation threshold, the coordinates corresponding to the maximum vertical distance are determined as the target breakpoint of the first annotation line, and the first annotation line is segmented to obtain multiple new first annotation lines.

[0242] Determine the maximum vertical distance between each preset coordinate in each new first annotation line and the corresponding first and last line connecting the new first annotation line;

[0243] Multiple second annotation lines are obtained until the maximum vertical distance is less than or equal to the preset segmentation threshold.

[0244] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0245] For each second annotation line, determine the center position of the first character and the center position of the last character based on the character to be annotated and the preset character size;

[0246] The target annotation line corresponding to the second annotation line is determined based on the center position of the first character and the center position of the last character, and the counterclockwise angle between the horizontal line and the target annotation line is determined as the angle information.

[0247] The target character configuration strategy corresponding to the character to be annotated is determined based on the angle information.

[0248] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0249] For each second annotation line, the storage order and annotation order corresponding to the target annotation line of the second annotation line are determined based on the preset angle threshold and angle information;

[0250] The target character configuration strategy for each character to be annotated is determined based on the storage order and annotation order.

[0251] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0252] For each second annotation line, if the angle information is less than the preset angle threshold, the storage order is determined to be forward storage; if the angle information is greater than or equal to the preset angle threshold, the storage order is determined to be reverse storage.

[0253] If the angle information is less than the first angle threshold, the annotation order is determined to be from small to large ordinate values. If the angle information is greater than or equal to the preset angle threshold, the annotation order is determined to be from large to small ordinate values.

[0254] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0255] Obtain the geographic coordinates and scale of the initial annotation lines in the map data;

[0256] The geographic coordinates are mapped to image coordinates based on the scale, resulting in the first annotation line.

[0257] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0258] Obtain the original annotation lines and the road grade of the original annotation lines;

[0259] The original annotation lines are divided according to the road grade to obtain the first annotation line after preliminary division.

[0260] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.

[0261] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0262] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0263] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0264] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0265] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. An information annotation method, characterized in that, The method includes: Obtain the first annotation line and the character to be annotated; the first annotation line is contained in the map data to be annotated; Based on the curvature of the first annotation line and the breakpoint segmentation strategy, the first annotation line is segmented into multiple second annotation lines. For each of the second annotation lines, a target character configuration strategy is determined based on the angle information between the second annotation line and the horizontal line; the target character configuration strategy includes the character center configuration position and character tilt angle that match the character to be annotated in each of the second annotation lines; Based on the character center configuration position and the character tilt angle, each of the characters to be annotated corresponding to each of the second annotation lines is annotated to obtain the annotation result; The first annotation line is segmented into multiple second annotation lines based on its curvature and a breakpoint segmentation strategy, resulting in a plurality of second annotation lines, including: The curvature of each of the first annotation lines is determined based on the first annotation line and the corresponding end-to-end line of the first annotation line; If the curvature is greater than a preset curvature threshold and the length of the first annotation line on the graph is greater than a first length threshold, or if the curvature is less than or equal to the preset curvature threshold and the length on the graph is greater than a second length threshold, the target breakpoint corresponding to the first annotation line is determined according to the breakpoint segmentation strategy, and the first annotation line is segmented according to the target breakpoint to obtain multiple second annotation lines; If the curvature is greater than a preset curvature threshold and the on-graph length of the first annotation line is greater than a first length threshold, or the curvature is less than or equal to the preset curvature threshold and the on-graph length is greater than a second length threshold, a target breakpoint corresponding to the first annotation line is determined according to the breakpoint segmentation strategy, and the first annotation line is segmented according to the target breakpoint to obtain multiple second annotation lines, including: Determine the maximum vertical distance between each preset coordinate in the first annotation line and the corresponding first and last line connecting the first annotation line; If the maximum vertical distance is greater than the preset segmentation threshold, the coordinates corresponding to the maximum vertical distance are determined as the target breakpoint of the first annotation line, and the first annotation line is segmented to obtain multiple new first annotation lines. Determine the maximum vertical distance between each preset coordinate in each new first annotation line and the corresponding end-to-end line of the new first annotation line; Multiple second annotation lines are obtained until the maximum vertical distance is less than or equal to the preset segmentation threshold. The step of determining the target character configuration strategy corresponding to the character to be annotated for each of the second annotation lines based on the angle information between the second annotation line and the horizontal line includes: For each of the second annotation lines, the center positions of the first character and the last character are determined based on the character to be annotated and the preset character size; Based on the center positions of the first and last characters, the target annotation line corresponding to the second annotation line is determined, and the counterclockwise angle between the horizontal line and the target annotation line is determined as the angle information. Determine the target character configuration strategy corresponding to the character to be labeled based on the angle information; The step of determining the target character configuration strategy corresponding to the character to be annotated for each of the second annotation lines based on the angle information between the second annotation line and the horizontal line includes: For each of the second annotation lines, the storage order and annotation order corresponding to the target annotation line of the second annotation line are determined based on a preset angle threshold and the angle information; The target character configuration strategy corresponding to each character to be annotated is determined based on the storage order and the annotation order.

2. The method according to claim 1, characterized in that, For each of the second annotation lines, determining the storage order and annotation order corresponding to the target annotation line based on a preset angle threshold and the angle information includes: For each of the second annotation lines, if the angle information is less than a preset angle threshold, the storage order is determined to be forward storage; if the angle information is greater than or equal to the preset angle threshold, the storage order is determined to be reverse storage. If the angle information is less than the preset angle threshold, the annotation order is determined to be from small to large ordinate values; if the angle information is greater than or equal to the preset angle threshold, the annotation order is determined to be from large to small ordinate values.

3. The method according to claim 1, characterized in that, Before obtaining the first annotation line and the character to be annotated, the method further includes: Obtain the geographic coordinates and scale of the initial annotation lines in the map data; Based on the scale, the geographic coordinates are mapped to image coordinates to obtain the first annotation line.

4. The method according to claim 1, characterized in that, The step of obtaining the first annotation line and the character to be annotated includes: Obtain the original annotation lines and the road classification of the original annotation lines; The original annotation line is divided according to the road grade to obtain the first annotation line after preliminary division.

5. An information labeling device, characterized in that, The device includes: The first acquisition module is used to acquire the first annotation line to be labeled and the character to be labeled; the first annotation line is contained in the map data to be labeled; The segmentation module is used to segment the first annotation line according to the curvature and the breakpoint segmentation strategy of the first annotation line to obtain multiple second annotation lines; The determination module is used to determine, for each of the second annotation lines, the target character configuration strategy corresponding to the character to be annotated based on the angle information between the second annotation line and the horizontal line; the target character configuration strategy includes the character center configuration position and character tilt angle that match the character to be annotated in each of the second annotation lines; The annotation module is used to annotate each of the characters to be annotated corresponding to each of the second annotation lines according to the character center configuration position and the character tilt angle, and obtain the annotation result; The segmentation module is specifically used to determine the curvature of each of the first annotation lines based on the first annotation line and the corresponding end-to-end line of the first annotation line. If the curvature is greater than a preset curvature threshold and the length of the first annotation line on the graph is greater than a first length threshold, or if the curvature is less than or equal to the preset curvature threshold and the length on the graph is greater than a second length threshold, the target breakpoint corresponding to the first annotation line is determined according to the breakpoint segmentation strategy, and the first annotation line is segmented according to the target breakpoint to obtain multiple second annotation lines; The segmentation module is specifically used to determine the maximum vertical distance between each preset coordinate in the first annotation line and the corresponding end-to-end line of the first annotation line; If the maximum vertical distance is greater than the preset segmentation threshold, the coordinates corresponding to the maximum vertical distance are determined as the target breakpoint of the first annotation line, and the first annotation line is segmented to obtain multiple new first annotation lines. Determine the maximum vertical distance between each preset coordinate in each new first annotation line and the corresponding end-to-end line of the new first annotation line; Multiple second annotation lines are obtained until the maximum vertical distance is less than or equal to the preset segmentation threshold. The determining module is specifically used to determine the center position of the first character and the center position of the last character for each of the second annotation lines, based on the character to be annotated and the preset character size. Based on the center positions of the first and last characters, the target annotation line corresponding to the second annotation line is determined, and the counterclockwise angle between the horizontal line and the target annotation line is determined as the angle information. Determine the target character configuration strategy corresponding to the character to be labeled based on the angle information; The determining module is specifically used to determine the storage order and annotation order of the target annotation line of each second annotation line based on a preset angle threshold and the angle information. The target character configuration strategy corresponding to each character to be annotated is determined based on the storage order and the annotation order.

6. The apparatus according to claim 5, characterized in that, The determining module is specifically used for each of the second annotation lines. If the angle information is less than a preset angle threshold, the storage order is determined to be forward storage; if the angle information is greater than or equal to the preset angle threshold, the storage order is determined to be reverse storage. If the angle information is less than the preset angle threshold, the annotation order is determined to be from small to large ordinate values; if the angle information is greater than or equal to the preset angle threshold, the annotation order is determined to be from large to small ordinate values.

7. The apparatus according to claim 5, characterized in that, The device further includes: The second acquisition module is used to acquire the geographic coordinates and scale of the initial annotation lines in the map data; Based on the scale, the geographic coordinates are mapped to image coordinates to obtain the first annotation line.

8. The apparatus according to claim 5, characterized in that, The first acquisition module is specifically used to acquire the original annotation lines and the road grade of the original annotation lines; The original annotation line is divided according to the road grade to obtain the first annotation line after preliminary division.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.