Summary of the invention
The embodiment of the invention provides a kind of template matching method and device based on document realizes user without carrying out
Many and diverse PPT theme selection and follow-up editor, further solve when the subject controls do not match, the caused a large amount of time
And the technical issues of efforts.
A kind of template matching method based on document provided in an embodiment of the present invention, including:
Obtain the document information of document;
According to document information determination and the matched condition code of the document information;
Judge whether described document information has corresponding template, if so, using the template in the document.
Optionally,
Further include before obtaining the content information of document:
Obtain template matches instruction.
Optionally,
The document information includes:
Document Title, document color and document content.
Optionally,
It is determined according to the document information and is specifically included with the matched condition code of the document information:
According to the Document Title in the document information, document color and document content according to preset weight distribution calculate with
The matched described document information of document information.
Optionally,
Judge whether described document information has corresponding template, if so, specific in the document using the template
Including:
Judge whether described document information has template corresponding with described document information, if so, randomly selecting and the feature
One is applied in the document in the corresponding multiple template of code.
Optionally,
Judge whether described document information has corresponding template, if so, using the template after the document
Further include:
If the template not corresponding with described document information, reaches database for the document information and notices.
A kind of template matches device based on document provided in an embodiment of the present invention, including:
Acquiring unit, for obtaining the document information of document, stating document information includes Document Title, document color and document
Content;
Determination unit, for according to document information determination and the matched condition code of the document information;
Judging unit, for judging whether described document information has corresponding template, if so, triggering matching unit,
If it is not, then triggering notification unit;
The matching unit, for the application template in the document.
Optionally,
The determination unit, specifically for according to the Document Title in the document information, document color and document content
It is calculated and the matched described document information of the document information according to preset weight distribution.
Optionally,
The matching unit, which is specifically used for randomly selecting in multiple template corresponding with described document information one, is applied to institute
It states in document.
Optionally,
The notification unit is noticed for the document information to be reached database.
As can be seen from the above technical solutions, the embodiment of the present invention has the following advantages that:
A kind of template matching method and device based on document provided in the embodiment of the present invention, method and step include:It obtains
Take the document information of document;According to document information determination and the matched condition code of document information;Whether judging characteristic code has therewith
Corresponding template, if so, application template is in document.In the present embodiment, the document by obtaining the document that user edits is believed
Breath carries out condition code and determines, obtains corresponding template according to condition code and application template is in the document editted, just real
User is showed to be not necessarily to carry out many and diverse PPT theme selection and follow-up editor, further solve when the subject controls do not match, institute
The technical issues of caused a large amount of time and efforts expends.
Specific embodiment
The embodiment of the invention provides a kind of template matching method of document and devices, and it is many and diverse without carrying out to realize user
PPT theme selection and follow-up editor, further solve when the subject controls do not match, caused a large amount of time and essence
The technical issues of power expends.
In order to make the invention's purpose, features and advantages of the invention more obvious and easy to understand, below in conjunction with the present invention
Attached drawing in embodiment, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that disclosed below
Embodiment be only a part of the embodiment of the present invention, and not all embodiment.Based on the embodiments of the present invention, this field
Those of ordinary skill's all other embodiment obtained without making creative work, belongs to protection of the present invention
Range.
Referring to Fig. 1, a kind of one embodiment of the template matching method based on document provided in the embodiment of the present invention
Including:
101, the document information of document is obtained;
In the present embodiment, PPT document after user, which has editted, not to be rendered theme or be to have rendered theme,
It needs to document progress new theme template in application, the document information for the document for needing acquisition user to edit first, Ke Yili
Solution, document information above-mentioned include Document Title, for example, each page subject name keyword etc., document face
Color, such as the color of document charts, the word content in color of document font etc. and document content, such as document, such as
The relevant keyword of industry, the classification etc. of content, herein specifically without limitation.
It should be noted that in the present embodiment, the document information above-mentioned for obtaining document can also be user document not
To the document content of the document information in database before being edited, document color carries out preferential selection and is obtained again.
102, according to document information determination and the matched condition code of document information;
After obtaining the document information of document, need according to document information determination and the matched condition code of document information,
It should be noted that this feature code can be a variable, preset in the database with the preset template class in database
The not code of corresponding template.
103, whether judging characteristic code has corresponding template, if so, thening follow the steps 104;
After condition code matched with document information determining according to document information, need whether judging characteristic code has therewith
Corresponding template, if so, thening follow the steps 104, it is to be understood that whether judging characteristic code above-mentioned has corresponding mould
Plate can be the template in database, can also be the template in cloud storage, herein specifically without limitation.
104, application template is in document.
After judging characteristic code has corresponding template, then application template is in document, it is to be understood that aforementioned
Application template can be in document and carry out specified application before document is not edited, can also be carry out after documents editing it is whole
Application, further, template can be using and whole documents, can also be using and single or multiple documents.
In the present embodiment, the document information by obtaining the document that user edits carries out condition code and determines, according to feature
Code obtains corresponding template and application template in the document editted, just realizes user without carrying out many and diverse PPT
Theme selection and follow-up editor, further solve when the subject controls do not match, caused a large amount of time and efforts consumption
The technical issues of taking.
The above is that the process of the template matching method based on document is described in detail, below will to subsequent step into
The detailed description of row, referring to Fig. 2, an a kind of reality of the template matching method based on document provided in the embodiment of the present invention
Applying example includes:
201, template matches instruction is obtained;
In the present embodiment, PPT document after user, which has editted, not to be rendered theme or be to have rendered theme,
It needs to document progress new theme template in application, firstly the need of the template matches instruction for obtaining user's triggering.
202, the document information of document is obtained;
In the present embodiment, after obtaining template matches instruction, need to obtain the document information for the document that user edits,
It is understood that document information above-mentioned includes Document Title, for example, each page subject name keyword etc., text
Shelves color, such as the color of document charts, the word content in color of document font etc. and document content, such as document,
Such as the relevant keyword of industry, the classification etc. of content, herein specifically without limitation.
It should be noted that in the present embodiment, the document information above-mentioned for obtaining document can also be user document not
To the document content of the document information in database before being edited, document color carries out preferential selection and is obtained again.
203, according to the Document Title in document information, document color and document content according to preset weight distribution calculate with
The matched condition code of document information;
After obtaining the document information of document, need according to the Document Title in document information, document color and document
Content calculates and the matched condition code of document information according to preset weight distribution, it should be noted that this feature code can be one
A variable presets the code in the database with template corresponding to the preset template classification in database.
It is understood that preset weight above-mentioned can be the Document Title pre-set, document color and document
The weight value information of content is calculated, such as the keyword message majority of Document Title is key relevant to financial industry
Word, document color are mostly red, are mostly Money Data in document content such as chart, according to Document Title above-mentioned, document face
The information content of color and document content is calculated with preset weight information, which can be the mathematical algorithms such as addition subtraction multiplication and division with before
The value of information that the information content of the Document Title stated, document color and document content obtains, determines final condition code, this feature code
Can be how much corresponding settings of carry out according to information, for example, a document document information it is more when, then condition code can be with
It is that long string of substep condition code such as 123.456.789 etc. is distinguished by merogenesis symbol, can also be letter or vocabulary
Condition code etc., herein it is specific without limitation.
204, whether judging characteristic code has corresponding template, if so, 205 are thened follow the steps, if it is not, thening follow the steps
206;
After condition code matched with document information determining according to document information, need whether judging characteristic code has therewith
Corresponding template, if so, 205 are thened follow the steps, if it is not, thening follow the steps 206, it is to be understood that judging characteristic above-mentioned
Whether code has corresponding template, can be the template in database, can also be the template in cloud storage, herein specifically
Without limitation.
205, one is randomly selected in multiple template corresponding with condition code to be applied in document;
After judging characteristic code has corresponding template, then randomly select one in multiple template corresponding with condition code
It is a to be applied in document, it can manage, application template above-mentioned can be in document is specified before document is not edited
Using, can also be and carry out whole application after documents editing, further, template can be using and whole documents, may be used also
To be to apply and single or multiple documents.
206, document information database is reached to notice.
When 204 judging characteristic code of abovementioned steps does not have corresponding template, then by document information reach database into
Row notice, it is to be understood that it is above-mentioned by document information reach database carry out notice can be the document of document information
Title, document color and document content are uploaded to database or cloud storage save and by the document without matched mould
Plate, so that subsequent technology personnel can be with the matched template addition of further progress and design.
In the present embodiment, the document information by obtaining the document that user edits carries out condition code and determines, according to feature
Code obtains corresponding template and application template in the document editted, just realizes user without carrying out many and diverse PPT
Theme selection and follow-up editor, further solve when the subject controls do not match, caused a large amount of time and efforts consumption
The technical issues of taking, meanwhile, according to the Document Title in document information, document color and document content are according to preset weight distribution
Calculate with the design of the matched condition code of document information, further improve the template matching based on document in the present embodiment more
Add accurate and intelligent.
Referring to Fig. 3, a kind of one embodiment of the template matches device based on document provided in the embodiment of the present invention
Including:
Acquiring unit 301, for obtaining the document information of document, stating document information includes Document Title, document color and
Document content;
Determination unit 302, for according to document information determination and the matched condition code of document information;
Whether judging unit 303 has corresponding template for judging characteristic code, if so, triggering matching unit
304, if it is not, then triggering notification unit;
Matching unit 304, for application template in document.
In the present embodiment, the document information for the document that user edits is obtained by acquiring unit 301, then by determination unit
302 carry out condition codes determines, matching unit 304 according to condition code obtains corresponding template and application template is editting
In document, just realizes user and be not necessarily to carry out many and diverse PPT theme selection and follow-up editor, further solve when theme compares
When mismatch, the technical issues of caused a large amount of time and efforts expends.
The above is that each unit of the template matches device based on document is described in detail, referring to Fig. 4, of the invention
A kind of another embodiment of the template matches device based on document provided in embodiment includes:
Acquiring unit 401, for obtaining the document information of document, stating document information includes Document Title, document color and
Document content;
Determination unit 402, for according to document information determination and the matched condition code of document information, it should be noted that
Determination unit 402 is specifically used for according to the Document Title in document information, document color and document content according to preset weight point
With calculating and the matched condition code of document information;
Whether judging unit 403 has corresponding template for judging characteristic code, if so, triggering matching unit
404, if it is not, then triggering notification unit;
Matching unit 404, for application template in document, it is necessary to which explanation, matching unit 404 are specifically used for random take out
One is taken in multiple template corresponding with condition code to be applied in document;
Notification unit 405 is noticed for document information to be reached database.
In the present embodiment, the document information for the document that user edits is obtained by acquiring unit 401, then by determination unit
402 carry out condition codes determines, matching unit 404 according to condition code obtains corresponding template and application template is editting
In document, just realizes user and be not necessarily to carry out many and diverse PPT theme selection and follow-up editor, further solve when theme compares
When mismatch, the technical issues of caused a large amount of time and efforts expends, meanwhile, determination unit 402 is with specific reference to document
Document Title in information, document color and document content calculate and the matched condition code of document information according to preset weight distribution
Function, the template matching based on document further improved in the present embodiment is more accurate and intelligent.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description,
The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In several embodiments provided herein, it should be understood that disclosed system, device and method can be with
It realizes by another way.For example, the apparatus embodiments described above are merely exemplary, for example, the unit
It divides, only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or components
It can be combined or can be integrated into another system, or some features can be ignored or not executed.Another point, it is shown or
The mutual coupling, direct-coupling or communication connection discussed can be through some interfaces, the indirect coupling of device or unit
It closes or communicates to connect, can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple
In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme
's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product
When, it can store in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially
The all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other words
It embodies, which is stored in a storage medium, including some instructions are used so that a computer
Equipment (can be personal computer, server or the network equipment etc.) executes the complete of each embodiment the method for the present invention
Portion or part steps.And storage medium above-mentioned includes:USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only
Memory), random access memory (RAM, Random Access Memory), magnetic or disk etc. are various can store journey
The medium of sequence code.
The above, the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although referring to before
Stating embodiment, invention is explained in detail, those skilled in the art should understand that:It still can be to preceding
Technical solution documented by each embodiment is stated to modify or equivalent replacement of some of the technical features;And these
It modifies or replaces, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution.