Method and system for realizing configurable automatic generation layout file of digital-to-electronic invoice

By editing and configuring digital invoice layout file style templates and data field rules, combined with sensitive data signature verification and encryption methods, the configurable automatic generation of digital invoice layout files is realized, solving the problems of low efficiency, poor quality and insufficient security in the existing technology, and improving work efficiency and system maintainability.

CN120068827APending Publication Date: 2025-05-30AEROSPACE INFORMATION (SHANDONG) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411892669.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

In the prior art, when generating layout files for digital invoices, there are problems such as single file format configuration, manual intervention, inability to achieve real-time automatic generation, excessive time to generate files from massive data, poor file quality, easy file corruption, and high system maintenance failure rate.

Method used

Provide a method and system to realize the configurable automatic generation of typing files of digital invoices by editing typing files of digital invoices, configuring data field rules, setting sensitive data signature verification methods and encryption methods, configuring typing file output format, prefabricated task scheduling services and configuring typing file preview platform.

Benefits of technology

It realizes automatic configuration of extended layout file format, reduces manual intervention, improves work efficiency, ensures the quality and security of layout files, reduces system maintenance costs, and improves the system maintainability and scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120068827A_ABST
    Figure CN120068827A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a system for realizing configurable automatic generation of layout files of digital and electronic invoices, and particularly relates to the technical field of electronic invoices, and the method for realizing configurable automatic generation of layout files of digital and electronic invoices comprises the following steps: S1, editing a digital and electronic invoice layout file style template, prefabricating a basic format, a special business format, a specific element format and a user-defined format; s2, data field rule configuration realizes field type configuration, rule code editing, rule name editing, sq 1 function editing, template customizing, data dictionary conversion and character string splicing; and S3, configuring a sensitive data signature verification mode. According to the method, custom configuration of the digital-to-electronic invoice layout file generation rule can be supported, the layout file is automatically and flexibly generated according to the configuration rule, the layout file is signed and encrypted, the layout file is prevented from being maliciously damaged and tampered, and it is guaranteed that file data are real, complete, safe and reliable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electronic invoices. More specifically, the present invention relates to a method and system for realizing configurable automatic generation of layout files for digital electronic invoices. Background Art

[0002] Digital electronic invoices are fully digitalized electronic invoices, which are new invoices with the same legal effect as traditional paper invoices and electronic invoices. With the development of the digital economy, digital electronic invoices have been widely used. After a digital electronic invoice is issued, it is often necessary to generate a layout file for enterprises to conduct financial processing, archiving, and meet the requirements of relevant regulations.

[0003] Currently, the traditional solution is to generate the format by manually configuring the layout file, load the structured data from a technical level to call the configuration information, and then display the layout file in the form of manual preview. Due to the single template of the technical solution and difficulty in expansion, it cannot meet the diverse formats and special scenario file requirements of digital electronic invoices.

[0004] The current solution has the following disadvantages:

[0005] 1. The file format configuration is single, lacking data field extension items;

[0006] 2. Manual intervention is required, and real-time automatic generation cannot be achieved, resulting in low work efficiency;

[0007] 3. Generating files for massive data cannot be completed within the specified time, and data loss and system freeze frequently occur;

[0008] 4. The quality of the layout file is poor, and the pixels, size, and clarity cannot meet the business needs;

[0009] 5. The failure rate of file damage and tampering is high, and data encryption and signature verification cannot be performed;

[0010] 6. System upgrades and transformations require system downtime, which seriously affects the continuity and availability of the business, resulting in untimely file generation and the system being unable to run normally;

[0011] 7. The maintenance failure rate is too high, the production cost is too high, and the income and expenditure are not proportional.

[0012] To solve the above problems, a technical solution is provided now. Summary of the Invention

[0013] In order to overcome the above-mentioned defects of the prior art, embodiments of the present invention provide a method and system for realizing configurable automatic generation of layout files for digital electronic invoices to solve the problems raised in the above background art.

[0014] To achieve the above object, the present invention provides the following technical solutions:

[0015] A method for realizing the configurable automatic generation of layout files for digital electronic invoices, comprising the following steps:

[0016] Step S1, edit the style template of the digital electronic invoice layout file, and prefabricate the basic layout, special business layout, specific element layout, and custom layout;

