Data rendering method, system, electronic device and storage medium

The data rendering method and system address the need for flexible label rendering by generating JSON-formatted label files with adaptive and position-based display modes, and format conversion, improving compatibility and reducing costs.

JP7738945B2Active Publication Date: 2025-09-16WUHAN 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
Patents
Current Assignee / Owner
Priority Date
2023-04-18
Filing Date
2023-07-04
Publication Date
2025-09-16
Estimated Expiration
2043-07-04

AI Technical Summary

Technical Problem

Existing label printing software requires different programs for different rendering methods, leading to high development costs and limited flexibility in meeting diverse application scenarios.

Method used

A data rendering method and system that generates label files in JSON format, supports multiple display modes (self-adaptive and position-based), and performs format conversion using data converters and renderers tailored to specific application scenarios.

Benefits of technology

Enables flexible rendering across various scenarios by adaptively laying out content blocks and converting formats, reducing development costs and enhancing compatibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007738945000001
    Figure 0007738945000001
  • Figure 0007738945000002
    Figure 0007738945000002
  • Figure 0007738945000003
    Figure 0007738945000003
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 relates to the field of computers, and more particularly to data rendering methods, systems, electronic devices and storage media. [Background technology]

[0002] Labels refer to the text, graphics, symbols, and all other explanatory materials on products. Labels are widely used in supermarkets, industrial production, delivery, clothing, office management, and other situations, such as price labels, product description labels, shelf labels, barcode labels, clothing labels, document labels, file storage labels, labels for various goods and stationery, and delivery slips. Users can edit labels using the label printing software provided with the label machine, and then send the edited labels to the label machine for printing.

[0003] Currently, most commercially available label printing software uses HTML technology for multi-end rendering or the Markdown document format for cross-platform rendering. These technologies are mature, widely used, and easy to transfer. However, the rendering method is so single that it cannot meet the needs of some users. It is necessary to develop different programs for different rendering methods, which results in high development costs. Summary of the Invention [Problem to be solved by the invention]

[0004] SUMMARY OF THE INVENTION In order to solve the above-mentioned problems of the prior art, the present invention aims to provide a data rendering method, system, electronic device and storage medium that can meet the rendering requirements of different application scenarios. [Means for solving the problem]

[0005] To achieve the above object, one aspect of the present invention provides a method for obtaining label editing information input by a user, and generating a label file in a JSON data format based on the label editing information, the label file including editing information for a plurality of content blocks, the editing information including position layout information for the content blocks; determining a label display mode according to an application scenario, the label display mode being either a first display mode for displaying content blocks in the label file by self-adaptively laying them out from above in a display window, or a second display mode for displaying content blocks in the label file according to the position layout information; When the label display mode is the first display mode, a deletion process is performed to delete the position layout information in the label file, and 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.

[0006] Furthermore, before rendering, it determines whether the remaining data in the label file or the label file needs to be format converted according to the current application scenario. If format conversion is required, it calls a corresponding data converter to perform the format conversion, and then performs rendering on the format-converted data.

[0007] Furthermore, when the label display mode is a 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 being used to convert the label file into HTML format, and the second data converter being used to convert the label file into Markdown format; calling the first data converter when the remaining data of the label file or the label file needs to be converted to HTML format; and calling the second data converter when the remaining data of the label file or the label file needs to be converted to Markdown format.

[0008] Furthermore, calling the corresponding data converter to perform format conversion includes: Providing a reference data interface for adding a custom third data transformer and performing format conversion based on the reference data interface is also included.

[0009] Further, 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 residual data of the label file or the label file may include: pre-arranging a first renderer, a second renderer, and a third renderer, wherein the first renderer is used to perform rendering based on a data protocol specification of an application side of a mobile device, the second renderer is used to perform rendering based on a data protocol specification of an applet side of the mobile device, and the third renderer is used to perform rendering based on a data protocol specification of a web page side; and calling any one of the first renderer, the second renderer, and the third renderer to perform rendering according to the current application scenario.

[0011] Furthermore, determining the label display mode according to the application scene includes determining that the label display mode is a second display mode when the application scene is an artboard editing mode.

