Rapid label drawing method based on vector tiling technology
By adopting vector tile technology on the low graphics card configuration hardware platform, building signage Unicode encoding and character tile fast indexing, and dynamically managing tile set resources, the problem of small single-threaded sign drawing capacity is solved, and efficient signage drawing is achieved.
Patent Information
- Application Number
- CN202411690622.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-04-11
AI Technical Summary
On hardware platforms with low graphics card configuration, when reliant on CPU computing power to render large-capacity target signs, a serious performance bottleneck is encountered, which makes it difficult for a single-threaded sign drawing capacity to exceed 1,000 batches.
The rapid sign drawing method based on vector tile technology is adopted, and the signage style encoding and tile set resources are dynamically managed, and the tile signage is rendered by building signage Unicode encoding and character tile tiles.
It realizes high-speed rendering and cache management of tile hashing in computer memory, which significantly improves the rapid drawing efficiency of track signs, and the drawing efficiency is more than 10 times higher than that of traditional vector text drawing methods.
Smart Images

Figure CN119808711A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of software display integration, and in particular to a method for quickly drawing a sign based on a vector tiling technology. Background Art
[0002] In the civil situation information system, target signs can indicate key information of the target, such as the target model, nationality, navigation information and other key information, which is an indispensable element in real-time information display. In the field of civil situation, users' demand for monitoring maritime targets has gradually expanded from the first island chain to global waters. At present, the number of civilian ships such as fishing boats, cargo ships, and merchant ships in my country, as well as the total number of international ships with a gross tonnage of more than 300 in the world, has exceeded 1 million, and the number of ships active at sea is 400,000 to 500,000. Therefore, the capacity of situation display targets needs to be improved urgently.
[0003] At this time, relying on mainstream 2D vector text drawing engines (such as AGG, Qt, etc.), on low graphics card configurations, especially on domestic hardware platform environments, relying on CPU computing power for large-capacity target sign rendering encounters serious performance bottlenecks. Under the premise of maintaining smooth operation of the desktop system, the single-threaded sign drawing capacity is difficult to exceed 1,000 batches. Summary of the invention
[0004] Purpose of the invention: The purpose of the present invention is to provide a method for fast drawing signs based on vector tiling technology to solve the problem of small capacity of single-threaded sign drawing.
[0005] Technical solution: The method for quickly drawing a sign based on vector tiling technology described in the present invention comprises the following steps: (1) Constructing the Unicode encoding of signs and fast indexing of character tiles; (2) Dynamically adjust the sign style code and tile set resources; (3) Rendering tiled signs.
[0006] Furthermore, step (1) includes the following steps: (11) Use the character Unicode encoding matrix to store the sign content; (12) Fast indexing of characters to character tiles based on Unicode values.
[0007] Furthermore, step (2) includes the following steps: (21) Encode the sign character style or tile set ID in 8 bytes, where the font and font size each occupy 2 bytes, and the font color uses the ARGB mode and occupies 4 bytes. Establish a bidirectional index relationship between the sign character style and the tile set resource; the character style includes: font, font color, and font size; (22) When adding a new sign style, create a new tile set resource, use the target sign of the current style as the user to point to the tile set, and deconstruct the current tile set resource when the number of tile set users returns to zero. Specifically: Check whether there is a tile set with the corresponding ID in the system. If it exists, establish a bidirectional index relationship between the target and the tile set. If it does not exist, create a new tile set. The non-Chinese characters commonly used for signs in the tile set 0-9, AZ, az, ","."." / "":"°"'"" are pre-created, and other characters are dynamically created incrementally during the use of the tile set; traverse the sign Unicode matrix, query the tile of the corresponding character in the tile set according to the character Unicode, directly obtain it if it exists, and dynamically create it incrementally if it does not exist.
[0008] Furthermore, step (3) is specifically as follows: traverse the sign Unicode matrix, query the tile corresponding to the character in the tile set according to the character Unicode, and complete the sign rendering by arranging and rendering the obtained tiles.
[0009] The present invention provides a fast signage drawing system based on vector tiling technology, comprising: Index module: used to build fast index of sign Unicode encoding and character tiles; Dynamic management module: used to dynamically adjust the sign style code and tile set resources; Rendering module: used to render tiled signs.
[0010] Furthermore, in the indexing module, the specific steps are as follows: using the character Unicode encoding matrix to store the sign content; and performing fast indexing from characters to character tiles based on Unicode values.
[0011] Further, in the dynamic management module, it is as follows: encode the sign character style or tile set ID by 8 bytes, wherein the font and font size occupy 2 bytes respectively, and the font color occupies 4 bytes in ARGB mode, and establish a bidirectional index relationship between the sign character style and the tile set resource; wherein the character style includes: font, font color, font size; create a new tile set resource when adding a new sign style, use the target sign of the current style as the user to point to the tile set, and deconstruct the current tile set resource when the number of tile set users returns to zero. Specifically as follows: retrieve whether there is a tile set with the corresponding ID in the system, if it exists, establish a bidirectional index relationship between the target and the tile set, if it does not exist, create a new tile set, wherein 0-9, AZ, az, "," "." " / " ":" "°" "'" "" in the tile set are pre-created for the non-Chinese characters commonly used for signs, and other characters are dynamically and incrementally created during the use of the tile set; traverse the sign Unicode matrix, query the tile of the corresponding character in the tile set according to the character Unicode, directly obtain it if it exists, and dynamically and incrementally create it if it does not exist.
[0012] Furthermore, in the rendering module, the specific steps are as follows: traverse the sign Unicode matrix, query the tile corresponding to the character in the tile set according to the character Unicode, and complete the sign rendering by arranging and rendering the obtained tiles.
[0013] An electronic device described in the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is loaded into the processor, it implements any one of the methods for quickly drawing signs based on vector tiling technology.
[0014] The present invention provides a storage medium storing a computer program, which, when executed by a processor, implements any one of the methods for quickly drawing a sign based on vector tiling technology.
[0015] Beneficial effect: Compared with the prior art, the present invention has the following significant advantages: by establishing a sign text tile library hash with font, color and size as the unique coding value, high-speed rendering and cache management of tile hashes are realized in computer memory, and on this basis, fast drawing of track signs is realized, and the drawing efficiency is more than 10 times higher than that of traditional vector text drawing methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 is a flow chart of the present invention; Figure 2 This is an example of the mapping relationship between the original text of the signboard of the present invention and the conversion into the Unicode matrix; Figure 3 is the encoding rule of the sign character style and the corresponding tile set ID of the present invention; Figure 4 is an example of a tile set of different character styles / IDs of the present invention; Figure 5 This is the management mode of the tile set resources of the present invention. DETAILED DESCRIPTION
[0017] The technical solution of the present invention is further described below in conjunction with the accompanying drawings.
[0018] like Figure 1 As shown, an embodiment of the present invention provides a method for quickly drawing a sign based on vector tiling technology, comprising the following steps: (1) Constructing the sign Unicode encoding and character tile fast indexing; including the following steps: (11) Use the character Unicode encoding matrix to store the sign content; (12) Fast indexing of characters to character tiles based on Unicode values.
[0019] (2) Dynamically adjust the sign style code and tile set resources; Figure 2-Figure 4 As shown, the following steps are included: (21) Encode the sign character style or tile set ID in 8 bytes, where the font and font size each occupy 2 bytes, and the font color uses the ARGB mode and occupies 4 bytes. Establish a bidirectional index relationship between the sign character style and the tile set resource; the character style includes: font, font color, and font size; (22) When adding a new sign style, create a new tile set resource, use the target sign of the current style as the user to point to the tile set, and deconstruct the current tile set resource when the number of tile set users returns to zero. Specifically: Check whether there is a tile set with the corresponding ID in the system. If it exists, establish a bidirectional index relationship between the target and the tile set. If it does not exist, create a new tile set. The non-Chinese characters commonly used for signs in the tile set 0-9, AZ, az, ","."." / "":"°"'"" are pre-created, and other characters are dynamically created incrementally during the use of the tile set; traverse the sign Unicode matrix, query the tile of the corresponding character in the tile set according to the character Unicode, directly obtain it if it exists, and dynamically create it incrementally if it does not exist.
[0020] (3) Render the tiled sign. Figure 5 As shown, the details are as follows: traverse the sign Unicode matrix, query the tile corresponding to the character in the tile set according to the character Unicode, and complete the sign rendering by arranging and rendering the obtained tiles.
[0021] The present invention provides a fast signage drawing system based on vector tiling technology, comprising: Index module: used to construct the sign Unicode encoding and character tile fast indexing; specifically: use the character Unicode encoding matrix to store the sign content; and perform fast indexing from character to character tile based on Unicode values.
[0022] Dynamic management module: used to dynamically adjust the sign style encoding and tile set resources; specifically as follows: encode the sign character style or tile set ID with 8 bytes, where the font and font size each occupy 2 bytes, and the font color uses the ARGB mode and occupies 4 bytes, and establish a bidirectional index relationship between the sign character style and the tile set resources; where the character style includes: font, font color, and font size; create a new tile set resource when adding a new sign style, use the target sign of the current style as the user to point to the tile set, and deconstruct the current tile set resources when the number of tile set users returns to zero. The details are as follows: Check whether there is a tile set with the corresponding ID in the retrieval system. If so, establish a bidirectional index relationship between the target and the tile set. If not, create a new tile set. The non-Chinese characters commonly used for signs in the tile set, such as 0-9, AZ, az, ","."," / ,":,"°,"',""" are created in advance, and other characters are dynamically and incrementally created during the use of the tile set. Traverse the sign Unicode matrix, query the tile set for the corresponding character according to the character Unicode, obtain it directly if it exists, and dynamically and incrementally create it if it does not exist.
[0023] Rendering module: used to render tiled signs. Specifically: traverse the sign Unicode matrix, query the tile corresponding to the character in the tile set according to the character Unicode, and complete the sign rendering by arranging and rendering the obtained tiles.
[0024] An embodiment of the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is loaded into the processor, the method for quickly drawing a sign based on vector tiling technology described in any one of the above is implemented.
[0025] An embodiment of the present invention further provides a storage medium storing a computer program, wherein the computer program, when executed by a processor, implements any one of the methods for quickly drawing a sign based on vector tiling technology.
Claims
1. A method for fast drawing signs based on vector tiling technology, characterized in that: The following steps are involved: (1) Constructing the Unicode encoding of signs and fast indexing of character tiles; (2) Dynamically adjust the sign style code and tile set resources; (3) Rendering tiled signs.
2. The method for quickly drawing a sign based on vector tiling technology according to claim 1 is characterized in that: Step (1) includes the following steps: (11) Use the character Unicode encoding matrix to store the sign content; (12) Fast indexing of characters to character tiles based on Unicode values.
3. The method for quickly drawing a sign based on vector tiling technology according to claim 1 is characterized in that: Step (2) includes the following steps: (21) Encode the sign character style or tile set ID in 8 bytes, where the font and font size each occupy 2 bytes, and the font color uses the ARGB mode and occupies 4 bytes. Establish a bidirectional index relationship between the sign character style and the tile set resource; the character style includes: font, font color, and font size; (22) When adding a new sign style, a new tile set resource is created. The target sign of the current style is used as the user to point to the tile set. When the number of tile set users returns to zero, the current tile set resource is destructed. Specifically, check whether there is a tile set with the corresponding ID in the system. If so, a bidirectional index relationship is established between the target and the tile set. If not, a new tile set is created. The non-Chinese characters commonly used for signs in the tile set such as 0-9, AZ, az, ""."" / "":""°""'""" are pre-created. Other characters are dynamically and incrementally created during the use of the tile set. Specifically, traverse the sign Unicode matrix, query the tile set for the corresponding character according to the character Unicode, obtain it directly if it exists, and dynamically and incrementally create it if it does not exist.
4. The method for quickly drawing a sign based on vector tiling technology according to claim 1 is characterized in that: Step (3) is as follows: traverse the sign Unicode matrix, query the tile corresponding to the character in the tile set according to the character Unicode, and complete the sign rendering by arranging and rendering the obtained tiles.
5. A fast signage drawing system based on vector tiling technology, characterized in that: include: Index module: used to build fast index of sign Unicode encoding and character tiles; Dynamic management module: used to dynamically adjust the sign style code and tile set resources; Rendering module: used to render tiled signs.
6. The fast signage drawing system based on vector tiling technology according to claim 5 is characterized in that: In the index module, the details are as follows: the sign content is stored using the character Unicode encoding matrix; and the character to character tile is quickly indexed based on the Unicode value.
7. The fast signage drawing system based on vector tiling technology according to claim 5 is characterized in that: In the dynamic management module, the details are as follows: encode the sign character style or tile set ID with 8 bytes, where the font and font size occupy 2 bytes respectively, and the font color uses the ARGB mode and occupies 4 bytes, and establish a bidirectional index relationship between the sign character style and the tile set resource; where the character style includes: font, font color, and font size; create a new tile set resource when adding a new sign style, use the target sign of the current style as the user to point to the tile set, and deconstruct the current tile set resource when the number of tile set users returns to zero; specifically as follows: retrieve whether there is a tile set with the corresponding ID in the system, if so, establish a bidirectional index relationship between the target and the tile set, if not, create a new tile set, where 0-9, AZ, az, "",""."" / "":""°""'""" commonly used non-Chinese characters for signs in the tile set are pre-created, and other characters are dynamically and incrementally created during the use of the tile set, as follows: traverse the sign Unicode matrix, query the tile of the corresponding character in the tile set according to the character Unicode, directly obtain it if it exists, and dynamically and incrementally create it if it does not exist.
8. The fast signage drawing system based on vector tiling technology according to claim 5 is characterized in that: In the rendering module, the specific steps are as follows: traverse the sign Unicode matrix, query the tile corresponding to the character in the tile set according to the character Unicode, and complete the sign rendering by arranging and rendering the obtained tiles.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the computer program is loaded into a processor, a method for quickly drawing a sign based on vector tiling technology according to any one of claims 1 to 4 is implemented.
10. A storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, a method for quickly drawing a sign based on vector tiling technology according to any one of claims 1 to 4 is implemented.