[0017] Step S2, configure the data field rules to realize the field type configuration, and edit the rule code, rule name, sql function, custom template, data dictionary conversion, and string splicing;

[0018] Step S3, configure the sensitive data signature verification method, configure the encryption methods including SM4, AES, BASE64, and dynamically configure the generation of encryption algorithms and encryption keys;

[0019] Step S4, configure the output format of the layout file, configure the generation rules for file formats including PDF, OFD, and XML respectively, and prefabricate the flag data at the beginning and end of the file;

[0020] Step S5, prefabricate the task scheduling service, allocate the layout file generation template, and drive the automatic generation of the layout file through the scheduling engine;

[0021] Step S6, configure the layout file preview platform, integrate PDF and OFD readers, integrate the iframe plugin, and integrate freemarker to preview XML to complete the preview of the layout file.

[0022] In a preferred embodiment, step S1 includes the following specific contents:

[0023] Determine the basic layout of the invoice, set the positions of the basic invoice information, specify the font, font size, and color, and design specific layouts for different industries or special business scenarios;

[0024] Determine the display methods of some specific elements and provide user-customizable options.

[0025] In a preferred embodiment, step S2 includes the following specific contents:

[0026] Determine the data types of each field in the invoice data, assign a unique code to each data field rule, and give the rule a name;

[0027] According to the data processing requirements, configure the corresponding SQL functions and allow users to create custom templates to process specific data fields;

[0028] Establish a data dictionary to convert some specific codes or abbreviations into easily understandable text descriptions;

[0029] For the case where multiple data fields need to be concatenated into a string for display, configure the string concatenation rule.

[0030] In a preferred embodiment, step S3 includes the following specific contents:

[0031] Select a signature algorithm, determine the signature generation method, including the process of encrypting data with a private key to generate a signature, configure the signature verification mechanism, and verify the signature with a public key;

[0032] Configure the key length of the SM4 algorithm, select the key length of AES, determine the appropriate key length according to the sensitivity and security requirements of the data, determine the encryption mode of AES, and configure the conversion rule of BASE64 encoding;

[0033] Establish a dynamic key generation mechanism, and configure the encryption and decryption processes of the system during data processing according to the selected encryption algorithm and the generated key.

[0034] In a preferred embodiment, step S4 includes the following specific contents:

[0035] Determine the generation rule of the PDF file, set the PDF version, configure the page layout, including the page size and page orientation, and determine the font embedding rule;

[0036] Prefabricate the flag data at the beginning and end of the file. At the beginning of the PDF file, set the file header information, and at the end of the file, add the file tail identifier.

[0037] In a preferred embodiment, step S4 further includes the following specific contents:

[0038] Formulate the generation rule of the OFD file, determine the structure of the OFD file, including the document root node, page node, and content node, and configure the reference method of fonts and graphics in the OFD file;

[0039] Prefabricate the flag data at the beginning and end of the file. At the beginning of the OFD file, set the file header information that conforms to the OFD specification, and at the end of the file, add the end identifier of the OFD file.

[0040] In a preferred embodiment, step S4 further includes the following specific contents:

[0041] Determine the generation rule of the XML file, design the document structure of the XML, define the root element and sub - elements, and configure the data types and attributes of the XML elements;

[0042] Prefabricate the flag data at the beginning and end of the file. At the beginning of the XML file, add the XML declaration, and at the end of the file, add the end tag.

[0043] In a preferred embodiment, step S5 includes the following specific contents:

[0044] According to different business requirements and invoice types, assign the pre-edited layout file style templates to the corresponding tasks;

[0045] Build a scheduling engine, which can start the layout file generation task according to a preset time interval or event trigger mechanism.

[0046] In a preferred embodiment, step S6 includes the following specific contents:

[0047] Select a PDF reader plugin, integrate it into the preview platform, and directly view the invoice layout file in PDF format on the platform. For the OFD format, integrate an OFD reader to correctly parse and display the invoice content in OFD format;

[0048] Use the i frame tag to embed an external PDF or OFD reader into the preview platform page, and by setting the attributes of the iframe, realize the embedded viewing of the invoice layout file within the platform;

[0049] Utilize the freemarker template engine to process the invoice layout file in XML format.

