Document variable chapter online compiling method and readable storage medium

文档序号:1846551 发布日期:2021-11-16 浏览:16次 中文

阅读说明:本技术 一种文档可变章节在线编写方法及可读存储介质 (Document variable chapter online compiling method and readable storage medium ) 是由 贺雷雷 赵亚舟 雒乐 于 2021-10-20 设计创作,主要内容包括:本发明提供一种文档可变章节在线编写方法及可读存储介质。其中所述方法包括:根据文档ID从数据库获取解析后的所有章节;从所述解析后的所有章节中提取可变章节;加载文档控件,并展示可变章节内容;对展示的可变章节内容进行编写处理。根据章节编号能够快速定位到具体的章节名称,其次每一个章节对应了唯一的章节标识,避免了重复,使得每一个章节之间的关联关系更为清晰,具有更好的可读性;通过对可变章节的处理,打破了传统习惯那种按照整份文档去编写的思路,实现了对文档按章节进行编写,并且达到了对每一个章节进行增删改的操作效果。(The invention provides a document variable chapter online writing method and a readable storage medium. Wherein the method comprises: acquiring all analyzed chapters from a database according to the document ID; extracting variable chapters from all the chapters after the analysis; loading a document control and displaying variable chapter content; and writing the displayed variable chapter contents. Specific chapter names can be quickly positioned according to the chapter numbers, and then each chapter corresponds to a unique chapter mark, so that repetition is avoided, the association relation between each chapter is clearer, and better readability is achieved; by processing the variable chapters, the idea that the document is written according to the whole document in the traditional habit is broken through, the document is written according to chapters, and the operation effect of adding, deleting and modifying each chapter is achieved.)

1. A document variable chapter online writing method is characterized by comprising the following steps:

s1: acquiring all analyzed chapters from a database according to the document ID;

s2: extracting variable chapters from all the chapters after the analysis;

s3: loading a document control and displaying variable chapter content;

s4: and writing the displayed variable chapter contents.

2. The method of on-line authoring of variable chapters for documents according to claim 1, further comprising:

and constructing the tree structure of the extracted variable chapters according to the parent-child relationship.

3. The document variable chapter online writing method according to claim 1, wherein the specific method for extracting variable chapters from all chapters after the parsing includes:

and extracting sections with the marks from all the sections, namely the sections with the marks are variable sections.

4. The document variable chapter online writing method according to claim 1, wherein the document control includes:

NTKO OFFICE document control or PageOffice control.

5. The method for online writing of variable sections of documents according to claim 1, wherein the writing of the displayed variable section content specifically includes:

there are modify, delete, and add operations that are not modifiable, delete, and add for the sections themselves of some documents.

6. The on-line writing method for variable sections of documents according to claim 5, wherein the addition of sections for variable sections is mainly based on the sections, and the addition of the same-level sections and the addition of sub-sections are performed; deleting a chapter for a variable chapter deletes the chapter from under the document.

7. The document variable section online writing method according to claim 6, wherein section modification is mainly to modify the name of the section for a variable section.

8. The method of claim 7, wherein when a chapter at the same level or a sub-chapter is added to a variable chapter, a tree structure is constructed based on the currently selected chapter node number according to a parent-child relationship to add the chapter at the same level or add the sub-chapter to the chapter at the same level; when a document variable chapter is deleted, acquiring a chapter ID according to a currently selected chapter, and deleting the chapter from the document; when the file variable file chapter is modified, the chapter ID is obtained according to the currently selected chapter, the chapter name corresponding to the chapter ID is searched from the database, and the chapter name is modified.

9. The method of claim 8, wherein when constructing a tree structure, according to the currently selected node ID of the chapter, if the added chapter is the same level, the same level of the chapter ID is submitted to the background, and a new parent chapter is created in the background, and the data is stored in the database; if the added sub sections are the sub sections, the sub sections are used as the sub nodes, the sub nodes are inserted under the father nodes in a recursive mode, and the data are stored in a database; and calling the query method by the page to obtain child nodes under the father node and displaying the tree structure.

10. A readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the document variable chapter online writing method of any one of claims 1 to 9.

Technical Field

The invention relates to the technical field of document compiling, in particular to a document variable chapter online compiling method and a readable storage medium.

Background

