Search

CN-121683749-B - Authentication document generation method and system

CN121683749BCN 121683749 BCN121683749 BCN 121683749BCN-121683749-B

Abstract

The invention provides a method and a system for generating an authentication document, which relate to the technical field of software architecture design, wherein the method comprises the steps of obtaining a user request for generating the authentication document; the method comprises the steps of responding to a user request, carrying out unified code encapsulation processing on a business entity through a universal controller based on generalized abstraction to obtain bottom support data for providing unified data for a form engine and a fragment engine, calling a plug-in data constructor according to the bottom support data through the form engine to construct form data, calling the plug-in fragment constructor according to the form data through the fragment engine to construct HTML fragment data, carrying out rendering processing on the HTML fragment data and form data associated with the HTML fragment data by using a rendering template to generate rendering contents of an authentication document, and returning the rendering contents to a user side to generate the authentication document.

Inventors

  • ZHANG ZHE
  • XIE XIN
  • XIE WENFEI

Assignees

  • 浙江望安科技有限公司

Dates

Publication Date
20260508
Application Date
20260210

Claims (7)

  1. 1. A method of generating an authentication document, comprising: S1, acquiring a user request for generating an authentication document; S2, responding to the user request, and carrying out unified code encapsulation processing on the business entity through a universal controller based on the generalized abstraction to obtain bottom-layer support data for providing unified data for the form engine and the fragment engine; wherein, the S2 specifically includes: s201, receiving the user request through a service controller; s202, judging whether the business controller inherits a general controller base class based on the generic abstraction, if so, calling a general CRUD method through the general controller base class, linking a general service class and a general data access interface, completing unified data processing of the business entity, and obtaining the bottom layer support data, otherwise, executing custom logic; S3, calling a plug-in data constructor through a form engine according to the bottom layer support data to construct form data; wherein, the S3 specifically includes: S301, receiving form data requested by a user through a form engine controller to obtain form request parameters; S302, processing the form request parameters through FormEngine types to obtain initialized form request parameters, wherein the initialized form request parameters comprise a form ID and a service ID; s303, inquiring list structure information based on the list ID; S304, searching the plug-in data constructor according to the form ID; S305, executing buildData methods of the plug-in data constructor; s306, acquiring service data; s307, combining the form construction information and the service data to form the form data; s4, calling a plug-in fragment builder through a fragment engine according to the form data to build HTML fragment data; Wherein, the S4 specifically includes: S401, receiving fragment data requested by a user through a fragment engine controller to obtain fragment request parameters; S402, processing the fragment request parameters through FRAGMENTENGINE types to obtain initialized fragment request parameters, wherein the initialized fragment request parameters comprise fragment IDs and service IDs; s403, searching fragment information based on the fragment ID; s404, searching the plug-in fragment constructor according to the fragment ID, wherein the plug-in fragment constructor is a DefaultFragmentBuilder subclass; S405, calling buildHtml methods of the plug-in fragment constructor to construct the HTML fragment data; S5, using a rendering template to render the HTML fragment data and the form data associated with the HTML fragment data, and generating the rendering content of the authentication document; and S6, returning the rendering content to the user side to generate the authentication document.
  2. 2. The method according to claim 1, wherein all data required for constructing the HTML fragment data in S4 is forcibly acquired by calling the plug-in data constructor in S3.
  3. 3. The method for generating an authentication document according to claim 1, wherein S202 specifically comprises: s2021, calling the universal CRUD method through the universal controller base class to generate a calling instruction; S2022, triggering service processing business according to the calling instruction; S2023, judging whether the service processing business inherits the general service class, if yes, entering S2024, otherwise, executing the custom data logic; S2024, calling a universal data access interface through the universal service class, carrying out unified data processing on the business entity, and outputting the bottom layer support data for calling by a follow-up form engine and a fragment engine.
  4. 4. The method for generating an authentication document according to claim 1, wherein S5 specifically comprises: S501, processing the form data associated with the HTML fragment data by applying a data cleaning rule chain to obtain standardized data; S502, performing rendering processing on the standardized data and the HTML fragment data through a template rendering rule to generate the rendering content.
  5. 5. The method of generating an authentication document as recited in claim 4, wherein the data cleansing rule chain comprises a field filtering rule, a formatting rule, a desensitizing rule, a converting rule, and an aggregation rule.
  6. 6. A generation system of an authentication document is characterized by comprising a processor and a memory; the memory stores a program or instructions executable on the processor, which when executed by the processor, implement the steps of the method of generating an authentication document as claimed in any one of claims 1 to 5.
  7. 7. A readable storage medium, wherein a program or instructions is stored on the readable storage medium, which when executed by a processor, implements the steps of the method of generating an authentication document according to any one of claims 1 to 5.

Description

Authentication document generation method and system Technical Field The invention relates to the technical field of software architecture design, in particular to a method and a system for generating an authentication document. Background In the fields of enterprise management, product authentication, compliance inspection and the like, it is often required to generate standardized authentication documents with complex structures and strict contents. Such documents are typically assembled from multiple logically independent and interrelated segments (e.g., "project overview," "technical architecture," "test cases," "compliance declarations," etc.). The traditional development mode writes front-end codes and back-end codes for each document or segment independently, so that a great deal of repeated labor exists in the development process, the project period is long, the cost is high, and the system is difficult to maintain and update uniformly. Currently, there is an improvement over the infrastructure component that reduces the repetition code of the front-end page to some extent by introducing generic front-end UI components (e.g., forms, tables) and underlying tool classes. The developer manually assembles interfaces for different business entities by utilizing the components, and writes corresponding controller and service layer codes to acquire and process data. However, the prior art scheme lacks standardized constraint on the development of the back-end fragments, so that the fragments realized by different developers have obvious differences in data verification, exception handling and interface specification, the data acquisition path is not planned uniformly, all UI components still directly access the data source through the scattered interfaces, the data consistency cannot be ensured, a collaboration mechanism is lacking between the forms and the fragments, the data association and the content splicing still need to be carried out through manual intervention during document assembly, the system expansibility is poor, and the maintenance cost is high. This loosely-integrated architecture mode results in low code reuse rates and high system coupling. Disclosure of Invention In view of the shortcomings of the prior art, the embodiment of the invention aims to provide a generation method of an authentication document, which can solve the problems that in the prior art, a data acquisition path is not planned uniformly, each UI component still directly accesses a data source through a scattered interface and cannot guarantee data consistency, a collaboration mechanism is lacking between a form and a fragment, and manual intervention is still needed for data association and content splicing during document assembly, so that the system expansibility is poor and the maintenance cost is high. The loosely integrated architecture mode has the technical problems of low code multiplexing rate and high system coupling degree. In a first aspect of an embodiment of the present invention, a method for generating an authentication document is provided, including: S1, acquiring a user request for generating an authentication document; S2, responding to a user request, and carrying out unified code encapsulation processing on a business entity through a universal controller based on generalized abstraction to obtain bottom-layer support data for providing unified data for a form engine and a fragment engine; S3, calling a plug-in data constructor through a form engine according to the bottom layer support data to construct form data; S4, calling a plug-in fragment builder through a fragment engine according to the form data to build HTML fragment data; S5, rendering the HTML fragment data and form data associated with the HTML fragment data by using a rendering template to generate rendering contents of the authentication document; And S6, returning the rendering content to the user side to generate an authentication document. In a second aspect of the embodiment of the invention, a generation system of an authentication document is provided, which comprises a processor and a memory; The memory stores a program or instructions executable on the processor which when executed by the processor implement the steps of the method of generating an authentication document as in the first aspect. In a third aspect of the embodiments of the present invention, a readable storage medium is provided, on which a program or an instruction is stored, which when executed by a processor, implements the steps of the method for generating an authentication document as in the first aspect. The technical scheme provided by the embodiment of the invention has the beneficial effects that at least: In the embodiment of the invention, the form engine is established as a unique data source framework, the data acquisition path is planned uniformly, the problem of inconsistent data caused by a scattered interface is radically solved, the automa