[0050] A system for realizing the configurable automatic generation of layout files for digital electronic invoices, including a file style template editing module, a data field rule configuration module, a sensitive data signature verification and encryption method configuration module, a layout file output format configuration module, a prefabricated task scheduling service module, and a layout file preview platform configuration module;

[0051] The file style template editing module is used to edit the layout file style templates for digital electronic invoices, and prefabricate basic layouts, special business layouts, specific element layouts, and custom layouts;

[0052] The data field rule configuration module is used to implement field type configuration, edit rule codes, rule names, sq l functions, custom templates, data dictionary conversion, and string concatenation;

[0053] The sensitive data signature verification and encryption method configuration module is used to configure the sensitive data signature verification method, and the configured encryption methods include SM4, AES, and BASE64, and dynamically configure the generation of encryption algorithms and encryption keys;

[0054] The layout file output format configuration module is used to configure the layout file output format, and configure the generation rules for file formats including PDF, OFD, and XML respectively, and prefabricate the marker data at the beginning and end of the file;

[0055] The prefabricated task scheduling service module is used to allocate the layout file generation template and drive the automatic generation of the layout file through the scheduling engine;

[0056] The layout file preview platform configuration module is used to integrate PDF and OFD readers, integrate the i frame plugin, and integrate freemarker to preview XML to complete the layout file preview.

[0057] The technical effects and advantages of the method and system for realizing the configurable automatic generation of layout files for digital electronic invoices of the present invention:

[0058] 1. Automatically configure and expand the layout file format, and automatically implement template construction without adjusting the code and system;

[0059] 2. The scheduling tasks can be flexibly started and stopped, liberating manual intervention, improving quality and efficiency;

[0060] 3. For data that needs to be filled in at a fixed frequency, once configured, it will take effect permanently and be automatically updated;

[0061] 4. Dynamically generate encrypted strings, automatically generate signature verification and encryption algorithms to prevent data leakage;

[0062] 5. The content of the layout file is clear, highly readable, and convenient for storage;

[0063] 6. The platform is highly maintainable and extensible, with no downtime and no faults for 7x24 hours, greatly reducing the maintenance cost. Description of the Drawings

[0064] Figure 1 It is a schematic flow chart of a method for realizing the configurable automatic generation of layout files for digital electronic invoices of the present invention;

[0065] Figure 2 It is a schematic structural diagram of a system for realizing the configurable automatic generation of layout files for digital electronic invoices of the present invention. Detailed Embodiments

[0066] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0067] Embodiment 1

[0068] A method and system for realizing the configurable automatic generation of layout files for digital electronic invoices of the present invention.

[0069] Figure 1A method for the present invention to realize the configurable automatic generation of the layout file of the digital electronic invoice is provided, which includes the following steps:

[0070] Step S1, edit the style template of the digital electronic invoice layout file, and prefabricate the basic layout, special business layout, specific element layout, and custom layout;

[0071] Step S2, configure the data field rules to implement the field type configuration, and edit the rule code, rule name, sql function, custom template, data dictionary conversion, and string splicing;

[0072] Step S3, configure the sensitive data signature verification method, and configure the encryption methods including SM4, AES, and BASE64, and dynamically configure the generation of the encryption algorithm and encryption key;

[0073] Step S4, configure the output format of the layout file, and configure the generation rules for the file formats including PDF, OFD, and XML respectively, and prefabricate the flag data at the beginning and end of the file;

[0074] Step S5, prefabricate the task scheduling service, allocate the layout file generation template, and drive the automatic generation of the layout file through the scheduling engine;

[0075] Step S6, configure the layout file preview platform, integrate the PDF and OFD readers, integrate the iframe plug-in, and integrate the freemarker to preview XML to complete the preview of the layout file.

[0076] Step S1 includes the following specific contents:

[0077] Determine the basic layout of the invoice, set the positions of the basic invoice information, specify the font, font size, and color, and design specific layouts for different industries or special business scenarios;

[0078] Determine the display methods of some specific elements and provide user-customizable options.

[0079] It should be added that designing specific layouts for different industries or special business scenarios can fully adapt to various complex business situations. Taking the construction industry as an example, adding display areas for additional information such as the project name and location on the invoice can ensure that the invoice completely records the business details, facilitating the enterprise's cost accounting, project management, and other work. For enterprises with installment payment business, setting areas to display the payment progress or installment amounts helps the enterprise and customers clearly understand the financial status of the transaction and reduce financial disputes.

