Method for quickly importing and exporting label template at web end, cloud label system and computer readable storage medium
By formatting the configuration data of the tag template into JSON formatted strings, the rapid import and export of tag templates in the cloud tag system is realized, which solves the inflexible problem of tag template import and export in the existing technology, and improves the correction efficiency and user experience.
Patent Information
- Application Number
- CN202411937751.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-04-18
AI Technical Summary
In existing cloud labeling systems, label templates cannot be imported or exported flexibly and quickly, making it difficult to quickly locate and correct when there are problems with printing labels or label templates.
By formatting the configuration data of the tag template into a JSON formatted string, using this string to create or update the tag template on the web side, and combining the import interface of the cloud tag system, the tag template is quickly imported and exported.
It realizes the rapid and intelligent import and export of tag templates, simplifies the data flow process, and improves the correction efficiency and user experience of tag templates.
Smart Images

Figure CN119847522A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Web design, and in particular to a method for quickly importing and exporting label templates on a Web side, a cloud label system, and a computer-readable storage medium. Background Art
[0002] Traditional label templates are made locally, for example, using local label template design clients such as BarTend and Dlabel. They are usually designed and made by professionals and saved locally or on a file server. If the designer of the label template is not on duty, when encountering label printing problems, other personnel not only need to reinstall the design client, but also need to import and download the label template. Not only are there many problems with unsuccessful installation and registration, but the downloading and importing of label templates also requires special guidance, which is time-consuming and laborious.
[0003] To avoid the trouble of designing client installation and registration, with the development of Web design technology, the existing label template design, production, and printing can all be completed on the browser web page. For example, in the cloud label system, the relevant operations and data sources of the label template can be linked to each other and realize the corresponding functions. The display data of the label template usually comes from the cloud or the local cache of the browser. The data can be shared. You can design the label by opening the browser web page, which saves local storage space and ensures the consistency of the label template data. It can be quickly privately deployed to the business server, and the system upgrade is also very convenient.
[0004] However, this type of cloud label system, such as the patent document with announcement number CN106469063A, discloses a management method and management system for template labels. Since the label data of the label template is label data based on html comments or XML data, it not only occupies a large amount of memory, but also the speed of parsing the label data into the content of the web page file is slow. Although there is a unified import interface, the upgrades of the label templates are all released uniformly by the server, and there is a problem that the label templates cannot be exported flexibly and quickly; and, although the label data is stored in the cloud and can be shared, the system data corresponding to the template label is not easy to further design and modify. When there is a problem with the printed label or label template, the data problem corresponding to the problematic label template needs to be manually browsed or checked, and the corresponding label data cannot be quickly located, resulting in the problem that the correction of the label template is difficult, time-consuming and inefficient. Summary of the invention
[0005] The purpose of the present invention is to provide a method for quickly importing and exporting label templates on the web, a cloud label system and a computer-readable storage medium to address the problem that label templates in the prior art cannot be flexibly and quickly imported or exported.
[0006] In order to achieve the above object, the technical solution adopted by the present invention is:
[0007] The method for quickly importing and exporting label templates on the web includes the following steps:
[0008] The tag template is configured with a JSON data object, and when the data of the tag template is circulated, the JSON data object is formatted into a JOSN formatted string, wherein the JOSN formatted string includes: template components, configuration information, tag type, tag name, template size, group ID, and group name;
[0009] The label template is created or updated using the JOSN formatted string, and the JOSN formatted string corresponding to the created or updated label template is stored.
[0010] The method for quickly importing and exporting label templates on the Web side of the present invention configures JOSN data objects for label templates. When the data of the label template is circulated, the JOSN data objects can be formatted into JOSN formatted strings. The label template is created or updated using the JOSN formatted strings. When rendering the canvas, there is no need to make a network request to load the content of the new label template. The JOSN formatted strings contain all the data elements of the label template, reflecting the integrity of the data information. With the help of the import interface of the cloud label system, only a few necessary fields are required to complete the creation and update of the label template. The export function of the label template is realized in conjunction with the Web cache or local files. Data circulation runs through the entire process of importing and exporting label templates. The label template can be quickly and intelligently imported and exported, which is convenient for transmitting and parsing label template data, and can provide developers with semantically clear label template data, optimize Web design methods, provide convenience for developers to design, modify and print labels, and improve user experience.
[0011] Preferably, the method for quickly importing and exporting label templates on a web side of the present invention, the data flow of the label template, specifically includes the import and export of label data corresponding to the target label template; the export of label data includes the following steps:
[0012] Determine whether the target tag template exists on the list page or the design page;
[0013] If the target label template exists on the list page, the label data stored in the database is obtained from the network interface according to the ID request of the target label template, and the label data is converted into a JSON format string;
[0014] If the target label template exists on the design page, the label data is the real-time data in the converted JSON format string;
[0015] As a preferred solution of the present invention, the target label template of the label template in the list page and the design page can be quickly and intelligently exported. If the target label template exists in the list page, the network interface is requested according to the ID of the target label template to obtain the label data stored in the database; if the target label template is in the design page, the real-time data is exported as the label data, and then the information of the target label template is processed, or the label template information in the design page canvas is processed, some required fields are extracted, and then assembled into a JSON format string. The user can choose to store the JSON format string in the browser clipboard or in a local text file, or send it to others through various communication software or tools. If the design page has made modifications to the label template, the converted real-time JSON format string is exported as label data. The real-time data refers to the user's editing operation on the label template that has not been saved to the database. The label information in the current canvas has an updated part compared to the label template information in the database, thereby realizing the export and use of the label data corresponding to the target label template of the list page and the design page, so as to realize a more comprehensive and accurate export of the label data of the target label template.
[0016] Preferably, in the method for quickly importing and exporting label templates on a web side of the present invention, the importing of label data comprises the following steps:
[0017] Paste the JSON format string corresponding to the target label template into the text editing box to determine whether the current label template exists on the list page or on the design page;
[0018] If the current tag template exists on the list page, call JSON.parse to convert the JSON format string into a normal data object, and create the template tag template through the import interface;
[0019] If the current label template exists on the design page and is in draft state, the canvas content of the current label template is overwritten through the import interface, and the label template creation operation is performed; if the current label template exists on the design page, the label template update operation is performed through the import interface.
[0020] As a preferred solution of the present invention, a JSON format string is imported into the cloud label system, and the import button of the label template list page or the label template design page is clicked. The user can paste the JSON format string obtained from any source. After clicking OK, the cloud label system will parse the imported JSON format string, separate some required fields, and then call the label template creation interface to create the label template, and store the label template information in the database, refresh the label template list page, the list page will display the created label template, and complete the import of the second label data corresponding to the target label template; and through intelligent judgment, if the current template is in a draft state and the template ID is not generated, the label template is created by calling the creation interface, the label template information is stored in the database, and the design page is refreshed to update the canvas content and other configuration information; if the current template has generated a template ID, the current label template information is updated by calling the update interface, the label template information is stored in the database, and the design page is refreshed, so that the information of the target label template is displayed in the canvas, and the target standard template is imported into the current list page and design page more accurately and intelligently, further improving the convenience of the import operation and improving the user experience.
[0021] Preferably, the method for quickly importing and exporting label templates on a web terminal of the present invention further includes the following steps:
[0022] Export the JSON format string or JSON formatted text file corresponding to the question label template from the cloud label system on the design side;
[0023] Send the JSON format string or JSON formatted text file to the development end cloud tag system through the communication device;
[0024] The JSON format string or JSON formatted text file is imported into the cloud tag system, and then the tag data corresponding to the question tag template is analyzed.
[0025] As a preferred solution of the present invention, in a cross-network situation, since the developer cannot access the business party's network and thus cannot access the development-side cloud label system deployed on the business party's server, through the above steps, the label designer can export the JSON format string or JSON formatted text file corresponding to the problem label template in the design-side cloud label system, and then send it to the cloud label system developer through the communication software. The cloud label system developer imports the JSON format string into the development-side cloud label system for testing, and then analyzes the problem label template, which is convenient for analyzing and locating the problem, and then quickly locates the problem corresponding to the label data of the problem label template, so that the problem label template can be corrected more accurately and efficiently, thereby improving the correction and design efficiency of the label template.
[0026] Preferably, the method for quickly importing and exporting label templates on a web side of the present invention, and the data flow of label templates, further comprises the following steps:
[0027] Export a JSON format string from a copy of the standard label template; import the JSON format string into the current label template design page, and then return the current label template to the state of the standard label template.
[0028] As a preferred solution of the present invention, under the same cloud label system, the standard label template is usually associated with the process flow or product printing template. The components of the standard label template cannot be deleted from the database. If the label standard template is edited back to its original state due to the label designer's erroneous operation, through this solution, a JSON format string can be quickly exported from a copy of the standard label template and then imported into the current label template design page to realize the label template being rolled back to its original state. Without allowing arbitrary changes to the database, the convenience of modifying the label template is further improved, thereby enhancing the convenience of use and development.
[0029] To achieve the purpose of the present invention, the present invention also provides a solution:
[0030] A cloud label system, which implements the above-mentioned method of quickly importing and exporting label templates on the web side, includes: a data configuration module, a data export module, a data import module, a label template creation module, a label template update module and a label page generation module;
[0031] The data configuration module is used to configure JSON data objects for label templates; the data export module is used to convert label data into JSON format strings; the data import module is used to call JSON.parse to convert JSON format strings into ordinary data objects; the label template creation module performs creation operations through the import interface; the label template update module is used to perform update operations; the label page generation template is used to display the label template in the canvas.
[0032] The cloud label system described in the present invention realizes the ability to quickly import and export label templates through the data configuration module combined with the data export module and the data import module, and has the ability to intelligently import label templates; the label data of the problem label template is imported into the cloud label system on the development side, and by comparing and analyzing it with the current label template, the problem of the problem label template can be quickly located, which is convenient for developers to quickly correct label template design defects and is more convenient to use; any label template can be used as a template base class, and a new label template can be obtained by making modifications to the template base class, thereby improving the flexibility of note template design.
[0033] To achieve the purpose of the present invention, the present invention also provides a solution:
[0034] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the method for quickly importing and exporting label templates on the web side.
[0035] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are:
[0036] 1. The method for quickly importing and exporting label templates on the Web side does not need to make a network request to load the content of the new label template when rendering the canvas. The JOSN formatted string contains all the data elements of the label template, reflecting the integrity of the data information. With the help of the import interface of the cloud label system, only a few necessary fields are needed to complete the creation and update of the label template. The export function of the label template is realized in conjunction with the Web cache or local file. Data flow runs through the entire process of importing and exporting label templates. It can quickly and intelligently import and export label templates, facilitate the transmission and parsing of label template data; and can provide developers with semantically clear label template data, optimize Web design methods, provide convenience for developers to design, modify and print labels, and improve user experience.
[0037] 2. The cloud label system, through the data configuration module combined with the data export module and the data import module, can quickly import and export label templates, and has the ability to intelligently import label templates; the label data of the problem label template is imported into the cloud label system on the development side, and by comparing and analyzing it with the current label template, the problem of the problem label template can be quickly located, which is convenient for developers to quickly correct label template design defects and is more convenient to use; any label template can be used as a template base class, and a new label template can be obtained by making modifications to the template base class, thereby improving the flexibility of note template design. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 It is a schematic diagram of the process of quickly exporting label templates on the Web side of the present invention;
[0039] Figure 2 It is a schematic diagram of the process of quickly importing label templates on the Web side of the present invention;
[0040] Figure 3 It is a schematic diagram of the JOSN formatted string of the present invention;
[0041] Figure 4 is a schematic diagram of template components and configuration information of the present invention;
[0042] Figure 5 It is a schematic diagram of module connection of the cloud tag system of the present invention;
[0043] Figure 6 It is a connection diagram of the internal scenario of the cloud tag system of the present invention;
[0044] Figure 7 It is a connection diagram of the cloud tag system of the present invention in a cross-network or cross-system scenario. DETAILED DESCRIPTION
[0045] The present invention will be described in detail below in conjunction with the accompanying drawings.
[0046] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0047] Embodiment 1:
[0048] refer to Figures 1 to 4 As shown, this embodiment discloses a method for quickly importing and exporting label templates on a web side, comprising the following steps:
[0049] Configure the JSON data object for the label template. When the data of the label template is transferred, the JSON data object is formatted into a JOSN formatted string. The JOSN formatted string includes: template component, configuration information, label type, label name, template size, group ID and group name;
[0050] Create or update a tag template using a JOSN formatted string, and store the JOSN formatted string corresponding to the created or updated tag template.
[0051] The data flow of the label template described in the present invention is understood as the flow of label data that occurs during the import and export process of the label template, specifically including the import and export of label data corresponding to the target label template, realizing the import or export of the label template in the cloud label system or between two cloud label systems. It should be noted that the JSON format string conversion of the data object in the present invention is implemented by calling JSON.stringify data object in the export operation; and is implemented by calling JSON.parse in the import operation; in the present invention, JSON is the abbreviation of JavaScript Object Notation in English, which is understood as a lightweight data exchange format that is easy for people to read and write, and is also easy for machines to parse and generate. It is based on a subset of JavaScript and is independent of the text format of the language; wherein JSON.stringify is understood as a JavaScript function used to convert a JavaScript value or object into a JSON string so that it can be stored, sent to a server or used in other ways.
[0052] Specifically, the export of label data of the present invention includes the following steps: determining whether the target label template exists on the list page or the design page; if the target label template exists on the list page, obtaining the label data stored in the database from the network interface according to the ID request of the target label template, and converting the label data into a JSON format string; if the target label template exists on the design page, the label data is real-time data in the form of a converted JSON format string.
[0053] Specifically, the import of label data of the present invention includes the following steps: pasting the JSON format string corresponding to the target label template into the text editing box, and judging whether the current label template exists on the list page or on the design page; if the current label template exists on the list page, calling JSON.parse, converting the JSON format string into a normal data object, and executing the creation operation of the template label template through the import interface; if the current label template exists on the design page and is in a draft state, overwriting the canvas content of the current label template through the import interface, and executing the creation operation of the label template; if the current label template exists on the design page, executing the update operation of the label template through the import interface; it should be noted that JSON.parse is understood as a JavaScript function for converting a JSON string into a JavaScript object, which allows string data in JSON format received from a file, server or other source to be converted into an object that can be operated in JavaScript.
[0054] It should be noted that the reference Figure 3 and Figure 4As shown, the JSON format string described in the present invention contains all the elements of the label template data, which, as an information carrier, runs through the entire process of label template import and export; the present invention uses JSON data objects instead of XML or other languages as label template data, and JSON data occupies a small volume, is easy to transmit, convenient to parse, and has clear semantics. The complete label template data includes the following fields: labelContent, labelType, labelName, pageSize, labelSize, tagId, and tagName; wherein, the labelContent field is a core field, indicating the content of the label template, and this field cannot be empty. It is an object and contains two core fields, components and page, wherein the components field represents all label template components rendered in the canvas, such as elements, and page is the configuration information of the entire label template; wherein, the labelType field is the largest classification of the label template, the labelName field is the name of the label template, the pageSize field is the paper size, labelSize is the template size, tagId is the template group id, and tagName is the template group name, and these fields are also optional fields.
[0055] More specifically, the two core fields of labelContent of the present invention are components and page, where components is a component list, including all components in a single label template, for example, barcode components, QR code components, fixed text components, dynamic text or data text components, picture components, table components, etc., because different label templates are obtained by different component combinations; these components can be rendered in the canvas to facilitate further design or modification; wherein, page is the configuration information of the label template, including fields such as paper width, paper height, paper direction, label width, label height, label printing direction, number of label rows, number of label columns, etc.
[0056] Specifically, the method for quickly importing and exporting label templates on the web side described in the present invention also includes the following steps: exporting a JSON format string or a JSON formatted text file corresponding to the problem label template from the design side cloud label system; sending the JSON format string or the JSON formatted text file to the development side cloud label system through a communication device; importing the JSON format string or the JSON formatted text file in the cloud label system, and then analyzing the label data corresponding to the problem label template.
[0057] Specifically, in the present invention, the data flow of the label template also includes the following steps: exporting a JSON format string from a copy of the standard label template; importing the JSON format string into the current label template design page, and then returning the current label template to the state of the standard label template.
[0058] Embodiment 2:
[0059] Based on Example 1, the cloud tag system disclosed in this embodiment implements the method for quickly importing and exporting tag templates on the web side described in Example 1, referring to Figures 5 to 7 As shown, it includes: a data configuration module, a data export module, a data import module, a label template creation module, a label template update module and a label page generation module;
[0060] The data configuration module is used to configure JSON data objects for label templates; the data export module is used to convert label data into JSON format strings; the data import module is used to call JSON.parse to convert JSON format strings into ordinary data objects; the label template creation module performs creation operations through the import interface; the label template update module is used to perform update operations; the label page generation template is used to display the label template in the canvas.
[0061] In the present invention, reference Figure 6 As shown, in the same cloud label system, label templates can be imported and exported to each other. Assuming that a label designer is modifying a template that has been associated with a process flow or product printing, the label template cannot be deleted from the database. If some mistakes made by the label designer cause the label template to be unable to roll back to its original state, based on the existing copy of the standard label template, a JSON object format string can be quickly exported from the standard label template, and then quickly imported into the design page of the current label template, so that the label template can roll back to the original state of the standard label template.
[0062] In the present invention, reference Figure 7 As shown, in a cross-network situation, the cloud label system developer cannot access the business party network, and cannot access the development-side cloud label system deployed on the business party server. At this time, the business party's label designer can export the JSON object format string in the design-side cloud label system, or export it as a text file. The text content is the JSON format label template data, and then send it to the developer of the development-side cloud label system through the communication software. The developer imports the JSON object format string into the test cloud label system to analyze and locate the problem in the problem label template. The A label template is understood as the problem label template, and the B label template is understood as the current label template generated after importing the label data corresponding to the problem label template.
[0063] Embodiment 3:
[0064] On the basis of Example 1, this embodiment discloses a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method of quickly importing and exporting label templates on the web side of Example 1 is implemented.
[0065] It has been verified in practice that the technology of this patent application is mature and has been used in multiple business system implementation projects. It has good stability, real-time and fast efficiency, and can greatly improve work efficiency.
[0066] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for quickly importing and exporting label templates on a web terminal, characterized in that: The following steps are involved: The tag template is configured with a JSON data object, and when the data of the tag template is circulated, the JSON data object is formatted into a JOSN formatted string, wherein the JOSN formatted string includes: template components, configuration information, tag type, tag name, template size, group ID, and group name; The label template is created or updated using the JOSN formatted string, and the JOSN formatted string corresponding to the created or updated label template is stored.
2. The method for quickly importing and exporting label templates on a web terminal according to claim 1, characterized in that: The data flow of the label template specifically includes the import and export of label data corresponding to the target label template; the export of label data includes the following steps: Determine whether the target tag template exists on the list page or the design page; If the target label template exists on the list page, the label data stored in the database is obtained from the network interface according to the ID request of the target label template, and the label data is converted into a JSON format string; If the target label template exists on the design page, the label data is the real-time data in the converted JSON format string.
3. The method for quickly importing and exporting label templates on a web terminal according to claim 2, characterized in that: Importing label data includes the following steps: Paste the JSON format string corresponding to the target label template into the text editing box to determine whether the current label template exists on the list page or on the design page; If the current tag template exists on the list page, call JSON.parse to convert the JSON format string into a normal data object, and create the template tag template through the import interface; If the current label template exists on the design page and is in draft state, the canvas content of the current label template is overwritten through the import interface, and the label template creation operation is performed; if the current label template exists on the design page, the label template update operation is performed through the import interface.
4. The method for quickly importing and exporting label templates on a web terminal according to any one of claims 1 to 3, characterized in that: The following steps are also included: Export the JSON format string or JSON formatted text file corresponding to the question label template from the cloud label system on the design side; Send the JSON format string or JSON formatted text file to the development end cloud tag system through the communication device; The JSON format string or JSON formatted text file is imported into the cloud tag system, and then the tag data corresponding to the question tag template is analyzed.
5. The method for quickly importing and exporting label templates on a web terminal according to claim 1, characterized in that: The data flow of the label template also includes the following steps: Export a JSON format string from a copy of the standard label template; import the JSON format string into the current label template design page, and then return the current label template to the state of the standard label template.
6. Cloud tag system, characterized in that: A method for quickly importing and exporting label templates on a web terminal as described in any one of claims 1 to 5, comprising: a data configuration module, a data export module, a data import module, a label template creation module, a label template update module and a label page generation module; The data configuration module is used to configure JSON data objects for label templates; the data export module is used to convert label data into JSON format strings; the data import module is used to call JSON.parse to convert JSON format strings into ordinary data objects; the label template creation module performs creation operations through the import interface; the label template update module is used to perform update operations; the label page generation template is used to display the label template in the canvas.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for quickly importing and exporting label templates on the web side as described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Management method and system for template labels
CN106469063A