CN110866382A - Document generation method, device, terminal equipment and medium - Google Patents

Document generation method, device, terminal equipment and medium Download PDF

Info

Publication number
CN110866382A
CN110866382A CN201910973900.7A CN201910973900A CN110866382A CN 110866382 A CN110866382 A CN 110866382A CN 201910973900 A CN201910973900 A CN 201910973900A CN 110866382 A CN110866382 A CN 110866382A
Authority
CN
China
Prior art keywords
document
key
data
formatted
generating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910973900.7A
Other languages
Chinese (zh)
Inventor
顾鹏
金钰鑫
宿阳
朱继刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Value Online Information Technology Co Ltd
Original Assignee
Shenzhen Value Online Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Value Online Information Technology Co Ltd filed Critical Shenzhen Value Online Information Technology Co Ltd
Priority to CN201910973900.7A priority Critical patent/CN110866382A/en
Publication of CN110866382A publication Critical patent/CN110866382A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/31Indexing; Data structures therefor; Storage structures
    • G06F16/316Indexing structures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application is applicable to the technical field of computers, and provides a document generation method, a device, a terminal device and a medium, wherein the method is applicable to the terminal device and comprises the following steps: receiving text information to be processed; generating a corresponding formatted document aiming at the text information, wherein the formatted document comprises a plurality of key names and key values respectively corresponding to the key names; generating a target document according to a preset document template, the plurality of key names and key values corresponding to the key names respectively; and storing the target document. By the method, the target document can be generated on the terminal equipment by using the document template.

Description