[0080] Provide user-customizable options, such as adding a company logo and personalized note information, which can meet the personalized needs of enterprises. The addition of the company logo can enhance the display of the enterprise brand image on the invoice and improve brand recognition. The setting of personalized note information (such as the internal order number of the enterprise) facilitates internal management of the enterprise, enabling it to better integrate invoices with internal business processes, improve work efficiency and data relevance.

[0081] Step S2 includes the following specific contents:

[0082] Determine the data types of each field in the invoice data, assign a unique code to each data field rule, and give the rule a name;

[0083] According to the data processing requirements, configure the corresponding SQL functions, allowing users to create custom templates to process specific data fields;

[0084] Establish a data dictionary to convert some specific codes or abbreviations into easily understandable text descriptions;

[0085] For the case where multiple data fields need to be concatenated into a string for display, configure the string concatenation rule.

[0086] It should be added that configuring SQL functions according to data processing requirements facilitates accurately extracting, processing, and summarizing invoice data from the database. For example, using the SELECT statement can quickly obtain the detailed information of a specific invoice, and the SUM function can efficiently calculate the amount summary. For complex multi-table join queries, the correct SQL join statement can ensure obtaining complete data in the shortest time and improve data processing efficiency.

[0087] Establishing a data dictionary to convert specific codes or abbreviations into easily understandable text descriptions greatly improves the readability of invoice data. In invoice data, codes may be used to represent information such as product categories and customer types. Through the conversion of the data dictionary, financial personnel and other relevant personnel can directly see clear and understandable text descriptions, reducing errors caused by difficulties in understanding codes. For example, converting the product category code "1" to "electronic products" makes the invoice content more intuitive and facilitates business processing and data analysis.

[0088] Step S3 includes the following specific contents:

[0089] Select a signature algorithm, determine the signature generation method, including the process of encrypting data with a private key to generate a signature, configure a signature verification mechanism, and verify the signature with a public key;

[0090] Configure the key length of the SM4 algorithm, select the key length of AES, determine the appropriate key length according to the sensitivity of the data and security requirements, determine the encryption mode of AES, and configure the conversion rules for BASE64 encoding;

[0091] Establish a dynamic key generation mechanism, and configure the encryption and decryption processes of the system during data processing according to the selected encryption algorithm and the generated key.

[0092] It should be added that select an appropriate signature algorithm, determine the signature generation method and configure the signature verification mechanism. Generate a signature by encrypting the data with the private key, and then verify the signature with the public key later. This can ensure the integrity of invoice data during transmission and storage and prevent the data from being tampered with. For example, when the invoice is transferred from the issuer to the recipient, once any modification is made to the data, the signature verification link can detect the signature mismatch, thus prompting that the data may have been illegally modified. At the same time, this signature mechanism based on public and private keys also ensures the traceability of the data source, that is, non-repudiation. The issuer cannot deny the data content it issued because only its private key can generate the corresponding valid signature, which is crucial in important business scenarios such as finance and taxation and can effectively avoid disputes.

[0093] By establishing a dynamic key generation mechanism, corresponding encryption keys can be generated in real time according to different business scenarios, data sensitivity levels, and security requirements. This dynamic nature enables the system to flexibly respond to various changing situations. For example, when an enterprise adjusts the security level of invoice data at different times, or when different types of business invoices (regular business invoices and invoices involving large amounts and confidential projects) require differential security protection, it can rely on the dynamically generated key combined with the selected encryption algorithm to quickly adjust the encryption intensity and method, always ensuring that the data security is at an appropriate protection level and avoiding potential security risks such as key cracking that may be brought about by the long-term use of a fixed key.

[0094] Step S4 includes the following specific contents:

[0095] Determine the generation rules of the PDF file, set the PDF version, configure the page layout, including page size and page orientation, and determine the font embedding rules;

[0096] Prefabricate the marker data at the beginning and end of the file. At the beginning of the PDF file, set the file header information, and at the end of the file, add the file tail identifier.

[0097] Step S4 also includes the following specific contents:

[0098] Formulate the generation rules for OFD files, determine the structure of OFD files, including document root nodes, page nodes, and content nodes, and configure the reference methods for fonts and graphics in OFD files;

[0099] Prepare the marker data at the beginning and end of the file. At the beginning of the OFD file, set the file header information that conforms to the OFD specification. At the end of the file, add the end identifier of the OFD file.

[0100] Step S4 also includes the following specific content:

[0101] Determine the generation rules for XML files, design the document structure of XML, define the root element and child elements, and configure the data types and attributes of XML elements;

[0102] Prepare the marker data at the beginning and end of the file. At the beginning of the XML file, add the XML declaration. At the end of the file, add the end tag.

[0103] It should be added that setting the PDF version and configuring the page layout, such as page size and orientation, ensures that the generated PDF invoice layout file conforms to the standard specifications. This helps with the compatibility of the file between different PDF readers and operating systems, and the invoice content can be correctly displayed whether on Windows, Mac, or mobile devices.

[0104] Formulate the generation rules for OFD files, determine their structure, including document root nodes, page nodes, and content nodes, etc., so that the OFD-format invoice files are constructed in accordance with the standard format. This ensures the compatibility of OFD files in different OFD readers and also facilitates data extraction and management.

[0105] Determine the generation rules for XML files and design the document structure, including defining the root element and child elements, and configuring the data types and attributes of the elements, so that the XML-format invoice files have a clear logical structure. This standardization helps with data exchange and sharing and facilitates other systems to parse and process the invoice data.

[0106] Step S5 includes the following specific content:

[0107] According to different business requirements and invoice types, assign the pre-edited layout file style templates to the corresponding tasks;

[0108] Build a scheduling engine that can start the layout file generation task according to a preset time interval or event trigger mechanism.

[0109] It should be added that different businesses have different requirements for invoice presentation. For example, for the business of selling goods and the business of providing services, the key information emphasized on the invoice will be different; another example is different industries, such as manufacturing, financial services, etc., where there are also differences in the details of invoice formats. According to these diverse business needs and different invoice types (such as ordinary invoices, special invoices, etc.), accurately allocating the pre-edited layout file style templates to the corresponding tasks can ensure that the generated layout files fully conform to the specific business scenarios. In this way, the information carried by the invoices can not only comprehensively and accurately reflect the business essence but also comply with the norms and habits of various industries and business types, facilitating internal financial accounting, tax declaration, and external customer review within the enterprise, etc., and improving the accuracy and efficiency of overall business processing.

[0110] Build a scheduling engine and enable it to start the layout file generation task according to a preset time interval (such as batch processing the invoices issued on the same day to generate layout files at a fixed time every day) or an event trigger mechanism (for example, immediately generating the corresponding layout file when new invoice data enters the system), which greatly improves the automation level of the entire process. There is no need for manual judgment one by one on which invoices need to generate layout files and when to generate them. The system can automatically and timely respond and orderly promote the task according to the established rules. This not only reduces the mistakes and omissions that may be brought by manual intervention but also greatly saves labor costs, allowing staff to devote more energy to other more valuable business analysis, decision-making, and other work links, and improving the overall operation efficiency of the enterprise.

[0111] Step S6 includes the following specific contents:

[0112] Select a PDF reader plugin, integrate it into the preview platform, and directly view the invoice layout file in PDF format on the platform. For the OFD format, integrate an OFD reader to correctly parse and display the content of the OFD format invoice;

[0113] Use the iframe tag to embed an external PDF or OFD reader into the preview platform page, and through setting the attributes of the iframe, achieve the embedded viewing of the invoice layout file within the platform;

[0114] Utilize the freemarker template engine to process the invoice layout file in XML format.

[0115] It should be added that corresponding reader plugins are selected to integrate the viewing functions of PDF and OFD formats respectively, and the freemarker template engine is used to process XML format, enabling users to view invoice layout files in different formats on the same preview platform. Whether it is the commonly seen PDF format in daily life, the OFD format that conforms to the specific standards of domestic electronic invoices, or the XML format that facilitates data interaction and processing, users do not need to additionally search for dedicated viewing tools or switch between different software, greatly enhancing the convenience of viewing invoice files and optimizing the user experience.

[0116] Integrating the preview functions of invoice files in multiple formats onto the same platform enhances the comprehensiveness of this platform as a hub for invoice-related business processing. Whether it is internal financial personnel in an enterprise when auditing invoices, performing bookkeeping operations, etc., or external partners who need to view and confirm invoice content, they can complete the viewing requirements for invoices in different formats in one stop on this integrated preview platform, avoiding the inconvenience brought by using multiple different software separately, improving the efficiency of communication and collaboration among different participants in the entire invoice business process, and also facilitating the enterprise to conduct centralized management and monitoring of invoice-related work.

[0117] Figure 2 A system for realizing the configurable automatic generation of layout files for digital electronic invoices according to the present invention is given, including a file style template editing module, a data field rule configuration module, a sensitive data signature verification and encryption method configuration module, a layout file output format configuration module, a prefabricated task scheduling service module, and a layout file preview platform configuration module;

[0118] The file style template editing module is used to edit the style template of the digital electronic invoice layout file, and prefabricate the basic layout, special business layout, specific element layout, and custom layout;

[0119] The data field rule configuration module is used to implement field type configuration, edit rule encoding, rule name, sql function, custom template, data dictionary conversion, and string splicing;

[0120] The sensitive data signature verification and encryption method configuration module is used to configure the sensitive data signature verification method, and the configured encryption methods include SM4, AES, and BASE64, and dynamically configure and generate encryption algorithms and encryption keys;

[0121] The layout file output format configuration module is used for layout file output format configuration, and respectively configures generation rules for file formats including PDF, OFD, and XML, and prefabricates the marker data at the beginning and end of the file;

[0122] The prefabricated task scheduling service module is used to allocate the layout file generation template, and drive the automatic generation of the layout file through the scheduling engine;

[0123] The layout file preview platform configuration module is used to integrate PDF and OFD readers, integrate the i frame plugin, and integrate freemarker to preview XML to complete the layout file preview.

[0124] Example 3, application of the present invention

[0125] Business form configuration

[0126]

[0127]

[0128]

[0129] Layout file generation configuration

[0130] First step: Configure data

[0131] Business type · PDF · XML · OFD encryption method

[0132] Decryption methods SM4, AES, BASE64 Output format File picture Structured data Filter conditions Add rows Delete rows

[0133]

[0134] Second step: Layout file type fields

[0135]

[0136]

[0137] Third step: Layout file preview

[0138] Code block display

[0139]

[0140] Fourth step: Task scheduling configuration

[0141] Business type · PDF · XML ● OFD encryption method

[0142] Decryption methods SM4, AES, BASE64 Output format File picture Structured data Filter conditions Add rows Delete rows

[0143]

[0144] As described above, it is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of changes or substitutions, which should all be covered within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claimed rights.

[0145] Finally: The above description is only the preferred embodiment of the present invention and is not used to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A method for realizing the automatic generation of format files for digital invoices, characterized in that: The steps include: Step S1, edit the digital invoice format file style template, and pre-make the basic format, special business format, specific element format, and custom format; Step S2, data field rule configuration implements field type configuration, edits rule code, rule name, sql function, custom template, data dictionary conversion, and string concatenation; Step S3, configure the sensitive data signature verification method, configure the encryption method including SM4, AES, BASE64, and dynamically configure the generated encryption algorithm and encryption key; Step S4, the output format of the layout file is configured, the file formats include PDF, OFD, and XML, and the generation rules are configured respectively, and the mark data of the beginning and the end of the file are pre-made; Step S5, prefabricate task scheduling service, allocate layout file generation template, and drive layout file automatic generation through scheduling engine; Step S6, configure the layout file preview platform, integrate PDF, OFD readers, integrate iframe plug-ins, integrate freemarker preview XML, and complete the layout file preview.

2. A method for realizing the automatic generation of format files for digital invoices according to claim 1, characterized in that: Step S1 includes the following specific contents: Determine the basic layout of the invoice, set the location of the basic invoice information, specify the font, size and color, and design specific layouts for different industries or special business scenarios; Determine how some specific elements are displayed, providing user-customizable options.

