Document generation method and device and computer equipment

By obtaining and generating the configuration and attribute text information of the target source file, forming intermediate files and generating documents, the cumbersome problems of the document generation process in the prior art are solved, and the efficiency of document generation is improved and operations are simplified.

CN119045875APending Publication Date: 2024-11-29DAWNING INFORMATION IND (BEIJING) CO LTD +2
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411044519.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-11-29

AI Technical Summary

Technical Problem

The prior art has cumbersome process when generating documents, resulting in low document generation efficiency.

Method used

By obtaining configuration text information and attribute text information of multiple command directories in the target source file, generating intermediate files, and generating documents based on intermediate files, the workload of maintaining document source files or increasing comments is reduced, and the document generation process is simplified.

Benefits of technology

Improves document generation efficiency, simplifies operational processes, and reduces the complexity and cost of document generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119045875A_ABST
    Figure CN119045875A_ABST
Patent Text Reader

Abstract

The invention relates to a document generation method and device and computer equipment. The method comprises the following steps: in response to a document generation request of a target source file, obtaining configuration text information corresponding to a plurality of command directories in the target source file and attribute text information corresponding to each command directory; generating an intermediate file of the target source file according to the configuration text information corresponding to each command directory and the corresponding attribute text information; and generating a document of the target source file according to the intermediate file of the target source file. By adopting the method, the workload of maintaining the document source file or increasing the annotation is reduced, the document generation process is simplified, and the document generation efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a document generation method, apparatus and computer equipment. Background Art

[0002] Source programs are generally highly professional and have poor readability. In the process of software development, in order to facilitate developers to understand the source programs, it is usually necessary to convert the source programs into simple and easy-to-understand documents.

[0003] In the related art, when generating a document, the corresponding document source file is usually maintained first or comments are added to the source program according to a preset template, and then the document is generated by parsing the document source file or parsing the comment content.

[0004] However, the process of generating documents in the related art is too complicated, resulting in a technical problem of low document generation efficiency. Summary of the invention

[0005] Based on this, it is necessary to provide a document generation method, apparatus and computer equipment to address the above technical problems, which can simplify the document generation process and improve the document generation efficiency.

[0006] In a first aspect, the present application provides a document generation method, comprising:

[0007] In response to a document generation request of a target source file, obtaining configuration text information corresponding to a plurality of command directories in the target source file and attribute text information corresponding to each command directory;

[0008] Generate an intermediate file of the target source file according to the configuration text information and the corresponding attribute text information of each command directory;

[0009] Generates the document of the target source file according to the intermediate file of the target source file.

[0010] In the document generation method provided by the embodiment of the present application, by responding to the document generation request of the target source file, the configuration text information corresponding to multiple command directories in the target source file and the attribute text information corresponding to each command directory are obtained, and then the intermediate file of the target source file is generated according to the configuration text information corresponding to each command directory and the corresponding attribute text information, and then the document of the target source file is generated according to the intermediate file of the target source file. In this method, when it is necessary to generate the document of the target source file, the configuration text information corresponding to multiple command directories in the target source file and the attribute text information corresponding to each command directory are first obtained, that is, the text content related to each command in the target source file is obtained, and then the intermediate file of the target source file is generated based on the configuration text information corresponding to each command directory and the corresponding attribute text information, that is, the text content related to each command is converted into a file, and by converting it into an intermediate file, the operation of generating the file content is simplified, and the complexity of the operation is simplified, and finally, according to the intermediate file of the target source file, the document of the target source file can be generated, in this process, the workload of maintaining the document source file or adding annotations is reduced, the process of generating documents is simplified, and the efficiency of document generation is improved.

[0011] In one embodiment, obtaining configuration text information corresponding to multiple command directories in a target source file and attribute text information corresponding to each command directory includes:

[0012] Get multiple commands corresponding to each command directory in the target source file;

[0013] According to each command directory and a plurality of commands corresponding to each command directory, configuration text information corresponding to the plurality of command directories and attribute text information corresponding to each command directory are determined.

[0014] In the document generation method provided in the embodiment of the present application, by obtaining multiple commands corresponding to each command directory in the target source file, the configuration text information corresponding to the multiple command directories and the attribute text information corresponding to each command directory are determined according to each command directory and the multiple commands corresponding to each command directory. In this method, by obtaining multiple command directories in the target source file, the configuration text information and the corresponding attribute text information corresponding to each command directory can be quickly determined based on each command directory and the multiple commands under each command directory, providing an optional way to quickly obtain configuration text information and attribute text information.

[0015] In one embodiment, according to each command directory and the multiple commands corresponding to each command directory, determining configuration text information corresponding to the multiple command directories and attribute text information corresponding to each command directory includes:

[0016] According to each command directory, obtain the configuration files under each command directory;

[0017] According to the multiple commands corresponding to each command directory, command attribute information of the multiple commands under each command directory is obtained;

[0018] According to the configuration files under each command directory, the configuration text information corresponding to each command directory is determined, and according to the command attribute information of multiple commands under each command directory, the attribute text information corresponding to each command directory is determined.

[0019] In the document generation method provided in the embodiment of the present application, by obtaining the configuration files under each command directory according to each command directory, and then obtaining the command attribute information of multiple commands under each command directory according to the multiple commands corresponding to each command directory, and then determining the configuration text information corresponding to each command directory according to the configuration files under each command directory, and determining the attribute text information corresponding to each command directory according to the command attribute information of multiple commands under each command directory. In this method, an optional way to determine the configuration text information and attribute text information is provided. By obtaining the configuration files under each command directory, the configuration text information corresponding to each command directory can be quickly obtained based on the configuration files. By obtaining the command attribute information of multiple commands under each command directory, the attribute text information corresponding to each command directory can be quickly determined based on the command attribute information, which provides data support for generating the intermediate file of the target source file, simplifies the document generation process, and improves the document generation efficiency.

[0020] In one embodiment, the configuration text information corresponding to each command directory is determined according to the configuration files under each command directory, including:

[0021] According to the configuration files in each command directory, obtain the configuration information in each configuration file;

[0022] According to the configuration information in each configuration file and the preset configuration template, the configuration text information corresponding to each command directory is determined.

[0023] In the document generation method provided in the embodiment of the present application, the configuration information in each configuration file is obtained according to the configuration file under each command directory, and then the configuration text information corresponding to each command directory is determined according to the configuration information in each configuration file and the preset configuration template. In this method, the configuration information in each configuration file is obtained from the configuration files under each command directory, so that the computer device can convert the configuration information in each configuration file, and quickly obtain the configuration text information corresponding to each command directory, which provides an optional way to determine the configuration text information.

[0024] In one embodiment, according to the command attribute information of multiple commands under each command directory, the attribute text information corresponding to each command directory is determined, including:

[0025] For any command directory, determine the command text information of each command according to the command attribute information of multiple commands in the command directory and a preset attribute template;

[0026] According to the command sequence of each command, the command text information of each command is spliced ​​to obtain the attribute text information corresponding to the command directory.

[0027] In the document generation method provided in the embodiment of the present application, for any command directory, the command text information of each command is determined according to the command attribute information of multiple commands under the command directory and the preset attribute template, and then the command text information of each command is spliced ​​according to the command order of each command to obtain the attribute text information corresponding to the command directory. In this method, the command text information of each command under the command directory can be obtained by performing text conversion processing on the command attribute information of multiple commands under the command directory, so that the computer device splices the command text information of each command to quickly obtain the attribute text information corresponding to the command directory, which provides an optional way to quickly determine the attribute text information.

[0028] In one embodiment, generating a document of a target source file according to an intermediate file of the target source file includes:

[0029] Parse the intermediate file to obtain multiple strings;

[0030] Generate a document of a target source file according to multiple strings and key information in each string.

[0031] In the document generation method provided in the embodiment of the present application, multiple strings are obtained by parsing the intermediate file, and then the document of the target source file is generated according to the multiple strings and the key information in each string. In this method, multiple strings can be obtained by parsing the intermediate file, and then the key information is extracted from the multiple strings, so that the computer device can generate the document of the target source file based on the multiple strings and the key information in the multiple strings. In this process, the document can be quickly generated by parsing the intermediate file, which simplifies the document generation process and improves the document generation efficiency.

[0032] In one embodiment, a document of a target source file is generated according to a plurality of character strings and key information in each character string, including:

[0033] Writing multiple character strings into a first preset file to obtain a character string file;

[0034] Determine the key information file based on the key information and intermediate files in each string;

[0035] Generates documentation for the target source file based on the string file and key information file.

[0036] In the document generation method provided by the embodiment of the present application, a string file is obtained by writing multiple strings into a first preset file, and then a key information file is determined based on the key information and intermediate files in each string, and finally a document of the target source file is generated based on the string file and the key information file. In this method, a string file is obtained by writing multiple strings into a first preset file, and a key information file is determined based on the key information and intermediate files in each string, which provides data support for generating the document of the target source file. The computer device can quickly generate the document of the target source file based on the string file and the key information file, which simplifies the document generation process and improves the document generation efficiency.

[0037] In one embodiment, determining the key information file according to the key information and the intermediate file in each character string includes:

[0038] Associating the key information in each string with the file content corresponding to each key information in the intermediate file to obtain multiple key information mapping relationships;

[0039] A plurality of key information mapping relationships are written into a second preset file to obtain a key information file.

[0040] In the document generation method provided by the embodiment of the present application, multiple key information mapping relationships are obtained by associating the key information in each string with the file content corresponding to each key information in the intermediate file, and then the multiple key information mapping relationships are written into the second preset file to obtain the key information file. In this method, multiple key information mapping relationships can be obtained by associating the key information in each string with the file content corresponding to each key information in the intermediate file, which provides data support for determining the key information file, that is, multiple key information mapping relationships are written into the second preset file to obtain the key information file, thereby improving the generation efficiency of the key information file.

[0041] In a second aspect, the present application also provides a document generation device, comprising:

[0042] An information acquisition module, configured to respond to a document generation request of a target source file and acquire configuration text information corresponding to a plurality of command directories in the target source file and attribute text information corresponding to each command directory;

[0043] A file generation module is used to generate an intermediate file of a target source file according to the configuration text information and the corresponding attribute text information corresponding to each command directory;

[0044] The document generation module is used to generate the document of the target source file according to the intermediate file of the target source file.

[0045] In a third aspect, the present application also provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps in any one of the embodiments of the first aspect when executing the computer program.

[0046] In a fourth aspect, the embodiments of the present application further provide a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps in any one of the embodiments of the first aspect are implemented.

[0047] In a fifth aspect, the embodiments of the present application further provide a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps in any one of the embodiments in the first aspect are implemented.

[0048] The document generation method, device and computer equipment described above obtain configuration text information corresponding to multiple command directories in the target source file and attribute text information corresponding to each command directory in response to a document generation request of the target source file, and then generate an intermediate file of the target source file according to the configuration text information and the corresponding attribute text information corresponding to each command directory, and then generate the document of the target source file according to the intermediate file of the target source file. In the method, when it is necessary to generate a document of the target source file, firstly obtain the configuration text information corresponding to multiple command directories in the target source file and the attribute text information corresponding to each command directory, that is, obtain the text content related to each command in the target source file, and then generate the intermediate file of the target source file based on the configuration text information and the corresponding attribute text information corresponding to each command directory, that is, convert the text content related to each command into a file, and by converting it into an intermediate file, simplify the operation of generating the file content and simplify the complexity of the operation, and finally generate the document of the target source file according to the intermediate file of the target source file, in this process, reduce the workload of maintaining the document source file or adding annotations, simplify the process of generating documents, and improve the efficiency of document generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0050] FIG1 is a diagram showing the internal structure of a computer device in one embodiment;

[0051] FIG2 is a schematic diagram of a flow chart of a document generation method in one embodiment;

[0052] FIG3 is a schematic diagram of a process for obtaining configuration text information and attribute text information in one embodiment;

[0053] FIG4 is a schematic diagram of a process for obtaining configuration text information and attribute text information in another embodiment;

[0054] FIG5 is a schematic diagram of a process for determining configuration text information in one embodiment;

[0055] FIG6 is a schematic diagram of a process for determining attribute text information in one embodiment;

[0056] FIG7 is a schematic diagram of a process of generating a document in one embodiment;

[0057] FIG8 is a schematic diagram of a process of generating a document in another embodiment;

[0058] FIG9 is a schematic diagram of a process for determining a key information file in one embodiment;

[0059] FIG10 is a schematic diagram of a flow chart of a document generation method in another embodiment;

[0060] FIG. 11 is a schematic diagram of the structure of a document generating device in one embodiment. DETAILED DESCRIPTION

[0061] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0062] The document generation method provided in the embodiment of the present application can be applied to a computer device. The computer device can be a controller of a distributed storage system, and its internal structure diagram can be shown in Figure 1. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a document generation method is implemented. Those skilled in the art will understand that the structure shown in FIG. 1 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0063] Source programs are generally highly professional and have poor readability. In the process of software development, in order to facilitate developers to understand the source programs, it is usually necessary to convert the source programs into simple and easy-to-understand documents.

[0064] Existing online document automatic generation tools are generally unable to automatically parse the source program and convert the source program with poor readability into a simple and easy-to-understand document. Therefore, the solution usually adopted is based on the document source file or annotation, such as MkDocs, Sphinx, etc. Its working principle generally requires the maintenance of the corresponding document source file or the addition of annotations to the source program according to the corresponding template. The tool generates the document by parsing the document source file or parsing the annotation content. Whether adding document source files or adding annotations according to templates, this method will inevitably increase the workload and cost. At the same time, because there is no strong correlation, when the source program is modified, but the document source file or annotation information is not modified accordingly, it will cause problems such as outdated documents and inconsistent implementation.

[0065] The applicant discovered that the cli-build-doc tool obtains relevant information of the corresponding command by pre-executing the corresponding CLI (Command Line Interface) command, automatically generates a file in the md (Markdown, lightweight markup language) format of the corresponding command, and then converts the md file into a deployable, browser-accessible html (Hyper Text Markup Language, Hypertext Markup Language)-related file through the md parsing tool. This achieves the function of directly parsing the relevant information of the corresponding command and generating an online document without maintaining the source file of the document or the annotation information. Building CLI command documents through this tool has the advantages of easy maintenance, small workload, and less likely to have documents and real commands not corresponding to each other.

[0066] Based on this, the present application provides a document generation method. When it is necessary to generate a document of a target source file, firstly obtain the configuration text information corresponding to multiple command directories in the target source file and the attribute text information corresponding to each command directory, that is, obtain the text content related to each command in the target source file, and then generate an intermediate file of the target source file based on the configuration text information corresponding to each command directory and the corresponding attribute text information, that is, convert the text content related to each command into a file. By converting it into an intermediate file, the operation of generating the file content is simplified, and the complexity of the operation is simplified. Finally, according to the intermediate file of the target source file, the document of the target source file can be generated. In this process, the workload of maintaining the document source file or adding annotations is reduced, the process of generating documents is simplified, and the efficiency of document generation is improved.

[0067] It should be noted that the beneficial effects brought about by the embodiments of the present application or the technical problems solved are not limited to this one, but may also include other implicit or related problems. For details, please refer to the description of the following embodiments.

[0068] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0069] In an exemplary embodiment, as shown in FIG2 , a document generation method is provided, which is described by taking the method applied to the computer device in FIG1 as an example, and includes the following steps 201 to 203. Among them:

[0070] S201, in response to a document generation request of a target source file, obtaining configuration text information corresponding to a plurality of command directories in the target source file and attribute text information corresponding to each command directory.

[0071] Source file refers to the result of saving the code written in assembly language or high-level language as a file. Target source file refers to the source file with document generation requirements.

[0072] The document generation request of the target source file refers to a request triggered when the document generation application of the computer device is required to generate a document for the target source file. Naturally, after receiving the document generation request, the computer device needs to process the target source file to generate a document corresponding to the target source file.

[0073] In one embodiment, the request is triggered by a user in a document generation application through a computer device interface; wherein the triggering method includes but is not limited to external input device clicks, voice control, touch screen triggering, etc., and the embodiment of the present application does not limit the triggering method.

[0074] In another embodiment, the request is triggered according to a preset automatic program; for example, if the computer device receives the target source file, the document generation request for the target source file is automatically triggered according to the preset program; or, after the computer device receives the target source file, if the number of received target source files reaches a certain threshold, and / or, when the application is in an idle state, the document generation request for the target source file is automatically triggered according to the preset program. The embodiment of the present application does not limit the triggering method of the document generation request.

[0075] The target source file includes multiple commands, and different commands correspond to different command directories, and one command directory corresponds to multiple commands. Configuration text information refers to text information corresponding to configuration information. Attribute text information refers to text information corresponding to attribute information of a command.

[0076] Exemplarily, when a computer device receives a document generation request for a target source file, it can first obtain the configuration information under each command directory and the attribute information of each command under each command directory based on the target source file, and then generate text information corresponding to each configuration information based on the configuration information under each command directory, that is, obtain configuration text information, and generate text information corresponding to each attribute information based on the attribute information of each command under each command directory, that is, obtain attribute text information.

[0077] S202: Generate an intermediate file of the target source file according to the configuration text information and the corresponding attribute text information corresponding to each command directory.

[0078] The intermediate file refers to a file in Markdown format consisting of configuration text information and attribute text information.

[0079] Exemplarily, after obtaining the configuration text information corresponding to multiple command directories in the target source file and the attribute text information corresponding to each command directory, the computer device can splice the configuration text information corresponding to each command directory and the attribute text information corresponding to each command directory in the order of each command directory, and write the spliced ​​content into a specified file to obtain an intermediate file of the target source file.

[0080] S203, generating a document of the target source file according to the intermediate file of the target source file.

[0081] After generating the intermediate file of the target source file, the computer device can generate a document of the target source file according to the intermediate file of the target source file.

[0082] In one embodiment, after obtaining the intermediate file of the target source file, the computer device may use a document generation tool to convert the intermediate file of the target source file into a document to obtain the document of the target source file. For example, a tool such as GitBook may be used to convert the intermediate file in Markdown format into an HTML document. Naturally, the converted HTML document is the document of the target source file.

[0083] In another embodiment, after obtaining the intermediate file of the target source file, the computer device can extract the HTML string from the intermediate file, and then write the HTML string into the corresponding file to obtain the document of the target source file.

[0084] In the document generation method provided by the embodiment of the present application, by responding to the document generation request of the target source file, the configuration text information corresponding to multiple command directories in the target source file and the attribute text information corresponding to each command directory are obtained, and then the intermediate file of the target source file is generated according to the configuration text information corresponding to each command directory and the corresponding attribute text information, and then the document of the target source file is generated according to the intermediate file of the target source file. In this method, when it is necessary to generate the document of the target source file, the configuration text information corresponding to multiple command directories in the target source file and the attribute text information corresponding to each command directory are first obtained, that is, the text content related to each command in the target source file is obtained, and then the intermediate file of the target source file is generated based on the configuration text information corresponding to each command directory and the corresponding attribute text information, that is, the text content related to each command is converted into a file, and by converting it into an intermediate file, the operation of generating the file content is simplified, and the complexity of the operation is simplified, and finally, according to the intermediate file of the target source file, the document of the target source file can be generated, in this process, the workload of maintaining the document source file or adding annotations is reduced, the process of generating documents is simplified, and the efficiency of document generation is improved.

[0085] Based on the above embodiment, an embodiment is provided to illustrate the process of obtaining the configuration text information corresponding to multiple command directories in the target source file and the attribute text information corresponding to each command directory.

[0086] In an exemplary embodiment, as shown in FIG3 , obtaining configuration text information corresponding to multiple command directories in a target source file and attribute text information corresponding to each command directory includes:

[0087] S301, obtaining multiple commands corresponding to each command directory in the target source file.

[0088] As mentioned above, there are multiple commands in the target source file. Different commands are in different command directories, and each command directory corresponds to multiple commands.

[0089] Exemplarily, the computer device may obtain directory identification information of the command directory, and then obtain multiple command directories from the target source file according to the directory identification information. For example, if each command directory in the target source file is preceded by "▽" as directory identification information, the computer device may obtain multiple command directories from the target source file based on the target identification information "▽".

[0090] S302: Determine configuration text information corresponding to the multiple command directories and attribute text information corresponding to each command directory according to each command directory and the multiple commands corresponding to each command directory.

[0091] As mentioned above, the configuration text information is generated by the configuration information, and the attribute text information is generated by the attribute information of the command. Therefore, when determining the configuration text information and the attribute text information, the attribute information of the configuration information and the command must be obtained first.

[0092] Exemplarily, a computer device can obtain configuration information under each command directory and attribute information of each command under each command directory based on each command directory, and then perform text conversion processing on the configuration information under each command directory to obtain configuration text information corresponding to each command directory, and perform text conversion processing on the attribute information of each command under each command directory to obtain attribute text information under each command directory.

[0093] In the document generation method provided in the embodiment of the present application, by obtaining multiple commands corresponding to each command directory in the target source file, the configuration text information corresponding to the multiple command directories and the attribute text information corresponding to each command directory are determined according to each command directory and the multiple commands corresponding to each command directory. In this method, by obtaining multiple command directories in the target source file, the configuration text information and the corresponding attribute text information corresponding to each command directory can be quickly determined based on each command directory and the multiple commands under each command directory, providing an optional way to quickly obtain configuration text information and attribute text information.

[0094] Based on the above embodiment, an optional method is provided for the process of determining configuration text information corresponding to multiple command directories and attribute text information corresponding to each command directory based on each command directory and multiple commands corresponding to each command directory.

[0095] In an exemplary embodiment, as shown in FIG. 4 , according to each command directory and a plurality of commands corresponding to each command directory, configuration text information corresponding to the plurality of command directories and attribute text information corresponding to each command directory are determined, including:

[0096] S401, according to each command directory, obtain the configuration files under each command directory.

[0097] For any command directory, the computer device can obtain the configuration file under the command directory from the command directory according to the file name of the configuration file.

[0098] For example, if the file names of the configuration files are all "application", then the file named "application" can be found in the command directory based on the file name "application". Naturally, the file named "application" is the configuration file in the command directory.

[0099] S402: Acquire command attribute information of multiple commands under each command directory according to multiple commands corresponding to each command directory.

[0100] The command attribute information includes the command name, example, parameter description, return value description and other corresponding command contents.

[0101] For any command directory, the computer device can perform keyword extraction on the commands under the command directory, where the keywords include key information such as the command name, example, parameter description, return value description, etc., and then determine the command content corresponding to each keyword based on each keyword, and then determine the command content corresponding to each keyword as the command attribute information of multiple commands under the command directory.

[0102] S403, determining configuration text information corresponding to each command directory according to the configuration files under each command directory, and determining attribute text information corresponding to each command directory according to command attribute information of multiple commands under each command directory.

[0103] After obtaining the configuration files under each command directory and the command attribute information of multiple commands under each command directory, the computer device can extract the configuration information from each configuration file, and then perform text conversion processing on each configuration information to obtain the configuration text information corresponding to each command directory; and perform text conversion processing on the command attribute information of multiple commands under each command directory to obtain the attribute text information corresponding to each command directory.

[0104] It should be noted that if the corresponding configuration file does not exist or there is no configuration information in a command directory, the document generation under the command directory will be skipped, that is, there is no need to generate the configuration text information corresponding to the command directory, nor the attribute text information corresponding to the command directory.

[0105] Of course, in this embodiment, when determining the configuration text information corresponding to each command directory, it is also possible to directly obtain the configuration files of the multiple command directories based on the multiple command directories obtained in the target source file on the basis of any of the aforementioned embodiments, and then determine the configuration text information corresponding to each command directory from the configuration file.

[0106] Similarly, in this embodiment, when determining the attribute text information corresponding to each command directory, it is also possible to directly obtain the command attribute information of multiple commands under the multiple command directories based on the multiple command directories obtained in the target source file on the basis of any of the aforementioned embodiments, and then determine the attribute text information corresponding to each command directory based on the command attribute information of the multiple commands under each command directory.

[0107] The above is merely an example of the combination of different steps in different embodiments of the present application, and is not intended to be limiting.

[0108] In the document generation method provided in the embodiment of the present application, by obtaining the configuration files under each command directory according to each command directory, and then obtaining the command attribute information of multiple commands under each command directory according to the multiple commands corresponding to each command directory, and then determining the configuration text information corresponding to each command directory according to the configuration files under each command directory, and determining the attribute text information corresponding to each command directory according to the command attribute information of multiple commands under each command directory. In this method, an optional way to determine the configuration text information and attribute text information is provided. By obtaining the configuration files under each command directory, the configuration text information corresponding to each command directory can be quickly obtained based on the configuration files. By obtaining the command attribute information of multiple commands under each command directory, the attribute text information corresponding to each command directory can be quickly determined based on the command attribute information, which provides data support for generating the intermediate file of the target source file, simplifies the document generation process, and improves the document generation efficiency.

[0109] Based on the above embodiment, an embodiment is provided to illustrate the process of determining the configuration text information corresponding to each command directory according to the configuration files under each command directory.

[0110] In an exemplary embodiment, as shown in FIG5 , the configuration text information corresponding to each command directory is determined according to the configuration files under each command directory, including:

[0111] S501, acquiring configuration information in each configuration file according to the configuration files in each command directory.

[0112] When determining the configuration text information corresponding to each command directory, the computer device can first obtain the configuration information in each configuration file from the configuration files under each command directory, so that the computer device converts the configuration information in each configuration file to obtain the configuration text information corresponding to each command directory.

[0113] For any command directory, when determining the configuration text information corresponding to the command directory, the computer device obtains the file content of the configuration file from the configuration file under the command directory. Naturally, the file content of the configuration file is the configuration information of the configuration file.

[0114] S502: Determine configuration text information corresponding to each command directory according to configuration information in each configuration file and a preset configuration template.

[0115] After obtaining the configuration information in each configuration file, the computer device may convert the configuration information in each configuration file based on a preset configuration template to obtain configuration text information corresponding to each command directory.

[0116] For any command directory, after the computer device obtains the configuration information in the configuration file under the command directory, it can convert the configuration information in the configuration file under the command directory into text information based on a preset configuration template. Naturally, the converted text information is the configuration text information corresponding to the command directory.

[0117] Of course, in this embodiment, when determining the configuration text information corresponding to each command directory, it is also possible to directly obtain the configuration files under the multiple command directories based on the multiple command directories obtained in the target source file on the basis of any of the aforementioned embodiments, and then determine the configuration information in each configuration file from the configuration file, and then determine the configuration text information corresponding to each command directory based on the configuration information in each configuration file and the preset configuration template. Or,

[0118] Based on multiple command directories obtained in the target source file, configuration information corresponding to each command directory is directly obtained, and then configuration text information corresponding to each command directory is determined according to the configuration information corresponding to each command directory and a preset configuration template.

[0119] The above is merely an example of the combination of different steps in different embodiments of the present application, and is not intended to be limiting.

[0120] In the document generation method provided in the embodiment of the present application, the configuration information in each configuration file is obtained according to the configuration file under each command directory, and then the configuration text information corresponding to each command directory is determined according to the configuration information in each configuration file and the preset configuration template. In this method, the configuration information in each configuration file is obtained from the configuration files under each command directory, so that the computer device can convert the configuration information in each configuration file, and quickly obtain the configuration text information corresponding to each command directory, which provides an optional way to determine the configuration text information.

[0121] Based on the above embodiment, an embodiment is provided to illustrate the process of determining the attribute text information corresponding to each command directory according to the command attribute information of multiple commands under each command directory.

[0122] In an exemplary embodiment, as shown in FIG6 , the attribute text information corresponding to each command directory is determined according to the command attribute information of multiple commands under each command directory, including:

[0123] S601: For any command directory, determine command text information of each command according to command attribute information of multiple commands in the command directory and a preset attribute template.

[0124] For any command directory, when determining the attribute text information corresponding to the command directory, the computer device can first perform text conversion processing on the command attribute information of multiple commands under the command directory to obtain the command text information of each command under the command directory, so that the computer device can obtain the attribute text information corresponding to the command directory based on the command text information of each command.

[0125] For any command under the command directory, the computer device can convert the command attribute information of the command into text information based on a preset attribute template. Naturally, the converted text information is the command text information of the command.

[0126] S602: splice the command text information of each command according to the command sequence of each command to obtain attribute text information corresponding to the command directory.

[0127] After acquiring the command text information of each command, the computer device may concatenate the command text information of each command according to the command sequence of each command to obtain the attribute text information corresponding to the command directory.

[0128] Of course, in this embodiment, when determining the attribute text information corresponding to each command directory, it is also possible to directly obtain the command attribute information of multiple commands under each command directory based on the multiple command directories obtained in the target source file on the basis of any of the aforementioned embodiments, and then determine the command text information of each command under each command directory according to the command attribute information of multiple commands under each command directory and the preset attribute template, and then splice the command text information of each command under each command directory according to the command order of each command under each command directory to obtain the attribute text information corresponding to each command directory. Or,

[0129] Based on the multiple command directories obtained in the target source file, the command text information of multiple commands under each command directory is obtained directly based on the preset attribute template, and then the command text information of each command under each command directory is spliced ​​according to the command order of each command under each command directory to obtain the attribute text information corresponding to each command directory.

[0130] The above is merely an example of the combination of different steps in different embodiments of the present application, and is not intended to be limiting.

[0131] In the document generation method provided in the embodiment of the present application, for any command directory, the command text information of each command is determined according to the command attribute information of multiple commands under the command directory and the preset attribute template, and then the command text information of each command is spliced ​​according to the command order of each command to obtain the attribute text information corresponding to the command directory. In this method, the command text information of each command under the command directory can be obtained by performing text conversion processing on the command attribute information of multiple commands under the command directory, so that the computer device splices the command text information of each command to quickly obtain the attribute text information corresponding to the command directory, which provides an optional way to quickly determine the attribute text information.

[0132] After the intermediate file of the target source file is generated, the intermediate file can be parsed to extract the content to generate the document of the target source file. Based on this, the following embodiment describes the method of generating the document of the target source file.

[0133] In an exemplary embodiment, as shown in FIG7 , generating a document of a target source file according to an intermediate file of the target source file includes:

[0134] S701, parse the intermediate file to obtain multiple character strings.

[0135] After obtaining the intermediate file of the target source file, the computer device may parse the intermediate file to obtain a plurality of character strings, so that the computer device generates a document based on the parsed character strings.

[0136] Exemplarily, the computer device can parse the intermediate file through a file parser to parse and obtain multiple strings. In the embodiment of the present application, the intermediate file is an md format file, and then an md parser can be used to convert the generated md intermediate file into an html string that can be recognized and parsed by the browser according to preset rules.

[0137] S702: Generate a document of a target source file according to the multiple character strings and key information in each character string.

[0138] After parsing and obtaining the multiple character strings, the computer device may generate a document of the target source file based on the multiple character strings.

[0139] Exemplarily, after parsing multiple character strings, the computer device can extract key information from the multiple character strings to extract the key information in each character string. Then, the computer device can write the multiple character strings into a designated file and write the key information in each character string into another designated file. Then, based on the file where the character strings are located and the file where the key information is located, a document of the target source file is generated.

[0140] It should be noted that in an embodiment of the present application, when a target source file is modified or updated, a document generation request for the target source file can be re-triggered to modify and update the content of the document so as to maximize the consistency between the document and the source program.

[0141] In the document generation method provided in the embodiment of the present application, multiple strings are obtained by parsing the intermediate file, and then the document of the target source file is generated according to the multiple strings and the key information in each string. In this method, multiple strings can be obtained by parsing the intermediate file, and then the key information is extracted from the multiple strings, so that the computer device can generate the document of the target source file based on the multiple strings and the key information in the multiple strings. In this process, the document can be quickly generated by parsing the intermediate file, which simplifies the document generation process and improves the document generation efficiency.

[0142] Based on the above embodiment, an embodiment is provided to illustrate the process of generating a document of a target source file according to multiple character strings and key information in each character string.

[0143] In an exemplary embodiment, as shown in FIG8 , a document of a target source file is generated according to a plurality of character strings and key information in each character string, including:

[0144] S801, write multiple character strings into a first preset file to obtain a character string file.

[0145] When generating the document of the target source file, the computer device first writes the multiple strings obtained by parsing into a first preset file to obtain a string file, so that the computer device generates the document of the target source file based on the string file.

[0146] S802: Determine a key information file according to the key information and intermediate files in each character string.

[0147] The key information in each string is also written into a specified file to provide data support for generating the document of the target source file.

[0148] The computer device can extract the file content corresponding to each key information from the intermediate file according to the key information in each string, and then write the key information in each string and the file content corresponding to each key information in the intermediate file into the designated file to obtain a key information file.

[0149] Among them, the key information can be the directory name of the command directory, and the directory name is extracted through each character string, and then the file content corresponding to each directory name is determined from the intermediate file according to each directory name, and then each directory name and the file content corresponding to each directory name are written into the specified file to obtain the key information file. Among them, the file content corresponding to the directory name in the intermediate file may include configuration text information and attribute text information corresponding to the directory name.

[0150] It should be noted that in the embodiment of the present application, the key information in each string and the file content corresponding to the key information are written into the specified file to obtain the key information file, which can provide support for the content search function of the subsequent document. For example, if the user needs to search for the content under a certain directory name, the directory name can be directly entered in the search box, and the document can directly present the content corresponding to the directory name to the user.

[0151] S803, generating a document of the target source file according to the string file and the key information file.

[0152] After obtaining the string file and the key information file, the computer device may combine the string file and the key information file to generate a document of the target source file.

[0153] Of course, in this embodiment, when generating the document of the target source file, it is also possible to directly obtain the string file based on the intermediate file based on any of the above embodiments, and then determine the key information file based on the key information in the multiple strings in the string file and the intermediate file, and then generate the document of the target source file based on the string file and the key information file. Or,

[0154] The string file is directly obtained based on the intermediate file, and then the document of the target source file is generated according to the key information in the string file and multiple strings in the string file.

[0155] The above is merely an example of the combination of different steps in different embodiments of the present application, and is not intended to be limiting.

[0156] In the document generation method provided by the embodiment of the present application, a string file is obtained by writing multiple strings into a first preset file, and then a key information file is determined based on the key information and intermediate files in each string, and finally a document of the target source file is generated based on the string file and the key information file. In this method, a string file is obtained by writing multiple strings into a first preset file, and a key information file is determined based on the key information and intermediate files in each string, which provides data support for generating the document of the target source file. The computer device can quickly generate the document of the target source file based on the string file and the key information file, which simplifies the document generation process and improves the document generation efficiency.

[0157] Based on the above embodiment, an embodiment is provided to illustrate the process of determining the key information file according to the key information and intermediate files in each character string.

[0158] In an exemplary embodiment, as shown in FIG9 , determining the key information file according to the key information and the intermediate file in each character string includes:

[0159] S901, associating the key information in each character string with the file content corresponding to each key information in the intermediate file to obtain a plurality of key information mapping relationships.

[0160] When determining the key information file, the computer device may first extract the file content corresponding to each key information from the intermediate file according to the key information in each string, and then associate each key information with the file content corresponding to each key information to obtain multiple key information mapping relationships, wherein one key information corresponds to one key information mapping relationship.

[0161] Still taking the directory name as the key information as an example, for any directory name, based on the directory name, the configuration text information and attribute text information corresponding to the directory name are matched from the intermediate file, wherein the configuration text information and attribute text information corresponding to the directory name are the file content corresponding to the directory name, and then the directory name is associated with the configuration text information and attribute text information corresponding to the directory name to obtain the key information mapping relationship corresponding to the directory name.

[0162] S902, writing multiple key information mapping relationships into a second preset file to obtain a key information file.

[0163] After acquiring the key information mapping relationships corresponding to the key information, the computer device writes the key information mapping relationships into a second preset file to obtain a key information file.

[0164] Of course, in this embodiment, when generating the document of the target source file, it is also possible to directly obtain the string file based on the intermediate file on the basis of any of the aforementioned embodiments, and then associate the key information in multiple strings in the string file with the file content corresponding to each key information in the intermediate file to obtain multiple key information mapping relationships, and write the multiple key information mapping relationships into a second preset file to obtain a key information file, and then generate the document of the target source file based on the string file and the key information file.

[0165] The above is merely an example of the combination of different steps in different embodiments of the present application, and is not intended to be limiting.

[0166] In the document generation method provided by the embodiment of the present application, multiple key information mapping relationships are obtained by associating the key information in each string with the file content corresponding to each key information in the intermediate file, and then the multiple key information mapping relationships are written into the second preset file to obtain the key information file. In this method, multiple key information mapping relationships can be obtained by associating the key information in each string with the file content corresponding to each key information in the intermediate file, which provides data support for determining the key information file, that is, multiple key information mapping relationships are written into the second preset file to obtain the key information file, thereby improving the generation efficiency of the key information file.

[0167] In addition, in an exemplary embodiment, the present application also provides an optional example of a document generation method, as shown in FIG10 , which may include the following steps:

[0168] S1001, in response to a document generation request of a target source file, obtaining a plurality of commands corresponding to each command directory in the target source file.

[0169] S1002: According to each command directory, obtain the configuration files under each command directory.

[0170] S1003: Acquire command attribute information of multiple commands under each command directory according to multiple commands corresponding to each command directory.

[0171] S1004, acquiring configuration information in each configuration file according to the configuration files in each command directory.

[0172] S1005: Determine configuration text information corresponding to each command directory according to the configuration information in each configuration file and a preset configuration template.

[0173] S1006: For any command directory, determine command text information of each command according to command attribute information of multiple commands in the command directory and a preset attribute template.

[0174] S1007: Concatenate the command text information of each command according to the command sequence of each command to obtain attribute text information corresponding to the command directory.

[0175] S1008, parsing the intermediate file to obtain multiple character strings.

[0176] S1009, writing multiple character strings into a first preset file to obtain a character string file.

[0177] S1010, associating the key information in each character string with the file content corresponding to each key information in the intermediate file to obtain a plurality of key information mapping relationships.

[0178] S1011, write multiple key information mapping relationships into a second preset file to obtain a key information file.

[0179] S1012, generating a document of the target source file according to the string file and the key information file.

[0180] The above-mentioned processes of S1001-S1012 can refer to the description of the above-mentioned method embodiment, and the implementation principles and technical effects thereof are similar and will not be repeated here.

[0181] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0182] Based on the same inventive concept, the embodiment of the present application also provides a document generation device for implementing the document generation method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more document generation device embodiments provided below can refer to the limitations on the document generation method above, and will not be repeated here.

[0183] In an exemplary embodiment, as shown in FIG11 , a document generation device 1 is provided, comprising: an information acquisition module 10, a file generation module 20 and a document generation module 30, wherein:

[0184] An information acquisition module 10 is used to respond to a document generation request of a target source file and acquire configuration text information corresponding to a plurality of command directories in the target source file and attribute text information corresponding to each command directory;

[0185] A file generation module 20, for generating an intermediate file of a target source file according to configuration text information and corresponding attribute text information corresponding to each command directory;

[0186] The document generation module 30 is used to generate a document of the target source file according to the intermediate file of the target source file.

[0187] In one embodiment, the information acquisition module 10 is further used for:

[0188] Acquire multiple commands corresponding to each command directory in the target source file; determine configuration text information corresponding to the multiple command directories and attribute text information corresponding to each command directory according to each command directory and the multiple commands corresponding to each command directory.

[0189] In one embodiment, the information acquisition module 10 is further used for:

[0190] According to the multiple commands corresponding to each command directory, command attribute information of the multiple commands under each command directory is obtained; according to the configuration files under each command directory, configuration text information corresponding to each command directory is determined; and according to the command attribute information of the multiple commands under each command directory, attribute text information corresponding to each command directory is determined.

[0191] In one embodiment, the information acquisition module 10 is further used for:

[0192] According to the configuration files under each command directory, the configuration information in each configuration file is obtained; according to the configuration information in each configuration file and the preset configuration template, the configuration text information corresponding to each command directory is determined.

[0193] In one embodiment, the information acquisition module 10 is further used for:

[0194] For any command directory, the command text information of each command is determined according to the command attribute information of multiple commands under the command directory and the preset attribute template; the command text information of each command is spliced ​​according to the command sequence of each command to obtain the attribute text information corresponding to the command directory.

