[go: up one dir, main page]

CN112613290A - Document template generation method, device, equipment and storage medium - Google Patents

Document template generation method, device, equipment and storage medium Download PDF

Info

Publication number
CN112613290A
CN112613290A CN202011500617.1A CN202011500617A CN112613290A CN 112613290 A CN112613290 A CN 112613290A CN 202011500617 A CN202011500617 A CN 202011500617A CN 112613290 A CN112613290 A CN 112613290A
Authority
CN
China
Prior art keywords
document
template
label
pattern
dynamic difference
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011500617.1A
Other languages
Chinese (zh)
Inventor
黄学蒙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN202011500617.1A priority Critical patent/CN112613290A/en
Publication of CN112613290A publication Critical patent/CN112613290A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computational Linguistics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Mathematical Physics (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to the field of artificial intelligence and discloses a document template generation method, a document template generation device, document template generation equipment and a storage medium. The document template generation method comprises the following steps: acquiring a master template file pattern and a plurality of service attributes corresponding to the document master template; carrying out dynamic difference pattern label identification on the master template pattern; if the dynamic difference pattern label exists in the master template pattern, carrying out validity check on the dynamic difference pattern label; if the validity is verified, splitting the document main template into a plurality of document sub-templates according to each service attribute; determining a difference detailed file of the position of the dynamic difference file label in each sub-template file according to each business attribute; and replacing the dynamic difference pattern labels in the corresponding sub-template patterns by using the difference detail patterns to generate target document templates of the document main templates in different service scenes. The document template generating method and the document template generating device can generate document templates suitable for different application scenes in batches, and can effectively reduce the maintenance cost of the document templates.

Description

Document template generation method, device, equipment and storage medium
Technical Field
The invention relates to the field of artificial intelligence, in particular to a document template generation method, a document template generation device, document template generation equipment and a storage medium.
Background
With the development of artificial intelligence technology, some documents can be stored in a template form, when specific documents need to be generated, only corresponding document templates in a template library need to be searched, and parameters of the document templates are specified, so that the documents used in a real service scene can be generated.
The traditional document template management mode is uniformly maintained by background developers, different service lines correspond to different templates, and the mode often cannot meet the requirement of timeliness along with the rapid change of supervision situations. Moreover, when the common portion of each template needs to be adjusted, the templates corresponding to each service line need to be modified, which is laborious and prone to errors.
Disclosure of Invention
The invention mainly aims to solve the technical problems of excessively high coupling degree of a document template and a specific service scene and high maintenance cost.
The invention provides a document template generation method in a first aspect, which comprises the following steps:
acquiring a main template file and a plurality of service attributes corresponding to a document main template, wherein the main template file is composed of text information and/or picture information in a document format;
carrying out dynamic difference pattern label identification on the master template pattern;
if the dynamic difference pattern label exists in the master template pattern, carrying out validity check on the dynamic difference pattern label;
if the verification of the validity is passed, splitting the single certificate main template into a plurality of single certificate sub-templates according to the service attributes, wherein the sub-template patterns corresponding to the single certificate sub-templates are the same as the main template patterns, and the service attribute combinations correspond to a plurality of different service scenes;
determining a difference detailed file of the position of the dynamic difference file label in each sub-template file according to each business attribute;
and replacing the dynamic difference pattern labels in the corresponding sub-template patterns by using the difference detail patterns to generate target document templates of the document main templates in different service scenes.
Optionally, in a first implementation manner of the first aspect of the present invention, if it is identified that a dynamic difference document tag exists in the master template document, performing validity check on the dynamic difference document tag includes:
if the master template file is identified to have the dynamic difference file label, acquiring a dynamic difference file label set corresponding to the document master template in a preset data dictionary, and sequentially reading the dynamic difference file label from a preset label queue;
judging whether the read dynamic difference document label is matched with the label in the dynamic difference document label set;
and if so, determining that the currently read dynamic difference pattern tag passes the validity check, otherwise, not passing the validity check.
Optionally, in a second implementation manner of the first aspect of the present invention, before the performing dynamic difference document pattern tag identification on the master template document, the method further includes:
acquiring a preset symbol set for constructing a dynamic difference pattern label;
constructing a retrieval expression according to the symbol set;
optionally, in a third implementation manner of the first aspect of the present invention, the performing of dynamic difference pattern tag identification on the master template pattern includes:
executing the retrieval expression to scan the master template file to obtain a scanning result;
judging whether symbols matched with the retrieval expression exist in the scanning result or not;
and if the dynamic difference pattern label exists, storing the dynamic difference pattern label corresponding to the symbol into the label queue.
Optionally, in a fourth implementation manner of the first aspect of the present invention, before the performing validity check on the dynamic difference document tag if the dynamic difference document tag is identified to exist in the master template document, the method further includes:
performing data modeling on each service attribute and each dynamic difference pattern label corresponding to the document master template, and constructing the data dictionary;
extracting dynamic difference pattern tags corresponding to all service attributes in the data dictionary to generate a dynamic difference pattern tag set;
optionally, in a fifth implementation manner of the first aspect of the present invention, if the validity check is passed, splitting the document main template into a plurality of document sub-templates according to the service attributes includes:
if the validity is verified, analyzing the service attributes to obtain the coding information of the service attributes corresponding to the single certificate main template;
acquiring a plurality of attribute values corresponding to each service attribute by taking the coding information of each service attribute as an index;
sequentially storing the attribute values corresponding to the service attributes into an attribute stack to obtain a plurality of attribute stacks formed by combining different attribute values;
and sequentially generating corresponding document sub-templates according to the attribute stacks, wherein the document sub-templates comprise the main template file and the dynamic difference file labels corresponding to the attribute values.
Optionally, in a sixth implementation manner of the first aspect of the present invention, after the replacing, by the difference detailed schema, the dynamic difference schema tag in the corresponding sub-template schema, and generating the target document template of the document main template in different service scenarios, the method further includes:
judging whether the target document template contains a hyperlink or not;
if yes, analyzing the coding information in the hyperlink to obtain an embedded document template corresponding to the target document template;
and replacing the dynamic difference document case label in the embedded document case template with the difference detail document case corresponding to the dynamic difference document case label in the target document case template to obtain the embedded document case template corresponding to the target document case template in the current service scene.
A second aspect of the present invention provides a document template generating apparatus, including:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a main template file pattern and a plurality of service attributes corresponding to a document main template, and the main template file pattern is composed of character information and/or picture information with a document format;
the identification module is used for carrying out dynamic difference pattern label identification on the master template pattern;
the verification module is used for verifying the legality of the dynamic difference pattern tag if the dynamic difference pattern tag is identified to exist in the master template pattern;
the splitting module is used for splitting the document main template into a plurality of document sub-templates according to the business attributes if the validity is verified, wherein the sub-template pattern corresponding to the document sub-template is the same as the main template pattern, and each business attribute combination corresponds to a plurality of different business scenes;
the determining module is used for determining the difference detailed file of the position of the dynamic difference file label in each sub-template file according to each service attribute;
and the generation module is used for replacing the dynamic difference pattern labels in the corresponding sub-template patterns by using the difference detail patterns and generating the target document templates of the document main templates in different service scenes.
Optionally, in a first implementation manner of the second aspect of the present invention, the verification module is specifically configured to:
if the master template file is identified to have the dynamic difference file label, acquiring a dynamic difference file label set corresponding to the document master template in a preset data dictionary, and sequentially reading the dynamic difference file label from a preset label queue; judging whether the read dynamic difference document label is matched with the label in the dynamic difference document label set; and if so, determining that the currently read dynamic difference pattern tag passes the validity check, otherwise, not passing the validity check.
Optionally, in a second implementation manner of the second aspect of the present invention, the document template generating apparatus further includes:
the expression construction module is used for acquiring a preset symbol set for constructing the dynamic difference pattern label; constructing a retrieval expression according to the symbol set;
the identification module is specifically configured to:
executing the retrieval expression to scan the master template file to obtain a scanning result;
judging whether symbols matched with the retrieval expression exist in the scanning result or not;
and if the symbol matched with the retrieval expression exists in the scanning result, storing the dynamic difference file scheme label corresponding to the symbol into the label queue.
Optionally, in a third implementation manner of the second aspect of the present invention, the document template generating apparatus further includes:
the dictionary construction module is used for carrying out data modeling on each service attribute and the dynamic difference pattern label corresponding to the document main template and constructing the data dictionary;
and the tag set generating module is used for extracting dynamic difference file tags corresponding to all service attributes in the data dictionary and generating a dynamic difference file tag set.
Optionally, in a fourth implementation manner of the second aspect of the present invention, the splitting module is specifically configured to:
if the validity is verified, analyzing the service attributes to obtain the coding information of the service attributes corresponding to the single certificate main template;
acquiring a plurality of attribute values corresponding to each service attribute by taking the coding information of each service attribute as an index;
sequentially storing the attribute values corresponding to the service attributes into an attribute stack to obtain a plurality of attribute stacks formed by combining different attribute values;
and sequentially generating corresponding document sub-templates according to the attribute stacks, wherein the document sub-templates comprise the main template file and the dynamic difference file labels corresponding to the attribute values.
Optionally, in a fifth implementation manner of the second aspect of the present invention, the document template generating apparatus further includes:
the analysis module is used for judging whether the target document template contains a hyperlink or not, and if the target document template contains the hyperlink, analyzing the coding information in the hyperlink to obtain an embedded document template corresponding to the target document template;
and the replacing module is used for replacing the dynamic difference document label in the embedded document template with the difference detail document corresponding to the dynamic difference document label in the target document template to obtain the embedded document template corresponding to the target document template in the current service scene.
A third aspect of the present invention provides a document template generating apparatus, including: a memory and at least one processor, the memory having instructions stored therein; the at least one processor invokes the instructions in the memory to cause the document template generation device to perform the document template generation method described above.
A fourth aspect of the present invention provides a computer-readable storage medium having stored therein instructions, which, when run on a computer, cause the computer to execute the above-described document template generation method.
In the technical scheme provided by the invention, in view of the fact that the template documents used between different document templates are basically consistent and only a few documents have differences, dynamic difference document labels are introduced, the positions of the difference documents in different service application scenes in the general template documents are marked by the labels in advance, and then the difference documents used in each service scene are replaced into the corresponding label positions to obtain the document templates suitable for different service scenes. The document template is corresponding to each service scene in an attribute combination mode, so that the document template can be rapidly generated in batches, the time cost of manual operation is reduced, the maintenance cost of the document template is reduced, and the generation efficiency of the document template is improved.
Drawings
FIG. 1 is a schematic diagram of a first embodiment of a document template generation method according to an embodiment of the present invention;
FIG. 2 is a diagram of a second embodiment of a document template generation method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a first embodiment of a document template generating apparatus according to an embodiment of the present invention;
FIG. 4 is a diagram of a second embodiment of a document template generating apparatus according to an embodiment of the present invention;
fig. 5 is a schematic diagram of an embodiment of a document template generating device in the embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a document template generation method, a document template generation device, document template generation equipment and a storage medium. The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," or "having," and any variations thereof, are intended to cover non-exclusive inclusions, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
For convenience of understanding, a specific flow of the embodiment of the present invention is described below, and referring to fig. 1, a first embodiment of a document template generating method in the embodiment of the present invention includes:
101. acquiring a main template file and a plurality of service attributes corresponding to a document main template, wherein the main template file is composed of text information and/or picture information in a document format;
it is to be understood that the executing subject of the present invention may be a document template generating apparatus, and may also be a terminal or a server, which is not limited herein. The embodiment of the present invention is described by taking a server as an execution subject.
In this embodiment, the document master template is a split basis according to different service attributes when the sub-templates are generated, and the content of the document master template is a master template pattern including text information and/or picture information in a document format. In addition, it also has a corresponding plurality of business attributes, for example, the current document master template has two business attributes: and the common insurer and the fund mode are adopted, so that when the sub-template is split, the sub-template is split according to the attribute values corresponding to the two attributes to obtain the sub-template with different attribute value combinations.
102. Carrying out dynamic difference pattern label identification on the master template pattern;
in this embodiment, after receiving the master template document, the dynamic difference document tag in the document needs to be identified, so that the content of the tag is replaced with the detailed document content corresponding to each service attribute, and a sub-template used in a specific service scene is further obtained.
In this embodiment, the dynamic difference document tags may be configured by a user, a configuration interface is provided for the user to operate, after the master template is selected, the system obtains a selectable dynamic difference document tag set corresponding to the attribute of the current template from the data dictionary, after the user selects, the dynamic difference document tags are inserted into the master template as the content of the master template, and are brought in when the sub-templates are split, and when the target document template is generated, the dynamic difference document tags are replaced with the detailed difference document, so as to obtain the document template used in a specific service scenario.
103. If the dynamic difference pattern label exists in the master template pattern, carrying out validity check on the dynamic difference pattern label;
in this embodiment, each master template document has a corresponding legal tag, and the accuracy and the safety of the generation of the sub-templates can be improved by limiting the legal tags, and if an illegal tag is verified, prompt information is output to remind a user to delete the corresponding illegal tag, so as to ensure that the sub-templates do not contain illegal information.
In this embodiment, whether a dynamic difference document pattern tag identified from a master template is legal is determined through a legal tag set corresponding to each attribute in a data dictionary, and the tag validity check method includes modeling a service attribute and a legal tag corresponding to the master template to construct a corresponding data dictionary, extracting a tag set corresponding to each service attribute from the data dictionary, comparing a tag queue identified from the master template document pattern with the legal tag sets one by one, if a tag in the tag queue cannot be found in the legal tag sets, the tag does not pass the illegal tag and the validity check does not pass, otherwise, the tag is a legal tag and the validity check passes. For example, Tag queues are { Tag1, Tag2}, and legal Tag sets are { Tag2, Tag3}, then Tag1 is not present in the legal Tag sets and is an illegal Tag, and Tag2 is a legal Tag.
Optionally, in an embodiment, step 103 includes:
if the master template file is identified to have the dynamic difference file label, acquiring a dynamic difference file label set corresponding to the document master template in a preset data dictionary, and sequentially reading the dynamic difference file label from a preset label queue;
judging whether the read dynamic difference document label is matched with the label in the dynamic difference document label set;
and if so, determining that the currently read dynamic difference pattern tag passes the validity check, otherwise, not passing the validity check.
Optionally, in an embodiment, before step 103, the method further includes:
performing data modeling on each service attribute and each dynamic difference pattern label corresponding to the document master template, and constructing the data dictionary;
and extracting dynamic difference pattern tags corresponding to the service attributes in the data dictionary to generate a dynamic difference pattern tag set.
In this optional embodiment, the method for checking the validity of the tag includes modeling the service attribute and the valid tag corresponding to the master template, creating a corresponding data dictionary, extracting a tag set corresponding to each service attribute from the data dictionary, comparing a tag queue identified in the master template document with the valid tag sets one by one, and if a certain tag in the tag queue cannot be found in the valid tag sets, the tag does not have an illegal tag, the validity check fails, otherwise, the tag is a valid tag, and the validity check passes. For example, Tag queues are { Tag1, Tag2}, and legal Tag sets are { Tag2, Tag3}, then Tag1 is not present in the legal Tag sets and is an illegal Tag, and Tag2 is a legal Tag.
104. If the verification of the validity is passed, splitting the single certificate main template into a plurality of single certificate sub-templates according to the service attributes, wherein the sub-template patterns corresponding to the single certificate sub-templates are the same as the main template patterns, and the service attribute combinations correspond to a plurality of different service scenes;
in this embodiment, when all the dynamic difference pattern tags in the master template are legal tags, the template is split. The splitting method is to combine and split according to each attribute value corresponding to each service attribute to generate a plurality of sub-templates which are formed by combining different service attributes and correspond to a plurality of different service scenes. For example, the business attributes of the main template are co-insured party and fund mode, where the co-insured party includes co-insured party 1 and co-insured party 2, and the fund mode includes fund mode 1 and fund mode 2, then there are 4 sub-template combinations generated, which are: "Coupier 1-funding mode 1", "Coupier 1-funding mode 2", "Coupier 2-funding mode 1", and "Coupier 2-funding mode 2".
Optionally, in an embodiment, step 104 includes:
if the validity is verified, analyzing the service attributes to obtain the coding information of the service attributes corresponding to the single certificate main template;
acquiring a plurality of attribute values corresponding to each service attribute by taking the coding information of each service attribute as an index;
sequentially storing the attribute values corresponding to the service attributes into an attribute stack to obtain a plurality of attribute stacks formed by combining different attribute values;
and sequentially generating corresponding document sub-templates according to the attribute stacks, wherein the document sub-templates comprise the main template file and the dynamic difference file labels corresponding to the attribute values.
In this optional embodiment, since the service attribute source of the master template is not limited, when the service attribute of the master template is obtained, the service attribute needs to be analyzed, so that the service attribute is converted into a coding format that can be recognized by the system and stored in the database, which is convenient for subsequent use. For example, if the service attribute of the current master template is a regular expression obtained by another system, the corresponding attribute name and attribute value in the regular expression need to be analyzed, and converted into a coding format recognizable by the system for storage.
In this optional embodiment, after the main template is split into a plurality of sub-templates, each difference detail pattern is determined according to the dynamic difference pattern tags corresponding to different attributes, so that the difference detail patterns are replaced into the corresponding sub-templates, and a document template used in a target service scene is generated. For example, the sub-template "co-insurer 1-fund mode 1" is a sub-template, and the corresponding difference detail documents are the detail document of the co-insurer 1 and the detail document of the fund mode 1, the difference label of the co-insurer 1 is replaced by the detail document of the co-insurer 1, and the difference label of the fund mode 1 is replaced by the detail document of the fund mode 1, so that the document template in the "co-insurer 1-fund mode 1" service scene is obtained. And obtaining the corresponding document template of other sub-modes in the same way.
105. Determining a difference detailed file of the position of the dynamic difference file label in each sub-template file according to each business attribute;
in this embodiment, after the main template is split into a plurality of sub-templates, each difference detail pattern is determined according to the dynamic difference pattern tags corresponding to different attributes, so that the difference detail patterns are replaced into the corresponding sub-templates, and a document template used in a target service scene is generated. For example, the sub-template "co-insurer 1-fund mode 1" is a sub-template, and the corresponding difference detail documents are the detail document of the co-insurer 1 and the detail document of the fund mode 1, the difference label of the co-insurer 1 is replaced by the detail document of the co-insurer 1, and the difference label of the fund mode 1 is replaced by the detail document of the fund mode 1, so that the document template in the "co-insurer 1-fund mode 1" service scene is obtained. And obtaining the corresponding document template of other sub-modes in the same way.
106. And replacing the dynamic difference pattern labels in the corresponding sub-template patterns by using the difference detail patterns to generate target document templates of the document main templates in different service scenes.
In this embodiment, different business attributes correspond to different dynamic difference document labels, and different dynamic difference document labels correspond to different difference detailed documents, in order to customize different document templates for different business scenarios when generating the document template, in practical applications, document templates used in different business scenarios may have only slight differences, and for these slight differences, a document template needs to be added and managed together with other document templates, which may cause a certain confusion. After the scheme of replacing the dynamic tags with the differential case is adopted, the management of the document template is more intelligent, different templates only need to be configured with different tags, the differential case can be linked, and the loss caused by manual review is reduced.
Optionally, in an embodiment, after step 106, the method further includes:
judging whether the target document template contains a hyperlink or not;
if yes, analyzing the coding information in the hyperlink to obtain an embedded document template corresponding to the target document template;
and replacing the dynamic difference document case label in the embedded document case template with the difference detail document case corresponding to the dynamic difference document case label in the target document case template to obtain the embedded document case template corresponding to the target document case template in the current service scene.
In this optional embodiment, because there may be a nesting relationship between the document templates, the nested document template also needs to be replaced by a corresponding detail document under the service scene of the current document template, and the replacement mode is the same as the master template replacement mode. The embedded document template corresponding to the target document template can be obtained by analyzing the coding information in the hyperlink, so that detailed document replacement is carried out, a document template combination under the current service scene is obtained, and the document template combination can be directly used for document generation work of the current service scene.
In the embodiment of the invention, in view of the fact that the template files used between different document templates are generally consistent and only a few files have differences, dynamic difference file labels are introduced, the positions of the difference files in different service application scenes in the universal template files are marked by the labels in advance, and then the difference files used in each service scene are replaced into the corresponding label positions to obtain the document templates suitable for different service scenes. The document template is corresponding to each service scene in an attribute combination mode, so that the document template can be rapidly generated in batches, the time cost of manual operation is reduced, the maintenance cost of the document template is reduced, and the generation efficiency of the document template is improved.
Referring to fig. 2, a second embodiment of the document template generating method according to the embodiment of the present invention includes:
201. acquiring a main template file and a plurality of service attributes corresponding to a document main template, wherein the main template file is composed of text information and/or picture information in a document format;
202. acquiring a preset symbol set for constructing a dynamic difference pattern label;
203. constructing a retrieval expression according to the symbol set;
204. executing the retrieval expression to scan the master template file to obtain a scanning result;
205. judging whether symbols matched with the retrieval expression exist in the scanning result or not;
206. if yes, storing the dynamic difference pattern label corresponding to the symbol into the label queue;
in this embodiment, the tag identification method includes first constructing a symbol set of the dynamic difference pattern tag, where the symbol set includes an identification symbol of the tag, constructing an expression of retrieving the tag through the identified tag symbol, executing the expression, and determining whether the tag symbol exists in the master pattern, so as to know whether the tag exists in the master pattern. And after the label symbol is identified, storing the label corresponding to the label symbol into a label queue so as to be convenient for use in subsequent label validity check and detail file replacement.
In this embodiment, the preset symbol set is generated when a dynamic difference pattern Tag is constructed, for example, the Tag of the pattern is $ { Tag }, then the Tag symbol corresponding to the Tag is $ ", the Tag is stored in the preset symbol set, when the master template pattern is identified, whether the Tag symbol in the symbol set exists in the master template pattern is determined, and if the Tag symbol exists in the symbol set, the Tag is stored in a Tag queue for validity check of the Tag.
207. Carrying out dynamic difference pattern label identification on the master template pattern;
208. if the dynamic difference pattern label exists in the master template pattern, carrying out validity check on the dynamic difference pattern label;
209. if the verification of the validity is passed, splitting the single certificate main template into a plurality of single certificate sub-templates according to the service attributes, wherein the sub-template patterns corresponding to the single certificate sub-templates are the same as the main template patterns, and the service attribute combinations correspond to a plurality of different service scenes;
210. determining a difference detailed file of the position of the dynamic difference file label in each sub-template file according to each business attribute;
211. and replacing the dynamic difference pattern labels in the corresponding sub-template patterns by using the difference detail patterns to generate target document templates of the document main templates in different service scenes.
In the embodiment of the invention, the dynamic difference pattern label has the special label symbol, so that the dynamic difference pattern label is convenient to identify in the master template pattern, all symbol sets of the label need to be constructed in advance, all the label symbols are stored, after the label symbols are identified, a label retrieval expression is constructed, the label existing in the master template pattern is retrieved, and the pattern replacement is carried out. The embodiment enables the setting and the identification of the label to be more intelligent, so that the target document template can be generated more quickly.
In the above description of the document template generating method in the embodiment of the present invention, the document template generating apparatus in the embodiment of the present invention is described below with reference to fig. 3, and a first embodiment of the document template generating apparatus in the embodiment of the present invention includes:
an obtaining module 301, configured to obtain a master template pattern and multiple service attributes corresponding to a document master template, where the master template pattern is formed by text information and/or picture information in a document format;
an identifying module 302, configured to perform dynamic difference pattern tag identification on the master template pattern;
a verification module 303, configured to perform validity verification on the dynamic difference document tag if it is identified that the dynamic difference document tag exists in the master template document;
a splitting module 304, configured to split the document main template into multiple document sub-templates according to the service attributes if the validity check is passed, where a sub-template pattern corresponding to the document sub-template is the same as the main template pattern, and each service attribute combination corresponds to multiple different service scenes;
a determining module 305, configured to determine, according to the service attributes, a difference detail document of the position where the dynamic difference document tag is located in each sub-template document;
and the generating module 306 is configured to replace the dynamic difference document pattern tag in the corresponding sub-template document pattern with the difference detail document pattern, and generate a target document template of the document main template in different service scenes.
Optionally, in an embodiment, the splitting module 304 is specifically configured to:
if the validity is verified, analyzing the service attributes to obtain the coding information of the service attributes corresponding to the single certificate main template;
acquiring a plurality of attribute values corresponding to each service attribute by taking the coding information of each service attribute as an index;
sequentially storing the attribute values corresponding to the service attributes into an attribute stack to obtain a plurality of attribute stacks formed by combining different attribute values;
and sequentially generating corresponding document sub-templates according to the attribute stacks, wherein the document sub-templates comprise the main template file and the dynamic difference file labels corresponding to the attribute values.
In the embodiment of the invention, in view of the fact that the template files used between different document templates are generally consistent and only a few files have differences, dynamic difference file labels are introduced, the positions of the difference files in different service application scenes in the universal template files are marked by the labels in advance, and then the difference files used in each service scene are replaced into the corresponding label positions to obtain the document templates suitable for different service scenes. The document template is corresponding to each service scene in an attribute combination mode, so that the document template can be rapidly generated in batches, the time cost of manual operation is reduced, the maintenance cost of the document template is reduced, and the generation efficiency of the document template is improved.
Referring to fig. 4, a second embodiment of the document template generating apparatus according to the embodiment of the present invention includes:
an obtaining module 301, configured to obtain a master template pattern and multiple service attributes corresponding to a document master template, where the master template pattern is formed by text information and/or picture information in a document format;
an identifying module 302, configured to perform dynamic difference pattern tag identification on the master template pattern;
a verification module 303, configured to perform validity verification on the dynamic difference document tag if it is identified that the dynamic difference document tag exists in the master template document;
a splitting module 304, configured to split the document main template into multiple document sub-templates according to the service attributes if the validity check is passed, where a sub-template pattern corresponding to the document sub-template is the same as the main template pattern, and each service attribute combination corresponds to multiple different service scenes;
a determining module 305, configured to determine, according to the service attributes, a difference detail document of the position where the dynamic difference document tag is located in each sub-template document;
and the generating module 306 is configured to replace the dynamic difference document pattern tag in the corresponding sub-template document pattern with the difference detail document pattern, and generate a target document template of the document main template in different service scenes.
The analysis module 307 is configured to determine whether the target document template includes a hyperlink, and if yes, analyze encoding information in the hyperlink to obtain an embedded document template corresponding to the target document template;
the replacing module 308 is configured to replace the dynamic difference document pattern tag in the embedded document template with the difference detail document pattern corresponding to the dynamic difference document pattern tag in the target document template, so as to obtain the embedded document template corresponding to the target document template in the current service scene.
The expression constructing module 309 is configured to obtain a preset symbol set used for constructing the dynamic difference pattern label, and construct a retrieval expression according to the symbol set.
The identification module 302 is specifically configured to:
executing the retrieval expression to scan the master template file to obtain a scanning result;
judging whether symbols matched with the retrieval expression exist in the scanning result or not;
and if the symbol matched with the retrieval expression exists in the scanning result, storing the dynamic difference file scheme label corresponding to the symbol into the label queue.
The dictionary construction module 310 is configured to perform data modeling on each service attribute and the dynamic difference pattern tag corresponding to the document master template, and construct the data dictionary;
and the tag set generating module 311 is configured to extract dynamic difference document tags corresponding to the service attributes in the data dictionary, and generate a dynamic difference document tag set.
The verification module 303 is specifically configured to:
if the master template file is identified to have the dynamic difference file label, acquiring a dynamic difference file label set corresponding to the document master template in a preset data dictionary, and sequentially reading the dynamic difference file label from a preset label queue;
judging whether the read dynamic difference document label is matched with the label in the dynamic difference document label set;
and if so, determining that the currently read dynamic difference pattern tag passes the validity check, otherwise, not passing the validity check.
In the embodiment of the invention, in view of the fact that the template files used between different document templates are generally consistent and only a few files have differences, dynamic difference file labels are introduced, the positions of the difference files in different service application scenes in the universal template files are marked by the labels in advance, and then the difference files used in each service scene are replaced into the corresponding label positions to obtain the document templates suitable for different service scenes. The document template is corresponding to each service scene in an attribute combination mode, so that the document template can be rapidly generated in batches, the time cost of manual operation is reduced, the maintenance cost of the document template is reduced, and the generation efficiency of the document template is improved.
Fig. 3 and 4 describe the document template generating apparatus in the embodiment of the present invention in detail from the perspective of the modular functional entity, and the document template generating apparatus in the embodiment of the present invention is described in detail from the perspective of hardware processing.
Fig. 5 is a schematic structural diagram of a document template generating apparatus according to an embodiment of the present invention, where the document template generating apparatus 500 may have a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 510 (e.g., one or more processors) and a memory 520, and one or more storage media 530 (e.g., one or more mass storage devices) for storing applications 533 or data 532. Memory 520 and storage media 530 may be, among other things, transient or persistent storage. The program stored on the storage medium 530 may include one or more modules (not shown), each of which may include a series of instruction operations on the document template generation apparatus 500. Still further, the processor 510 may be configured to communicate with the storage medium 530 to execute a series of instruction operations in the storage medium 530 on the document template generating apparatus 500.
Document template generation apparatus 500 may also include one or more power supplies 540, one or more wired or wireless network interfaces 550, one or more input-output interfaces 560, and/or one or more operating systems 531, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, and the like. Those skilled in the art will appreciate that the document template generation apparatus configuration shown in FIG. 5 does not constitute a limitation of the document template generation apparatus and may include more or fewer components than shown, or some components may be combined, or a different arrangement of components.
The invention further provides a document template generating device, which includes a memory and a processor, where the memory stores computer readable instructions, and the computer readable instructions, when executed by the processor, cause the processor to execute the steps of the document template generating method in the above embodiments.
The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium, and which may also be a volatile computer-readable storage medium, having stored therein instructions, which, when run on a computer, cause the computer to perform the steps of the document template generation method.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A document template generation method is characterized by comprising the following steps:
acquiring a main template file and a plurality of service attributes corresponding to a document main template, wherein the main template file is composed of text information and/or picture information in a document format;
carrying out dynamic difference pattern label identification on the master template pattern;
if the dynamic difference pattern label exists in the master template pattern, carrying out validity check on the dynamic difference pattern label;
if the verification of the validity is passed, splitting the single certificate main template into a plurality of single certificate sub-templates according to the service attributes, wherein the sub-template patterns corresponding to the single certificate sub-templates are the same as the main template patterns, and the service attribute combinations correspond to a plurality of different service scenes;
determining a difference detailed file of the position of the dynamic difference file label in each sub-template file according to each business attribute;
and replacing the dynamic difference pattern labels in the corresponding sub-template patterns by using the difference detail patterns to generate target document templates of the document main templates in different service scenes.
2. The document template generation method of claim 1, wherein if it is recognized that a dynamic differential document tag exists in the master template document, the performing validity check on the dynamic differential document tag comprises:
if the master template file is identified to have the dynamic difference file label, acquiring a dynamic difference file label set corresponding to the document master template in a preset data dictionary, and sequentially reading the dynamic difference file label from a preset label queue;
judging whether the read dynamic difference document label is matched with the label in the dynamic difference document label set;
and if so, determining that the currently read dynamic difference pattern tag passes the validity check, otherwise, not passing the validity check.
3. The document template generation method of claim 2, further comprising, before the performing dynamic differential document tag recognition on the master template document:
acquiring a preset symbol set for constructing a dynamic difference pattern label;
constructing a retrieval expression according to the symbol set;
the performing dynamic differential document label recognition on the master template document comprises:
executing the retrieval expression to scan the master template file to obtain a scanning result;
judging whether symbols matched with the retrieval expression exist in the scanning result or not;
and if the dynamic difference pattern label exists, storing the dynamic difference pattern label corresponding to the symbol into the label queue.
4. The document template generating method of claim 2, wherein before the verifying the validity of the dynamic differential document tag if the dynamic differential document tag is identified to exist in the master template document, the method further comprises:
performing data modeling on each service attribute and each dynamic difference pattern label corresponding to the document master template to construct a data dictionary;
and extracting dynamic difference pattern tags corresponding to the service attributes in the data dictionary to generate a dynamic difference pattern tag set.
5. The document template generation method of claim 1, wherein splitting the document master template into a plurality of document sub-templates according to the business attributes if the document master template passes the validity check comprises:
if the validity is verified, analyzing the service attributes to obtain the coding information of the service attributes corresponding to the single certificate main template;
acquiring a plurality of attribute values corresponding to each service attribute by taking the coding information of each service attribute as an index;
sequentially storing the attribute values corresponding to the service attributes into an attribute stack to obtain a plurality of attribute stacks formed by combining different attribute values;
and sequentially generating corresponding document sub-templates according to the attribute stacks, wherein the document sub-templates comprise the main template file and the dynamic difference file labels corresponding to the attribute values.
6. The document template generating method of claim 1, wherein after the step of replacing the dynamic differential document pattern tag in the corresponding sub-template document pattern with the differential detailed document pattern to generate the target document template of the document main template in different service scenarios, the method further comprises:
judging whether the target document template contains a hyperlink or not;
if yes, analyzing the coding information in the hyperlink to obtain an embedded document template corresponding to the target document template;
and replacing the dynamic difference document case label in the embedded document case template with the difference detail document case corresponding to the dynamic difference document case label in the target document case template to obtain the embedded document case template corresponding to the target document case template in the current service scene.
7. A document template generating apparatus, characterized by comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a main template file pattern and a plurality of service attributes corresponding to a document main template, and the main template file pattern is composed of character information and/or picture information with a document format;
the identification module is used for carrying out dynamic difference pattern label identification on the master template pattern;
the verification module is used for verifying the legality of the dynamic difference pattern tag if the dynamic difference pattern tag is identified to exist in the master template pattern;
the splitting module is used for splitting the document main template into a plurality of document sub-templates according to the business attributes if the validity is verified, wherein the sub-template pattern corresponding to the document sub-template is the same as the main template pattern, and each business attribute combination corresponds to a plurality of different business scenes;
the determining module is used for determining the difference detailed file of the position of the dynamic difference file label in each sub-template file according to each service attribute;
and the generation module is used for replacing the dynamic difference pattern labels in the corresponding sub-template patterns by using the difference detail patterns and generating the target document templates of the document main templates in different service scenes.
8. The document template generating device of claim 7, wherein the verification module is specifically configured to:
if the master template file is identified to have the dynamic difference file label, acquiring a dynamic difference file label set corresponding to the document master template in a preset data dictionary, and sequentially reading the dynamic difference file label from a preset label queue;
judging whether the read dynamic difference document label is matched with the label in the dynamic difference document label set;
and if so, determining that the currently read dynamic difference pattern tag passes the validity check, otherwise, not passing the validity check.
9. A document template generation device, characterized by comprising: a memory and at least one processor, the memory having instructions stored therein;
the at least one processor invokes the instructions in the memory to cause the document template generation device to perform the document template generation method of any of claims 1-6.
10. A computer-readable storage medium having instructions stored thereon, wherein the instructions, when executed by a processor, implement the document template generation method of any of claims 1-6.
CN202011500617.1A 2020-12-18 2020-12-18 Document template generation method, device, equipment and storage medium Pending CN112613290A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011500617.1A CN112613290A (en) 2020-12-18 2020-12-18 Document template generation method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011500617.1A CN112613290A (en) 2020-12-18 2020-12-18 Document template generation method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112613290A true CN112613290A (en) 2021-04-06

Family

ID=75240445

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011500617.1A Pending CN112613290A (en) 2020-12-18 2020-12-18 Document template generation method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112613290A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113255311A (en) * 2021-05-20 2021-08-13 浙江网商银行股份有限公司 Contract template issuing processing method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113255311A (en) * 2021-05-20 2021-08-13 浙江网商银行股份有限公司 Contract template issuing processing method and device
CN113255311B (en) * 2021-05-20 2024-12-13 浙江网商银行股份有限公司 Contract template publishing processing method and device

Similar Documents

Publication Publication Date Title
CN103930898B (en) Program analysis/the service for checking credentials provides system and control method, program analysis/checking device, program analysis/verification tool managing device
CN112036145B (en) Financial statement recognition method, device, computer equipment and readable storage medium
WO2019237540A1 (en) Method and device for acquiring financial data, terminal device, and medium
US20210366055A1 (en) Systems and methods for generating accurate transaction data and manipulation
CN113836038B (en) Test data construction method, device, equipment and storage medium
CN110908890A (en) Automatic test method and device for interface
CN110188568B (en) Confidential information identification method, apparatus, device and computer readable storage medium
CN112612506A (en) Code change notification method, device, equipment and storage medium
CN112329418A (en) Parallel approval method, apparatus and computer readable storage medium
CN113255369A (en) Text similarity analysis method and device and storage medium
US11574491B2 (en) Automated classification and interpretation of life science documents
CN110688315A (en) Interface code detection report generation method, electronic device, and storage medium
CN112328246A (en) Page component generation method and device, computer equipment and storage medium
CN112989820B (en) Legal document positioning method, device, equipment and storage medium
CN112613290A (en) Document template generation method, device, equipment and storage medium
CN110147516A (en) The intelligent identification Method and relevant device of front-end code in Pages Design
CN114821613A (en) A method and system for extracting table information in PDF
CN119272756A (en) Management method, device and storage medium of multimodal knowledge base
CN116932499B (en) Method for modifying labels of DWG format files in batches
CN113283231A (en) Method for acquiring signature bit, setting system, signature system and storage medium
CN117435189A (en) Test case analysis method, device, equipment and medium of financial system interface
CN113947510A (en) Real estate electronic license management system based on file format self-adaptation
CN113434760A (en) Construction method recommendation method, device, equipment and storage medium
CN114115831A (en) Data processing method, device, equipment and storage medium
JP2008046850A (en) Document type determination device, and document type determination program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination