Metadata model-based form printing method, equipment and medium

Through the form printing method based on the metadata model, the problem of time-consuming and uncertain effects of traditional manual design printing formats is solved, and simplified operations, improved efficiency and consistent printing effects are achieved.

CN120045147APending Publication Date: 2025-05-27INSPUR GENERSOFT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510218976.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-26
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

When designing document printing functions, traditional methods require developers to manually drag and drop the printing button to the form interface and customize the printing format through professional designers. The process is time-consuming and the effect is uncertain, making it difficult to achieve the optimal design.

Method used

The form printing method based on the metadata model is adopted, the form is determined through drag and drop operations and the server request is initiated, the printing parameters are determined according to the request, the mapping relationship between the traversal view object and the form is analyzed, the printing format is generated and printing is performed.

Benefits of technology

It simplifies user operations, improves usage flexibility, reduces manual intervention, improves processing efficiency, ensures consistency between form data and print output, and improves the readability and information presentation effect of print output.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120045147A_ABST
    Figure CN120045147A_ABST
Patent Text Reader

Abstract

The invention discloses a form printing method and device based on a metadata model and a medium, and the method comprises the steps: determining a specified form through a dragging operation, thereby initiating a server-side request, and determining printing parameters according to the server-side request, the printing parameters comprising data source configuration, a form ID and a printing report; performing analysis traversal according to a server request to determine a mapping relationship between the view object and the form; and generating a printing format according to the mapping relation, and printing the form according to the printing format. The form is selected through the dragging operation, so that the user operation is simplified, and the use flexibility is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a form printing method, device, and medium based on a metadata model. Background Art

[0002] As an ideal platform for implementing OA office-related business scenarios, the zero-code platform enables users to quickly develop forms that meet business needs and configure corresponding approval processes. These forms can be easily published to the process center, allowing all users to easily fill out forms and initiate processes in "My Initiate", greatly improving work efficiency.

[0003] In real-world business scenarios, when designing document printing functionality, the traditional approach requires developers to drag a print button onto the form interface, enter the print settings, and manually customize the print format using a professional print designer. This process often relies on specialized developers and is not user-friendly for business personnel. Especially when a form has numerous fields, manually designing the print format is not only time-consuming but also requires careful consideration of field formats and the layout of primary and sub-table fields. This leads to uncertainty in implementation results and makes it difficult to achieve an optimal design. Summary of the Invention

[0004] In order to solve the above problems, the present application proposes a form printing method based on a metadata model, including: determining the specified form through a drag operation, thereby initiating a server request, and determining printing parameters according to the server request, wherein the printing parameters include data source configuration, form ID, and print report; parsing and traversing according to the server request to determine the mapping relationship between the view object and the form; generating a print format according to the mapping relationship, so as to print the form according to the print format.

[0005] In one example, the method further includes: searching according to the form ID to determine the corresponding form model, recursively traversing the form model to determine the component DOM structure; determining a tree data structure according to the component DOM structure, determining multiple child nodes of the tree data structure, and determining multiple form fields corresponding to the multiple child nodes.

[0006] In one example, after determining the mapping relationship between the view object and the form, the method further includes: determining form metadata in the form field, determining view object metadata based on the mapping relationship of the form metadata, and determining the field ID corresponding to the view object metadata; adding the field ID to a preset view object field set, and obtaining print data in the view object field set through a preset call service.

[0007] In one example, the method further includes: performing field filtering according to the view object field set to determine a data source data structure, thereby obtaining fields containing form metadata.

[0008] In one example, the method further includes: determining a pre-set printing object and initializing the printing object; determining an object instance through the printing object to store form content through the object instance, wherein the form content includes field name, data source, and display format.

[0009] In one example, the method further includes: determining a pre-set display object, traversing all fields of the form through the display object, and determining corresponding sub-display objects based on the fields to display the contents of the fields through the sub-display objects; and adding the sub-display objects to the display object according to the order of the fields to integrate the form.

[0010] In one example, the server request includes a request type and request content; the request content includes a request object, an attribute name, and an attribute description.

[0011] In one example, before determining the printing parameters according to the server request, the method further includes: responding to the server request to obtain a response type and response content, wherein the response content includes a return value type, object attributes, and attribute description.

[0012] On the other hand, the present application also proposes a form printing device based on a metadata model, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the form printing device based on the metadata model to execute: determining a specified form through a drag operation, thereby initiating a server request, and determining printing parameters according to the server request, the printing parameters including data source configuration, form ID, and print report; parsing and traversing according to the server request to determine the mapping relationship between the view object and the form; generating a print format according to the mapping relationship, so as to print the form according to the print format.

[0013] On the other hand, the present application also proposes a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured to: determine a specified form through a drag operation, thereby initiating a server request, and determine printing parameters according to the server request, wherein the printing parameters include data source configuration, form ID, and print report; perform parsing and traversal according to the server request to determine a mapping relationship between a view object and the form; generate a print format according to the mapping relationship, and print the form according to the print format.

[0014] This application uses drag-and-drop operations to select forms, which simplifies user operations and improves usage flexibility. At the same time, it supports dynamic determination of printing parameters based on server requests, making printing configuration more flexible and changeable. This application automatically parses and traverses to determine the mapping relationship between view objects and forms, reducing manual intervention and improving processing efficiency. Recursively traverse the form model to determine the component DOM structure, further simplifying the identification and processing process of form fields. The print format is generated through the mapping relationship, ensuring the consistency between form data and print output. At the same time, it supports filtering and integration of form fields, improving the readability and information presentation of the print output. It supports pre-setting and initialization of print objects, display objects, etc., which facilitates subsequent expansion and maintenance. At the same time, storing form content through object instances makes data management and updating more efficient. The clear division of server requests and responses in this application makes the entire processing flow clearer and more controllable. The detailed definition of request type and content, as well as the clear return of response type and content, improve the stability and reliability of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0016] Figure 1 This is a flowchart of a form printing method based on a metadata model in an embodiment of the present application;

[0017] Figure 2 This is a schematic diagram of a form printing device based on a metadata model in an embodiment of the present application. DETAILED DESCRIPTION

[0018] To make the purpose, technical solutions, and advantages of this application more clear, the technical solutions of this application will be clearly and completely described below in conjunction with the specific embodiments of this application and the corresponding drawings. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0019] The following describes in detail the technical solutions provided by various embodiments of the present application in conjunction with the accompanying drawings.

[0020] like Figure 1 As shown, in order to solve the above problems, an embodiment of the present application provides a form printing method based on a metadata model, which is applied in a form printing system based on a metadata model. The method includes:

[0021] S101 , determining a designated form through a dragging operation, thereby initiating a server request, and determining printing parameters according to the server request, the printing parameters including data source configuration, form ID, and print report.

[0022] When the developer drags and drops the Print button onto the form interface, the system automatically triggers a server-side request. This request encapsulates all the necessary parameters for executing the print job, including the base data source configuration (BaseSourceOption) in a unified view object format, a specific form ID, and detailed print report (PrintReport) settings. During the report printing preparation phase, the system first sets print-related properties such as the report title, paper size, and margins. The system then uses the form ID as a search key to locate the corresponding form data model. Next, the system performs a depth-first recursive traversal of the component DOM structure within the form data model. This traversal aims to construct a tree-like data structure, where each root node of the tree structure represents a container within the form, and the child nodes of a container correspond to all form fields contained within that container. This tree structure not only clearly represents the form's hierarchical structure but also greatly facilitates subsequent data processing and print layout optimization. Each form field's data structure includes key attributes such as the schema ID and field name, which uniquely identify the form metadata field.

[0023] S102: Perform parsing and traversal according to the server request to determine the mapping relationship between the view object and the form.

[0024] By mapping form metadata to view object metadata, the system can locate the view object metadata corresponding to the form. Next, using the key information extracted from the form fields, the system searches for matching fields in the view object and adds the found view object field IDs to a collection. This collection stores the mapping between the form field schemaID and the corresponding view object field ID. The system then retrieves the interface data for the print data structure (PrintDataSchemaView) from the print format designer by calling the getPrintSchemaViewBySource method of the PrintService.

[0025] Because not all fields in the print data source data structure may exist in the form metadata, it is necessary to filter the fields in the print data source data structure based on the field set extracted from the view object. This step is achieved by calling the getNewPrintSchemaById method of the print service, which generates the final data source data structure for printing based on the filtering results.

[0026] S103: Generate a printing format according to the mapping relationship, and print the form according to the printing format.

[0027] When organizing print data source data structures into printed reports, a structured organization strategy is crucial for effectively mapping complex data source structures to printed report generation. This process first requires a deep understanding of the data source structure, specifically the ability to clearly distinguish the hierarchical relationships between master and sub-tables, as well as their respective content structures. Subsequently, a series of customizable print objects are created to progressively encapsulate and present these data structures, ensuring accurate report content and a reasonable layout.

[0028] In one embodiment, when organizing and encapsulating the main table content, a PrintContentCard object is initialized to serve as a framework or basic container for the entire printed report body content.

[0029] Within PrintContentCard, create a PrintCardInnerCard instance specifically for carrying and organizing the data content of the main table. Objects at this level are designed to simulate the visual layout of a card-style report.

[0030] For each field in the master table, a PrintCardCol object is created. These objects are responsible for carrying and displaying all relevant information about a single field, including the field name, data source (mapped to the corresponding field in the data source structure), and display format (such as field size and type), to ensure accurate organization and clear display of field content.

[0031] Add all PrintCardCol objects to PrintCardInnerCard in a logical order to build a complete main table content layout.

[0032] In one embodiment, when organizing and integrating sub-table contents, a PrintCardInnerTable object is created for each sub-table in the data source as an independent container for displaying the sub-table contents. This object is designed to clearly distinguish and display sub-table data while maintaining the hierarchical relationship of the data.

[0033] Traverse each field of the child table and create a PrintContentCol object for each field. These objects are dedicated to organizing and displaying the specific content of the child table fields to ensure data consistency and readability.

[0034] According to the definition order of the sub-table fields, all PrintContentCol objects are added to the corresponding PrintCardInnerTable, thereby constructing a complete view of the sub-table content.

[0035] Finally, each PrintCardInnerTable object is integrated into PrintContentCard to achieve full integration and unified display of the main table and sub-table contents in the printed report.

[0036] This application achieves accurate mapping and efficient organization from complex data source structures to intuitive and orderly printed report content. This hierarchical and modular design strategy not only significantly improves the flexibility and maintainability of report generation, but also ensures the accurate presentation and efficient use of report content. It greatly simplifies the process of manually designing print formats and avoids the repetitive labor of manual configuration, thereby significantly improving development efficiency and reducing labor costs. At the same time, because the automatically generated print format can accurately reflect the business needs and display intent of the form, it also effectively guarantees the quality and accuracy of the printed output, providing users with a more convenient, efficient and professional data output solution.

[0037] In one embodiment, user interface interactions, such as dragging, trigger a process designed to save a specific print format configuration to the server. This process involves data exchange between the front-end and back-end: the front-end captures user actions and constructs a request based on them, while the back-end processes the print format configuration information contained in the request and provides feedback on the results.

[0038] In one embodiment, the request includes request initiation, request response, a tree data structure extracted from the form metadata through recursive traversal, and determination of the form field information data. The trigger condition for the request initiation is that the user drags and drops the print button to the selected button area of ​​the form and clicks the OK button. This action will serve as a trigger condition. The request type uses an HTTP POST request. The request body contains a SavePrintFormatReq object encoded in JSON format. This object encapsulates the key information required to save the print format, including: BaseSourceOption represents the basic data source configuration; formID is the unique identifier of the form, which is used to associate the print format with a specific form metadata instance; PrintReport defines the relevant content of the printed report, covering detailed information such as the report layout, style, and data source mapping. The request parameter data structure is shown in Table 1.

[0039] Table 1 Request parameter data structure

[0040]

[0041] The response type is an HTTP response, typically containing a status code and a response body. The response content is a RestMessage object encoded in JSON format, used to convey the operation results to the client. The corresponding response parameter data structure is shown in Table 2.

[0042] Table 2 Response corresponding parameter data structure

[0043]

[0044]

[0045] The tree data structure extracted from the form metadata through recursive traversal is shown in Table 3.

[0046] Table 3 Tree data structure extracted from form metadata through recursive traversal

[0047]

[0048] The data structure of form field information is shown in Table 4.

[0049] Table 4 Form field information data structure

[0050]

[0051] like Figure 2 As shown, the embodiment of the present application further provides a form printing device based on a metadata model, including:

[0052] at least one processor; and,

[0053] a memory communicatively connected to at least one processor; wherein,

[0054] The memory stores instructions that can be executed by at least one processor, and the instructions are executed by the at least one processor to enable a form printing device based on a metadata model to perform:

[0055] Determine the specified form by dragging and dropping, thereby initiating a server request, and determining printing parameters based on the server request, the printing parameters including data source configuration, form ID, and print report;

[0056] Parsing and traversing the server request to determine the mapping relationship between the view object and the form;

[0057] A printing format is generated according to the mapping relationship, so as to print the form according to the printing format.

[0058] The embodiment of the present application further provides a non-volatile computer storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured as follows:

[0059] Determine the specified form by dragging and dropping, thereby initiating a server request, and determining printing parameters based on the server request, the printing parameters including data source configuration, form ID, and print report;

[0060] Parsing and traversing the server request to determine the mapping relationship between the view object and the form;

[0061] A printing format is generated according to the mapping relationship, so as to print the form according to the printing format.

[0062] In the 1990s, technological improvements could be clearly distinguished as either hardware improvements (for example, improvements to circuit structures like diodes, transistors, and switches) or software improvements (improvements to process flows). However, with the advancement of technology, many process flow improvements today can now be considered direct improvements to hardware circuit structures. Designers almost always create the corresponding hardware circuit structure by programming the improved process flow into the hardware circuit. Therefore, it cannot be said that a process flow improvement cannot be implemented using hardware modules. For example, a programmable logic device (PLD), such as a field programmable gate array (FPGA), is an integrated circuit whose logical function is determined by user programming. Designers can "integrate" a digital system on a PLD through their own programming, without having to hire a chip manufacturer to design and manufacture a dedicated integrated circuit chip. Moreover, nowadays, instead of manually fabricating integrated circuit chips, this programming is mostly done using "logic compiler" software. This is similar to the software compiler used when developing programs. Before compilation, the original code must also be written in a specific programming language, called a hardware description language (HDL). There is not just one HDL, but many, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art will also understand that by simply programming the method flow in one of these hardware description languages ​​and then programming it into an integrated circuit, a hardware circuit that implements the logic method flow can be easily obtained.

[0063] The controller can be implemented in any suitable manner. For example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also know that in addition to implementing the controller in a purely computer-readable program code format, the controller can be implemented in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, such a controller can be considered a hardware component, and the devices included therein for implementing various functions can also be considered as structures within the hardware component. Or even, the devices for implementing various functions can be considered as both software modules that implement the method and structures within the hardware component.

[0064] The systems, devices, modules, or units described in the above embodiments may be implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0065] For the convenience of description, the above devices are described as being divided into various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0066] The various embodiments in this application are described in a progressive manner. Similar portions between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the device and medium embodiments are generally similar to the method embodiments, so their descriptions are relatively simple. For relevant portions, refer to the descriptions of the method embodiments.

[0067] The devices and media provided in the embodiments of the present application correspond one-to-one to the methods. Therefore, the devices and media also have similar beneficial technical effects to their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.

[0068] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0069] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0070] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0071] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0072] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0073] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0074] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0075] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.

[0076] The above are merely embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.

Claims

1. A form printing method based on a metadata model, characterized in that: include: Determine the specified form by dragging and dropping, thereby initiating a server request, and determine the printing parameters according to the server request, the printing parameters including data source configuration, form ID, and print report; Perform parsing and traversal according to the server request to determine the mapping relationship between the view object and the form; A printing format is generated according to the mapping relationship, so as to print the form according to the printing format.

2. The method according to claim 1, characterized in that The method further comprises: Retrieve according to the form ID to determine the corresponding form model, and recursively traverse the form model to determine the component DOM structure; A tree data structure is determined according to the component DOM structure, a plurality of child nodes of the tree data structure are determined, and a plurality of form fields corresponding to the plurality of child nodes are determined.

3. The method according to claim 2, characterized in that After determining the mapping relationship between the view object and the form, the method further includes: Determine the form metadata in the form field, determine the view object metadata according to the mapping relationship of the form metadata, and determine the field ID corresponding to the view object metadata; The field ID is added to a preset view object field set, and print data is obtained from the view object field set through a preset call service.

4. The method according to claim 1, characterized in that: The method further comprises: Field filtering is performed according to the view object field set to determine the data source data structure, thereby obtaining fields containing form metadata.

5. The method according to claim 1, characterized in that The method further comprises: Determine a preset printing object and initialize the printing object; An object instance is determined through the print object to store form content through the object instance, wherein the form content includes field name, data source, and display format.

6. The method according to claim 1, characterized in that The method further comprises: Determine a preset display object, traverse all fields of the form through the display object, and determine a corresponding sub-display object according to the field, so as to display the content of the field through the sub-display object; The sub-display objects are added to the display object according to the order of the fields to integrate the form.

7. The method according to claim 1, characterized in that The server request includes a request type and a request content; The request content includes a request object, an attribute name, and an attribute description.

8. The method according to claim 1, characterized in that Before determining the printing parameters according to the server request, the method further includes: Respond to the server request to obtain a response type and response content, wherein the response content includes a return value type, object attributes, and attribute description.

9. A form printing device based on a metadata model, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the form printing device based on the metadata model to execute: Determine the specified form by dragging and dropping, thereby initiating a server request, and determine the printing parameters according to the server request, the printing parameters including data source configuration, form ID, and print report; Perform parsing and traversal according to the server request to determine the mapping relationship between the view object and the form; A printing format is generated according to the mapping relationship, so as to print the form according to the printing format.

10. A non-volatile computer storage medium storing computer executable instructions, characterized in that: The computer executable instructions are configured to: Determine the specified form by dragging and dropping, thereby initiating a server request, and determine the printing parameters according to the server request, the printing parameters including data source configuration, form ID, and print report; Perform parsing and traversal according to the server request to determine the mapping relationship between the view object and the form; A printing format is generated according to the mapping relationship, so as to print the form according to the printing format.