Invention content
The embodiment of the present application provides template establishment method, document creating method, rendering intent and corresponding device, it is intended to
The establishment of document and rendering with the adjustment of document template are dynamically adjusted, meet the use demand of user.
The embodiment of the present application uses following technical proposals:
In a first aspect, the embodiment of the present application provides a kind of document creating method, including:
It determines to create template based on document, template identification is included in the template;
According to the template identification, determine and the corresponding default paragraph model of the template, the default paragraph model
In comprising multiple default paragraphs, the correspondence passed through between the first paragraph mark of the default paragraph reflects the default section
Hierarchical relationship between falling;
The hierarchical relationship preset according to the default paragraph model between paragraph creates the document, and establish institute
State the first incidence relation between the document identification of document and the template identification of the template.
Preferably, in the document creating method that the embodiment of the present application first aspect provides, according to the default paragraph model
Described in the hierarchical relationship preset between paragraph create the document, including:
By the default paragraph in the default paragraph model, the paragraph being determined as in the document;By the default paragraph
Between hierarchical relationship, be determined as the hierarchical relationship between paragraph in the document.
Preferably, in the document creating method that the embodiment of the present application first aspect provides, according to the default paragraph mould
The hierarchical relationship preset described in type between paragraph creates the document, and establishes the document identification of the document and the template
Template identification between the first incidence relation after, the method further includes:
When needing to the paragraph content of target paragraph into edlin, establish the target paragraph the second paragraph mark with
The second incidence relation between the first paragraph mark of the corresponding default paragraph, and establish the second of the target paragraph
Paragraph identifies the third incidence relation between the document identification of the document;Wherein, the target paragraph is in the document
With the default corresponding any one of paragraph;
The paragraph content of the target paragraph into edlin and is preserved.
Preferably, in the document creating method that the embodiment of the present application first aspect provides, when in the default paragraph model
Default paragraph when being fallen for subsegment, the subsegment, which is fallen, further includes third paragraph mark;The third paragraph is identified as the subsegment
The first paragraph mark of the father's paragraph fallen, third paragraph mark is for reflecting layer that the subsegment is fallen between his father's paragraph
Secondary relationship.
Second aspect, the embodiment of the present application provide a kind of template establishment method, including:
Generate the default paragraph model in template;Comprising multiple default paragraphs in the default paragraph model, by described
Correspondence between the first paragraph mark of default paragraph reflects the hierarchical relationship between the default paragraph;
Establish the correspondence between the template identification of the template and the default paragraph model.
The third aspect, the embodiment of the present application provide a kind of document rendering intent, including:
Determine the document identification of document to be rendered;
According to the document identification, determine and the corresponding template of document to be rendered;The template identification of the template
There are the first incidence relations between the document identification of the document to be rendered;
According to the template identification, determine and the corresponding default paragraph model of the template;The default paragraph model
In comprising multiple default paragraphs, the correspondence passed through between the first paragraph mark of the default paragraph reflects the default section
Hierarchical relationship between falling;
The paragraph content of each paragraph in the document to be rendered is obtained, and according to each described pre- in the default paragraph model
If the hierarchical relationship between paragraph renders the document to be rendered.
Preferably, it in the document rendering intent that the embodiment of the present application third aspect provides, obtains in the document to be rendered
The paragraph content of each paragraph, including:
Following operation is performed to any default paragraph in the default paragraph model, until traversing the default paragraph mould
Each default paragraph in type:
It judges whether and the default corresponding target paragraph of paragraph;The second paragraph mark of the target paragraph
There are the second incidence relations between the first paragraph mark of the default paragraph;
When there is target paragraph corresponding with the default paragraph, using the paragraph content of the target paragraph as institute
State the paragraph content of document to be rendered.
Preferably, the embodiment of the present application third aspect provide document rendering intent in, judge whether with it is described pre-
If the corresponding target paragraph of paragraph, including:
It is identified according to the first paragraph of the default paragraph, it is determined whether there is the second paragraph mark for meeting preset condition
Know;The preset condition is, the second paragraph mark established with first paragraph mark have the second incidence relation and with
The document identification foundation of the document to be rendered has third incidence relation;
When there is the second paragraph for meeting preset condition mark, determined according to second paragraph mark described to be rendered
Target paragraph in document, and judge to exist corresponding by the target paragraph with the default paragraph.
Preferably, it in the document rendering intent that the embodiment of the present application third aspect provides, obtains in the document to be rendered
The paragraph content of each paragraph, further includes:
Following operation is performed to any default paragraph in the default paragraph model, until traversing the default paragraph mould
Each default paragraph in type:
It judges whether and the default corresponding target paragraph of paragraph;The second paragraph mark of the target paragraph
There are the second incidence relations between the first paragraph mark of the default paragraph;
When there is no during target paragraph corresponding with the default paragraph, using the paragraph content of the default paragraph as
The paragraph content of the document to be rendered.
Fourth aspect, the embodiment of the present application provide a kind of corresponding document of document creating method provided with first aspect
Creating device, including:
Template determining module determines to create template based on document, template identification is included in the template;
Paragraph model determining module, according to the template identification, determine with the corresponding default paragraph model of the template,
Comprising multiple default paragraphs in the default paragraph model, pass through the corresponding pass between the first paragraph mark of the default paragraph
The hierarchical relationship between the default paragraph is reflected in system;
Document creation module is preset according to the default paragraph model described in the hierarchical relationship establishment between paragraph
Document, and establish the first incidence relation between the document identification of the document and the template identification of the template.
5th aspect, the embodiment of the present application provide a kind of corresponding template of template establishment method provided with second aspect
Creating device, including:
Paragraph model generation module generates the default paragraph model in template;Comprising multiple in the default paragraph model
Default paragraph reflects the layer between the default paragraph by the correspondence between the first paragraph mark of the default paragraph
Secondary relationship;
Corresponding relation building module establishes the corresponding pass between the template identification of the template and the default paragraph model
System.
6th aspect, the embodiment of the present application provide a kind of corresponding document of document rendering intent provided with the third aspect
Rendering device, including:
Document identification determining module determines the document identification of document to be rendered;
Template determining module is rendered, according to the document identification, is determined and the corresponding template of document to be rendered;Institute
State between the template identification of template and the document identification of the document to be rendered that there are the first incidence relations;
Paragraph model determining module according to the template identification, determines and the corresponding default paragraph model of the template;
Comprising multiple default paragraphs in the default paragraph model, pass through the corresponding pass between the first paragraph mark of the default paragraph
The hierarchical relationship between the default paragraph is reflected in system;
Paragraph content rendering module obtains the paragraph content of each paragraph in the document to be rendered, and according to described default
Hierarchical relationship in paragraph model between each default paragraph renders the document to be rendered.
7th aspect, the embodiment of the present application provide a kind of corresponding electronics of document creating method provided with first aspect
Equipment, including:
Processor;And
The memory of storage computer executable instructions is arranged to, the executable instruction makes the place when executed
It manages device and performs following operate:
It determines to create template based on document, template identification is included in the template;
According to the template identification, determine and the corresponding default paragraph model of the template, the default paragraph model
In comprising multiple default paragraphs, the correspondence passed through between the first paragraph mark of the default paragraph reflects the default section
Hierarchical relationship between falling;
The hierarchical relationship preset according to the default paragraph model between paragraph creates the document, and establish institute
State the first incidence relation between the document identification of document and the template identification of the template.
Eighth aspect, the embodiment of the present application provide a kind of corresponding one kind of template establishment method provided with second aspect
Electronic equipment, including:
Processor;And
The memory of storage computer executable instructions is arranged to, the executable instruction makes the place when executed
It manages device and performs following operate:
Generate the default paragraph model in template;Comprising multiple default paragraphs in the default paragraph model, by described
Correspondence between the first paragraph mark of default paragraph reflects the hierarchical relationship between the default paragraph;
Establish the correspondence between the template identification of the template and the default paragraph model.
9th aspect, the embodiment of the present application provide a kind of corresponding electronics of document rendering intent provided with the third aspect
Equipment, including:
Processor;And
The memory of storage computer executable instructions is arranged to, the executable instruction makes the place when executed
It manages device and performs following operate:
Determine the document identification of document to be rendered;
According to the document identification, determine and the corresponding template of document to be rendered;The template identification of the template
There are the first incidence relations between the document identification of the document to be rendered;
According to the template identification, determine and the corresponding default paragraph model of the template;The default paragraph model
In comprising multiple default paragraphs, the correspondence passed through between the first paragraph mark of the default paragraph reflects the default section
Hierarchical relationship between falling;
The paragraph content of each paragraph in the document to be rendered is obtained, and according to each described pre- in the default paragraph model
If the hierarchical relationship between paragraph renders the document to be rendered.
Tenth aspect, the embodiment of the present application provide a kind of computer readable storage medium, the computer-readable storage medium
The one or more programs of matter storage, one or more of programs when being performed by the electronic equipment including multiple application programs,
So that the electronic equipment performs following operate:
It determines to create template based on document, template identification is included in the template;
According to the template identification, determine and the corresponding default paragraph model of the template, the default paragraph model
In comprising multiple default paragraphs, the correspondence passed through between the first paragraph mark of the default paragraph reflects the default section
Hierarchical relationship between falling;
The hierarchical relationship preset according to the default paragraph model between paragraph creates the document, and establish institute
State the first incidence relation between the document identification of document and the template identification of the template.
Tenth on the one hand, and the embodiment of the present application provides a kind of computer readable storage medium, the computer-readable storage
Media storage one or more program, one or more of programs are performed when by the electronic equipment including multiple application programs
When so that the electronic equipment performs following operate:
Generate the default paragraph model in template;Comprising multiple default paragraphs in the default paragraph model, by described
Correspondence between the first paragraph mark of default paragraph reflects the hierarchical relationship between the default paragraph;
Establish the correspondence between the template identification of the template and the default paragraph model.
12nd aspect, the embodiment of the present application provide a kind of computer readable storage medium, the computer-readable storage
Media storage one or more program, one or more of programs are performed when by the electronic equipment including multiple application programs
When so that the electronic equipment performs following operate:
Determine the document identification of document to be rendered;
According to the document identification, determine and the corresponding template of document to be rendered;The template identification of the template
There are the first incidence relations between the document identification of the document to be rendered;
According to the template identification, determine and the corresponding default paragraph model of the template;The default paragraph model
In comprising multiple default paragraphs, the correspondence passed through between the first paragraph mark of the default paragraph reflects the default section
Hierarchical relationship between falling;
The paragraph content of each paragraph in the document to be rendered is obtained, and according to each described pre- in the default paragraph model
If the hierarchical relationship between paragraph renders the document to be rendered.
Above-mentioned at least one technical solution that the embodiment of the present application uses can reach following advantageous effect:
In technical solution provided by the embodiments of the present application, the template for document creates corresponding default paragraph model,
Multiple default paragraphs are designed in default paragraph model, and anti-by presetting the correspondence between the first paragraph mark of paragraph
Reflect the hierarchical relationship between default paragraph.Then when being created according to this template, editing or render document, it can pass through document
First paragraph mark location of middle paragraph, and can be pre- with other by the specific paragraph to the specific paragraph in default paragraph model
If the correspondence between the first paragraph mark of paragraph determines the hierarchical relationship in document between each paragraph.
Therefore, using technical solution provided by the embodiments of the present application, when the default paragraph model in document template is adjusted
When whole, when creating document according to the template or render the document created according to the template, the level of each paragraph closes in document
System also can dynamically adjust therewith, so as to meet the use demand of user.
Specific embodiment
Purpose, technical scheme and advantage to make the application are clearer, below in conjunction with the application specific embodiment and
Technical scheme is clearly and completely described in corresponding attached drawing.Obviously, described embodiment is only the application one
Section Example, instead of all the embodiments.Based on the embodiment in the application, those of ordinary skill in the art are not doing
Go out all other embodiments obtained under the premise of creative work, shall fall in the protection scope of this application.
The method that the embodiment of the present application provides template establishment, document creation and editor and document renders three phases
With corresponding device.It should be noted that the document that the embodiment of the present application is applicable in, including text document, code document, configuration
The various information carrier files that can use structuring or the storage of unstructured technology such as document.It is used in the embodiment of the present application
The template arrived is mainly used for the form of the above-mentioned document of unified standard, is mainly concerned with to the paragraph structure in unified document, may be used also
To preset the paragraph content in the specific paragraph of certain in document.Wherein, the paragraph structure in document, is mainly reflected in document
Hierarchical relationship between each paragraph.
Below with reference to attached drawing, the technical solution that each embodiment of the application provides is described in detail.
It is understood that before document creation is carried out according to template, need to establish template based on establishment document.
When it is implemented, drawing template establishment with create document executive agent all can be computer or other have setting for this function
It is standby;It physically may be the same or different, the embodiment of the present application does not limit this.
Specifically, the exemplary method drawing template establishments of Fig. 1 may be used, which may particularly include:
S101:Generate the default paragraph model in template;Comprising multiple default paragraphs in default paragraph model, by default
The hierarchical relationship between the default paragraph of correspondence reflection between the first paragraph mark of paragraph;
S103:Establish the correspondence between the template identification of template and default paragraph model.
According to the needs of user, when creating new template, it is possible, firstly, to which the template for establishment is named, and a mould is distributed
Panel sign for identifying the uniqueness of the template, also serves as calling the foundation of the template.Show for example, following table 1 may be used
The relevant information of each template that the template table record of example creates, the data combination of data structure shown in a plurality of table 1 can be formed
2 exemplary template list of table selects template for user when creating document.
1 template table of table
Field name |
Type |
Whether can be empty |
Annotation |
id |
Varchar(32) |
It is no |
Major key id, that is, template identification |
name |
Varchar(216) |
It is no |
The title of template |
create_time |
Timestamp |
It is no |
The data creation time |
modified_time |
Timestamp |
It is no |
Data last newest time |
2 template list of table
On this basis, you can further perform step S101, design the paragraph model in the template.It is wrapped in paragraph model
Containing multiple default paragraphs, each default paragraph has the first paragraph mark for indicating its uniqueness.It should be noted that here
" uniqueness " can refer to the default uniqueness of the paragraph in the corresponding template of affiliated paragraph model, at this point, to search or
Call the default paragraph, it is also necessary to reference to the template identification of its corresponding template." uniqueness " of default paragraph, can also refer to this
Default uniqueness of the paragraph in all templates if then need to search or call the default paragraph, directly presets paragraph according to this
First paragraph identifies.
It is also default by indicating in addition to the default paragraph that the paragraph model need to include is preset in design segments stamping die type
The first paragraph mark of paragraph uniqueness establishes the correspondence between different default paragraphs, that is, establishes different default sections
Correspondence between the first paragraph mark fallen, so as to reflect the hierarchical relationship between default paragraph.
Specifically, the hierarchical relationship presented between tree, default paragraph with paragraph model be embodied as level-one or
For multistage set membership, when certain default paragraph in default paragraph model is fallen for subsegment, also design can be fallen for the subsegment
Third paragraph identifies;Third paragraph mark is taken as the first paragraph mark for father's paragraph that the subsegment is fallen, and third paragraph mark is used for
Reflect the hierarchical relationship that the subsegment is fallen between his father's paragraph.
Further, to each default paragraph in paragraph model, the template segment of example as shown in table 3 below can be built
Table is fallen, for establishing the correspondence of default paragraph template corresponding with affiliated paragraph model (by field " id " and field
The corresponding of " template_id " is realized), and establish default correspondence between paragraph and his father's paragraph (if there is) and (pass through
Field " id " is realized with field " parent_id ").In addition to this it is possible to it is preset in design template for default paragraph
Paragraph content (content in field " content " namely in table 3), the format text provided as template.It is establishing
When similar to the document for needing to have unified content this mode may be used, by specific provision content in standard contract template
It is placed in template in the form of presetting the paragraph content of paragraph, is used for user when creating document.
3 template paragraph table of table
It is understood that by 3 exemplary template paragraph table of table, it can be identified and determined by the first paragraph of father's paragraph
The first paragraph mark that all subsegments below father's paragraph are fallen can also be identified (namely by the third paragraph that subsegment is fallen
Field " parent_id ", be substantially still his father's paragraph the first paragraph mark) navigate to the subsegment fall belonging to father section
It falls, so as to reflect the hierarchical relationship between default paragraph.
It, can be specific by taking entitled " Hetong ", template identification is the paragraph models corresponding to the template of " MB-01 " as an example
It is presented as the template paragraph catalogue exemplified by table 4.It is understood that the first paragraph is identified as the default paragraph of " DL-01 ", section
It falls entitled " TK-01 ", preset paragraph content is " content 1 ", belongs to the template that template identification is " MB-01 ", the paragraph
" DL-01 " has no father's paragraph.First paragraph is identified as the default paragraph of " DL-03 ", and paragraph is entitled " TK-02-1 ", presets
Paragraph content for " content 3 ", belong to the template that template identification is " MB-01 ", father's paragraph of the paragraph is the first paragraph mark
Default paragraph for " DL-02 ".
4 template paragraph catalogue of table
id |
name |
content |
parent_id |
template_id |
create_time |
modified_time |
DL-01 |
TK-01 |
Content 1 |
(sky) |
MB-01 |
Timestamp 5 |
Timestamp 6 |
DL-02 |
TK-02 |
Content 2 |
(sky) |
MB-01 |
Timestamp 7 |
Timestamp 8 |
DL-03 |
TK-02-1 |
Content 3 |
DL-02 |
MB-01 |
Timestamp 9 |
Timestamp 10 |
··· |
··· |
··· |
··· |
··· |
··· |
··· |
It can be seen that in the default paragraph model of the template paragraph tabular form exemplified by table 4, template is also established
Correspondence between template identification and default paragraph model.
In the embodiment of the present application, by the way of above example, structuring processing is carried out to preset template so that text
The template of shelves and the default paragraph model foundation correspondence of structuring, pass through the multiple default sections in default paragraph model
Fall and by default paragraph the first paragraph mark establish paragraph between hierarchical relationship so that according to the template institute into
Capable document creation, editor and rendering can be carried out as unit of paragraph.It is created compared to template will be based in related technology
Document establishment, editor and the rendering of content are carried out as entirety for, mode provided by the embodiments of the present application is cleverer
It is living, by adjusting default paragraph and its hierarchical relationship in a template, you can the paragraph structure to the document created according to the template
It realizes that dynamic adjusts, meets the use demand of user.
It is understood that the adjustment that the default paragraph corresponding to template carries out, can increase new default paragraph, delete
Except existing default paragraph, change the paragraph content of default paragraph or the field of father's paragraph id is represented by modification
Hierarchical relationship between the default paragraph of " parent_id " modification etc..When needing that a certain default paragraph is migrated or copied to another
During new template, also need to only change the information for the field " template_id " for representing template identification can establish the default paragraph with
The incidence relation of new template.
It should be added that the paragraph for being in same level, it can be in such as 3 exemplary template paragraph table of table
Increase by one for representing the field of paragraph sequence, it can also be according to the field " create_time " corresponding to each default paragraph
(representing the time that the default paragraph is created) determines the sequence of paragraph.It is believed that creation time earlier lean on by paragraph sequence
Before, the later paragraph sequence of creation time is rearward.
On the basis of establishment has template, the establishment that the method exemplified by Fig. 2 carries out document may be used, this method can have
Body includes:
S201:It determines to create template based on document, template identification is included in template;
S203:According to template identification, the determining and corresponding default paragraph model of template is preset in paragraph model comprising more
A default paragraph is closed by presetting the level between the default paragraph of correspondence reflection between the first paragraph mark of paragraph
System;
S205:Hierarchical relationship according to being preset in default paragraph model between paragraph creates document, and establish the text of document
The first incidence relation between shelves mark and the template identification of template.
Using the embodiment of the present application method carry out document creation when, first carry out step S201 determine create document institute according to
According to template, so as to obtain the template identification information of the template (the specific letter of exemplary field " id " in namely aforementioned table 2
Breath, for example, MB-01 or MB-02).
Perform step S203 on this basis, according to template identification, determine with the corresponding default paragraph model of template, in advance
It is if default by presetting the correspondence reflection between the first paragraph mark of paragraph comprising multiple default paragraphs in paragraph model
Hierarchical relationship between paragraph.With reference to the process of previous embodiment drawing template establishment, step S203 is performed it is to be understood that in table 4
The value of Lookup Field " template_id " is consistent with the template identification determined in exemplified template paragraph catalogue owns
Default paragraph, then, according to these preset paragraph first paragraphs mark (value that field " id " is embodied as in table 4) and
Third paragraph identifies (value that field " parent_id " is embodied as in table 4), determines each default section in the paragraph model
Hierarchical relationship between falling.And then step S205 can be performed on this basis according between paragraph default in default paragraph model
Hierarchical relationship create document.
It should be noted that establish the first incidence relation between the document identification of document and the template identification of template,
Above-mentioned first incidence relation of data structure records of the document table of example as shown in the following Table 5 may be used.It is understood that when wound
When having multiple documents, the lists of documents exemplified by table 6 can be used and record incidence relation of multiple documents with corresponding template.
5 document table of table
Field name |
Type |
Whether can be empty |
Annotation |
id |
Varchar(32) |
It is no |
Major key id, that is, the document identification of document |
name |
Varchar(216) |
It is no |
The title of document |
template_id |
Varchar(32) |
It is no |
The template identification of template corresponding to current document |
create_time |
Timestamp |
It is no |
The data creation time |
modified_time |
Timestamp |
It is no |
Data last newest time |
6 lists of documents of table
Step S205 is being performed, it, can when creating document according to the hierarchical relationship preset in default paragraph model between paragraph
It is the default paragraph in default paragraph model to be determined directly as to the paragraph in document, the hierarchical relationship between default paragraph is straight
Connect the hierarchical relationship being determined as in document between paragraph.
On the basis of having template using previous embodiment establishment, the paragraph content that paragraph is preset in template is if desired changed
(for example, the content of " paragraph content " this field does not meet user and needs for empty or particular content in original template), also
Be established when needing to the paragraph content of target paragraph into edlin the second paragraph mark of target paragraph with it is corresponding default
The second incidence relation between the first paragraph mark of paragraph, and establish the second paragraph mark of target paragraph and the document of document
Third incidence relation between mark;Wherein, target paragraph in document with the corresponding any one of default paragraph;Then,
The paragraph content of target paragraph into edlin and is preserved.
If it is understood that is carried out during creating and editing document to presetting preset paragraph content in paragraph
Modification, then can be associated with according to above-mentioned second incidence relation of data structure records of 7 exemplary document segment table of table with third
System.If being edited to the paragraph content in multiple paragraphs (namely target paragraph), text as exemplified in table 8 can be formed
Shelves paragraph catalogue.
7 document segment table of table
8 document segment list of table
id |
name |
content |
info_id |
parent_id |
template_unit_id |
create_time |
modified_time |
DD-01 |
M-01 |
Content 4 |
WD-01 |
(sky) |
DL-01 |
Timestamp 15 |
Timestamp 16 |
DD-02 |
M-02 |
Content 5 |
WD-01 |
(sky) |
DL-02 |
Timestamp 17 |
Timestamp 18 |
DD-03 |
M-02-1 |
Content 6 |
WD-01 |
DL-02 |
DL-03 |
Timestamp 19 |
Timestamp 20 |
··· |
··· |
··· |
|
··· |
··· |
··· |
··· |
It is understood that in the document segment list presented in table 8, the first paragraph is identified as in default paragraph model
The paragraph content of the default paragraph of " DL-01 ", " DL-02 " and " DL-03 ", in document of the document identification for " WD-01 "
Modification, particular content are changed respectively " content 4 ", " content 5 " and " content 6 ", the second paragraph mark of modified target paragraph
Know is respectively " DD-01 ", " DD-02 " and " DD-03 ".The incidence relation preserved from table 8 can be seen that the second of target paragraph
Paragraph is identified between " DD-01 " and the first paragraph mark " DL-01 " of corresponding default paragraph there are the second incidence relation, and
Third incidence relation between the document identification " WD-01 " of document, and so on.At the same time, it presets corresponding to paragraph
The target paragraph that the paragraph mark of father's paragraph is similarly preset with this corresponding to paragraph establishes incidence relation, so as to repair
While changing specific paragraph content in paragraph, still retain the layer between the paragraph established in the paragraph model corresponding to template
Secondary relationship realizes the consistency of paragraph structure, meets the use demand of user.
It should be noted that during creating and editing document, it is right that template institute can be traversed in a certain order
Each paragraph in the paragraph model answered, for example, according to the tree structure of paragraph model, using the strategy progress time of depth-first
It goes through, the target paragraph for needing to carry out Edition Contains can also be chosen according to specific needs by user.The embodiment of the present application to this not
It limits.
The embodiment of the present application additionally provides a kind of document rendering intent, shown in Figure 3, including:
S301:Determine the document identification of document to be rendered;
S303:According to document identification, determine and the corresponding template of document to be rendered;The template identification of template with it is to be rendered
There are the first incidence relations between the document identification of document;
S305:According to template identification, determine and the corresponding default paragraph model of template;Comprising more in default paragraph model
A default paragraph is closed by presetting the level between the default paragraph of correspondence reflection between the first paragraph mark of paragraph
System;
S307:The paragraph content of each paragraph in document to be rendered is obtained, and according to default paragraph each in default paragraph model
Between hierarchical relationship render document to be rendered.
It is understood that when needing to carry out document rendering, for document to be rendered, can be first carried out step S301 with
Obtain its document identification.As in the embodiments above, document identification and template identification are preserved in 6 exemplary lists of documents of table
The first incidence relation, therefore, can further perform step S303, according to document identification, determine opposite with document to be rendered
The template answered.
On this basis, due to preserving template identification and default paragraph model (tool in 4 exemplary template paragraph catalogue of table
Body be presented as default paragraph the first paragraph mark and its third paragraph mark) between correspondence, therefore, step can be performed
Rapid S305, according to template identification, the determining and corresponding default paragraph model of template, so as to be included according in default paragraph model
Multiple default paragraphs between hierarchical relationship.
It further, can be to default in the paragraph content of each paragraph in performing step S307 acquisitions document to be rendered
Any default paragraph in paragraph model performs following operation, until each default paragraph in the default paragraph model of traversal:
Judge whether with the corresponding target paragraph of default paragraph, wherein, the second paragraph of target paragraph mark with
There are the second incidence relations between the first paragraph mark of default paragraph;
When there is target paragraph corresponding with default paragraph, using the paragraph content of target paragraph as document to be rendered
Paragraph content.
In addition to this, when there is no during target paragraph corresponding with default paragraph, the paragraph content of default paragraph is made
Paragraph content for document to be rendered.
To the traversal of each default paragraph in default paragraph model during execution step S307, it can be understood as, according to treating
The associated template identification of document identification of rendering document is preset used by the document is determined after paragraph model, you can root
It determines to preset the layer between paragraph and each default paragraph included in document to be rendered according to 4 exemplary template paragraph catalogue of table
Secondary relationship.It is repaiied since the paragraph content in paragraph can be preset to certain during creating according to template and editing document
Change, preset the corresponding target paragraph of paragraph with this so as to be formed, and generate one in the document segment list exemplified by table 8
Data, therefore, can be with the document exemplified by inquiry table 8 when judging whether target paragraph corresponding with default paragraph
In the following manner specifically may be used in paragraph catalogue:
(value that can be embodied as field " id " in table 4) is identified according to the first paragraph of default paragraph, it is determined whether exist
Meet the second paragraph mark (value that field " id " in table 8 can be embodied as) of preset condition;Preset condition is the second paragraph mark
Knowing to establish with the first paragraph mark has the second incidence relation (can be embodied as the value and field of the field " id " in table 8
The value of " template_unit_id " is corresponding, and essence is it is to be understood that in table 8 in field " template_unit_id "
In the presence of the key assignments consistent with the value of field " id " in table 4) and (can be embodied as in table 8 with the document identification of document to be rendered
The value of field " info_id ") establish have third incidence relation;
When there is the second paragraph for meeting preset condition mark, word in table 8 (can be embodied as according to the second paragraph mark
The value of section " id ") determine target paragraph in document to be rendered, and judge to exist corresponding by target phase with default paragraph
It falls.On this basis, you can the second paragraph for meeting preset condition with this further is identified corresponding paragraph content (can have
Body turns to the value of field " content " in table 8) as the paragraph content in document to be rendered.
It is understood that according to the inquiry to table 4 and table 8 and traversal, it is determined that the section of each paragraph in document to be rendered
It falls after content, you can text to be rendered is further rendered according to the hierarchical relationship between each default paragraph in default paragraph model
Shelves.
In technical solution provided by the embodiments of the present application, the template for document creates corresponding default paragraph model,
Multiple default paragraphs are designed in default paragraph model, and anti-by presetting the correspondence between the first paragraph mark of paragraph
Reflect the hierarchical relationship between default paragraph.Then when being created according to this template, editing or render document, it can pass through document
First paragraph mark location of middle paragraph, and can be pre- with other by the specific paragraph to the specific paragraph in default paragraph model
If the correspondence between the first paragraph mark of paragraph determines the hierarchical relationship in document between each paragraph.
Therefore, using technical solution provided by the embodiments of the present application, when the default paragraph model in document template is adjusted
When whole, when creating document according to the template or render the document created according to the template, the level of each paragraph closes in document
System also can dynamically adjust therewith, so as to meet the use demand of user.
Shown in Figure 4, the embodiment of the present application also provides a kind of template wound corresponding with template establishment method shown in Fig. 1
Device is built, including:
Paragraph model generation module 101 generates the default paragraph model in template;Comprising multiple pre- in default paragraph model
If paragraph, by presetting the hierarchical relationship between the default paragraph of correspondence reflection between the first paragraph mark of paragraph;
Corresponding relation building module 103 establishes the correspondence between the template identification of template and default paragraph model.
Shown in Figure 5, the embodiment of the present application also provides a kind of document wound corresponding with document creating method shown in Fig. 2
Device is built, including:
Template determining module 201 determines to create template based on document, template identification is included in template;
Paragraph model determining module 203, according to template identification, the determining and corresponding default paragraph model of template is preset
Comprising multiple default paragraphs in paragraph model, by presetting the default section of correspondence reflection between the first paragraph mark of paragraph
Hierarchical relationship between falling;
Document creation module 205 creates document, and build according to the hierarchical relationship preset in default paragraph model between paragraph
The first incidence relation between the document identification of vertical document and the template identification of template.
Shown in Figure 6, the embodiment of the present application also provides the corresponding document wash with watercolours of document rendering intent shown in a kind of and Fig. 3
Device is contaminated, including:
Document identification determining module 301 determines the document identification of document to be rendered;
Template determining module 303 is rendered, according to document identification, is determined and the corresponding template of document to be rendered;Template
There are the first incidence relations between template identification and the document identification of document to be rendered;
Paragraph model determining module 305 according to template identification, determines and the corresponding default paragraph model of template;It is default
Comprising multiple default paragraphs in paragraph model, by presetting the default section of correspondence reflection between the first paragraph mark of paragraph
Hierarchical relationship between falling;
Paragraph content rendering module 307 obtains the paragraph content of each paragraph in document to be rendered, and according to default paragraph mould
Hierarchical relationship in type between each default paragraph renders document to be rendered.
It is understood that being suitable for device embodiment to all explainations of embodiment of the method above, details are not described herein again.
Fig. 7 is the structure diagram of one embodiment electronic equipment of the application.Fig. 7 is please referred to, in hardware view, the electricity
Sub- equipment includes processor, optionally further includes internal bus, network interface, memory.Wherein, memory may include interior
It deposits, such as high-speed random access memory (Random-AccessMemory, RAM), it is also possible to further include nonvolatile memory
(non-volatile memory), for example, at least 1 magnetic disk storage etc..Certainly, which is also possible that other industry
It is engaged in required hardware.
Processor, network interface and memory can be connected with each other by internal bus, which can be ISA
(Industry Standard Architecture, industry standard architecture) bus, PCI (Peripheral
Component Interconnect, Peripheral Component Interconnect standard) bus or EISA (Extended Industry Standard
Architecture, expanding the industrial standard structure) bus etc..The bus can be divided into address bus, data/address bus, control always
Line etc..For ease of representing, only represented in Fig. 7 with a four-headed arrow, it is not intended that an only bus or a type of
Bus.
Memory, for storing program.Specifically, program can include program code, and said program code includes calculating
Machine operational order.Memory can include memory and nonvolatile memory, and provide instruction and data to processor.
Processor reads in corresponding computer program to memory and then is run from nonvolatile memory, in logical layer
Template creating device is formed on face.Processor performs the program that memory is stored, and specifically for performing following operate:
Generate the default paragraph model in template;Comprising multiple default paragraphs in the default paragraph model, by described
Correspondence between the first paragraph mark of default paragraph reflects the hierarchical relationship between the default paragraph;
Establish the correspondence between the template identification of the template and the default paragraph model.
The method that template creating device disclosed in the above-mentioned embodiment illustrated in fig. 1 such as the application performs can be applied to processor
In or realized by processor.Processor may be a kind of IC chip, have the processing capacity of signal.It was realizing
Cheng Zhong, each step of the above method can be complete by the integrated logic circuit of the hardware in processor or the instruction of software form
Into.Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit, CPU),
Network processing unit (Network Processor, NP) etc.;It can also be digital signal processor (Digital Signal
Processor, DSP), it is application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), existing
Field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device are divided
Vertical door or transistor logic, discrete hardware components.It can realize or perform and is in the embodiment of the present application disclosed each
Method, step and logic diagram.General processor can be microprocessor or the processor can also be any conventional place
Manage device etc..The step of method with reference to disclosed in the embodiment of the present application, can be embodied directly in hardware decoding processor and perform
Completion is performed into or with hardware in decoding processor and software module combination.Software module can be located at random access memory,
This fields such as flash memory, read-only memory, programmable read only memory or electrically erasable programmable memory, register maturation
In storage medium.The storage medium is located at memory, and processor reads the information in memory, and above-mentioned side is completed with reference to its hardware
The step of method.
The electronic equipment can also carry out the method that template creating device performs in Fig. 1, and realize template creating device in Fig. 1
The function of illustrated embodiment, details are not described herein for the embodiment of the present application.
The embodiment of the present application also proposed a kind of computer readable storage medium, the computer-readable recording medium storage one
A or multiple programs, the one or more program include instruction, which works as is held by the electronic equipment including multiple application programs
During row, the electronic equipment can be made to perform the method that template creating device performs in embodiment illustrated in fig. 1, and specifically for holding
Row:
Generate the default paragraph model in template;Comprising multiple default paragraphs in the default paragraph model, by described
Correspondence between the first paragraph mark of default paragraph reflects the hierarchical relationship between the default paragraph;
Establish the correspondence between the template identification of the template and the default paragraph model.
Fig. 8 is the structure diagram of one embodiment electronic equipment of the application.Fig. 8 is please referred to, in hardware view, the electricity
Sub- equipment includes processor, optionally further includes internal bus, network interface, memory.Wherein, memory may include interior
It deposits, such as high-speed random access memory (Random-Access Memory, RAM), it is also possible to further include non-volatile memories
Device (non-volatile memory), for example, at least 1 magnetic disk storage etc..Certainly, which is also possible that other
The required hardware of business.
Processor, network interface and memory can be connected with each other by internal bus, which can be ISA
(Industry Standard Architecture, industry standard architecture) bus, PCI (Peripheral
Component Interconnect, Peripheral Component Interconnect standard) bus or EISA (Extended Industry Standard
Architecture, expanding the industrial standard structure) bus etc..The bus can be divided into address bus, data/address bus, control always
Line etc..For ease of representing, only represented in Fig. 8 with a four-headed arrow, it is not intended that an only bus or a type of
Bus.
Memory, for storing program.Specifically, program can include program code, and said program code includes calculating
Machine operational order.Memory can include memory and nonvolatile memory, and provide instruction and data to processor.
Processor reads in corresponding computer program to memory and then is run from nonvolatile memory, in logical layer
Document creation device is formed on face.Processor performs the program that memory is stored, and specifically for performing following operate:
It determines to create template based on document, template identification is included in the template;
According to the template identification, determine and the corresponding default paragraph model of the template, the default paragraph model
In comprising multiple default paragraphs, the correspondence passed through between the first paragraph mark of the default paragraph reflects the default section
Hierarchical relationship between falling;
The hierarchical relationship preset according to the default paragraph model between paragraph creates the document, and establish institute
State the first incidence relation between the document identification of document and the template identification of the template.
The method that document creation device disclosed in the above-mentioned embodiment illustrated in fig. 2 such as the application performs can be applied to processor
In or realized by processor.Processor may be a kind of IC chip, have the processing capacity of signal.It was realizing
Cheng Zhong, each step of the above method can be complete by the integrated logic circuit of the hardware in processor or the instruction of software form
Into.Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit, CPU),
Network processing unit (Network Processor, NP) etc.;It can also be digital signal processor (Digital Signal
Processor, DSP), it is application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), existing
Field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device are divided
Vertical door or transistor logic, discrete hardware components.It can realize or perform and is in the embodiment of the present application disclosed each
Method, step and logic diagram.General processor can be microprocessor or the processor can also be any conventional place
Manage device etc..The step of method with reference to disclosed in the embodiment of the present application, can be embodied directly in hardware decoding processor and perform
Completion is performed into or with hardware in decoding processor and software module combination.Software module can be located at random access memory,
This fields such as flash memory, read-only memory, programmable read only memory or electrically erasable programmable memory, register maturation
In storage medium.The storage medium is located at memory, and processor reads the information in memory, and above-mentioned side is completed with reference to its hardware
The step of method.
The electronic equipment can also carry out the method that document creating device performs in Fig. 2, and realize document creation device in Fig. 2
The function of illustrated embodiment, details are not described herein for the embodiment of the present application.
The embodiment of the present application also proposed a kind of computer readable storage medium, the computer-readable recording medium storage one
A or multiple programs, the one or more program include instruction, which works as is held by the electronic equipment including multiple application programs
During row, the electronic equipment can be made to perform the method that document creating device performs in embodiment illustrated in fig. 2, and specifically for holding
Row:
It determines to create template based on document, template identification is included in the template;
According to the template identification, determine and the corresponding default paragraph model of the template, the default paragraph model
In comprising multiple default paragraphs, the correspondence passed through between the first paragraph mark of the default paragraph reflects the default section
Hierarchical relationship between falling;
The hierarchical relationship preset according to the default paragraph model between paragraph creates the document, and establish institute
State the first incidence relation between the document identification of document and the template identification of the template.
Fig. 9 is the structure diagram of one embodiment electronic equipment of the application.Fig. 9 is please referred to, in hardware view, the electricity
Sub- equipment includes processor, optionally further includes internal bus, network interface, memory.Wherein, memory may include interior
It deposits, such as high-speed random access memory (Random-Access Memory, RAM), it is also possible to further include non-volatile memories
Device (non-volatile memory), for example, at least 1 magnetic disk storage etc..Certainly, which is also possible that other
The required hardware of business.
Processor, network interface and memory can be connected with each other by internal bus, which can be ISA
(Industry Standard Architecture, industry standard architecture) bus, PCI (Peripheral
Component Interconnect, Peripheral Component Interconnect standard) bus or EISA (Extended Industry Standard
Architecture, expanding the industrial standard structure) bus etc..The bus can be divided into address bus, data/address bus, control always
Line etc..For ease of representing, only represented in Fig. 9 with a four-headed arrow, it is not intended that an only bus or a type of
Bus.
Memory, for storing program.Specifically, program can include program code, and said program code includes calculating
Machine operational order.Memory can include memory and nonvolatile memory, and provide instruction and data to processor.
Processor reads in corresponding computer program to memory and then is run from nonvolatile memory, in logical layer
Document rendering device is formed on face.Processor performs the program that memory is stored, and specifically for performing following operate:
Determine the document identification of document to be rendered;
According to the document identification, determine and the corresponding template of document to be rendered;The template identification of the template
There are the first incidence relations between the document identification of the document to be rendered;
According to the template identification, determine and the corresponding default paragraph model of the template;The default paragraph model
In comprising multiple default paragraphs, the correspondence passed through between the first paragraph mark of the default paragraph reflects the default section
Hierarchical relationship between falling;
The paragraph content of each paragraph in the document to be rendered is obtained, and according to each described pre- in the default paragraph model
If the hierarchical relationship between paragraph renders the document to be rendered.
The method that document rendering device disclosed in the above-mentioned embodiment illustrated in fig. 3 such as the application performs can be applied to processor
In or realized by processor.Processor may be a kind of IC chip, have the processing capacity of signal.It was realizing
Cheng Zhong, each step of the above method can be complete by the integrated logic circuit of the hardware in processor or the instruction of software form
Into.Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit, CPU),
Network processing unit (Network Processor, NP) etc.;It can also be digital signal processor (Digital Signal
Processor, DSP), it is application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), existing
Field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device are divided
Vertical door or transistor logic, discrete hardware components.It can realize or perform and is in the embodiment of the present application disclosed each
Method, step and logic diagram.General processor can be microprocessor or the processor can also be any conventional place
Manage device etc..The step of method with reference to disclosed in the embodiment of the present application, can be embodied directly in hardware decoding processor and perform
Completion is performed into or with hardware in decoding processor and software module combination.Software module can be located at random access memory,
This fields such as flash memory, read-only memory, programmable read only memory or electrically erasable programmable memory, register maturation
In storage medium.The storage medium is located at memory, and processor reads the information in memory, and above-mentioned side is completed with reference to its hardware
The step of method.
The electronic equipment can also carry out the method that document rendering device performs in Fig. 3, and realize document rendering device in Fig. 3
The function of illustrated embodiment, details are not described herein for the embodiment of the present application.
The embodiment of the present application also proposed a kind of computer readable storage medium, the computer-readable recording medium storage one
A or multiple programs, the one or more program include instruction, which works as is held by the electronic equipment including multiple application programs
During row, the electronic equipment can be made to perform the method that document rendering device performs in embodiment illustrated in fig. 3, and specifically for holding
Row:
Determine the document identification of document to be rendered;
According to the document identification, determine and the corresponding template of document to be rendered;The template identification of the template
There are the first incidence relations between the document identification of the document to be rendered;
According to the template identification, determine and the corresponding default paragraph model of the template;The default paragraph model
In comprising multiple default paragraphs, the correspondence passed through between the first paragraph mark of the default paragraph reflects the default section
Hierarchical relationship between falling;
The paragraph content of each paragraph in the document to be rendered is obtained, and according to each described pre- in the default paragraph model
If the hierarchical relationship between paragraph renders the document to be rendered.
It should be understood by those skilled in the art that, the embodiment of the present invention can be provided as method, system or computer program
Product.Therefore, the reality in terms of complete hardware embodiment, complete software embodiment or combination software and hardware can be used in the present invention
Apply the form of example.Moreover, the computer for wherein including computer usable program code in one or more can be used in the present invention
The computer program production that usable storage medium is implemented on (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of product.
The present invention be with reference to according to the method for the embodiment of the present invention, the flow of equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that it can be realized by computer program instructions every first-class in flowchart and/or the block diagram
The combination of flow and/or box in journey and/or box and flowchart and/or the block diagram.These computer programs can be provided
The processor of all-purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce
A raw machine so that the instruction performed by computer or the processor of other programmable data processing devices is generated for real
The device of function specified in present one flow of flow chart or one box of multiple flows and/or block diagram or multiple boxes.
These computer program instructions, which may also be stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that the instruction generation being stored in the computer-readable memory includes referring to
Enable the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one box of block diagram or
The function of being specified in multiple boxes.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that counted
Series of operation steps are performed on calculation machine or other programmable devices to generate computer implemented processing, so as in computer or
The instruction offer performed on other programmable devices is used to implement in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in a box or multiple boxes.
In a typical configuration, computing device includes one or more processors (CPU), input/output interface, net
Network interface and memory.
Memory may include computer-readable medium in volatile memory, random access memory (RAM) and/or
The forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable medium
Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology come realize information store.Information can be computer-readable instruction, data structure, the module of program or other data.
The example of the storage medium of computer includes, but are not limited to phase transition internal memory (PRAM), static RAM (SRAM), moves
State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable
Programmable read only memory (EEPROM), fast flash memory bank or other memory techniques, CD-ROM read-only memory (CD-ROM),
Digital versatile disc (DVD) or other optical storages, magnetic tape cassette, the storage of tape magnetic rigid disk or other magnetic storage apparatus
Or any other non-transmission medium, available for storing the information that can be accessed by a computing device.It defines, calculates according to herein
Machine readable medium does not include temporary computer readable media (transitory media), such as data-signal and carrier wave of modulation.
It should also be noted that, term " comprising ", "comprising" or its any other variant are intended to nonexcludability
Comprising so that process, method, commodity or equipment including a series of elements are not only including those elements, but also wrap
Include other elements that are not explicitly listed or further include for this process, method, commodity or equipment it is intrinsic will
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that wanted including described
Also there are other identical elements in the process of element, method, commodity or equipment.
It will be understood by those skilled in the art that embodiments herein can be provided as method, system or computer program product.
Therefore, complete hardware embodiment, complete software embodiment or the embodiment in terms of combining software and hardware can be used in the application
Form.It is deposited moreover, the application can be used to can be used in one or more computers for wherein including computer usable program code
The shape of computer program product that storage media is implemented on (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
Formula.
The foregoing is merely embodiments herein, are not limited to the application.For those skilled in the art
For, the application can have various modifications and variations.All any modifications made within spirit herein and principle are equal
Replace, improve etc., it should be included within the scope of claims hereof.