Data rendering method, system, electronic device, and storage medium

The data rendering method and system address the limitations of existing label printing software by generating JSON label files with adaptable display modes and performing format conversions, resulting in flexible and cost-effective rendering solutions for diverse application scenarios.

JP2025518432AActive Publication Date: 2025-06-17WUHAN JINGCHEN INTELLIGENT IDENTIFICATION TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
JP2024537459
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-04-18
Filing Date
2023-07-04
Publication Date
2025-06-17
Estimated Expiration
2043-07-04

AI Technical Summary

Technical Problem

Existing label printing software uses single rendering methods based on HTML or Markdown technologies, which are not adaptable to different application scenarios, leading to high development costs for custom programs.

Method used

A data rendering method and system that generates a label file in JSON format, allowing for two display modes: adaptive layout from top to bottom or layout based on position information, and performs format conversion and rendering accordingly.

Benefits of technology

Enables flexible rendering in various application scenarios, reducing development costs by supporting multiple rendering methods and adapting to different display requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025518432000001_ABST
    Figure 2025518432000001_ABST
Patent Text Reader

Abstract

The present invention discloses a data rendering method, system, electronic device, and storage medium. The data rendering method includes: obtaining label editing information input by a user, generating a label file in Json data format including editing information of a plurality of content blocks based on the label editing information, where the editing information includes position layout information of the content blocks; determining a label display mode which is either a first display mode or a second display mode according to an application scenario; when the label display mode is the first display mode, performing a deletion process of deleting the position layout information in the label file and rendering the remaining data of the label file, and when the label display mode is the second display mode, rendering the label file. The present invention can meet the rendering requirements in different application scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computers, and more specifically, relates to a data rendering method, system, electronic device, and storage medium.

Background Art

[0002] A label means characters, graphics, symbols, and all explanatory materials on a product. Labels are widely applied in scenarios such as supermarket sales items, industrial production, delivery, clothing, office management, etc., such as price labels, product description labels, product shelf labels, barcode labels, clothing labels, document labels, file storage labels, various article and stationery labels, delivery slips, etc. Users can edit labels using the label printing software attached to the label machine and send them to the label machine for printing after completion of editing.

[0003] Currently, commercially available label printing software generally uses HTML technology as the specification and method for multi-end rendering, or performs cross-platform rendering using the Markdown document format. These technologies are mature, widely used, and easy to transmit. However, their rendering methods are single, unable to meet the requirements of users in some scenarios, and it is necessary to develop programs corresponding to different rendering methods respectively, resulting in high development costs.

Summary of the Invention

Problems to be Solved by the Invention

[0004] In order to solve the problems of the above-mentioned prior art, an object of the present invention is to provide a data rendering method, system, electronic device, and storage medium that can meet the rendering requirements in different application scenarios.

Means for Solving the Problems

[0005] To achieve the above object, according to one aspect of the present invention, the following method is provided. That is, obtain the label editing information input by the user, generate a label file in Json data format including the editing information of a plurality of content blocks based on the label editing information, the editing information includes the position layout information of the content blocks, Determine the label display mode according to the application scenario, the label display mode is either the first display mode of adaptively laying out and displaying the content blocks in the label file from top to bottom in the display window, or the second display mode of displaying the content blocks in the label file based on the position layout information, When the label display mode is the first display mode, perform a deletion process of deleting the position layout information in the label file and render the remaining data of the label file. When the label display mode is the second display mode, render the label file.

[0006] Furthermore, before rendering, determine whether it is necessary to perform format conversion on the remaining data of the label file or the label file according to the on-site application scenario. If format conversion is necessary, call the corresponding data converter to perform format conversion and render the data after format conversion.

[0007] Furthermore, when the label display mode is the first display mode, calling the corresponding data converter to perform format conversion includes: Pre-arranging a first data converter and a second data converter, the first data converter is used to convert the label file into HTML format, and the second data converter is used to convert the label file into Markdown format; When it is necessary to convert the remaining data of the label file or the label file into HTML format, a step of calling the first data converter; When it is necessary to convert the remaining data of the label file or the label file into Markdown format, a step of calling the second data converter, including.

[0008] Furthermore, calling the corresponding data converter to perform format conversion provides a standard data interface for adding a custom third data converter, and includes a step of performing format conversion based on the standard data interface.

[0009] Furthermore, the label file includes a plurality of content blocks, the first data converter defines a function for converting each content block into HTML format, and the second data converter defines a function for converting each content block into Markdown format.

[0010] Furthermore, rendering the remaining data of the label file or the label file pre-arranges a first renderer, a second renderer, and a third renderer. The first renderer is used to perform rendering based on the data protocol specification on the application side of the mobile device. The second renderer is used to perform rendering based on the data protocol specification on the applet side of the mobile device. The third renderer is used to perform rendering based on the data protocol specification on the web page side, and including a step of calling any one of the first renderer, the second renderer, and the third renderer to perform rendering according to the on-site application scenario.

[0011] Furthermore, determining the label display mode according to the application scenario includes, when the application scenario on the spot is the artboard editing mode, determining that the label display mode is the second display mode.

[0012] According to a second aspect of the present invention, there is provided a data rendering system for editing and displaying labels, and the data rendering system includes a generation module that acquires label editing information input by a user and is used to generate a label file in Json data format including editing information of a plurality of content blocks based on the label editing information, where the editing information includes position layout information of the content blocks, and a determination module that determines a label display mode according to the application scenario, where the label display mode is either a first display mode that adaptively layouts and displays the content blocks in the label file from top to bottom in a display window, or a second display mode that displays the content blocks in the label file based on the position layout information, and a rendering module that is used to perform rendering according to the label display mode. When the label display mode is the first display mode, a deletion process of deleting the position layout information in the label file is performed to perform rendering on the remaining data of the label file. When the label display mode is the second display mode, rendering is performed on the label file.

[0013] According to a third aspect of the present invention, there is provided an electronic device including at least one processing unit and at least one storage unit, where a computer program is stored in the storage unit, and when the computer program is executed by the processing unit, the processing unit is caused to execute the steps of any data rendering method.

[0014] According to a fourth aspect of the present invention, there is provided a storage medium storing a computer program executable on an access authentication device, and when the computer program is executed on the access authentication device, the access authentication device is caused to execute steps of any data rendering method.

[0015] Overall, the technical solution conceived by the present invention can achieve the following beneficial effects compared with the prior art. That is, it has a plurality of different types of rendering methods, can determine the label display mode according to the application scenario, perform corresponding processing according to the label display mode and then perform rendering processing, and can display according to the corresponding label display mode after the rendering processing. Also, the label display mode can support "self-adaptively laying out and displaying the content blocks in the label file from top to bottom in the display window" and "displaying based on the position layout information", so as to meet the rendering requirements in different application scenarios.

Brief Description of the Drawings

[0016]

Figure 1

Figure 2

Figure 3

Figure 4

Modes for Carrying Out the Invention

[0017] To make the objectives, technical solutions and advantages of the present invention more apparent, the present invention will be described in detail with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are merely for interpreting the present invention and not for limiting the present invention. It should be further understood that the technical features according to the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0018] In the description of the embodiments of the present application, the terms "first" and "second" are used for the purpose of description and should not be construed as indicating or implying relative importance or implicitly suggesting the number of the indicated technical features. Therefore, the features limited by "first" and "second" can include at least one of the corresponding features explicitly or implicitly. Unless specifically and clearly limited, the term "a plurality" means at least two, such as two, three, etc.

[0019] In the embodiments of the present invention, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product or facility comprising a series of steps or modules is not limited to the explicitly listed steps or modules, but may include other steps or modules not explicitly listed or inherent to these processes, methods, products or facilities.

[0020] In the embodiments of the present invention, even if steps are named or numbered, it does not mean that they must be executed in the chronological / logical order indicated by the naming or numbering of the steps in the method flow. The named or numbered flow steps can change the execution order according to the technical objectives to be achieved, as long as the same or similar technical effects can be achieved.

[0021] When referring to "embodiments" in this specification, it means that the specific features, structures, or characteristics shown in the description of the embodiments can be included in at least one embodiment of the present invention. The phrase appearing in each part of the specification does not necessarily refer to the same embodiment, nor does it refer to independent or alternative embodiments that are mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described in this specification can be used in combination with other embodiments.