With the development of informatization, the application of software is more and more extensive, document control software products such as NTKO OFFICE, Pageoffice and the like slowly enter the lives of people and become indispensable software on desks of people, and both the document control software products and the software are general component libraries used for providing functions of online editing OFFICE documents, dynamic filling, dynamic submission and the like, and can help Web developers to easily realize the special function of embedding Microsoft OFFICE in a webpage.

Integrating NTKO OFFICE and PageOffice document controls can not only realize online editing and save documents in the OFFICE format, but also easily realize advanced and complex functions of online opening, editing and saving, authority control, read-only control, editing area control and the like of OFFICE documents such as Word/Excel user input submission, Word/Excel/PowerPoint and the like.

The NTKO OFFICE and Pageoffice document controls realize cross-browser support, support all popular browsers, and realize automatic installation and automatic update of the client control. Browser support: IE6 above full series, Google Chrome, fire fox Firefox, Opera, Safari, etc., wherein PageOffice document control is standard server control, easy to use, its original document concurrent editing control mechanism. In order to prevent the problem of mutual coverage caused by the fact that multiple persons edit the same Office document online at the same time, the Pageoffice document control sends out a notice and prevents other persons from editing the document until the current user leaves or the time lock is expired, the NTKO is an ActiveX control, and when the local control is operated through a browser, the user right needing to be operated must be an administrator user, so that normal loading can be realized. This problem can be solved by adding the application site to the IE browser trusted site.

At present, the existing software in the field is Office components and Google Doc, but after the software and hardware technology in the IT industry changes greatly, new technology of a new platform is continuously introduced, and products with epoch-making significance, such as Windows7, Windows8, IE9, IE10, Office2010, Office2013, VS2010, VS2012, and the like, are continuously introduced, so that a software developer is required to accelerate innovation speed and timely introduce software products which adapt to new platform architecture and meet new requirements of customers, otherwise, the software developer is inevitably eliminated from the market, and NTKO ofe and PageOffice document controls are born under the epoch-like background.

The NTKO OFFICE or PageOffice document control products are not left either in the traditional practice of writing documents in whole or in the current state of the art invention of variable section writing. The traditional habit is to compile the whole document, and store the document after compiling, but there are two problems, (1) the file volume is large, the opening speed is slow, the compiling speed is slow; (2) when the content is written in a large amount, the document may be forcibly exited directly due to a long storage time, and the storage may fail. The variable chapter writing keeps the flexibility of chapters, and chapters are added at any time, deleted at any time, modified at any time and the like.

Disclosure of Invention

The invention aims to provide an online writing method of variable chapters of a document, which aims to solve the technical problems in the prior art.

The invention provides a method for online writing variable chapters of a document, which comprises the following steps:

s1: acquiring all analyzed chapters from a database according to the document ID;

s2: extracting variable chapters from all the chapters after the analysis;

s3: loading a document control and displaying variable chapter content;

s4: and writing the displayed variable chapter contents.

In some specific embodiments, the method further comprises:

and constructing the tree structure of the extracted variable chapters according to the parent-child relationship.

In some specific embodiments, the specific method for extracting variable chapters from all chapters after parsing includes:

and extracting sections with the marks from all the sections, namely the sections with the marks are variable sections.

In some specific embodiments, the document control comprises:

NTKO OFFICE document control or PageOffice control.

In some specific embodiments, the writing the displayed variable section content specifically includes:

there are modify, delete, and add operations that are not modifiable, delete, and add for the sections themselves of some documents.

In some specific embodiments, adding a section for a variable section is primarily an addition of sibling sections and an addition of sub-sections on the basis of the section.

In some specific embodiments, deleting a chapter for a variable chapter primarily deletes the chapter from under the document.

In some specific embodiments, the chapter modification for a variable chapter is primarily a modification of the name of the chapter.

In some specific embodiments, when a variable chapter increases a same-level chapter or a sub-chapter, a tree structure is constructed according to a parent-child relationship on the basis of the currently selected chapter according to the node number of the chapter, so as to increase the same-level chapter or the sub-chapter; when a document variable chapter is deleted, acquiring a chapter ID according to a currently selected chapter, and deleting the chapter from the document; when the file variable file chapter is modified, the chapter ID is obtained according to the currently selected chapter, the chapter name corresponding to the chapter ID is searched from the database, and the chapter name is modified.

In some specific embodiments, when constructing a tree structure, according to the currently selected chapter node ID as a parent node, if a peer chapter is added, submitting the peer chapter ID to a background, re-creating a parent chapter in the background, and storing data in a database; if the added sub sections are the sub sections, the sub sections are used as the sub nodes, the sub nodes are inserted under the father nodes in a recursive mode, and the data are stored in a database; and calling the query method by the page to obtain child nodes under the father node and displaying the tree structure.

