A file generation method and device, electronic equipment and storage medium
Patent Information
- Application Number
- CN202211316456.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-26
- Publication Date
- 2026-09-15
- Estimated Expiration
- 2042-10-26
AI Technical Summary
[0004]发明人在实现本发明的过程中,发现现有技术存在如下缺陷:应对统一文件类型对不同文件模板的多样化需求,依次生成各个不同的文件模板会导致增加文件处理成本,导致文件生成效率低下
[0021]This invention addresses the problems of high generation costs, poor maintainability and reusability of file templates, and low generation efficiency in existing file generation methods. It reduces file generation costs, improves the maintainability and reusability of file templates, and ultimately increases file generation efficiency.
Smart Images

Figure CN115617757B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a file generation method, apparatus, electronic device and storage medium. Background Technology
[0002] In the field of document processing, different document templates can be defined according to different work needs. Document templates can store relevant raw data and have certain design patterns, such as including but not limited to format, font, font size, required content framework, headers and footers, document numbering requirements, styles of original and copy stamps, and the requirement to indicate the effective date of records and documents, etc. When a document needs to be generated, document templates can be applied to improve work efficiency.
[0003] However, due to various external factors, such as corporate policies, government policies, and the standardization requirements of relevant documents, the same type of document may require different types of document templates to generate specific documents based on these templates. Currently, to meet the diverse needs of different document templates for the same document type, the relevant technology requires generating the corresponding document templates sequentially. Taking a second-hand housing contract as a specific example, as a crucial financing document in the loan process, the second-hand housing contract varies depending on factors such as region, policies, intermediaries, business types, customer groups, fund escrow, whether it is a personal second-hand housing loan, and the escrow funds. Currently, most online second-hand housing contracts have the contract template file directly fixed in the code. When adding other types of second-hand housing contract template files, staff need to modify or generate new template files and then update the code.
[0004] In the process of developing this invention, the inventors discovered the following drawbacks in the existing technology: To address the diverse needs of different file templates for a unified file type, sequentially generating various different file templates increases file processing costs and leads to low file generation efficiency. Taking a second-hand housing contract template as an example, given the diverse demands of the market for second-hand housing contracts, the existing online development and application methods for second-hand housing contract templates inevitably result in low code reusability, high development costs, and difficulty in maintaining the contract templates. Summary of the Invention
[0005] This invention provides a file generation method, apparatus, electronic device, and storage medium, which can reduce the cost of file generation, improve the maintainability and reusability of file templates, and thus improve the efficiency of file generation.
[0006] According to one aspect of the present invention, a file generation method is provided, comprising:
[0007] Obtain the file inheritance hierarchy of the target file to be generated;
[0008] The target traversal structure layer of the target file to be generated is determined according to the file inheritance order of the file inheritance architecture.
[0009] Obtain the target file template and target file element parameters of the target traversal structure layer;
[0010] The target file is generated based on the target file template and the target file element parameters.
[0011] According to another aspect of the present invention, a document generation apparatus is provided, comprising:
[0012] The file inheritance structure acquisition module is used to obtain the file inheritance structure of the target file to be generated.
[0013] The target traversal structure layer determination module is used to determine the target traversal structure layer of the target file to be generated according to the file inheritance order of the file inheritance system.
[0014] The template element acquisition module is used to acquire the target file template and target file element parameters of the target traversal structure layer.
[0015] The target file generation module is used to generate a target file based on the target file template and the target file element parameters.
[0016] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0017] At least one processor; and
[0018] A memory communicatively connected to the at least one processor; wherein,
[0019] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the file generation method according to any embodiment of the present invention.
[0020] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the file generation method described in any embodiment of the present invention.
[0021] This invention addresses the problems of high generation costs, poor maintainability and reusability of file templates, and low generation efficiency in existing file generation methods. It reduces file generation costs, improves the maintainability and reusability of file templates, and ultimately increases file generation efficiency.
[0022] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0024] Figure 1 This is a flowchart of a file generation method provided in Embodiment 1 of the present invention;
[0025] Figure 2 This is a flowchart of a file generation method provided in Embodiment 2 of the present invention;
[0026] Figure 3 This is a schematic diagram of a file inheritance architecture provided in Embodiment 2 of the present invention;
[0027] Figure 4 This is a structural diagram illustrating the relationship between a contract template and contract element templates provided in Embodiment 2 of the present invention;
[0028] Figure 5 This is a schematic diagram of a process for generating contract files based on an inheritable file inheritance architecture, provided in Embodiment 2 of the present invention.
[0029] Figure 6 This is a schematic diagram of another process for generating contract files based on an inheritable file inheritance architecture, provided in Embodiment 2 of the present invention.
[0030] Figure 7 This is a schematic diagram of a document generation device provided in Embodiment 3 of the present invention;
[0031] Figure 8This is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. Detailed Implementation
[0032] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0033] It should be noted that the terms "first," "second," "original," "target," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0034] Example 1
[0035] Figure 1 This is a flowchart of a file generation method provided in Embodiment 1 of the present invention. This embodiment is applicable to situations where a target file is generated according to a file inheritance architecture. The method can be executed by a file generation device, which can be implemented in software and / or hardware, and is generally integrated into an electronic device. This electronic device can be a terminal device or a server device. The present invention does not limit the specific type of electronic device. Correspondingly, as... Figure 1 As shown, the method includes the following operations:
[0036] S110. Obtain the file inheritance structure of the target file to be generated.
[0037] The target file to be generated can be any type of file to be generated. For example, the target file to be generated can include, but is not limited to, contract documents, agreement documents, notification documents, and appointment documents of the target type. The file inheritance hierarchy can be a type of inheritance hierarchy that includes multiple structural levels. Inheritance means that a subclass possesses the attributes or methods of its parent class, which is one of the three fundamental characteristics of object-oriented programming. In the file inheritance hierarchy, each structural level can include a type of file template and file element parameters. The file template can be a file type that provides the basic file architecture, and the file element parameters can be the member types that make up the file template.
[0038] For different types of target files to be generated, corresponding file inheritance architectures can be configured. Therefore, in this embodiment of the invention, when a target file to be generated is obtained, the corresponding file inheritance architecture can be determined based on the file type of the target file. For example, when the target file to be generated is a contract file, the file inheritance architecture corresponding to the contract file can be determined based on the file type of the target file. When the target file to be generated is an appointment document, the file inheritance architecture corresponding to the appointment document can be determined based on the type of organization to which the target file belongs.
[0039] The file inheritance architecture provided in this invention can include a hierarchical structure composed of multiple different nodes, and there are certain inheritance relationships between the hierarchical structures. For example, the lower-level structure can inherit data from the upper-level structure. The file inheritance architecture consists of two main categories: the target file template and file element parameters, and sets the configuration relationship between the file template and the file element parameters. As members of the file template, the file element parameters specify which specific file element parameters constitute the file template, and the file element parameters ultimately assign values to the specific attributes of the file template. In this way, the file template can focus on assembling the target file, while the file element parameters can focus on the values of file elements.
[0040] Taking contract documents as an example, the file inheritance structure of a contract document can separate into two main categories: contract templates and contract elements, and define the configuration relationship between the contract templates and contract elements. Contract elements are members of the contract template; the contract template specifies which contract elements constitute the document, and the contract elements ultimately complete the assignment of specific attribute values. In this way, the contract template can focus on assembling the contract, while the contract elements can focus on assigning values to contract elements.
[0041] S120. Determine the target traversal structure layer of the target file to be generated according to the file inheritance order of the file inheritance architecture.
[0042] The file inheritance order can be the inheritance order within the file inheritance hierarchy, and it depends on how the file inheritance hierarchy was generated. For example, when the file inheritance hierarchy is in the top-to-bottom order of parent node-child node-grandchild node, the file inheritance order can be bottom-up. When the file inheritance hierarchy is in the bottom-to-top order of parent node-child node-grandchild node, the file inheritance order can be top-down. The target traversal structure layer is the final structural level located when traversing the file inheritance hierarchy based on the target file to be generated.
[0043] Accordingly, after obtaining the file inheritance hierarchy of the target file to be generated, the file inheritance hierarchy can be traversed according to the file inheritance order based on the target file to be generated, in order to search for each structural level in the file inheritance hierarchy layer by layer, and determine the target traversal structure layer that matches the target file to be generated. Matching the target file to be generated can be understood as the target traversal structure layer including the file template and file element parameters required for the target file to be generated.
[0044] S130. Obtain the target file template and target file element parameters of the target traversal structure layer.
[0045] The target file template can be a file template included in the target traversal structure layer, and the target file feature parameters can be file feature parameters included in the target traversal structure layer.
[0046] S140. Generate a target file based on the target file template and the target file element parameters.
[0047] The target file is the final file to be generated, corresponding to the target file to be generated. It is understood that the target file must correspond to the target file to be generated, and may include, but is not limited to, contract documents, agreement documents, notification documents, and appointment documents of the target type.
[0048] In this embodiment of the invention, after traversing each structural level of the file inheritance architecture in the order of file inheritance and determining the target traversal structural level, the target file template and target file element parameters included in the target traversal structural level can be further obtained, so as to assemble the target file according to the target file template and assign values to the elements of the target file using the target file element parameters to obtain the final target file.
[0049] It is understandable that each structural level of the file inheritance architecture can include at least one file template and at least one file element parameter. Therefore, after determining the target traversal structure layer, a target file template can be selected from the various file templates in the target traversal structure layer. This target file template can be one or more file templates from the various file templates in the target traversal structure layer. Similarly, a target file element parameter can be selected from the various file element parameters in the target traversal structure layer. This target file element parameter can be one or more file element parameters from the various file element parameters in the target traversal structure layer. The target file is then generated based on the selected target file template and target file element parameter.
[0050] In summary, for application scenarios requiring personalized file templates for different target files, file templates and file element parameters can be fixed to form a set of corresponding file template resources stored in the file inheritance architecture. By configuring this architecture through the management interface, redundant code and repetitive development can be avoided, reducing file generation costs. Furthermore, the file inheritance architecture has a natural inheritance structure, so files with the same requirements do not need to be repeatedly configured. They can directly inherit the file template from the parent node structure as the default file template, or directly inherit the file element parameters from the parent node structure as the default file element parameters. Personalized file templates and file element parameters not available in the parent node structure can be configured in lower-level nodes. That is, the deeper the inheritance relationship, the richer the types and content of file templates and file element parameters included in the corresponding structural level, and the more pronounced the personalized features. In addition, the file templates and file element parameters included in each structural level can be updated and maintained according to actual needs, resulting in stronger reusability and maintainability. When a file needs to be generated, the file inheritance hierarchy can be traversed sequentially to obtain the required file template and file element parameters through a certain layer of the file inheritance hierarchy, and then quickly assembled and assigned to generate the final required file, thereby improving the efficiency of file generation.
[0051] This invention addresses the problems of high generation costs, poor maintainability and reusability of file templates, and low generation efficiency in existing file generation methods. It reduces file generation costs, improves the maintainability and reusability of file templates, and ultimately increases file generation efficiency.
[0052] Example 2
[0053] Figure 2 This is a flowchart of a file generation method provided in Embodiment 2 of the present invention. This embodiment is a specific embodiment based on the above embodiment. In this embodiment, specific optional generation and update methods of the file inheritance structure are given, and specific optional determination methods of the target traversal structure layer are also given. Correspondingly, as Figure 2 As shown, the method in this embodiment may include:
[0054] S210. Determine the file differences of the target file to be generated within the target area.
[0055] The target area can be the geographical region to which the target document to be generated applies. Taking a second-hand housing contract as an example, the target area could be an administrative region encompassing various levels, such as province, city, district, and county. Similarly, taking an appointment document from a public institution as an example, the target area could be the hierarchical geographical region comprised of all levels within the institution. The document differences can be the variations in content across different levels of the target area. For instance, using a second-hand housing contract as an example, the document differences could be the variations in contract content resulting from different real estate policies in different regions within the target area.
[0056] S220. Determine the structural hierarchy of the file inheritance system based on the target region range.
[0057] Specifically, the file inheritance hierarchy can be determined based on the various levels of the target region. Optionally, one level of region can correspond to one structural level.
[0058] In an optional embodiment of the present invention, the target area may include provincial-level areas, municipal-level areas, and district-level areas; determining the structural hierarchy of the file inheritance system based on the target area may include: using provincial-level area nodes as the first structural hierarchy of the file inheritance system; using municipal-level area nodes as the second structural hierarchy of the file inheritance system; and using district-level area nodes as the third structural hierarchy of the file inheritance system; wherein the first structural hierarchy is at a higher level than the second structural hierarchy; and the second structural hierarchy is at a higher level than the third structural hierarchy.
[0059] Figure 3 This is a schematic diagram of a file inheritance architecture provided in Embodiment 2 of the present invention. In a specific example, such as Figure 3As shown, the target area includes provincial, municipal, and district levels. Each level can be configured with a corresponding node, and each node represents a hierarchical structure in the file inheritance hierarchy. Specifically, the node corresponding to the provincial level serves as the parent node in the file inheritance hierarchy, representing the first level; the node corresponding to the municipal level serves as the child node, representing the second level; and the node corresponding to the district level serves as the grandchild node, representing the third level. In these three levels, the file inheritance order is parent node - child node - grandchild node. That is, the second level can inherit the file templates and file element parameters from the first level, and the third level can inherit the file templates and file element parameters from the second level.
[0060] S230. Determine the differentiated file generation content for each structural level in the file inheritance architecture based on the file difference content.
[0061] The differentiated file generation content can be the file templates and file element parameters included in each structural level of the file inheritance architecture, which are used to generate the file.
[0062] Accordingly, after determining the file differences in the target area and the structural hierarchy of the file inheritance system, the corresponding differentiated file generation content can be determined for each structural hierarchy of the file inheritance system based on the file differences.
[0063] In an optional embodiment of the present invention, determining the differentiated file generation content of each structural level in the file inheritance system based on the file difference content may include: determining the provincial file generation content of the first structural level in the file inheritance system based on the provincial file difference content of the provincial region; determining the municipal file generation content of the second structural level in the file inheritance system based on the municipal file difference content of the municipal region; and determining the district file generation content of the third structural level in the file inheritance system based on the district file difference content of the district region; wherein the provincial file generation content, the municipal file generation content, and the district file generation content include file templates and file element parameters of the corresponding levels.
[0064] Specifically, provincial-level document differences refer to document discrepancies within the provincial-level region. The generated content for provincial-level documents can be related to generating target documents applicable to the provincial-level region, and may include, but is not limited to, document templates and document element parameters applicable to the provincial-level region. Similarly, municipal-level document differences refer to document discrepancies within the municipal-level region. The generated content for municipal-level documents can be related to generating target documents applicable to the municipal-level region, and may include, but is not limited to, document templates and document element parameters applicable to the municipal-level region. Finally, district-level document differences refer to document discrepancies within the district-level region. The generated content for district-level documents can be related to generating target documents applicable to the district-level region, and may include, but is not limited to, document templates and document element parameters applicable to the district-level region.
[0065] S240. Determine the structure file template and structure file element parameters for each of the structure levels based on the differentiated file generation content, so as to generate the file inheritance system architecture.
[0066] Here, the structure file template refers to the file template corresponding to each structural level, and the structure file element parameters refer to the file element parameters corresponding to each structural level. It can be understood that the deeper the structural level inherits from the higher-level structural level, the richer the content of its corresponding structure file template and structure file element parameters.
[0067] In this embodiment of the invention, after determining the differentiated file generation content of each structural level of the file inheritance architecture, the structural file templates and structural file element parameters of each structural level can be generated according to the differentiated file generation content of each structural level, thereby generating the final file inheritance architecture.
[0068] In an optional embodiment of the present invention, the file generation method may further include: obtaining the architecture update content of the file inheritance architecture; updating the file inheritance architecture according to the architecture update content; wherein the architecture update content includes file update content and / or structure hierarchy update content.
[0069] The architecture update content refers to the content that needs to be updated in the file inheritance architecture. File updates can involve updating existing file templates and / or file element parameters within a specific structural level. Structural level updates can involve updating the structural levels of the file inheritance architecture.
[0070] In this embodiment of the invention, updating the file inheritance structure according to the updated file content can specifically involve adding, deleting, or modifying file templates and / or file element parameters at a certain structural level within the file inheritance structure. Specifically, updating the file inheritance structure according to the structural level can involve adding extended structural levels, deleting existing structural levels, or rearranging the order of structural levels.
[0071] S250. Obtain the file inheritance structure of the target file to be generated.
[0072] S260. Starting from the lowest level of the file inheritance architecture, traverse the various structural levels of the file inheritance architecture in sequence.
[0073] S270. When it is determined that the target associated file content of the target file to be generated exists in the current structural level, the current structural level is determined as the target traversal structural level.
[0074] Among them, the target associated file content, that is, a certain structural level of the file inheritance system, contains relevant content that can be used to generate the target file, which may include relevant file templates and file element parameters.
[0075] In this embodiment of the invention, optionally, the file inheritance order in the file inheritance architecture can be bottom-up. Therefore, the deeper the file inheritance architecture, the more detailed the corresponding file templates and file element parameters, and the more pronounced the personalized characteristics. Correspondingly, when determining the target traversal structure layer, traversal can begin from the bottom layer of the file inheritance architecture, searching whether the structure layer richest in file templates and file element parameters includes the target-related file content such as the file templates and file element parameters required to generate the target file. When no corresponding target-related file content is found in the bottom layer of the file inheritance architecture, the search can continue to the next higher layer of the file inheritance architecture until the target-related file content for the target file to be generated is found in the current structure layer, at which point the current structure layer is determined as the target traversal structure layer.
[0076] S280. Obtain the target file template and target file element parameters of the target traversal structure layer.
[0077] S290. Generate a target file based on the target file template and the target file element parameters.
[0078] To more clearly illustrate the technical solutions provided by the embodiments of the present invention, the embodiments of the present invention use a combined second-hand housing document as an example to specifically explain the specific operation process of the document generation method. In the current second-hand housing field, with changes in second-hand housing policies, contracts are also frequently changed, leading to situations where new parameters are added to second-hand housing contracts at any time. However, the elements added to the contract templates in related technologies cannot be implemented online and require code modification. Each time a second-hand housing contract template is initially imported, the parameters of the second-hand housing contract template must be selected. If the content of the second-hand housing contract template is long and has too many parameters, a lot of time needs to be spent configuring the template, resulting in high operational complexity. It can be seen that the current second-hand housing contract document template has problems such as complicated addition of parameters and complex configuration operations.
[0079] To address the characteristics and problems existing in current second-hand housing contract documents, this invention proposes an inheritable configuration method based on second-hand housing contract documents. Specifically, the second-hand housing contract document needs to be highly abstracted, separating it into two classes: contract template and contract elements. Contract elements may include, but are not limited to, customer information elements, housing information elements, and loan information elements. Responsibilities are divided between these two different classes, ultimately forming a complete second-hand housing contract. To hierarchically differentiate the highly abstract contract template and contract element classes, this invention designs a file inheritance architecture based on provinces, cities, and districts. This hierarchically distributed file inheritance architecture, continuously refining the inheritance system of second-hand housing contract documents, allows the second-hand housing contract generation system to meet the contract text differences arising from varying requirements without altering the original code.
[0080] Figure 4 This is a structural diagram illustrating the relationship between a contract template and contract element templates, provided in Embodiment 2 of the present invention. In a specific example... Figure 4 As shown, in second-hand housing contract documents, the basic contract template can include customer information, property information, management information, and loan information, etc. Figure 4 (Not all are shown in the text). It is understandable that although real estate policies generally differ across regions, the textual content of customer and property information is largely similar, and this part of the contract text can be shared and reused. However, for escrow information and loan information, different regions can develop customized contract content, forming new contract templates. This invention supports constructing a "province-city-district-others" document inheritance system based on different regional policies. Using contract templates as a foundation, it adapts to different real estate policies in various regions by inheriting and updating contract text content.
[0081] Figure 5 This is a schematic diagram of a process for generating contract files based on an inheritable file inheritance architecture, provided in Embodiment 2 of the present invention. Figure 6 This is a schematic diagram illustrating another process for generating contract files based on an inheritable file inheritance architecture, provided in Embodiment 2 of the present invention. In a specific example... Figure 5 and Figure 6 As shown, the inheritable file inheritance structure can be initially divided into provincial, municipal, and district structures. The file inheritance structure can also be continuously expanded downwards as needed, such as adding hierarchical structures corresponding to county-level regions.
[0082] For secondhand housing contracts, loan policies often vary significantly across provinces. For example, Province A and Province B may have different down payment requirements for second homes. In such cases, different secondhand housing contracts can be drafted at the provincial level, based on the loan rules. However, within Province A, different cities and districts may not have differentiated requirements for the content of secondhand housing contracts. Therefore, city-level contracts can inherit from province-level contracts, and district-level contracts can also directly inherit from province-level contracts. As the secondhand housing market further develops, different districts within Province A may also have different housing policies. In this case, the district level, while inheriting from the city-level contracts, can further customize the contract text with district-specific features based on the differentiated contract information at the district level, forming new contract templates and / or contract elements.
[0083] Accordingly, when displaying secondhand housing contract documents in the system's financing process, the contract template will be selected from the lowest-level structure of the document inheritance system, and the contract elements will also read the values of the contract elements from the lowest-level structure of the document inheritance system. That is, if the contract needs to be displayed or printed during the secondhand housing financing process, the corresponding contract template and contract elements can be queried based on the document inheritance system configured in the secondhand housing contract document. Specifically, one can first query the province / city / district dimension of the document inheritance system, then query the province / city dimension, and finally query the province dimension, until the corresponding contract template and contract element parameter values are found and used. If a customer in a certain region needs to handle secondhand housing financing, simply binding the customer to the province / city / district / county in the document inheritance system will allow the use of the contract template and contract element parameters corresponding to the document inheritance system of that province / city / district / county to generate the final usable secondhand housing contract document.
[0084] In summary, when configuring contract templates, a hierarchical file inheritance system can be implemented, inheriting from higher levels and combining contract text as needed. When displaying contract templates, the system can search from bottom to top, based on the file inheritance system. If no contract template or elements are configured in a given dimension, the search continues for higher-level templates and elements. This allows for the seamless updating of contract templates and elements based on the file inheritance system when new policies emerge in the secondary housing market, enabling "plug-and-play" functionality for secondary housing contract documents.
[0085] Therefore, in the above method, the differences in second-hand housing financing contracts caused by varying real estate policies in different regions can be addressed by setting corresponding level templates and fixed element parameters through a file inheritance system architecture, forming a set of corresponding contract templates. Through configuration operations on the management end, a large amount of redundant code and development is avoided, enabling flexible configuration of contract templates. Furthermore, following the natural top-down structure of "province-city-district-county," regions with the same real estate policies and financing contracts do not need to be repeatedly set up; they can directly inherit the contract template of the parent region as the default contract template, achieving the inheritable feature of contract templates. If there are smaller-scale differences in contracts within a province, city, or district, the contract template can be configured at smaller hierarchical levels based on the file inheritance system architecture, achieving the scalability of contract templates. The file generation method provided in this embodiment supports dynamically adding configuration dimensions without requiring complex development work. Users can configure templates on dimensions they add themselves, reducing the development cost of contract files, improving the efficiency of contract file generation, and exhibiting strong scalability and maintainability.
[0086] It should be noted that any arrangement or combination of the technical features in the above embodiments also falls within the protection scope of this invention.
[0087] Example 3
[0088] Figure 7 This is a schematic diagram of a document generation device provided in Embodiment 3 of the present invention, as shown below. Figure 7 As shown, the device includes: a file inheritance structure acquisition module 310, a target traversal structure layer determination module 320, a template element acquisition module 330, and a target file generation module 340, wherein:
[0089] File inheritance structure acquisition module 310 is used to acquire the file inheritance structure of the target file to be generated;
[0090] The target traversal structure layer determination module 320 is used to determine the target traversal structure layer of the target file to be generated according to the file inheritance order of the file inheritance system.
[0091] The template element acquisition module 330 is used to acquire the target file template and target file element parameters of the target traversal structure layer.
[0092] The target file generation module 340 is used to generate a target file based on the target file template and the target file element parameters.
[0093] This invention addresses the problems of high generation costs, poor maintainability and reusability of file templates, and low generation efficiency in existing file generation methods. It reduces file generation costs, improves the maintainability and reusability of file templates, and ultimately increases file generation efficiency.
[0094] Optionally, the file generation device may further include a file inheritance structure generation module, used for: determining the file difference content of the target file to be generated within a target region; determining the structural hierarchy of the file inheritance structure based on the target region; determining the differentiated file generation content of each structural hierarchy in the file inheritance structure based on the file difference content; and determining the structural file template and structural file element parameters of each structural hierarchy based on the differentiated file generation content, so as to generate the file inheritance structure.
[0095] Optionally, the target area includes provincial-level areas, municipal-level areas, and district-level areas; the file inheritance structure generation module is specifically used to: use provincial-level area nodes as the first structural level of the file inheritance structure; use municipal-level area nodes as the second structural level of the file inheritance structure; and use district-level area nodes as the third structural level of the file inheritance structure; wherein, the first structural level is higher than the second structural level; and the second structural level is higher than the third structural level.
[0096] Optionally, the file inheritance structure generation module is specifically used to: determine the provincial-level file generation content of the first structural level in the file inheritance structure based on the provincial-level file differences in the provincial region; determine the municipal-level file generation content of the second structural level in the file inheritance structure based on the municipal-level file differences in the municipal region; and determine the district-level file generation content of the third structural level in the file inheritance structure based on the district-level file differences in the district region; wherein the provincial-level file generation content, the municipal-level file generation content, and the district-level file generation content include file templates and file element parameters of the corresponding levels.
[0097] Optionally, the file generation apparatus may further include a file inheritance architecture update module, configured to: obtain the architecture update content of the file inheritance architecture; update the file inheritance architecture according to the architecture update content; wherein the architecture update content includes file update content and / or structural hierarchy update content.
[0098] Optionally, the target traversal structure layer determination module 320 is specifically used to: traverse from the bottom structure layer of the file inheritance architecture, sequentially search each structure layer of the file inheritance architecture; when it is determined that the target associated file content of the target file to be generated exists in the current structure layer, the current structure layer is determined as the target traversal structure layer.
[0099] Optionally, the target file may include a contract file of the target type.
[0100] The above-described document generation apparatus can execute the document generation method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method. Technical details not described in detail in this embodiment can be found in the document generation method provided in any embodiment of the present invention.
[0101] Since the document generation apparatus described above is an apparatus capable of executing the document generation method in the embodiments of the present invention, those skilled in the art can understand the specific implementation and various variations of the document generation apparatus in this embodiment based on the document generation method described in the embodiments of the present invention. Therefore, how the document generation apparatus implements the document generation method in the embodiments of the present invention will not be described in detail here. Any apparatus used by those skilled in the art to implement the document generation method in the embodiments of the present invention falls within the scope of protection of this application.
[0102] Example 4
[0103] Figure 8 A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0104] like Figure 8As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0105] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0106] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as file generation methods.
[0107] In some embodiments, the file generation method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the file generation method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to execute the file generation method by any other suitable means (e.g., by means of firmware).
[0108] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0109] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0110] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0111] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0112] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0113] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
Claims
1. A file generation method characterized by, include: Obtain the file inheritance hierarchy of the target file to be generated; The target traversal structure layer of the target file to be generated is determined according to the file inheritance order of the file inheritance architecture. Obtain the target file template and target file element parameters of the target traversal structure layer; wherein, the target file template is a file template included in the target traversal structure layer; and the target file element parameters are file element parameters included in the target traversal structure layer. Generate a target file based on the target file template and the target file element parameters; Prior to obtaining the file inheritance hierarchy of the target file to be generated, the process also includes: Determine the file differences of the target file to be generated within the target region; The structural hierarchy of the file inheritance system is determined based on the target region range; The differentiated file generation content for each structural level in the file inheritance architecture is determined based on the file difference content; wherein, the differentiated file generation content is the file template and file element parameters included in each structural level in the file inheritance architecture; Based on the differentiated file generation content, determine the structure file templates and structure file element parameters for each of the structural levels to generate the file inheritance system architecture.
2. The method according to claim 1, characterized in that, The target region includes provincial-level regions, municipal-level regions, and district-level regions; determining the structural hierarchy of the file inheritance system based on the target region includes: The provincial-level regional nodes are used as the first structural level in the file inheritance architecture. The city-level regional nodes are used as the second structural level in the file inheritance architecture. The district-level regional nodes are used as the third structural level in the file inheritance architecture. Wherein, the first structural level is higher than the second structural level; the second structural level is higher than the third structural level.
3. The method according to claim 2, characterized in that, The step of determining the differentiated file generation content for each structural level in the file inheritance architecture based on the file difference content includes: The content of the provincial documents generated in the first structural level of the document inheritance system is determined based on the differences in provincial documents in the provincial regions. The content of the generated municipal-level documents in the second structural level of the document inheritance system is determined based on the differences in the municipal-level documents in the aforementioned municipal-level regions. The generated content of the district-level files in the third structural level of the file inheritance system is determined based on the differences in the district-level files in the district-level regions. The generated content of provincial-level documents, municipal-level documents, and district-level documents includes document templates and document element parameters for the corresponding levels.
4. The method according to claim 1, characterized in that, Also includes: Obtain the updated architecture information of the file inheritance architecture; Update the file inheritance architecture according to the architecture update content; The architecture update content includes file update content and / or structural hierarchy update content.
5. The method according to claim 1, characterized in that, Determining the target traversal structure layer of the target file to be generated according to the file inheritance order of the file inheritance architecture includes: Starting from the lowest level of the file inheritance architecture, traverse sequentially to find each level of the file inheritance architecture. When it is determined that the target associated file content of the target file to be generated exists in the current structural hierarchy, the current structural hierarchy is determined as the target traversal structural layer.
6. The method according to any one of claims 1-5, characterized in that, The target file includes contract documents of the target type.
7. A document generation device, characterized in that, include: The file inheritance structure acquisition module is used to obtain the file inheritance structure of the target file to be generated. The target traversal structure layer determination module is used to determine the target traversal structure layer of the target file to be generated according to the file inheritance order of the file inheritance system. The template element acquisition module is used to acquire the target file template and target file element parameters of the target traversal structure layer; wherein, the target file template is a file template included in the target traversal structure layer; and the target file element parameters are file element parameters included in the target traversal structure layer. The target file generation module is used to generate a target file based on the target file template and the target file element parameters; The file generation device further includes a file inheritance structure generation module, used for: determining the file difference content of the target file to be generated within a target region; determining the structural hierarchy of the file inheritance structure based on the target region; determining the differentiated file generation content of each structural hierarchy in the file inheritance structure based on the file difference content; wherein the differentiated file generation content consists of file templates and file element parameters included in each structural hierarchy of the file inheritance structure; and determining the structural file templates and structural file element parameters of each structural hierarchy based on the differentiated file generation content to generate the file inheritance structure.
8. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the file generation method according to any one of claims 1-6.
9. A computer storage medium, characterized in that, The computer storage medium stores computer instructions that are used to cause the processor to execute the file generation method according to any one of claims 1-6.
Citation Information
Patent Citations
Method for generating documents using layer-specific inheritance rules
US20060271523A1