[0022] The present invention provides a data rendering method, a system, an electronic device, and a storage medium, which will be described below respectively.

[0023] As shown in FIG. 1, the data rendering method used for label editing and display according to an embodiment of the present invention includes steps S101 to S103 as follows.

[0024] In S101, label editing information including editing information of a plurality of content blocks input by a user is obtained, and a label file conforming to the Json data format is generated based on the label editing information. The editing information includes the position layout information of the content blocks.

[0025] The user can edit the label using the label printing software attached to the label machine. For example, titles, texts, images, lists, links, videos, etc. can be inserted into the editing interface.

[0026] The content block is an editing insertion object described based on a predefined data structure. In an embodiment of the present invention, the title, text, image, list, link, and video inserted by the user can be a title content block, a text content block, an image content block, a list content block, a link content block, and a video content block respectively. The data structure of each type of content block is defined in advance, and based on the predefined data structure, the editing information of each content block is recorded in the label file respectively. For example, for a text content block, the editing information of the text content block includes the specific character content of the text content block and the position layout information of the content block.

[0027] The position layout information may be the coordinates, width, height, rotation angle, etc. of the text content block.

[0028] In S102, the label display mode is determined according to the application scenario. The label display mode is either the first display mode in which the content blocks in the label file are adaptively laid out and displayed from top to bottom in the display window, or the second display mode in which the content blocks in the label file are displayed based on the position layout information.

[0029] The label display mode supports "adaptively laying out and displaying the content blocks in the label file from top to bottom in the display window". As shown in FIG. 2, the content blocks of the title, text, and image are adaptively laid out and displayed from top to bottom in the display window. In this example, the width of the content block is the same as the width of the display window, and the height is adaptively adjusted.

[0030] The label display mode further supports displaying based on the position layout information, that is, it is the WYSIWYG mode. As shown in Figure 3, each content block can be appropriately arranged at any position within the page frame. The width, height, position, rotation, etc. of each content block can all be set by the user, that is, what is displayed on the display window is consistent with the user's settings.

[0031] Determining the label display mode according to the application scenario, for example, when the application scenario is an artboard editing mode such as the artboard editing mode built using Flutter, which is a toolkit for building Google's open-source user interface, the label display mode is determined to be the second display mode. For example, when the application scenario is to improve the convenience for the user to perform label editing operations but has no high requirements for others, the first display mode may be adopted. Here, the application scenarios are not enumerated further.

[0032] In S103, when the label display mode is the first display mode, a deletion process of deleting the position layout information in the label file is performed, and then rendering is performed on the remaining data of the label file. When the label display mode is the second display mode, rendering is performed on the label file. When the label display mode is the second display mode, since the display on the display window needs to meet the consistency with the user's settings, it is necessary to retain the position layout information such as coordinates, width, and height in the label file.

[0033] When it is determined that the label display mode is the first display mode, the position layout information such as coordinates, width, and height in the label file is omitted, and less data is transferred to the renderer.

[0034] Rendering refers to processing the input data and displaying it on the interface.

[0035] In this way, the present invention can determine the label display mode according to the application scenario and perform rendering processing according to the label display mode. The label display mode can support "self-adaptively laying out and displaying the content blocks in the label file from top to bottom in the display window" and "displaying based on the position layout information", so as to meet the rendering requirements in different application scenarios.

[0036] Furthermore, before performing rendering, according to the on-site application scenario, it is determined whether there is a need to format-convert the remaining data of the label file or the label file, and if format conversion is required, the corresponding data converter is called to perform format conversion, and then rendering is performed on the data after format conversion.

[0037] In different application scenarios, the data formats supported by the renderer are different. For example, when performing rendering on the browser side, since the renderer generally only supports the HTML format, it is necessary to convert the data to be rendered into the supported format before the rendering process.

[0038] Furthermore, when the label display mode is the first display mode, calling the corresponding data converter to perform format conversion includes the steps of pre-arranging the first data converter and the second data converter, where the first data converter is used to convert the label file into the HTML format, and the second data converter is used to convert the label file into the Markdown format, the step of calling the first data converter when there is a need to convert the remaining data of the label file or the label file into the HTML format, and the step of calling the second data converter when there is a need to convert the remaining data of the label file or the label file into the Markdown format.

