Electronic certificate layout file generation method and system

By combining the technology of MapReduce and Tinymce plug-in, multiple problems of the NTKO plug-in when generating electronic proof documents are solved, and fast, stable and efficient electronic proof documents are achieved, which significantly improves user experience and system performance.

CN120123015APending Publication Date: 2025-06-10INSPUR SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510266053.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-07
Publication Date
2025-06-10

AI Technical Summary

Technical Problem

The existing NTKO plug-in has problems in template file storage, browser compatibility issues, slow loading speed, poor stability and slow generation speed when generating electronic certificate files, which is difficult to meet the needs of fast synthesis of large batches of proof files.

Method used

Using the combination technology of MapReduce and Tinymce plug-in, through task program configuration and execution, the Tinymce template renderer is used to generate an electronic proof layout file in HTML format, and convert it into PDF format through the WkHtmlToPdf plug-in and save it to the database to achieve rapid generation and storage.

Benefits of technology

It improves the speed and stability of electronic proof files generation, loading speed is less than 1 second, is compatible with more browsers, supports the rapid synthesis of large batches of files, significantly improving user experience and system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120123015A_ABST
    Figure CN120123015A_ABST
Patent Text Reader

Abstract

The invention discloses an electronic certificate layout file generation method and system, belongs to the technical field of software application, and aims to solve the technical problem of how to quickly generate a certificate file based on a Tinymce plug-in. Comprising the steps that generation of each type of electronic certificate layout file serves as a task, a program of each task is constructed based on a predefined electronic certificate layout file generation process, and the programs of all the tasks are fused to a MapReduce multi-task processing program; for multiple types of electronic certificate layout files to be generated, related template data, metadata and exposure data of each type of electronic certificate layout file serve as input data, and a MapReduce multitask processing program is executed to generate each type of electronic certificate layout file, each piece of input data is marked with a mark corresponding to the electronic certificate layout file type.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software applications, and more particularly to an electronic proof layout file generation system and method. Background Art

[0002] Currently, electronic proofs mainly rely on the NTKO plugin to synthesize proof files. The NTKO plugin has strong functionality and can establish a rich template library to complete the creation of proof templates with rich styles. However, there are the following problems:

[0003] 1. Storage problem of template files: The NTKO template file is a word format file, and the template file is relatively large. Storage tools such as mongdb are required to complete the storage of template data. When the storage tool has problems initially, there may be a risk of losing electronic proof templates;

[0004] 2. Browser compatibility problem: Generating electronic proofs relying on the NTKO plugin has certain restrictions on browsers. Currently, the browsers that can be used normally are low - version Firefox, IE, and 360 compatible mode browsers. And after installing the plugin, there is a certain probability that the browser cannot detect the NTKO plugin, and it needs to be installed multiple times to solve, greatly reducing the user experience;

[0005] 3. Loading speed problem: The NTKO plugin has a relatively slow loading speed in the browser and is prone to problems such as page freezing. In addition, the page may crash after the plugin is successfully loaded. Due to the high integration of the plugin, it is difficult to troubleshoot problems, and it may only be possible to refresh the page to solve;

[0006] 4. The stability of the NTKO plugin for synthesizing proof files is average, and it is prone to crashing when generating no proofs, resulting in the failure of proof file synthesis;

[0007] 5. The speed of the NTKO plugin for synthesizing proof files is relatively slow, and it may not be able to meet the rapid synthesis of a large number of proof files.

[0008] The Tinymce plugin is based on HTML programming language to complete the storage and editing of lightweight data. The electronic proof template based on HTML language is easy to troubleshoot problems. In addition, HTML is easy for data storage and can be directly stored in the large fields of the database (such as the CLOB type of Oracle). After the data is read, it is rendered and displayed to the user by the Tinymce plugin, with a faster loading speed and being simple and clear.

[0009] How to quickly generate proof files based on the Tinymce plugin is a technical problem to be solved. Summary of the Invention

[0010] The technical task of the present invention is to address the above deficiencies and provide a method and system for generating electronic proof layout files to solve the technical problem of how to quickly generate proof files based on the Tinymce plugin.

[0011] In the first aspect, a method for generating an electronic proof layout file according to the present invention quickly generates an electronic proof layout file based on MapReduce and the Tinymce plugin, including the following steps:

[0012] Task program configuration: Regarding the generation of each type of electronic proof layout file as a task, constructing the program for each task based on a predefined electronic proof layout file generation process, and integrating the programs of each task into a MapReduce multi-task processing program;

[0013] Task program execution: For multiple types of electronic proof layout files to be generated, using the template data, metadata, and face data related to each type of electronic proof layout file as input data, and executing the MapReduce multi-task processing program to generate each type of electronic proof layout file, where each piece of input data is marked with the tag corresponding to the type of electronic proof layout file;

[0014] The electronic proof layout file generation process includes the following operations:

[0015] Judge whether the electronic proof layout file to be generated is a new type. If so, call the Tinymce template design program to load the electronic proof file template of the corresponding type, and configure the template data, metadata, and face data. If not, load the electronic proof file template of the corresponding type from the database;

[0016] Fill the information corresponding to the corresponding lighting data into the electronic proof file template through the Tinymce template renderer to obtain an HTML-format electronic proof layout file;

[0017] Convert the HTML-format electronic proof layout file into a PDF-format electronic proof layout file through the WkHtmlToPdf plugin, and save the PDF-format electronic proof layout file to the database.

[0018] Preferably, when filling the information corresponding to the corresponding lighting data into the electronic proof file template through the Tinymce template renderer, obtain the information of the corresponding face data from the data source based on the metadata and lighting data. The information of the face data in the data source exists in a structured form, and the information of the face data in the electronic proof file template exists in HTML form. Replace the information of the face data in HTML form in the electronic proof file template with the information of the face data in structured form in the data source through the Tinymce template renderer to obtain an HTML-format electronic proof layout file.

[0019] Preferably, the task program execution includes the following steps:

[0020] Data preparation: Obtain template data, metadata, and face data related to the electronic proof file template. For each of the template data, metadata, and face data, each piece of data contains the type code of the corresponding electronic proof layout file. Mark each piece of data according to the type of the electronic proof layout file, divide all the template data, metadata, and face data into multiple data slices, and store the data slices in the distributed file system. Each data slice includes the template data, metadata, and face data of multiple types of electronic proof layout files.

[0021] Map task processing: Dynamically allocate Map tasks based on the number of data slices and the number of type codes. Each Map task is responsible for processing one data slice. The Map task reads the allocated data slice from the distributed file system, and regards each type of electronic proof layout data file in the data slice as a record.

[0022] For each record, the Map task processes it according to the predefined program logic, disassembles the template data and extracts the metadata and face data, and encapsulates the processing result into a key-value pair. The key is the type code, and the value is the corresponding electronic proof layout file. The content of the value includes the metadata and face data.

[0023] Reduce task processing: The Reduce task classifies and reorganizes the key-value pairs, allocates Reduce tasks according to the number of proof type codes, and each Reduce task processes one proof type. The Reduce task pulls the allocated key-value pairs. For each key, classify and reorganize the corresponding values to obtain the electronic proof layout files of the corresponding proof type, and store the electronic proof layout files of each type.

[0024] Preferably, when the task program is executed, the generated electronic proof layout files of each type are stored in mongdb, and the indexes of the electronic proof layout files of each type are returned. The indexes of the electronic proof layout files of each type are stored in the database, and the temporary files generated during the execution of the task program are deleted.

[0025] In a second aspect, an electronic proof layout file generation system of the present invention is used to generate an electronic proof layout file by using an electronic proof layout file generation method according to any one of the first aspects, and includes a task program configuration module and a task program execution module.

[0026] The task program configuration module is used to perform the following: taking the generation of each type of electronic certificate layout file as a task, constructing the program for each task based on the predefined electronic certificate layout file generation process, and integrating the programs of each task into the MapReduce multi-task processing program;

[0027] The task program execution module is used to perform the following: for multiple types of electronic certificate layout files to be generated, taking the template data, metadata, and face data related to each type of electronic certificate layout file as input data, and executing the MapReduce multi-task processing program to generate each type of electronic certificate layout file, where each piece of input data is marked with the tag of its corresponding electronic certificate layout file type;

[0028] The electronic certificate layout file generation process includes the following operations:

[0029] Judge whether the electronic certificate layout file to be generated is a new type. If so, call the Tinymce template design program to load the electronic certificate file template of the corresponding type, and configure the template data, metadata, and face data. If not, load the electronic certificate file template of the corresponding type from the database;

[0030] Fill the information corresponding to the corresponding lighting data into the electronic certificate file template through the Tinymce template renderer to obtain the electronic certificate layout file in HTML format;

[0031] Convert the electronic certificate layout file in HTML format to the electronic certificate layout file in PDF format through the WkHtmlToPdf plug-in, and save the electronic certificate layout file in PDF format to the database.

[0032] Preferably, when filling the information corresponding to the corresponding lighting data into the electronic certificate file template through the Tinymce template renderer, obtain the information of the corresponding face data from the data source based on the metadata and lighting data. The information of the face data in the data source exists in a structured form, and the information of the face data in the electronic certificate file template exists in HTML form. Replace the information of the face data in HTML form in the electronic certificate file template with the information of the face data in structured form in the data source through the Tinymce template renderer to obtain the electronic certificate layout file in HTML format.

[0033] Preferably, based on the MapReduce multi-task processing program, the task program execution module is used to perform the following operations:

[0034] Data Preparation: Obtain the template data, metadata, and face data related to the electronic certificate file template. For each piece of template data, metadata, and face data, each piece of data contains the type code of the corresponding electronic certificate layout file. Mark each piece of data according to the type of the electronic certificate layout file, divide all the template data, metadata, and face data into multiple data slices, and store the data slices in a distributed file system. Each data slice includes the template data, metadata, and face data of multiple types of electronic certificate layout files;

[0035] Map Task Processing: Dynamically allocate Map tasks based on the number of data slices and the number of type codes. Each Map task is responsible for processing one data slice. The Map task reads the allocated data slice from the distributed file system, and regards each type of electronic certificate layout data file in the data slice as a record.

[0036] For each record, the Map task processes it according to the predefined program logic, disassembles the template data and extracts the metadata and face data, and encapsulates the processing result into a key-value pair. The key is the type code, and the value is the corresponding electronic certificate layout file, and the content of the value includes the metadata and face data;

[0037] Reduce Task Processing: The Reduce task classifies and reorganizes the key-value pairs, allocates Reduce tasks according to the number of proof type codes, and each Reduce task processes one proof type. The Reduce task pulls the allocated key-value pairs. For each key, classify and reorganize the corresponding values to obtain the electronic certificate layout files of the corresponding proof type, and store the electronic certificate layout files of each type.

[0038] Preferably, the task program execution module is used to store the generated electronic certificate layout files of each type in mongdb, return the indexes of the electronic certificate layout files of each type, store the indexes of the electronic certificate layout files of each type in the database, and delete the temporary files generated during the execution of the task program.

[0039] The electronic certificate layout file generation system and method of the present invention have the following advantages:

[0040] 1. The proof generation method based on the Tinymce technology process reengineering can modify the source code of the Tinymce plugin according to the user's template requirements and customize the electronic certificate template by combining the wkhtmltopdf plugin parameters to complete the real-time generation of specific proof files;

[0041] 2. The template established based on Tinymce technology features fast and stable loading speed. For the electronic proof templates established by traditional NTKO, file loading may fail due to template data loss or browser compatibility issues. Moreover, the file loading speed of large templates is over 2 seconds. Thanks to the powerful parsing ability of the Tinymce plugin for HTML language, the loading speed of the electronic proof file templates established by this method is basically less than 1 second, greatly improving the user experience of the system.

[0042] 3. Using the Tinymce plugin can basically be compatible with the format of word. The Tinymce plugin can quickly copy text content from word and retain the word format, ensuring that the font format, line spacing, and paragraph layout remain unchanged, greatly reducing the time cost for users to create proof templates.

[0043] 4. For the generation of a large number of electronic proofs, utilize the parallel processing ability of MapReduce to quickly complete data conversion tasks.

[0044] 5. Compared with the electronic proof templates established by NTKO, the electronic proof templates established by this method are compatible with more browsers and have a wider range of applications. NTKO only supports browsers such as IE and 360 browsers, greatly limiting the choice of user clients. The electronic proof templates established by the method studied in this paper can be used normally in IE browsers, Firefox, Google, and 360 browsers, greatly facilitating user use.

[0045] 6. This method supports real-time updating of template data according to the actual application specifications of electronic proofs to meet relevant proof specification standards. For a certain fixed electronic proof, it can be stably stored and used. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0047] The present invention will be further described below with reference to the drawings.

[0048] Figure 1 FIG. is a flowchart of the generation process of an electronic proof layout file in an electronic proof layout file generation method for Embodiment 1;

[0049] Figure 2 FIG. is the data flow of the MapReduce job in an electronic proof layout file generation method for Embodiment 1;

[0050] Figure 3 For the process of the task program executing to generate an electronic proof layout file in the method for generating an electronic proof layout file in Embodiment 1. Specific embodiments

[0051] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments, so that those skilled in the art can better understand the present invention and be able to implement it. However, the embodiments cited are not intended to limit the present invention. Without conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other.

[0052] The embodiments of the present invention provide a method and system for generating an electronic proof layout file, which are used to solve the technical problem of how to quickly generate a proof file based on the Tinymce plug-in.

[0053] Embodiment 1:

[0054] A method for generating an electronic proof layout file according to the present invention quickly generates an electronic proof layout file based on MapReduce and the Tinymce plug-in, including two steps: task program configuration and task program execution.

[0055] Step S100 Task program configuration: Take the generation of each type of electronic proof layout file as a task, construct the program of each task based on the predefined electronic proof layout file generation process, and integrate the programs of each task into the MapReduce multi-task processing program.

[0056] Among them, as Figure 1 shown, the electronic proof layout file generation process includes the following operations:

[0057] (1) Determine whether the electronic proof layout file to be generated is a new type. If so, call the Tinymce template design program to load the corresponding type of electronic proof file template, and configure the template data, metadata, and face data. If not, load the corresponding type of electronic proof file template from the database;

[0058] (2) Fill the information corresponding to the corresponding lighting data into the electronic proof file template through the Tinymce template renderer to obtain an HTML-format electronic proof layout file;

[0059] (3) Convert the HTML-format electronic proof layout file into a PDF-format electronic proof layout file through the WkHtmlToPdf plug-in, and save the PDF-format electronic proof layout file to the database.

[0060] In step (2), when filling the information corresponding to the lighting data into the electronic proof file template through the Tinymce template renderer, the information of the corresponding lighting data is obtained from the data source based on the metadata and lighting data. The information of the lighting data exists in a structured form in the data source, and the information of the lighting data exists in HTML form in the electronic proof file template. The Tinymce template renderer replaces the information of the lighting data in HTML form in the electronic proof file template with the information of the lighting data in structured form in the data source to obtain an electronic proof layout file in HTML format.

[0061] In the process of generating the electronic proof layout file in this embodiment, the following implementation operations are included:

[0062] Step S1: Obtain the data that needs to be converted into an electronic proof layout file from the data source, and complete the preliminary processing of the electronic proof material data based on the relevant specifications and requirements of the electronic proof layout file. The specific implementation is as follows: Obtain and determine whether the electronic proof type is a new electronic proof. If it is a new electronic proof material, call the Tinymce template design program to load a new template, and fill the template content and design the face items of the electronic proof according to the new electronic proof. Otherwise, if it is a template that has been designed, directly read the HTML data of the template from the database, parse the HTML data using the Tinymce template designer, and display it in the corresponding template display area, and directly jump to S3 for data synthesis.

[0063] Step S2: Based on the electronic proof data in step S1, complete the configuration of the electronic proof layout file template according to the specific electronic proof specification requirements. Parse the content of the new electronic proof content.

[0064] After the input of the electronic proof data, the Tinymce template renderer completes the replacement of the face items.

[0065] After step S2 is completed, the electronic proof template data will exist in the database in the form of HTML. When the system receives the proof data imported through the interface, manually entered, or from an Excel file, the system will store the face information in the data source as structured data, and search and replace the data according to the English names of the face items defined in the template. The Tinymce template designer will replace the face items of character type, date type, and picture type according to the English names of the specially rendered face items in the template, replace the face items in the template with the actual proof data, and combine the fixed template data before the face items to synthesize the final electronic proof. Moreover, the electronic proof file can be previewed in the Tinymce template designer. After determining that the electronic proof data is accurate, standard electronic proof data is generated. The converted electronic proof files generally include: the object of proof, content, location, start and end time of the proof, etc. Some electronic proof files also need to be stamped, and the stamped electronic proof files are more convincing. The authenticity of the downloaded signature file can also be identified through the system.

[0066] Step S4: The wkhtmltopdf plugin completes the conversion of the proof data from HTML to PDF in S3 and saves it in the database.

[0067] Before finally using the wkhtmltopdf plugin to convert the electronic proof generated by Tinymce, this paper investigated 3 other conversion methods, and their advantages and disadvantages have been shown in the attached figure table.

[0068] For the HTML data of the electronic proof generated in S3, it can only be displayed and previewed in the Tinymce template designer. It has problems such as being not easy for data preview and transmission, and it is necessary to convert the HTML-formatted electronic proof data into a PDF file that is easy to view. With the help of the powerful wkhtmltopdf plugin for the conversion from HTML to PDF, this plugin can complete the conversion of the electronic proof HTML data in different fonts and various styles to PDF files by configuring the input parameters of the plugin. After the plugin completes the configuration of relevant parameters and the input of electronic proof data, the electronic proof file can be stored in the mongdb library in the form of a PDF file.