[0195] In one embodiment, the document generation module 30 is further used for:

[0196] The intermediate file is parsed to obtain multiple character strings; a document of the target source file is generated according to the multiple character strings and key information in each character string.

[0197] In one embodiment, the document generation module 30 is further used for:

[0198] A plurality of character strings are written into a first preset file to obtain a character string file; a key information file is determined according to key information in each character string and an intermediate file; and a document of a target source file is generated according to the character string file and the key information file.

[0199] In one embodiment, the document generation module 30 is further used for:

[0200] The key information in each character string is associated with the file content corresponding to each key information in the intermediate file to obtain a plurality of key information mapping relationships; the plurality of key information mapping relationships are written into the second preset file to obtain a key information file.

[0201] Each module in the document generation device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0202] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0203] In response to a document generation request of a target source file, obtaining configuration text information corresponding to a plurality of command directories in the target source file and attribute text information corresponding to each command directory;

[0204] Generate an intermediate file of the target source file according to the configuration text information and the corresponding attribute text information of each command directory;

[0205] Generates the document of the target source file according to the intermediate file of the target source file.

[0206] The implementation principles and technical effects of each step implemented by the processor in the embodiment of the present application are similar to the principles of the above-mentioned document generation method and will not be repeated here.

[0207] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0208] In response to a document generation request of a target source file, obtaining configuration text information corresponding to a plurality of command directories in the target source file and attribute text information corresponding to each command directory;

[0209] Generate an intermediate file of the target source file according to the configuration text information and the corresponding attribute text information of each command directory;

[0210] Generates the document of the target source file according to the intermediate file of the target source file.

[0211] The implementation principles and technical effects of the various steps implemented when the computer program in the embodiment of the present application is executed by the processor are similar to the principles of the above-mentioned document generation method and will not be repeated here.

[0212] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0213] In response to a document generation request of a target source file, obtaining configuration text information corresponding to a plurality of command directories in the target source file and attribute text information corresponding to each command directory;

[0214] Generate an intermediate file of the target source file according to the configuration text information and the corresponding attribute text information of each command directory;

[0215] Generates the document of the target source file according to the intermediate file of the target source file.

[0216] The implementation principles and technical effects of the various steps implemented when the computer program in the embodiment of the present application is executed by the processor are similar to the principles of the above-mentioned document generation method and will not be repeated here.

[0217] It should be noted that the personnel information (including but not limited to personnel equipment information, personnel personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the personnel or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0218] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0219] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0220] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A document generation method, characterized in that: The method comprises: In response to a document generation request of a target source file, obtaining configuration text information corresponding to a plurality of command directories in the target source file and attribute text information corresponding to each of the command directories; Generate an intermediate file of the target source file according to the configuration text information and the corresponding attribute text information corresponding to each of the command directories; A document of the target source file is generated according to the intermediate file of the target source file.

2. The method according to claim 1, characterized in that The obtaining of configuration text information corresponding to a plurality of command directories in the target source file and attribute text information corresponding to each of the command directories includes: Obtain multiple commands corresponding to each command directory in the target source file; According to each of the command directories and a plurality of commands corresponding to each of the command directories, configuration text information corresponding to the plurality of command directories and attribute text information corresponding to each of the command directories are determined.

3. The method according to claim 2, characterized in that The determining, according to each of the command directories and the multiple commands corresponding to each of the command directories, configuration text information corresponding to the multiple command directories and attribute text information corresponding to each of the command directories includes: According to each of the command directories, obtain the configuration files under each of the command directories; According to the multiple commands corresponding to each of the command directories, command attribute information of the multiple commands under each of the command directories is obtained; The configuration text information corresponding to each command directory is determined according to the configuration files under each command directory, and the attribute text information corresponding to each command directory is determined according to the command attribute information of multiple commands under each command directory.

4. The method according to claim 3, characterized in that Determining the configuration text information corresponding to each command directory according to the configuration files under each command directory includes: According to the configuration files under the command directories, obtain the configuration information in the configuration files; The configuration text information corresponding to each of the command directories is determined according to the configuration information in each of the configuration files and a preset configuration template.

5. The method according to claim 3, characterized in that: Determining attribute text information corresponding to each command directory according to command attribute information of multiple commands under each command directory includes: For any command directory, determine the command text information of each command according to the command attribute information of multiple commands in the command directory and a preset attribute template; According to the command sequence of each of the commands, the command text information of each of the commands is spliced ​​to obtain the attribute text information corresponding to the command directory.

6. The method according to any one of claims 1 to 5, characterized in that: The step of generating a document of the target source file according to the intermediate file of the target source file comprises: Parsing the intermediate file to obtain multiple character strings; A document of the target source file is generated according to the multiple character strings and key information in each of the character strings.

7. The method according to claim 6, characterized in that The step of generating a document of the target source file according to the multiple character strings and key information in each of the character strings includes: Writing the multiple character strings into a first preset file to obtain a character string file; Determining a key information file according to the key information in each of the character strings and the intermediate file; A document of the target source file is generated according to the string file and the key information file.

8. The method according to claim 7, characterized in that Determining the key information file according to the key information in each of the character strings and the intermediate file includes: Associating the key information in each of the character strings with the file content corresponding to each of the key information in the intermediate file to obtain a plurality of key information mapping relationships; The multiple key information mapping relationships are written into a second preset file to obtain the key information file.

9. A document generation device, characterized in that: The device comprises: An information acquisition module, configured to respond to a document generation request of a target source file and acquire configuration text information corresponding to a plurality of command directories in the target source file and attribute text information corresponding to each of the command directories; A file generation module, used for generating an intermediate file of the target source file according to the configuration text information and the corresponding attribute text information corresponding to each of the command directories; The document generation module is used to generate the document of the target source file according to the intermediate file of the target source file.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.

Citation Information

Cited By

  • Method and computer program product for automated construction of documents

    CN121722425A