[0012] According to a second aspect of the present invention, there is provided a data rendering system for editing and displaying a label, the data rendering system comprising: a generation module that is used to acquire label editing information input by a user and generate a label file that includes editing information of a plurality of content blocks and conforms to a JSON data format based on the label editing information, the editing information including position layout information of the content blocks; a determining module for determining a label display mode according to an application scenario, the label display mode being either a first display mode for displaying content blocks in the label file in a display window by self-adaptively laying them out from above, or a second display mode for displaying content blocks in the label file according to the position layout information; a rendering module that is used to perform rendering according to the label display mode, and that, when the label display mode is a first display mode, performs a deletion process to delete the position layout information in the label file and performs rendering on the remaining data of the label file, and when the label display mode is a second display mode, performs rendering 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, 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 perform steps of any of the data rendering methods.

[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, the computer program causing the access authentication device to perform steps of any of the data rendering methods when the computer program is executed on the access authentication device.

[0015] Overall, the above technical solution conceived by the present invention has the following beneficial effects compared with the prior art: it has multiple different rendering methods, can determine the label display mode according to the application scenario, and can perform corresponding processing according to the label display mode, then perform rendering processing, and display according to the corresponding label display mode after the rendering processing; and the label display mode supports "self-adaptively laying out and displaying the content blocks in the label file in the display window from above" and "displaying based on position layout information", thereby meeting the rendering requirements of different application scenarios. [Brief explanation of the drawings]

[0016] [Figure 1] 2 is a flowchart of a data rendering method according to an embodiment of the present invention. [Figure 2] FIG. 2 is a schematic diagram of an interface in a first display mode according to an embodiment of the present invention; [Figure 3] FIG. 10 is a schematic view of an interface in the second display mode according to the embodiment of the present invention; [Figure 4] 1 is a schematic diagram of a data rendering system according to an embodiment of the present invention; DETAILED DESCRIPTION OF THE INVENTION

[0017] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be described in detail with reference to the drawings and examples. It should be understood that the specific examples described herein are merely for the purpose of interpreting the present invention and are not intended to limit the present invention. It should be understood that the technical features of each embodiment of the present invention described below can be combined unless they are mutually exclusive.

[0018] In describing the embodiments of the present application, the terms "first" and "second" are used for descriptive purposes and should not be construed as indicating or implying relative importance or the number of the indicated technical features. Thus, a feature qualified as "first" or "second" may explicitly or implicitly include at least one of that feature. Unless otherwise expressly and specifically limited, the term "plurality" means at least two, e.g., two, three, etc.

[0019] In embodiments of the present invention, the terms "comprises" and "having" and any variations thereof are intended to be non-exclusive inclusive, for example, a process, method, apparatus, product or facility comprising a series of steps or modules is not limited to the explicitly recited steps or modules, but may include other steps or modules not explicitly recited or inherent to the process, method, product or facility.

[0020] In the embodiments of the present invention, naming or numbering steps does not mean that the steps in the method flow must be performed in the chronological / logical order indicated by the naming or numbering. The order of the named or numbered flow steps can be changed depending on the technical purpose to be achieved, as long as the same or similar technical effect is achieved.

[0021] When referring to an "embodiment" in this specification, it means that a particular feature, structure, or characteristic described in the description of the embodiment can be included in at least one embodiment of the present invention. Appearances of the phrase in various places in the description do not necessarily refer to the same embodiment, nor do they refer to independent or alternative embodiments that are mutually exclusive with other embodiments. Those skilled in the art will understand, both explicitly and implicitly, that the embodiments described herein can be used in combination with other embodiments.

[0022] The present invention provides a data rendering method, system, electronic device and storage medium, each of which is described below.

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

[0024] In S101, label editing information input by the user, which includes editing information for multiple content blocks, is obtained, and a label file conforming to the JSON data format is generated based on the label editing information, and the editing information includes position layout information for the content blocks.

[0025] The label printing software that comes with the label desk allows the user to edit the label, for example, inserting titles, text, images, lists, links, videos, etc. into the editing interface.

[0026] A content block is an edited and inserted 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 editing information for each content block is recorded in a label file based on the predefined data structure. For example, for a text content block, the editing information for the text content block includes the specific text 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 and height, rotation angle, etc. of the text content block.

[0028] In S102, a label display mode is determined 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 above in the display window, or a second display mode in which the content blocks in the label file are displayed based on position layout information.

[0029] The label display mode supports "self-adaptively displaying content blocks in a label file from the top of the display window." As shown in Figure 2, content blocks including titles, text, and images are self-adaptively displayed from the top of 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 self-adaptively adjusted.

[0030] The label display mode also supports displaying content based on positional layout information, i.e., the WYSIWYG mode. As shown in Figure 3, each content block can be positioned anywhere within the page frame. The width, height, position, and rotation of each content block can all be set by the user, meaning that what is displayed in the display window will match the user's settings.

[0031] For example, if the application scenario is an artboard editing mode such as an artboard editing mode built using Flutter, Google's open-source user interface building toolkit, the label display mode is determined to be the second display mode. For example, if the application scenario improves the convenience of user label editing operations but does not have high requirements for other aspects, the first display mode may be adopted. Here, no further application scenarios are listed.

[0032] In S103, if the label display mode is the first display mode, a deletion process is performed to delete the position layout information in the label file, and rendering is performed on the remaining data in the label file.If the label display mode is the second display mode, rendering is performed on the label file.If the label display mode is the second display mode, the display on the display window must match the user's settings, so it is necessary to leave the position layout information such as coordinates, width, and height in the label file.

[0033] When the label display mode is determined to be 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 in 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 supports "self-adaptively layout and display of content blocks in the label file from above in the display window" and "display based on position layout information", thereby meeting the rendering requirements of different application scenarios.

[0036] Furthermore, before rendering, it determines whether the remaining data in the label file or the label file needs to be format converted according to the current application scenario. If format conversion is required, it calls the corresponding data converter to perform the format conversion, and then performs rendering on the data after format conversion.

[0037] In different application scenarios, the data formats supported by renderers are different. For example, when rendering on the browser side, the renderer generally only supports HTML format, so the data to be rendered needs to be converted into a 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 is The method includes the steps of: pre-arranging a first data converter and a second data converter, the first data converter being used to convert the label file into HTML format, and the second data converter being used to convert the label file into Markdown format; calling the first data converter when the remaining data of the label file or the label file needs to be converted into HTML format; and calling the second data converter when the remaining data of the label file or the label file needs to be converted into Markdown format.

[0039] In the present invention, by pre-arranging a first data converter and a second data converter, it is possible to realize format conversion with HTML technology or Markdown technology, which are general-purpose solutions. Furthermore, the label file includes multiple content blocks, and the first data converter defines a function for converting each content block to HTML format, and the second data converter defines a function for converting each content block to Markdown format.

[0040] For example, if inserting titles, text, images, lists, links, videos, etc. is supported when a user edits 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, and a video content block, and if each content block is stored in a predefined data structure, the first data converter defines a corresponding function for each content block.

[0041] For example, if a multi-level title data structure is adopted for a title content block in a label file, one field will indicate the title level, for example, first level title, second level title, second level title, etc., and another field will indicate the specific text content of the title. The first data converter will convert the multi-level title of the title content block into multiple lines of HTML text, with each line corresponding to the specific text content of one title.

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

[0043] In other words, by providing a canonical data interface and supporting custom data converters, a renderer customizes the data converter to convert the rendered data into whatever data format is required. Specifically, the data converter may be a functional function.

[0044] Furthermore, a fourth data converter used to convert content blocks in HTML format into content blocks in JSON format with a predefined data structure, and a fifth data converter used to convert content blocks in Markdown format into content blocks in JSON format with a predefined data structure may be pre-arranged. If the label editing information entered by the user in step S101 includes content based on the HTML format, the fourth data converter is called to generate a label file, and if the label editing information entered by the user includes content based on the Markdown format, the fifth data converter is called to generate a label file.

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

[0046] For example, when a user edits and displays a label in a mobile device application, rendering is performed based on the data protocol specifications of the Android or IOS system. When a user edits and displays a label on a web page, rendering is performed based on the data protocol specifications of the web page. Also, rendering settings, such as adjusting the display resolution, can be adjusted depending on the application scenario.

[0047] The data rendering system for editing and displaying labels according to an embodiment of the present invention includes: a generating module 201 for receiving label editing information input by a user, and generating a label file in a JSON data format based on the label editing information, the label file including editing information for multiple content blocks, the editing information including position layout information for the content blocks; a determining module 202 for determining a label display mode according to an application scenario, the label display mode being either a first display mode for displaying content blocks in the label file in a display window by self-adaptively arranging them from above, or a second display mode for displaying content blocks in the label file based on position layout information; The rendering module 203 is used to perform rendering according to the label display mode, and when the label display mode is the first display mode, performs a deletion process to delete position layout information in the label file and performs rendering on the remaining data of the label file, and when the label display mode is the second display mode, performs rendering on the previous label file.

[0048] The principle and effect of the data rendering system are the same as the data rendering method described above, 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, wherein the storage unit stores a computer program, which, when executed by the processing unit, causes the processing unit to perform the steps of the data rendering method.

[0050] The present application further provides a storage medium storing a computer program executable on an access authentication device, which, when executed on the access authentication device, causes the access authentication device to perform steps for implementing the data rendering method. The storage medium may be, for example, but not limited to, a floppy disk, an optical disk, a DVD, a microdrive 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.

[0051] As can be appreciated by those skilled in the art, the above content only illustrates the preferred embodiments of the present application, and should not be construed as limiting the scope of the present application; without departing from the spirit and intent of the present invention, modifications, equivalent replacements and improvements can be made, all of which are included in the protection scope of the present invention.

Claims

1. A data rendering method used to edit and display labels, comprising: acquiring label editing information input by a user, and generating a label file conforming to a Json data format including editing information of a plurality of content blocks based on the label editing information, wherein the editing information includes positional layout information of the content blocks; determining a label display mode according to an application scenario, the label display mode being either a first display mode for displaying content blocks in the label file in a display window by self-adaptively laying them out from above, or a second display mode for displaying content blocks in the label file according to the position layout information; When the label display mode is a first display mode, a deletion process is performed to delete the position layout information in the label file, and rendering is performed on the remaining data of the label file; and when the label display mode is a second display mode, rendering is performed on the label file.

1. A data rendering method comprising:

2. 2. The data rendering method of claim 1, further comprising: determining whether a format conversion is required for the remaining data of the label file or the label file according to the current application scenario before rendering; if a format conversion is required, calling a corresponding data converter to perform the format conversion; and then rendering the data after the format conversion.

3. When the label display mode is a 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 being used to convert the label file into an HTML format, and the second data converter being used to convert the label file into a Markdown format; calling the first data converter when the remaining data of the label file or the label file needs to be converted to HTML format; and calling the second data converter when residual data of the label file or the label file needs to be converted to Markdown format.

4. Invoking the corresponding data converter to perform format conversion includes:

4. The method of claim 3, further comprising providing a nominal data interface for adding a custom third data transformer, and performing format conversion based on the nominal data interface.

5. 4. The data rendering method of claim 3, wherein 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.

6. Rendering the residual data of the label file or the label file includes: pre-arranging a first renderer, a second renderer, and a third renderer, the first renderer being used to perform rendering based on a data protocol specification of an application side of a mobile device, the second renderer being used to perform rendering based on a data protocol specification of an applet side of the mobile device, and the third renderer being used to perform rendering based on a data protocol specification of a web page side; and calling any one of the first renderer, the second renderer, and the third renderer according to a current application scenario to perform rendering.

7. 2. The data rendering method of claim 1, wherein determining a label display mode according to the application scene includes determining that the label display mode is a second display mode when the application scene is an artboard editing mode.

8. 1. A data rendering system for use in editing and displaying labels, comprising: a generating module that is used to acquire label editing information input by a user and generate a label file that conforms to the Json data format and includes editing information for a plurality of content blocks based on the label editing information, the editing information including position layout information for the content blocks; a determining module for determining a label display mode according to an application scenario, the label display mode being either a first display mode for displaying content blocks in the label file in a display window by self-adaptively laying them out from above, or a second display mode for displaying content blocks in the label file according to the position layout information; a rendering module that is used to perform rendering in accordance with the label display mode, and that, when the label display mode is a first display mode, performs a deletion process to delete the position layout information in the label file and performs rendering on remaining data of the label file, and that, when the label display mode is a second display mode, performs rendering on the label file.

9. 1. An electronic device comprising at least one processing unit and at least one storage unit, An electronic device, characterized in that a computer program is stored in the storage unit, and when the computer program is executed by the processing unit, the processing unit performs the steps of the data rendering method according to any one of claims 1 to 7.

10. A storage medium for storing a computer program executable by an access authentication device, A storage medium, characterized in that, when the computer program is executed in the access authentication device, the computer program causes the access authentication device to perform 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