[0039] In the present invention, by pre-arranging the first data converter and the second data converter, format conversion with HTML technology or Markdown technology, which is a general-purpose solution, can be realized. Further, the label file includes a plurality of content blocks, the first data converter defines a function for converting each content block into an HTML format, and the second data converter defines a function for converting each content block into a Markdown format.

[0040] For example, when a user is supported to insert a title, text, image, list, link, video, etc. when editing a label, the label file may include a title content block, a text content block, an image content block, a list content block, a link content block, a video content block, and when each content block is stored in a predefined data structure, the first data converter defines corresponding functions for each content block.

[0041] Illustrated with an example, in the label file, if a multi-level title data structure is adopted for the title content block, marking the title level, such as a first-level title, a second-level title, a second-level title, etc. in one field, and marking the specific character content of the title in another field, then in the first data converter, the multi-level title of the title content block is converted into multiple lines of HTML text, and each line corresponds to the specific character content of one title.

[0042] Furthermore, calling the corresponding data converter to perform format conversion includes providing a standard data interface for adding a custom third data converter, and performing the steps of format conversion based on the standard data interface.

[0043] In other words, by providing a specification data interface to support a custom data converter, the renderer customizes the data converter to convert the data to be rendered into the corresponding data format according to the required data format. Specifically, the data converter may be a functional function.

[0044] Furthermore, a fourth data converter used to convert an HTML format content block into a Json format content block of a predefined data structure and a fifth data converter used to convert a Markdown format content block into a Json format content block of a predefined data structure may be pre-arranged. When the label editing information input by the user in step S101 contains content based on the HTML format, the fourth data converter is called to generate a label file. When the label editing information input by the user contains content based on the Markdown format, the fifth data converter is called to generate a label file.

[0045] Furthermore, rendering the remaining data of the label file or the label file includes steps of pre-arranging a first renderer, a second renderer, and a third renderer. The first renderer is used to perform rendering based on the data protocol specification on the application side of the mobile device. The second renderer is used to perform rendering based on the data protocol specification on the applet side of the mobile device. The third renderer is used to perform rendering based on the data protocol specification on the web page side, and according to the on-site application scenario, calling any one of the first renderer, the second renderer, and the third renderer to perform rendering.

[0046] For example, when the user edits and displays labels on the application side of the mobile device, rendering is performed based on the data protocol specifications of the Android or IOS system. When the user edits and displays labels on the web page side, rendering is performed based on the data protocol specifications of the web page side. Also, according to the application scenario, the rendering settings are adjusted, such as adjusting the display resolution.

[0047] The data rendering system used for editing and displaying labels according to an embodiment of the present invention is used to obtain label editing information input by the user and generate a label file in Json data format including editing information of a plurality of content blocks based on the label editing information. The editing information includes a generation module 201 including position layout information of the content blocks, determine a label display mode according to the application scenario. The label display mode is any one of a first display mode in which the content blocks in the label file are self-adaptively laid out and displayed from top to bottom in the display window, or a second display mode in which the content blocks in the label file are displayed based on the position layout information. A determination module 202, used for performing rendering according to the label display mode. When the label display mode is the first display mode, a deletion process of deleting the position layout information in the label file is performed to perform rendering on the remaining data of the label file. When the label display mode is the second display mode, a rendering module 203 for performing rendering on the previous label file is included.

[0048] The principle and effect of the data rendering system are the same as those of the above data rendering method, and the description will not be repeated here.

[0049] The present application further provides an electronic device including at least one processing unit and at least one storage unit. A computer program is stored in the storage unit, and when the computer program is executed by the processing unit, the processing unit is caused to execute the steps of the above data rendering method.

[0050] The present application further provides a storage medium storing a computer program executable on an access authentication device. When the computer program is executed on the access authentication device, the access authentication device is caused to execute the steps of implementing the above data rendering method. Further, the storage medium may be, for example, a floppy (registered trademark) disk, an optical disk, a DVD, a microdriver and a magneto-optical disk, a ROM, a RAM, an EPROM, an EEPROM, a DRAM, a VRAM, a flash memory, a magnetic medium, a magneto-optical medium, or any type of medium or device capable of storing instructions and / or data, without limitation.

[0051] As will be understood by those skilled in the art, the above-described content merely shows preferred embodiments of the present application and should not be construed as limiting the scope of the present application. Modifications, equivalent replacements, and improvements can be made without departing from the spirit and gist of the present invention, and all of these are also included within the protection scope of the present invention.

Claims

1. A data rendering method used for label editing and display, which includes the steps of obtaining label editing information input by a user, generating a label file that contains editing information for a plurality of content blocks based on the label editing information and conforms to the Json data format, and the editing information includes position layout information of the content blocks; determining a label display mode according to the application scenario, and the label display mode is either a first display mode in which the content blocks in the label file are self-adaptively laid out and displayed from top to bottom in a display window, or a second display mode in which the content blocks in the label file are displayed based on the position layout information; when the label display mode is the first display mode, performing a deletion process of deleting the position layout information in the label file and rendering the remaining data of the label file, and when the label display mode is the second display mode, rendering the label file. A data rendering method characterized by the above.

2. Before rendering, determine whether it is necessary to perform format conversion on the remaining data of the label file or the label file according to the on-site application scenario. If format conversion is necessary, call the corresponding data converter to perform format conversion and then render the data after format conversion. The data rendering method according to claim 1 is characterized by this.

3. When the label display mode is the first display mode, calling the corresponding data converter to perform format conversion means Pre-arrange a first data converter and a second data converter, wherein the first data converter is used to convert the label file into an HTML format, and the second data converter is used to convert the label file into a Markdown format; When there is remaining data of the label file or when it is necessary to convert the label file into an HTML format, call the first data converter; When there is remaining data of the label file or when it is necessary to convert the label file into a Markdown format, call the second data converter. The data rendering method according to claim 2, characterized by comprising the above steps.

4. Calling the corresponding data converter to perform format conversion Provide a standard data interface for adding a custom third data converter, and based on the standard data interface, include the step of performing format conversion. The data rendering method according to claim 3, characterized by comprising the above steps.

5. The label file includes a plurality of content blocks. The first data converter defines a function for converting each content block into an HTML format, and the second data converter defines a function for converting each content block into a Markdown format. The data rendering method according to claim 3, characterized by comprising the above steps.

6. Performing rendering on the remaining data of the label file or on the label file Pre-arrange a first renderer, a second renderer, and a third renderer. The first renderer is used to perform rendering based on the data protocol specification on the application side of the mobile device. The second renderer is used to perform rendering based on the data protocol specification on the applet side of the mobile device. The third renderer is used to perform rendering based on the data protocol specification on the web page side, and the step of According to the on-site application scenario, calling any one of the first renderer, the second renderer, and the third renderer to perform rendering, and the data rendering method according to claim 1, characterized in that it includes.

7. Determining the label display mode according to the application scenario includes determining that the label display mode is the second display mode when the on-site application scenario is the artboard editing mode, and the data rendering method according to claim 1, characterized in that it includes.

8. A data rendering system used for editing and displaying labels, Obtain label editing information input by the user and use it to generate a label file that includes editing information of a plurality of content blocks and conforms to the Json data format. The editing information includes a generation module for position layout information of the content block, Determine the label display mode according to the application scenario. The label display mode is either a first display mode in which the content blocks in the label file are adaptively laid out and displayed from top to bottom in the display window, or a second display mode in which the content blocks in the label file are displayed based on the position layout information. A determination module that is any one of them, A data rendering system, comprising: a rendering module that is used to perform rendering according to the label display mode, and when the label display mode is a first display mode, perform a deletion process of deleting the position layout information in the label file and perform rendering on the remaining data of the label file; and when the label display mode is a second display mode, perform rendering on the label file. **Claim 9** An electronic device including at least one processing unit and at least one storage unit, wherein a computer program is stored in the storage unit, and when the computer program is executed by the processing unit, the processing unit is caused to execute the steps of the data rendering method according to any one of claims 1 to 7. **Claim 10** A storage medium storing a computer program executable by an access authentication device, wherein when the computer program is executed in the access authentication device, the access authentication device is caused to execute the steps of the data rendering method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • JavaScript rendering method and apparatus

    CN105404514A

  • Label generating and printing method and device and storage medium

    CN115660012A

  • Program for creating label and information processing device

    JP2022152756A