3. A method for realizing the automatic generation of a format file for a digital invoice according to claim 2, characterized in that: Step S2 includes the following specific contents: Determine the data type of each field in the invoice data, assign a unique code to each data field rule, and give the rule a name; Configure the corresponding SQL functions according to data processing requirements, allowing users to create customized templates to process specific data fields; Establish a data dictionary to convert some specific codes or abbreviations into easy-to-understand text descriptions; If you need to concatenate multiple data fields into a string for display, configure the string concatenation rules.

4. A method for realizing the automatic generation of a format file for a digital invoice according to claim 3, characterized in that: Step S3 includes the following specific contents: Select a signature algorithm and determine how to generate the signature, including the process of using the private key to encrypt data to generate a signature, configure the signature verification mechanism, and use the public key to verify the signature; Configure the key length of the SM4 algorithm, select the key length of AES, determine the appropriate key length based on the sensitivity of the data and security requirements, determine the encryption mode of AES, and configure the conversion rules of BASE64 encoding; Establish a dynamic key generation mechanism, and configure the system's encryption and decryption processes during data processing based on the selected encryption algorithm and generated keys.

5. A method for realizing the automatic generation of format files of digital invoices according to claim 4, characterized in that: Step S4 includes the following specific contents: Determine the rules for generating PDF files, set the PDF version, configure the page layout, including page size and page orientation, and determine the font embedding rules; Pre-create the mark data for the beginning and end of the file. Set the file header information at the beginning of the PDF file and add the file tail mark at the end of the file.

6. A method for realizing the automatic generation of a format file for a digital invoice according to claim 5, characterized in that: Step S4 also includes the following specific contents: Formulate the generation rules of OFD files, determine the structure of OFD files, including document root nodes, page nodes, and content nodes, and configure the reference method of fonts and graphics in OFD files; Pre-prepare the flag data for the beginning and end of the file. At the beginning of the OFD file, set the file header information that complies with the OFD specification. At the end of the file, add the end flag of the OFD file.

7. A method for realizing the automatic generation of a format file for a digital invoice according to claim 6, characterized in that: Step S4 also includes the following specific contents: Determine the generation rules of XML files, design the document structure of XML, define root elements and sub-elements, and configure the data types and attributes of XML elements; Prefabricate the marker data for the beginning and end of the file, add an XML declaration at the beginning of the XML file, and add an end tag at the end of the file.

8. A method for realizing the automatic generation of a format file for a digital invoice according to claim 7, characterized in that: Step S5 includes the following specific contents: Assign pre-edited layout document style templates to corresponding tasks according to different business needs and invoice types; Build a scheduling engine that can start the layout file generation task according to the preset time interval or event trigger mechanism.

9. A method for realizing automatic generation of format files for digital invoices according to claim 8, characterized in that: Step S6 includes the following specific contents: Select the PDF reader plug-in and integrate it into the preview platform to directly view the PDF invoice format file on the platform. For OFD format, integrate the OFD reader to correctly parse and display the invoice content in OFD format; Use the iframe tag to embed an external PDF or OFD reader into the preview platform page, and set the iframe attributes to enable embedded viewing of the invoice format file within the platform; Use the freemarker template engine to process the invoice layout file in XML format.

10. A system for realizing the automatic generation of layout files of digital electronic invoices, which is used to realize the method for realizing the automatic generation of layout files of digital electronic invoices as described in any one of claims 1 to 9, comprising a file style template editing module, a data field rule configuration module, a sensitive data signature verification method and encryption method configuration module, a layout file output format configuration module, a prefabricated task scheduling service module, and a layout file preview platform configuration module; The file style template editing module is used to edit the digital invoice format file style template, and pre-make the basic format, special business format, specific element format, and custom format; The data field rule configuration module is used to implement field type configuration, edit rule codes, rule names, sql functions, custom templates, data dictionary conversion, and string concatenation; The sensitive data signature verification and encryption configuration module is used to configure the sensitive data signature verification method, the encryption methods include SM4, AES, BASE64, and dynamically generate encryption algorithms and encryption keys; The layout file output format configuration module is used for layout file output format configuration. The file formats include PDF, OFD, and XML, and the generation rules are configured separately to pre-set the mark data at the beginning and end of the file. The prefabricated task scheduling service module is used to allocate templates for generating layout files, and the scheduling engine drives the automatic generation of layout files; The layout file preview platform configuration module is used to integrate PDF, OFD readers, iframe plug-ins, and freemarker preview XML to complete layout file preview.