[0069] Step S5: View and download the proof data in the system.

[0070] When the system displays the electronic proof file, the system will retrieve the proof data from the attachment library such as mongdb and can be viewed and downloaded in the system plugin.

[0071] Step S200 Task Program Execution: For multiple types of electronic proof layout files to be generated, use the template data, metadata, and face data related to each type of electronic proof layout file as input data, and execute the MapReduce multitask processing program to generate each type of electronic proof layout file. Each piece of input data is marked with a tag corresponding to the type of the electronic proof layout file.

[0072] As a specific implementation of the task program execution, this step includes the following operations:

[0073] (1) Data Preparation: Obtain the template data, metadata, and face data related to the electronic proof file template. For the template data, metadata, and face data, each piece of data contains the type code of the corresponding electronic proof layout file. Mark each piece of data according to the type of the electronic proof layout file, divide all the template data, metadata, and face data into multiple data slices, and store the data slices in the distributed file system. Each data slice includes the template data, metadata, and face data of multiple types of electronic proof layout files;

[0074] (2) Map Task Processing: Dynamically allocate Map tasks based on the number of data slices and the number of type codes. Each Map task is responsible for processing one data slice. The Map task reads the allocated data slice from the distributed file system, treats each type of electronic proof layout data file in the data slice as a record. For each record, the Map task processes it according to the predefined program logic, disassembles the template data and extracts the metadata and face data, and encapsulates the processing result into a key-value pair. The key is the type code, and the value is the corresponding electronic proof layout file. The content of the value includes the metadata and face data;

[0075] (3) Reduce Task Processing: The Reduce task classifies and reorganizes the key-value pairs, allocates Reduce tasks according to the number of proof type codes. Each Reduce task processes one proof type. The Reduce task pulls the allocated key-value pairs. For each key, classify and reorganize the corresponding values to obtain the electronic proof layout file of the corresponding proof type, and store the electronic proof layout files of each type.

[0076] When the task program of this embodiment is executed, the generated electronic proof layout files of each type are stored in mongdb, and the indexes of the electronic proof layout files of each type are returned. The indexes of the electronic proof layout files of each type are stored in the database, and the temporary files generated during the execution of the task program are deleted.

[0077] Using the MapReduce parallel processing module of Hadoop, the MapReduce (abbreviated as MR) parallel processing module is a software framework for distributed computing. The ResourceManager (RM), NodeManager (NM), and MapReduce ApplicationMaster (MRAM) constitute the MapReduce module. The ResourceManager is the address module for the client to input data in the MapReduce parallel processing module. The client submits applications and kills application programs to the RM through this address parameter. The NodeManager is the total available physical memory of the parallel processing module. Note that once this parameter is set, it cannot be modified, that is, it cannot be dynamically modified during the entire running process. Additionally, the default value of this parameter is 8192MB. The MRAM is a specific instance of the ApplicationMaster (AM).

[0078] The following introduces the YARN system. YARN is a general resource management system that completes unified scheduling and resource management and provides unified support for upper-layer applications. It consists of three components: the ResourceManager (RM), NodeManager (NM), and ApplicationMaster (AM). The design concept of YARN is to separate cluster resource management from job scheduling / monitoring. The RM completes the resource management and scheduling of the entire cluster, the NM realizes the resource management of a single node, and the AM realizes the monitoring of tasks and the scheduling of jobs. These three are closely related and inseparable.

[0079] In summary, MR is a manifestation of YARN applications. Therefore, MR and YARN have the same working principle. The MapReduce and MRAM processes are basically started synchronously. This process further combines with the ResourceManager for resource allocation. This process can achieve the startup and monitoring of each subtask in the ResourceManager and return the execution status of the task in real time. Additionally, MR also has its uniqueness. The map task is executed prior to the reduce task, and the order cannot be reversed. Only one of the map or reduce subtasks is executed in the container.

[0080] MapReduce is divided into two stages, namely Map and Reduce, to complete the task. The Map stage completes the decomposition of the task and contains multiple map tasks. The Map stage can input multiple data blocks (shards). In the present invention, multiple electronic certificates of the same proof type can be simultaneously used as a data block. Each map task is responsible for processing a data slice containing the template and proof metadata of an electronic certificate of the same proof type. After receiving the sharded data of the electronic certificate file, the map task defaults to treating each electronic certificate data in the shard as a record, sequentially processes each electronic certificate data record, and finally outputs multiple key-value pairs containing the data of the input electronic certificate layout file; the Reduce stage is to recombine the results of different types of electronic certificates that have been completed and re-output the data according to the specific requirements of the setter. The existence form of this Reduce task stage is relatively broad and can completely depend on the requirements of the project. There can be one or multiple. In some special scenarios, this stage can also be omitted. Each reduce task can process the key-value pairs outputting the data of a bound type of electronic certificate layout file. For the same type of key-value, the reduce stage finally only outputs the result of one proof type. It should be noted that before entering the Reduce stage, the data needs to be shuffled, that is, operations such as partitioning, sorting, and merging are implemented. The result output by the Reduce stage is saved on the distributed file storage system (Hadoop Distributed File System, HDFS). The data flow of the MR job is as Figure 2 shown.

[0081] In the example, the Map stage processes three sharded data. Each sharded data consists of the input of multiple electronic certificate template data, metadata, and face data. Each Map subtask performs the synthesis and conversion of the electronic certificate layout file within its own container partition. After the shuffle stage of partitioning, sorting, and merging, the reduce task is executed. These three reduce tasks are respectively responsible for the synthesis of each type of electronic certificate data. part1, part2, and part3 are the outputs of the final results of each type of electronic certificate.