Document generation method, device, terminal equipment and medium
Technical Field
The present application belongs to the field of computer technologies, and in particular, to a method, an apparatus, a terminal device, and a medium for generating a document.
Background
At present, various documents are often used in various office scenes, and different document contents need to be generated according to different data. For example, when a company opens a meeting, a document for notification needs to be written. Generally, such documents have a certain format, and only the information of the conference name, the holding time, and the like in the document content is different. For such documents, if written manually each time, it takes a long time, and format errors are likely to occur in the manual writing process.
Disclosure of Invention
The embodiment of the application provides a document generation method, a document generation device, a terminal device and a medium, and a document meeting the corresponding format requirement can be automatically generated on the terminal device according to text information to be processed.
In a first aspect, an embodiment of the present application provides a document generating method, which is applicable to a terminal device, and the method includes:
receiving text information to be processed;
generating a corresponding formatted document aiming at the text information, wherein the formatted document comprises a plurality of key names and key values respectively corresponding to the key names;
generating a target document according to a preset document template, the plurality of key names and key values corresponding to the key names respectively;
and storing the target document.
In a second aspect, an embodiment of the present application provides a document generating apparatus, which is suitable for a terminal device, and the apparatus includes:
the text information receiving module is used for receiving the text information to be processed;
a formatted document generating module, configured to generate, for the text information, a corresponding formatted document, where the formatted document includes a plurality of key names and key values corresponding to the key names, respectively;
the target document generation module is used for generating a target document according to a preset document template, the plurality of key names and key values corresponding to the key names respectively;
and the target document storage module is used for storing the target document.
In a third aspect, an embodiment of the present application provides a terminal device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the document generation method described in any one of the above first aspects when executing the computer program.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored, and the computer program, when executed by a processor, implements the document generating method according to the first aspect.
In a fifth aspect, an embodiment of the present application provides a computer program product, which, when running on a terminal device, causes the terminal device to execute the document generating method according to the first aspect.
Compared with the prior art, the embodiment of the application has the advantages that: after receiving text information to be processed, generating a corresponding formatted document according to the text information, then determining content needing to be replaced in a preset document template according to a plurality of key names in the formatted document and key values respectively corresponding to the key names, and replacing the content to generate a target document. According to the method and the device, the text information can be processed on the local terminal device, so that automatic generation of the document is realized, and time for a user to write the document is saved. In the embodiment, in the document generation process, only the part corresponding to the key value in the document template needs to be replaced, and other parts do not need to be modified, so that format errors are avoided, and the user data is only stored on the local terminal equipment, which is beneficial to protecting the data.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
FIG. 1 is a flowchart illustrating a document generating method according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating a document generating method according to a second embodiment of the present application;
FIG. 3 is a flowchart illustrating a document generating method according to a third embodiment of the present application;
FIG. 4 is a system diagram of a document generating method according to a fourth embodiment of the present application;
FIG. 5 is a schematic diagram of a document generating apparatus according to a fifth embodiment of the present application;
fig. 6 is a schematic diagram of a terminal device according to a sixth embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
Fig. 1 is a schematic flowchart of a document generating method provided in an embodiment of the present application, and as shown in fig. 1, the method may include the following steps:
s101, receiving text information to be processed;
the method can be applied to terminal equipment, namely the execution main body of the method is the terminal equipment, and the target document is generated by processing the text information in the terminal equipment. The terminal device may be a mobile phone, a tablet computer, or other portable text processing device, and the specific type of the terminal device is not limited in this embodiment.
In this embodiment, the text information may be composed of a plurality of pieces of data input by the user. The data may be text data input by the user, and the data may be input by a method including, but not limited to, selecting input, filling input, and the like.
The terminal device may store the text information in the database after receiving the data input by the user and generating the text information. For example, taking the text information to be processed as the conference notification content, the terminal device may provide an input interface to process data input by the user, and the user may select to input the conference time through a drop-down box in the interface, and directly fill in the conference subject and other content. The client generates text information after receiving data input by the user, wherein the text information comprises the meeting time selected and input by the user and the filled meeting theme.
By way of example and not limitation, the database may be a sqlite3 (an open source embedded database) database. The sqlite3 database is a light embedded database engine, has low dependency on a system, and is more beneficial to the realization of a document generation method on different terminal devices.
S102, generating a corresponding formatted document aiming at the text information, wherein the formatted document comprises a plurality of key names and key values corresponding to the key names respectively;
the formatted document refers to a document with a specific format, and can be conveniently analyzed and generated by a computer. Such as a json (javascript Object notification) format document. The formatted document includes a key name and a key value, the key name may refer to attribute information, and the key value may be a value corresponding to the attribute information. Illustratively, the formatted document includes a key name "time" and a key name "subject", the key value corresponding to the key name "time" may be "9 am 1/2019", and the key value corresponding to the key name "subject" may be "a first upcoming meeting".
Specifically, the text information can be read from the database, and the data in the text information can be converted into a formatted document by using the middleware. And storing the formatted document into the database through a database connection pool technology and a bottom database drive.
Further, the formatted document may be generated by JSON technology. Reading a plurality of pieces of data in text information in a sqlite3 database through a connection pool of the database, and converting the data into a JSON format document by using middleware such as jsondoc (plug-in which can be used for generating documents) and the like, wherein the JSON data comprises key names and key values. The JSON format document is stored in the database in a mode of connecting the pool by a database technology and driving a bottom database, the JSON document can be named by time information of local terminal equipment, and the accuracy is as high as millisecond, so that the uniqueness of the generated document is ensured.
S103, generating a target document according to a preset document template, the plurality of key names and key values corresponding to the key names respectively;
the preset document template refers to a document with a fixed format, and can be set by a user or default by a system. When generating the document, the content at the specific position in the document template can be replaced according to the data input by the user, and the document required by the user is generated and is the target document. The key name is used for determining the position of the content needing to be replaced in the document template, and the key value is used for replacing the content at the specific position.
Specifically, the contents of the document template can be analyzed by reading the document template and formatting the document via a Python (a computer programming language) plug-in. When the document template content is analyzed, the document format is analyzed according to the rules of OpenOffice (a set of cross-platform office software suite).
S104, storing the target document.
The target document is a document generated based on a document template selected by a user and information input by the user, and the user can name the target document autonomously and store the target document in a position designated by the user.
In the embodiment, the text information is processed into the formatted document comprising the key name and the key value, and the document is automatically generated by combining the preset document template, so that the time for writing the document by a user is saved, in the document generation process, only the part corresponding to the key value in the document template needs to be replaced, other parts do not need to be modified, the format error is avoided, and the user data is only stored on the local terminal equipment, so that the protection of the data is facilitated.
Fig. 2 is a flowchart of a document generating method provided in the second embodiment of the present application, where the method may include the following steps:
s201, receiving text information to be processed;
the method may be implemented on a terminal device. There are many kinds of programming software currently used on the desktop side, by which text information can be generated from data input by a user and the generated text information can be stored in a database.
S202, identifying a plurality of pieces of data in the text information, wherein any data respectively has corresponding attribute information;
the data may be input by a user, and the attribute information may be used to describe a corresponding location of the data in the document template. Specifically, a plurality of pieces of data in the text information and the corresponding attribute information thereof may be identified by reading the text information to be processed in the database. Illustratively, if the user selects that the meeting time is 9 am on 1 month 1 year 2019, the piece of data is "9 am on 1 month 1 year 2019", and the corresponding attribute information is "meeting time".
Further, the attribute information may be described with the contents of the alternative location. For example, taking the text information to be processed as the conference notification content, if the conference topic is "example meeting" in the preset document template, the user may fill in the currently required conference topic "first director meeting" on the processing interface when generating a new document by using the document template. When receiving data generation text information of a user, the terminal device may describe the piece of data as a "first board meeting", and the attribute information of the piece of data is a content "example meeting" to be replaced by the piece of data.
S203, determining key names respectively corresponding to the data in the formatted document to be generated according to the attribute information of the data;
in the formatted document to be generated, the key name corresponds to the attribute information of the data, and the key value corresponds to the data.
Specifically, by identifying a plurality of pieces of data in the text information in the database and attribute information corresponding to each piece of data, the attribute information can be used as a key name in the formatted document to be generated.
And S204, respectively using the data as key values associated with the corresponding key names to generate the formatted document.
Specifically, a plurality of pieces of data in text information in a database and attribute information corresponding to each piece of data are read, the attribute information is used as key names in a formatted document to be generated, and each piece of data is used as a key value associated with each corresponding key name to generate the formatted document.
For example, the text information read from the database includes a plurality of pieces of data such as "9 am on 1/2019" and "a first existing board meeting", and by the identification of the foregoing steps, it is determined that the attribute information of the piece of data "9 am on 1/2019" is "meeting time" and the attribute information of the piece of data of "a first existing board meeting" is "meeting subject", and then the piece of data of "9 am on 1/2019" is used as a key name of the "meeting time" and the piece of data of "9 am on 1/2019" is used as a key name of the "meeting subject" and the piece of data of "the first existing board meeting" is used as a key name of the "meeting subject" to be generated. After all data in the text information is processed in the above manner, a formatted document may be generated.
In another possible implementation manner, after a plurality of pieces of data in the text information are identified and a preset formatted document template is read, the formatted document may be generated by using the plurality of pieces of data as key values associated with key names that are the same as the attribute information of the pieces of data.
The local terminal device may generate a fixed-format formatted document template according to the modifiable data information in the preset document template, where the fixed-format formatted document template may include all the key names used in the document template. Not all key names are necessarily used each time the user enters data. The terminal equipment receives data input by a user, and then associates the data input by the user as key values with key names which are the same as the attribute information correspondingly according to the attribute information of the data input by the user to generate a formatted document.
For example, which key names are included in the formatted document template may be preconfigured according to the particular context of the application. For example, a plurality of key names such as "meeting time", "meeting subject" and the like can be pre-configured in the formatted document. After the text information to be processed is read, the attribute information of the data "9 am on 1/2019" is recognized as "meeting time" and the attribute information of the data "first board meeting" is recognized as "meeting subject" in the text information, and then the data "9 am on 1/2019" can be used as a key value associated with the key name of "meeting time" in the formatted document template, and the data "first board meeting" can be used as a key value associated with the key name of "meeting subject" in the formatted document template, so that the formatted document is generated.
The formatted document can be uniquely named at the generation time of the local terminal equipment, the time information can be accurate to millisecond, repeated names are avoided, and the formatted document can be conveniently searched by a machine. And storing the generated formatted document at a preset position by a mode of connecting the pool with a database technology and a bottom-layer database drive.
S205, generating a target document according to a preset document template, the plurality of key names and key values corresponding to the key names respectively;
the document template can be customized according to the needs of users, and can also be purchased by operators. When a user generates a document, the user may first determine a document template required by the user, where the document template is referred to as a preset document template. The target document is a document generated by using a document template according to the requirement of a user.
Specifically, the formatted document may be first found from a preset position according to the name of the formatted document, after the formatted document and the document template are read, the content of the document template is analyzed, information to be replaced in the document template is found according to the key name in the formatted document, the information is identified, and then the identified information may be replaced by a key value associated with the key name to generate the target document.
S206, storing the target document.
The target document may be named by the user and stored at a location specified by the user.
In the embodiment, the data input by the user is bound into the specified document template, so that the document can be quickly customized through the document template, the time for the user to write the document is saved, and the format error possibly caused by manual writing of the user is avoided; in addition, the user data is only stored on the local terminal equipment, which is beneficial to protecting the data.
Fig. 3 is a flowchart of a document generating method provided in the third embodiment of the present application, where the method may include the following steps:
s301, receiving text information to be processed;
s302, aiming at the text information, generating a corresponding formatted document, wherein the formatted document comprises a plurality of key names and key values corresponding to the key names respectively;
steps S301 to S302 of this embodiment are similar to steps S101 to S102 of the previous embodiment, and they can be referred to each other, and are not described herein again.
S303, reading the formatted document and the document template;
specifically, the contents of the formatted document and the document template may be read by a Python plug-in. The Python plug-in finds the formatted document at a preset position according to the name of the formatted document, and reads the key name and the key value in the formatted document; the content in the document template is read by Python and analyzed.
S304, if the key name which is the same as the name of the modifiable data in the document template exists in the formatted document, replacing the modifiable data with a key value which is associated with the key name which is the same as the name, and generating a target document;
the document template comprises modifiable data, and the document can be customized by modifying the modifiable data in the document template. The modifiable data in the document template can be set according to the requirements of a user, and the names of the modifiable data can be named according to the requirements of the user in the process of writing the document template.
Specifically, by analyzing the content in the document template, modifiable data in the document template can be found out, and if the name of the modifiable data is the same as a certain key name in the formatted document, the modifiable data is identified; and then, the modifiable data needing to be replaced in the document template is found through identification, and the modifiable data is replaced by a key value associated with the same key name as the name of the modifiable data. And after all positions needing to be searched and replaced in the document template are analyzed and replaced, the obtained document is the target document.
Further, if the key name in the formatted document is the content of the position in the document template that needs to be replaced, it is possible to find whether the modifiable data in the document template is the same as a certain key name in the formatted document by analyzing the content in the document template, and if so, it is possible to identify the modifiable data. The modifiable data is replaced with a key value that is associated with the key name in the formatted document by identifying modifiable data that is determined to be needed for replacement in the document template. And after all the modifiable data needing to be searched and replaced in the document template are analyzed and replaced, the obtained document is the target document.
Further, if the same key name as the name of the modifiable data in the document template does not exist in the formatted document, the modifiable data can be deleted or replaced with a preset value. For example, if the host in the document template is Zhang III, Zhang III is modifiable data, and the name of the modifiable data is the host; if the data input by the user does not include the conference host, if the generated formatted document has no key name host or no key value associated with the key name host, the Zhang III of the modifiable data is deleted or the Zhang III is replaced by 'none'.
S305, storing the target document.
The generated document is stored at a location designated by the user.
In the embodiment, the content of the specific position in the document template is replaced by the information specified by the user, so that the document can be quickly customized through the document template, the time for the user to write the document is saved, and the format error possibly caused by manual writing of the user is avoided; in addition, the user data is only stored on the local terminal equipment, which is beneficial to protecting the data.
Fig. 4 is a system diagram of a document generating method according to a fourth embodiment of the present application, and as shown in fig. 4, a process of generating a Word document on a terminal device by using a Word (Microsoft Office Word) document template may be as follows.
The local database can adopt a sqlite3 database to input data input by a user into the database; reading data in the sqlite3 database through a connection pool of the database, and then converting the data into a JSON format document through a JSON technology, wherein the data in the JSON format document can comprise a key name and a key value. The method comprises the steps that the content needing to be replaced in a preset word document template can be used as a key name, data input by a user can be used as a key value, time information generated by a JSON format document on terminal equipment is used for naming the key value, and the JSON format document is stored in a database in a mode of connecting a pool through a database technology and a bottom database driver.
In a Python environment, reading a JSON format document from a database according to the name of the JSON format document through a Python plug-in, and reading a preset word template through the Python plug-in; and then analyzing the word document format according to the rules of OpenOffice, and analyzing whether the key name in the formatted document is used in the word document template. If the word document template has the content which is the same as a certain key name in the formatted document, identifying the content which is the same as the key name in the word document template; and determining the position of the content needing to be replaced in the word document template through identification, replacing the identified content with a key value which is associated in the formatted document by taking the identified content as a key name, generating a target document and storing the target document at the position appointed by the user, wherein the target document is the word document needed by the user.
In the above process, the preset word document template may be a word template generated and written by utilizing open-source Jinjia2 (a Python-based template making language) technology.
In the embodiment, the word document is generated on the terminal equipment by using the word document template, so that the time for writing the document by a user is saved, and the format error possibly caused by manual writing can be avoided; meanwhile, the document generation process is completed in the terminal equipment, and the generated document is only stored on the local terminal equipment, so that the possibility that data is stolen in the transmission process of generating the document by the server and then transmitting the document to the terminal equipment is solved, and the data is protected.
Fig. 5 is a schematic diagram of a document generating apparatus provided in the fifth embodiment of the present application, and as shown in fig. 5, the apparatus includes the following modules:
a text message receiving module 51, configured to receive text messages to be processed;
a formatted document generating module 52, configured to generate, for the text information, a corresponding formatted document, where the formatted document includes a plurality of key names and key values corresponding to the key names respectively;
a target document generating module 53, configured to generate a target document according to a preset document template, the multiple key names, and key values corresponding to the key names, respectively;
a target document storage module 54 for storing the target document.
In this embodiment of the present application, the formatted document generating module 52 may specifically include the following sub-modules:
the identification submodule is used for identifying a plurality of pieces of data in the text information, and any piece of data has corresponding attribute information respectively;
the key name determining submodule is used for determining key names respectively corresponding to the data in the formatted document to be generated according to the attribute information of the data;
the key value determining submodule is used for respectively taking each piece of data as a key value associated with each corresponding key name to generate the formatted document;
and the naming submodule is used for determining the time information for generating the formatted document and naming the formatted document according to the time information.
In this embodiment of the application, the key value determining sub-module is further configured to use the pieces of data as key values associated with key names that are the same as attribute information of the pieces of data, and generate the formatted document.
In the embodiment of the present application, the document template includes modifiable data, and the target document generation module 53 may specifically include the following sub-modules:
the data reading submodule is used for reading the formatted document and the document template;
and the document generation sub-module is used for replacing the modifiable data with a key value associated with the key name with the same name to generate a target document if the key name with the same name as the modifiable data in the document template exists in the formatted document.
In this embodiment of the present application, the target document generating module 53 may further include the following sub-modules:
and the deleting submodule is used for deleting the modifiable data if the same key name as the name of the modifiable data in the document template does not exist in the formatted document. .
In this embodiment of the present application, the target document generating module 53 may further include the following sub-modules:
and the replacing sub-module is used for replacing the modifiable data with a preset value if the formatted document does not have the same key name as the name of the modifiable data in the document template.
It should be noted that, for the information interaction, the execution process, and other contents between the above-mentioned apparatuses, the specific functions and the technical effects of the embodiments of the method of the present application are based on the same concept, and specific reference may be made to the section of the embodiments of the method, which is not described herein again.
Fig. 6 is a schematic diagram of a terminal device according to a fifth embodiment of the present application. As shown in fig. 6, the terminal device 6 of this embodiment includes: at least one processor 60 (only one shown in fig. 6), a memory 61, and a computer program 62 stored in the memory 61 and operable on the at least one processor 60, the processor 60 implementing the steps in any of the various document generation method embodiments described above when executing the computer program 62.
The terminal device 6 may be a desktop computer, a notebook computer, a palm computer, or other computing devices. The terminal device may include, but is not limited to, a processor 60, a memory 61. Those skilled in the art will appreciate that fig. 6 is only an example of the terminal device 6, and does not constitute a limitation to the terminal device 6, and may include more or less components than those shown, or combine some components, or different components, such as an input/output device, a network access device, and the like.
The Processor 60 may be a Central Processing Unit (CPU), and the Processor 60 may be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 61 may in some embodiments be an internal storage unit of the terminal device 6, such as a hard disk or a memory of the terminal device 6. The memory 61 may also be an external storage device of the terminal device 6 in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are equipped on the terminal device 6. Further, the memory 61 may also include both an internal storage unit and an external storage device of the terminal device 6. The memory 61 is used for storing an operating system, an application program, a BootLoader (BootLoader), data, and other programs, such as program codes of the computer program. The memory 61 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/network device and method may be implemented in other ways. For example, the above-described apparatus/network device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A document generation method is suitable for terminal equipment, and is characterized by comprising the following steps:
receiving text information to be processed;
generating a corresponding formatted document aiming at the text information, wherein the formatted document comprises a plurality of key names and key values respectively corresponding to the key names;
generating a target document according to a preset document template, the plurality of key names and key values corresponding to the key names respectively;
and storing the target document.
2. The method of claim 1, wherein said generating a corresponding formatted document for said textual information comprises:
identifying a plurality of pieces of data in the text information, wherein any data respectively has corresponding attribute information;
determining key names respectively corresponding to the data in a formatted document to be generated according to the attribute information of the data;
and respectively using the data as key values associated with the corresponding key names to generate the formatted document.
3. The method of claim 1, wherein said generating a corresponding formatted document for said textual information comprises:
identifying a plurality of pieces of data in the text information, wherein any data respectively has corresponding attribute information;
reading a preset formatted document template, wherein the formatted document template comprises a plurality of key names;
and generating the formatted document by using the plurality of pieces of data as key values associated with the same key names as the attribute information of the pieces of data.
4. The method of claim 2 or 3, further comprising:
determining time information for generating the formatted document;
and naming the formatted document according to the time information.
5. The method of claim 1, wherein the document template includes modifiable data, and wherein generating the target document according to a preset document template, the plurality of key names, and key values respectively corresponding to the key names comprises:
reading the formatted document and the document template;
and if the key name which is the same as the name of the modifiable data in the document template exists in the formatted document, replacing the modifiable data with the key value which is associated with the key name which is the same as the name to generate a target document.
6. The method of claim 5, further comprising:
and if the key name which is the same as the name of the modifiable data in the document template does not exist in the formatted document, deleting the modifiable data.
7. The method of claim 5, further comprising:
and if the key name which is the same as the name of the modifiable data in the document template does not exist in the formatted document, replacing the modifiable data with a preset value.
8. A document generating apparatus suitable for a terminal device, the apparatus comprising:
the text information receiving module is used for receiving the text information to be processed;
a formatted document generating module, configured to generate, for the text information, a corresponding formatted document, where the formatted document includes a plurality of key names and key values corresponding to the key names, respectively;
the target document generation module is used for generating a target document according to a preset document template, the plurality of key names and key values corresponding to the key names respectively;
and the target document storage module is used for storing the target document.
9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 7.
CN201910973900.7A 2019-10-14 2019-10-14 Document generation method, device, terminal equipment and medium Pending CN110866382A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910973900.7A CN110866382A (en) 2019-10-14 2019-10-14 Document generation method, device, terminal equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910973900.7A CN110866382A (en) 2019-10-14 2019-10-14 Document generation method, device, terminal equipment and medium

Publications (1)

Publication Number Publication Date
CN110866382A true CN110866382A (en) 2020-03-06

Family

ID=69652387

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910973900.7A Pending CN110866382A (en) 2019-10-14 2019-10-14 Document generation method, device, terminal equipment and medium

Country Status (1)

Country Link
CN (1) CN110866382A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111444695A (en) * 2020-03-25 2020-07-24 腾讯科技(深圳)有限公司 Text generation method, device and equipment based on artificial intelligence and storage medium
CN111859886A (en) * 2020-06-22 2020-10-30 远光软件股份有限公司 Document generation method and device based on product prototype interface
CN115563371A (en) * 2022-08-19 2023-01-03 北京迎风知至科技有限公司 JSON data formatting method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104933020A (en) * 2015-07-17 2015-09-23 北京奇虎科技有限公司 Method and device for generating target documents based on template
CN109190098A (en) * 2018-08-15 2019-01-11 上海唯识律简信息科技有限公司 A kind of document automatic creation method and system based on natural language processing
CN109783787A (en) * 2018-12-29 2019-05-21 远光软件股份有限公司 A kind of generation method of structured document, device and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104933020A (en) * 2015-07-17 2015-09-23 北京奇虎科技有限公司 Method and device for generating target documents based on template
CN109190098A (en) * 2018-08-15 2019-01-11 上海唯识律简信息科技有限公司 A kind of document automatic creation method and system based on natural language processing
CN109783787A (en) * 2018-12-29 2019-05-21 远光软件股份有限公司 A kind of generation method of structured document, device and storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111444695A (en) * 2020-03-25 2020-07-24 腾讯科技(深圳)有限公司 Text generation method, device and equipment based on artificial intelligence and storage medium
CN111444695B (en) * 2020-03-25 2022-03-01 腾讯科技(深圳)有限公司 Text generation method, device and equipment based on artificial intelligence and storage medium
CN111859886A (en) * 2020-06-22 2020-10-30 远光软件股份有限公司 Document generation method and device based on product prototype interface
CN111859886B (en) * 2020-06-22 2024-02-02 远光软件股份有限公司 Document generation method and device based on product prototype interface
CN115563371A (en) * 2022-08-19 2023-01-03 北京迎风知至科技有限公司 JSON data formatting method and device

Similar Documents

Publication Publication Date Title
CN109542399B (en) Software development method and device, terminal equipment and computer readable storage medium
US11238099B2 (en) Method and device for obtaining answer, and computer device
CN109558525B (en) Test data set generation method, device, equipment and storage medium
CN110866382A (en) Document generation method, device, terminal equipment and medium
CN108073429B (en) Payment mode configuration method, device, equipment and storage medium
CN110601880A (en) Cloud platform, service processing method, command interface and computer equipment
CN111858727B (en) Multi-data source data export system and method based on template configuration
CN111813804B (en) Data query method and device, electronic equipment and storage medium
CN111459982A (en) Data query method and device, terminal device and storage medium
CN108319575B (en) Page component checking method, device, server and storage medium
CN108460068B (en) Method, device, storage medium and terminal for importing and exporting report
CN113204345A (en) Page generation method and device, electronic equipment and storage medium
CN110688111A (en) Configuration method, device, server and storage medium of business process
CN112363753A (en) Data verification method and device, electronic equipment and storage medium
CN110837727A (en) Document template generation method and device, terminal equipment and medium
CN111694992A (en) Data processing method and device
CN113204386A (en) Nginx + Lua-based data processing method and equipment
CN117033309A (en) Data conversion method and device, electronic equipment and readable storage medium
CN116628773A (en) Data processing method, device, electronic equipment and storage medium
CN107665124B (en) Modular JavaScript file processing method, device and server
CN114253642B (en) System information processing method, device, electronic equipment and medium
CN114461223A (en) Code generation method and device and terminal equipment
CN113781275A (en) Education resource management method and server
CN108647197B (en) Information processing method, device and storage medium
CN109783134B (en) Front-end page configuration method and device and electronic equipment

Legal Events

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