A second aspect of the present invention provides a readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement a document chapters-variable online writing method as described in the first aspect of the present application.

A third aspect of the invention provides a computer apparatus comprising a processor and a memory, wherein the memory is for storing a computer program; the processor is configured to execute the computer program stored in the memory to implement the steps of the document variable chapter online writing method according to the first aspect of the present application.

Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages:

specific chapter names can be quickly positioned according to the chapter numbers, and then each chapter corresponds to a unique chapter mark, so that repetition is avoided, the association relation between each chapter is clearer, and better readability is achieved;

by processing the variable chapters, the idea that the document is written according to the whole document in the traditional habit is broken through, the document is written according to chapters, and the operation effect of adding, deleting and modifying each chapter is achieved.

Drawings

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description in the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.

FIG. 1 is a flowchart of a document variable chapter online writing method adopted by the present invention;

FIG. 2 is a detailed diagram of the steps of the document variable chapter online writing method adopted by the present invention.

Detailed Description

The technical solutions of the present invention will be described clearly and completely with reference to the accompanying drawings, and it should be understood that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.

The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.

It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present invention. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.

Example 1:

as shown in fig. 1 and fig. 2, an embodiment 1 of the present invention provides a document variable chapter online writing method, including:

s1: acquiring all analyzed chapters from a database according to the document ID;

s2: extracting variable chapters from all the analyzed chapters, and constructing a tree structure of the extracted variable chapters according to a parent-child relationship;

s3: loading a document control and displaying variable chapter content;

s4: and writing the displayed variable chapter contents.

According to the above scheme, further, the specific method for extracting variable chapters from all the chapters after parsing includes:

and extracting sections with the marks from all the sections, namely the sections with the marks are variable sections.

Wherein the document control comprises:

NTKO OFFICE document control or PageOffice control.

Specifically, in some embodiments, the writing the displayed variable section content specifically includes:

there are modify, delete, and add operations that are not modifiable, delete, and add for the sections themselves of some documents.

Adding chapters for a variable chapter is mainly an addition of sibling chapters and an addition of sub-chapters on the basis of the chapter.

Deleting a chapter for a variable chapter primarily deletes the chapter from under the document.

Section modification for a variable section is primarily a modification of the name of the section.

In some embodiments, when a variable chapter increases a same-level chapter or a sub-chapter, a tree structure is constructed on the basis of the currently selected chapter according to a parent-child relationship to increase the same-level chapter or the sub-chapter according to the node number of the currently selected chapter; when a document variable chapter is deleted, acquiring a chapter ID according to a currently selected chapter, and deleting the chapter from the document; when the file variable file chapter is modified, the chapter ID is obtained according to the currently selected chapter, the chapter name corresponding to the chapter ID is searched from the database, and the chapter name is modified.

According to the method, further, when the tree structure is constructed, according to the currently selected chapter node ID as a father node, if the same-level chapters are added, submitting the same-level chapter ID to a background, recreating a father chapter on the background, and storing data in a database; if the added sub sections are the sub sections, the sub sections are used as the sub nodes, the sub nodes are inserted under the father nodes in a recursive mode, and the data are stored in a database; and calling the query method by the page to obtain child nodes under the father node and displaying the tree structure.

Example 2:

a method for writing a document variable chapter on line according to embodiment 1 of the present invention is provided, and a detailed description will be given below of an embodiment of writing a document variable chapter on line according to the present application with reference to fig. 1 and 2.

The selected document is compiled online in a chapter mode, and the compiling and writing process is carried out

The method takes Oracle 11g as a database and Java as a development language for development, and the design relationship of the database is as follows:

table 1 chapter information table

Table 2 chapter table of contents

Step 1:

all chapters of the document analysis are taken out of the database according to the document ID, wherein the chapters comprise chapter IDs, chapter numbers, chapter names, chapter identifications, whether the chapters can be added or not and the like.

Step 2:

and (3) acquiring chapter contents and the like according to the chapter ID acquired in the step (1), namely the SECTIN _ ID in the SECTIN ID association table (1) and the SECTIN _ ID in the table (2), and adding, deleting, modifying and storing the chapter contents of the document.

And step 3:

the processing of the variable chapters is mainly that operations including adding and deleting are carried out aiming at the fact that some chapters of the document are not modifiable, deleted or added, and the specific operations are carried out according to steps 1-5.

And 4, step 4:

the processing of the variable chapters obtains two types according to the node number of the currently selected chapter, namely nodeId and chapter father ID: adding the same-level chapters and adding the sub-chapters and simultaneously generating a chapter tree.

And 5:

save operation of variable chapter.

In conclusion, compared with the traditional conventional method of writing the document according to the whole document, the method increases writing the document according to chapters, increases the same-level chapters and sub-chapters, and forms a tree structure of parent-child relationship between the same-level chapters and the sub-chapters, thereby improving the operation efficiency of the document and enabling the document to have a high-readability and friendly display mode.

Example 3:

embodiment 3 of the present application provides a readable storage medium, where one or more programs are stored, and the one or more programs are executable by one or more processors to implement a method for on-line writing of variable sections of a document according to embodiments 1 to 2 of the first aspect of the present application.

Example 4:

an embodiment 4 of the present application provides a computer device, including a processor and a memory, where the memory is used for storing a computer program; the processor is configured to implement the method for on-line writing of variable sections of a document according to embodiments 1-2 when executing the computer program stored in the memory.

Embodiments of the subject matter and the functional operations described in this specification can be implemented in: digital electronic circuitry, tangibly embodied computer software or firmware, computer hardware including the structures disclosed in this specification and their structural equivalents, or a combination of one or more of them. Embodiments of the subject matter described in this specification can be implemented as one or more computer programs, i.e., one or more modules of computer program instructions, encoded on a tangible, non-transitory program carrier for execution by, or to control the operation of, data processing apparatus. Alternatively or additionally, the program instructions may be encoded on an artificially generated propagated signal, e.g., a machine-generated electrical, optical, or electromagnetic signal, that is generated to encode and transmit information to suitable receiver apparatus for execution by the data processing apparatus. The computer storage medium may be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or a combination of one or more of them.

The processes and logic flows described in this specification can be performed by one or more programmable computers executing one or more computer programs to perform corresponding functions by operating on input data and generating output. The processes and logic flows can also be performed by, and apparatus can also be implemented as, special purpose logic circuitry, e.g., an FPGA (field programmable gate array) or an ASIC (application-specific integrated circuit).

Computers suitable for executing computer programs include, for example, general and/or special purpose microprocessors, or any other type of central processing unit. Generally, a central processing unit will receive instructions and data from a read-only memory and/or a random access memory. The basic components of a computer include a central processing unit for implementing or executing instructions and one or more memory devices for storing instructions and data. Generally, a computer will also include, or be operatively coupled to receive data from or transfer data to, or both, one or more mass storage devices for storing data, e.g., magnetic, magneto-optical disks, or optical disks. However, a computer does not necessarily have such a device. Moreover, a computer may be embedded in another device, e.g., a mobile telephone, a Personal Digital Assistant (PDA), a mobile audio or video player, a game console, a Global Positioning System (GPS) receiver, or a portable storage device such as a Universal Serial Bus (USB) flash drive, to name a few.

Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media and memory devices, including by way of example semiconductor memory devices (e.g., EPROM, EEPROM, and flash memory devices), magnetic disks (e.g., an internal hard disk or a removable disk), magneto-optical disks, and CD ROM and DVD-ROM disks. The processor and the memory can be supplemented by, or incorporated in, special purpose logic circuitry.

While this specification contains many specific implementation details, these should not be construed as limitations on the scope of any invention or of what may be claimed, but rather as descriptions of features specific to particular embodiments of particular inventions. Certain features that are described in this specification in the context of separate embodiments can also be implemented in combination in a single embodiment. In other instances, features described in connection with one embodiment may be implemented as discrete components or in any suitable subcombination. Moreover, although features may be described above as acting in certain combinations and even initially claimed as such, one or more features from a claimed combination can in some cases be excised from the combination, and the claimed combination may be directed to a subcombination or variation of a subcombination.

Similarly, while operations are depicted in the drawings in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. In some cases, multitasking and parallel processing may be advantageous. Moreover, the separation of various system modules and components in the embodiments described above should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products.

Thus, particular embodiments of the subject matter have been described. Other embodiments are within the scope of the following claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve desirable results. Further, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some implementations, multitasking and parallel processing may be advantageous.

The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

11页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种从有限自动机生成简短正则表达式的方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!