[0082] The map tasks in this job flow split the electronic proof template data, metadata, and face data containing multiple proof types into multiple records, and generate data within different containers. Since the map tasks split the electronic proof template data, metadata, and face data of multiple different proof types into multiple records, each map task may output multiple key-value pairs of electronic proof layout file data of different proof types. According to whether the keys are the same, these key-value pairs can be divided into different electronic proof types. If the keys are the same, they belong to the same electronic proof layout file type; if the keys are different, they belong to another electronic proof layout file type. Because the end of the map tasks may generate key-value pairs of multiple different electronic proof types, different key-value pairs are processed through partitioning and matched with the reduce tasks. One type of electronic proof layout file corresponds to one type of partition, and one type of partition corresponds to one reduce task. The types of electronic proofs between different partitions are different, and each reduce task corresponds to a different proof type, and their proof type codes are different. Thus, data of different proof types enter different reduce tasks, and it is also ensured that key-value pairs of the same type are sent to the same reduce task to complete data processing.

[0083] The number of map tasks is determined by the number of shards of the input electronic proof template data, metadata, and face data, and the number of reduce tasks can be specified according to the number of input proof types. Sharding is a very flexible quantifier. We can define it as a file, or a part of a file, or all the files in a folder. However, in this invention, it refers to the electronic proof template data, metadata, and face data composed of several different proof types.

[0084] This embodiment also relates to the storage of electronic proof layout files, and the specific operations are as follows:

[0085] (1) Obtain the electronic proof data result data after the reduce step;

[0086] (2) Obtain the mongdb configuration information for storing the electronic proof data layout files;

[0087] (3) Sequentially store the electronic proof data result files into mongdb and record the indexes of the data in the mongdb library;

[0088] (4) Store the electronic proof data indexes into the database to facilitate data query operations;

[0089] (5) Clean up the temporary files and release disk space. Delete the generated temporary files, including the source proof layout files and the result files generated by reduce, to release space.

[0090] Based on the method disclosed in this embodiment, a case of generating an electronic proof layout file is given:

[0091] First, obtain the data that needs to be converted into an electronic proof layout file from the data source, and complete the preliminary processing of the electronic proof material data based on the relevant specifications and requirements of the electronic proof layout file. The specific implementation is as follows: Obtain and determine whether the electronic proof type is a new electronic proof. If it is a new proof material, obtain the Tinymce new template data, and obtain the corresponding face data and metadata face items.

[0092] Second, use the metadata and face data of the electronic proof to complete the replacement of the face items in the Tinymce template renderer. After completing step 2, it is necessary to replace the face data of the electronic proof template existing in the form of HTML with the face data information existing in a structured manner in the data source. This part of data conversion is automatically completed.

[0093] Third, the WkHtmlToPdf plugin completes the conversion of the Html file to the PDF electronic proof layout file and saves it in the database. The generation and storage of the electronic proof file are completed.

[0094] Fourth, integrate the program for generating the electronic proof above into the MapReduce multi-task processing program to complete the data processing. Perform a map task on the proof type codes corresponding to the electronic proof template data, metadata, and face data of multiple proof types, complete the decomposition of all the obtained proof template data, and determine the number of map tasks according to the number of proof types in the actual license layout file. In the present invention, the template data, metadata, and face data of multiple different proof types are simultaneously used as a data processing block, and each map task is responsible for processing a data slice containing the template data, metadata, and face data of multiple different proof types. The processing method is the same as the program introduced in 2.1. After receiving the shard data containing the template data, metadata, and face data of different proof types, the map task will default to treating each electronic proof layout data file in the shard as a record, complete the sequential processing of each record, and finally output the key-value pairs of the electronic proof layout files corresponding to multiple different proof types containing different proof metadata and face data; The Reduce stage is to recombine the results of the converted proof layout files to complete the classification processing of the output different proof type layout files. Each reduce task can process the key-value pairs corresponding to the electronic license layout files bound to the same proof type. For the same type of key-value, the reduce stage finally only outputs one calculation result.

[0095] Fifth, storing the data conversion results and deleting temporary files. Store the converted electronic proof layout files in mongdb, and store the index data returned by mongdb. Delete the temporary files before and after conversion.

[0096] The method of this embodiment is based on the MapReduce module of Hadoop to complete the research on the rapid generation of proof layout files. Using the MapReduce framework, it realizes the synthesis of proof layout files from template data, metadata, and face data of proof types to achieve multi-task conversion. And the proof synthesis method based on Tinymce technology has the advantages of convenient data storage, fast data reading, stable data storage, relatively rich content formats, significantly improving the user experience. And it uses the wkhtmltopdf plugin to complete the conversion of proof HTML files to PDF files. A mechanism for multi-task parallel processing conversion based on the MapReduce module of Hadoop is established, realizing the function of rapid generation of proof layout files. It shows that the template based on Tinymce technology has the characteristics of fast loading speed, stable loading, and strong browser compatibility. The conversion of HTML to PDF files based on the wkhtmltopdf plugin is established, with the advantages of simple operation and fast conversion speed. Based on Tinymce, the proof data exists in HTML, and different strict format rectifications of proofs can be completed using HTML. In addition, the Tinymce plugin can basically be compatible with the format of word. The Tinymce plugin can quickly copy text content from word and can retain the format of word, ensuring that the font format, line spacing, and paragraph layout remain unchanged, greatly reducing the time cost for users to make proof templates.

[0097] Embodiment 2:

[0098] An electronic proof layout file generation system of the present invention includes a task program configuration module and a task program execution module.

[0099] The task program configuration module is used to perform the following: Take the generation of each type of electronic proof layout file as a task, construct the program of each task based on the predefined electronic proof layout file generation process, and integrate the programs of each task into the MapReduce multi-task processing program.

[0100] Among them, the electronic proof layout file generation process includes the following operations:

[0101] (1) Determine whether the electronic certificate layout file to be generated is a new type. If it is, call the Tinymce template design program to load the corresponding type of electronic certificate file template, and configure the template data, metadata, and face data. If not, load the corresponding type of electronic certificate file template from the database;

[0102] (2) Use the Tinymce template renderer to fill the information corresponding to the relevant lighting data into the electronic certificate file template to obtain an HTML-format electronic certificate layout file;

[0103] (3) Use the WkHtmlToPdf plugin to convert the HTML-format electronic certificate layout file into a PDF-format electronic certificate layout file, and save the PDF-format electronic certificate layout file to the database.

[0104] In step (2), when using the Tinymce template renderer to fill the information corresponding to the relevant lighting data into the electronic certificate file template, obtain the information of the corresponding face data from the data source based on the metadata and lighting data. The information of the face data in the data source exists in a structured form, and the information of the face data in the electronic certificate file template exists in HTML form. Use the Tinymce template renderer to replace the information of the face data in HTML form in the electronic certificate file template with the information of the face data in structured form in the data source to obtain an HTML-format electronic certificate layout file

[0105] In the process of generating the electronic certificate layout file in this embodiment, the following implementation operations are included:

[0106] Step S1: Obtain the data that needs to be converted into an electronic certificate layout file from the data source, and complete the preliminary processing of the electronic certificate material data based on the relevant specifications and requirements of the electronic certificate layout file. The specific implementation is as follows: Obtain and judge whether the electronic certificate type is a new electronic certificate. If it is a new electronic certificate material, call the Tinymce template design program to load the new template, and fill the template content and design the face items of the electronic certificate according to the new electronic certificate. Otherwise, if it is a template that has been designed, directly read the HTML data of the template from the database, use the Tinymce template designer to parse the HTML data, and display it in the corresponding template display area, and directly jump to S3 for data synthesis.

[0107] Step S2: Based on the electronic certificate data in step S1, complete the configuration of the electronic certificate layout file template according to the specific electronic certificate specification requirements. Parse the content of the new electronic certificate.

[0108] Step S3: After the electronic certificate data is entered, the Tinymce template renderer completes the replacement of the face items.

[0109] After step S2 is completed, the electronic proof template data exists in the database in the form of HTML. When the system receives the proof data imported through the interface, manually entered, or from an Excel file, the system stores the face information in the data source as structured data, and searches for and replaces the data according to the English names of the face items defined in the template. The Tinymce template designer replaces the face items of character type, date type, and picture type according to the English names of the specially rendered face items in the template, replaces the face items in the template with the actual proof data, and combines the fixed template data before the face items to synthesize the final electronic proof. Moreover, the electronic proof file can be previewed in the Tinymce template designer. After determining that the electronic proof data is accurate, standard electronic proof data is generated. The converted electronic proof file generally includes: the object of proof, content, location, start and end time of the proof, etc. Some electronic proof files also need to be stamped, and the stamped electronic proof file is more convincing. The downloaded signature file can also be verified for authenticity through the system.

[0110] Step S4: The wkhtmltopdf plugin completes the conversion of the proof data in S3 from HTML to PDF and saves it in the database.

[0111] Before finally using the wkhtmltopdf plugin to convert the electronic proof generated by Tinymce, this article investigated 3 other conversion methods, and their advantages and disadvantages are shown in the attached figure table.

[0112] Regarding the HTML data of the electronic proof generated in S3, it can only be previewed in the Tinymce template designer, and there are problems such as being not easy for data preview and transmission. It is necessary to convert the HTML-formatted electronic proof data into a PDF file that is easy to view. With the help of the powerful wkhtmltopdf plugin, the conversion from HTML to PDF is carried out. This plugin can complete the conversion of the electronic proof HTML data of different fonts and various styles to PDF files by configuring the input parameters of the plugin. After the plugin completes the configuration of relevant parameters and the entry of electronic proof data, the electronic proof file can be stored in the mongdb library in the form of a PDF file.

[0113] Step S5: View and download the proof data in the system.

[0114] When the system displays the electronic proof file, the system retrieves the proof data from the attachment library such as mongdb, and can be viewed and downloaded in the system plugin, etc.

[0115] The task program execution module is used to perform the following: for multiple types of electronic proof layout files to be generated, using the template data, metadata, and face data related to each type of electronic proof layout file as input data, execute the MapReduce multitask processing program to generate each type of electronic proof layout file, where each input data is marked with the tag of the corresponding electronic proof layout file type.

[0116] As a specific implementation of the task program execution module, this module is used for the following operations:

[0117] (1) Data preparation: Obtain the template data, metadata, and face data related to the electronic proof file template. For the template data, metadata, and face data, each piece of data contains the type code of the corresponding electronic proof layout file. Mark each piece of data according to the type of the electronic proof layout file, divide all the template data, metadata, and face data into multiple data slices, and store the data slices in the distributed file system, where each data slice includes the template data, metadata, and face data of multiple types of electronic proof layout files;

[0118] (2) Map task processing: Dynamically allocate Map tasks based on the number of data slices and the number of type codes. Each Map task is responsible for processing one data slice. The Map task reads the allocated data slice from the distributed file system, treats each type of electronic proof layout data file in the data slice as a record. For each record, the Map task processes it according to the predefined program logic, disassembles the template data and extracts the metadata and face data, and encapsulates the processing result as a key-value pair, where the key is the type code and the value is the corresponding electronic proof layout file, and the content of the value includes the metadata and face data;

[0119] (3) Reduce task processing: The Reduce task classifies and reorganizes the key-value pairs, allocates Reduce tasks according to the number of proof type codes, and each Reduce task processes one proof type. The Reduce task pulls the allocated key-value pairs. For each key, classifies and reorganizes the corresponding values to obtain the electronic proof layout file of the corresponding proof type, and stores the electronic proof layout files of each type.

[0120] When the task program in this embodiment is executed, the generated electronic proof layout files of each type are stored in mongdb, and the indexes of the electronic proof layout files of each type are returned. The indexes of the electronic proof layout files of each type are stored in the database, and the temporary files generated during the execution of the task program are deleted.

[0121] Using the MapReduce parallel processing module of Hadoop, the MapReduce (abbreviated as MR) parallel processing module is a software framework for distributed computing. The Resource Manager (RM), Node Manager (NM), and MapReduce ApplicationMaster (MRAM) constitute the MapReduce module. The Resource Manager is the address module for the client to input data in the MapReduce parallel processing module. The client submits applications and kills application programs to the RM through this address parameter. The Node Manager is the total available physical memory of the parallel processing module. Note that once this parameter is set, it cannot be modified, that is, it cannot be dynamically modified during the entire running process. In addition, the default value of this parameter is 8192MB. MRAM is a specific instance of the ApplicationMaster (AM).

[0122] YARN is a general resource management system that completes unified scheduling and management of resources and provides unified support for upper-layer applications. It consists of three components: the Resource Manager (RM), Node Manager (NM), and ApplicationMaster (AM). The design concept of YARN is to separate cluster resource management from job scheduling / monitoring. The RM completes the resource management and scheduling of the entire cluster, the NM realizes the resource management of a single node, and the AM realizes the monitoring of tasks and scheduling of jobs. These three are closely related and inseparable.

[0123] In summary, MR is a manifestation of YARN applications. Therefore, MR and YARN have the same working principle. The MapReduce and MRAM processes are basically started synchronously. This process further combines with the Resource Manager for resource allocation. This process can start and monitor each subtask in the Resource Manager and return the execution status of the task in real time. In addition, MR also has its uniqueness. The map task is executed prior to the reduce task, and the order cannot be reversed. Only one of the map or reduce subtasks is executed in the container.

[0124] MapReduce is divided into two stages, namely Map and Reduce, to complete the task. The Map stage completes the decomposition of the task and contains multiple map tasks. The Map stage can input multiple data blocks (shards). In the present invention, multiple electronic certificates of the same proof type can be simultaneously used as a data block. Each map task is responsible for processing a data slice of an electronic certificate of the same proof type, which includes the template and proof metadata. After receiving the sharded data of the electronic certificate file, the map task will default to treating each electronic certificate data in the shard as a record, sequentially processing each record of the electronic certificate data, and finally outputting multiple key-value pairs containing the data of the input electronic certificate layout file; The Reduce stage is to recombine the results of different types of electronic certificates that have been completed and re-output the data according to the specific requirements of the setter. The existence form of this Reduce task stage is relatively broad and can completely depend on the requirements of the project. There can be one or multiple. In some special scenarios, this stage can also be omitted. Each reduce task can process the key-value pairs outputting the data of a bound type of electronic certificate layout file. For the same type of key-value, the reduce stage finally only outputs the result of one proof type. It should be noted that before entering the Reduce stage, the data needs to be shuffled, that is, operations such as partitioning, sorting, and merging are implemented. The result output by the Reduce stage is saved on the distributed file storage system (Hadoop Distributed File System, HDFS). The data flow of the MR job is as Figure 2 shown.

[0125] In the example, the Map stage processes three shards of data. Each shard of data is composed of the input of multiple electronic certificate template data, metadata, and face data. Each Map subtask performs the synthesis and conversion of the electronic certificate layout file within its own container partition. After the shuffle stage of partitioning, sorting, and merging, the reduce task is executed. These three reduce tasks are responsible for the synthesis of each type of electronic certificate data. part1, part2, and part3 are the outputs of the final results of each type of electronic certificate.

[0126] The map tasks in this job flow split the electronic proof template data, metadata, and face data containing multiple proof types into multiple records, and generate data in different containers. Since the map tasks split the electronic proof template data, metadata, and face data of multiple different proof types into multiple records, each map task may output multiple key-value pairs of electronic proof layout file data of different proof types. According to whether the keys are the same, these key-value pairs can be divided into different electronic proof types. If the keys are the same, they belong to the same electronic proof layout file type; if the keys are different, they belong to another type of electronic proof layout file type. Because the end of the map tasks may generate key-value pairs of multiple different electronic proof types, the different key-value pairs are processed through partitioning and matched with the reduce tasks. One type of electronic proof layout file corresponds to one type of partition, and one type of partition corresponds to one reduce task. The types of electronic proofs between different partitions are different, and each reduce task corresponds to a different proof type, and their proof type codes are different. Thus, data of different proof types enter different reduce tasks, and it is also ensured that key-value pairs of the same type are sent to the same reduce task to complete data processing.

[0127] The number of map tasks is determined by the number of shards of the input electronic proof template data, metadata, and face data, and the number of reduce tasks can be specified according to the number of input proof types. Sharding is a very flexible quantifier. We can define it as a file, a part of a file, or all the files in a folder. However, in this invention, it refers to the electronic proof template data, metadata, and face data composed of several different proof types.

[0128] This embodiment also relates to the storage of electronic proof layout files. The specific operations are as follows:

[0129] (1) Obtain the electronic proof data result data after the reduce step;

[0130] (2) Obtain the mongdb configuration information for saving the electronic proof data layout file;

[0131] (3) Sequentially store the electronic proof data result files into mongdb and record the indexes of the data in the mongdb library;

[0132] (4) Store the electronic proof data indexes into the database to facilitate data query operations;

[0133] (5) Clean up the temporary files and release disk space. Delete the generated temporary files, including the source proof layout files and the result files generated by reduce, to release space.

[0134] The system of this embodiment can execute the method disclosed in Embodiment 1 to generate an electronic proof layout file.

[0135] The method and system for generating an electronic proof layout file provided by the present invention have been introduced in detail above. Specific examples are used in this article to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.

Claims

1. A method for generating an electronic certification format file, characterized in that: Based on MapReduce and Tinymce plug-in, quickly generate electronic certificate format files, including the following steps: Task program configuration: Take the generation of each type of electronic certificate format file as a task, build the program of each task based on the predefined electronic certificate format file generation process, and integrate the program of each task into the MapReduce multi-task processing program; Task program execution: for multiple types of electronic certificate format files to be generated, the template data, metadata and face data related to each type of electronic certificate format file are used as input data, and the MapReduce multi-task processing program is executed to generate each type of electronic certificate format file, wherein each input data is marked with a tag of the corresponding electronic certificate format file type; The electronic certificate format file generation process includes the following operations: Determine whether the electronic certificate format file to be generated is of a new type. If so, call the Tinymce template design program to load the electronic certificate file template of the corresponding type, and configure the template data, metadata and face data. If not, load the electronic certificate file template of the corresponding type from the database; Fill the information corresponding to the corresponding lighting data into the electronic certificate file template through the Tinymce template renderer to obtain the electronic certificate format file in HTML format; The electronic certificate layout file in HTML format is converted into an electronic certificate layout file in PDF format through the WkHtmlToPdf plug-in, and the electronic certificate layout file in PDF format is saved to the database.

2. The method for generating an electronic certification format file according to claim 1, characterized in that: When the information corresponding to the corresponding lighting data is filled into the electronic certificate document template through the Tinymce template renderer, the information of the corresponding illumination data is obtained from the data source based on the metadata and the illumination data. The illumination data information exists in a structured form in the data source, and the illumination data information exists in the electronic certificate document template in the form of HTML. The illumination data information in a structured form in the data source is replaced by the Tinymce template renderer with the illumination data information in a structured form in the data source to obtain an electronic certificate layout file in HTML format.

3. The method for generating an electronic certification format file according to claim 1, characterized in that: The task program execution includes the following steps: Data preparation: obtaining template data, metadata and face data related to the electronic certification document template. For the template data, metadata and face data, each piece of data contains the type code of the corresponding electronic certification format file. Each piece of data is marked according to the type of the electronic certification format file. All template data, metadata and face data are divided into multiple data slices, and the data slices are stored in a distributed file system, wherein each data slice includes the template data, metadata and face data of multiple types of electronic certification format files; Map task processing: Map tasks are dynamically allocated based on the number of data slices and the number of type codes. Each Map task is responsible for processing one data slice. The Map task reads the allocated data slice from the distributed file system and regards each type of electronic certificate format data file in the data slice as a record. For each record, the Map task processes it according to the predefined program logic, disassembles the template data and extracts metadata and face data, and encapsulates the processing results into key-value pairs, where the key is the type code and the value is the corresponding electronic certificate format file. The value content includes metadata and face data. Reduce task processing: Reduce tasks classify and reorganize key-value pairs. Reduce tasks are assigned according to the number of proof type codes. Each Reduce task processes one proof type. The Reduce task pulls the assigned key-value pairs. For each key, the corresponding value is classified and reorganized to obtain the electronic proof format file of the corresponding proof type, and each type of electronic proof format file is stored.

4. The method for generating an electronic certification format file according to claim 1, characterized in that: When the task program is executed, the generated electronic certificate format files of various types are stored in mongdb, and the index of each type of electronic format file is returned. The index of each type of electronic format file is stored in the database, and the temporary files generated during the execution of the task program are deleted.

5. An electronic certification format file generation system, characterized in that: Used to generate an electronic certification format file by using an electronic certification format file generation method as described in any one of claims 1 to 4, including a task program configuration module and a task program execution module; The task program configuration module is used to perform the following: taking the generation of each type of electronic certificate format file as a task, constructing a program for each task based on a predefined electronic certificate format file generation process, and integrating the program of each task into a MapReduce multi-task processing program; The task program execution module is used to perform the following: for multiple types of electronic certificate format files to be generated, template data, metadata and face data related to each type of electronic certificate format file are used as input data, and a MapReduce multi-task processing program is executed to generate each type of electronic certificate format file, wherein each input data is marked with a mark of the corresponding electronic certificate format file type; The electronic certificate format file generation process includes the following operations: Determine whether the electronic certificate format file to be generated is of a new type. If so, call the Tinymce template design program to load the electronic certificate file template of the corresponding type, and configure the template data, metadata and face data. If not, load the electronic certificate file template of the corresponding type from the database; Fill the information corresponding to the corresponding lighting data into the electronic certificate file template through the Tinymce template renderer to obtain the electronic certificate format file in HTML format; The electronic certificate layout file in HTML format is converted into an electronic certificate layout file in PDF format through the WkHtmlToPdf plug-in, and the electronic certificate layout file in PDF format is saved to the database.

6. The electronic certification format file generation system according to claim 5, characterized in that: When the information corresponding to the corresponding lighting data is filled into the electronic certificate document template through the Tinymce template renderer, the information of the corresponding illumination data is obtained from the data source based on the metadata and the illumination data. The illumination data information exists in a structured form in the data source, and the illumination data information exists in the electronic certificate document template in the form of HTML. The illumination data information in a structured form in the data source is replaced by the Tinymce template renderer with the illumination data information in a structured form in the data source to obtain an electronic certificate layout file in HTML format.

7. The electronic certification format file generation system according to claim 5, characterized in that: Based on the MapReduce multi-task processing program, the task program execution module is used to perform the following operations: Data preparation: obtaining template data, metadata and face data related to the electronic certification document template. For the template data, metadata and face data, each piece of data contains the type code of the corresponding electronic certification format file. Each piece of data is marked according to the type of the electronic certification format file. All template data, metadata and face data are divided into multiple data slices, and the data slices are stored in a distributed file system, wherein each data slice includes the template data, metadata and face data of multiple types of electronic certification format files; Map task processing: Map tasks are dynamically assigned based on the number of data slices and the number of type codes. Each Map task is responsible for processing one data slice. The Map task reads the assigned data slice from the distributed file system and treats each type of electronic certificate format data file in the data slice as a record. For each record, the Map task processes according to the predefined program logic, disassembles the template data and extracts the metadata and face data, and encapsulates the processing results into a key-value pair, where the key is the type code and the value is the corresponding electronic certificate format file, and the value content includes metadata and face data; Reduce task processing: Reduce tasks classify and reorganize key-value pairs. Reduce tasks are assigned according to the number of proof type codes. Each Reduce task processes one proof type. The Reduce task pulls the assigned key-value pairs. For each key, the corresponding value is classified and reorganized to obtain the electronic proof format file of the corresponding proof type, and each type of electronic proof format file is stored.

8. The electronic certification format file generation system according to claim 5, characterized in that: The task program execution module is used to store the generated electronic certificate format files of various types in mongdb, return the index of each type of electronic format file, store the index of each type of electronic format file in the database, and delete the temporary files generated during the execution of the task program.