A kind of interface functional realiey method and deviceTechnical field
The present invention relates to data processing field, particularly relate to a kind of interface functional realiey method and device.
Background technology
Office system or other application systems have the demand of process document. At present, country, carrying forward vigorously office production domesticization, namely carries domestic operating system on domestic hardware, installs domestic office software, and unified the name of document interface. In system development process, in order to the interface of adaptive documents in various formats in systems in which, system development side and Document processing software exploitation box drain is needed to lead to the demand of oneself, function interface is provided to realize interface function by Document processing software exploitation side, or the problem of system development side's research and development burden that realizes interface function by system development side oneself programming, there is construction cycle length, increases. Especially, when allowing the document embedding different-format in system, the problems referred to above highlight more.
Summary of the invention
It is an object of the invention to provide a kind of interface functional realiey method and device, it is intended to solve the problem that the Document processing software function interface interchange inconvenience of different-format is not high with document process efficiency.
The technical solution adopted for the present invention to solve the technical problems is:
A kind of interface functional realiey method, comprising:
Receiving the function instruction that user sends, the function of described function command request is by function Interface realization, and multiple function interface encapsulation is in interface module;
Call JS function, for judging the Document processing software product that current document uses;
Call function interface corresponding with described Document processing software product in described interface module, for realizing the function of described function command request.
On this basis, further, described function interface comprises standard interface and self defined interface, wherein,
Described standard interface is the function interface directly called;
Described self defined interface is the function interface that described standard interface is called in combination.
On the basis of above-mentioned any embodiment, further, the function of the function command request that described user sends for preserve time, described in call function interface corresponding with described Document processing software product in described interface module, after realizing the functional steps of described function command request, also comprise:
Data transmittal and routing form according to described Document processing software, preserves described current document.
On this basis, further, described data form is: data stream or data packet.
On the basis of above-mentioned any embodiment, further, described the step that described current document preserves is comprised:
The document content of described current document and document information are separately preserved, described document information at least comprises the preservation path of described document content.
On this basis, further, also comprise:
Receive the reading command that user sends;
Call read functions interface, for according to the described preservation path in described document information, reading described document content.
On the basis of above-mentioned any embodiment, further, described the step that described current document preserves is comprised:
According to encryption algorithm, by described document content encrypting storing.
On this basis, further, described encryption algorithm is circulation encryption algorithm.
A kind of interface functional realiey device, comprising:
Receiver module, for receiving the function instruction that user sends, the function of described function command request is by function Interface realization, and multiple function interface encapsulation is in interface module;
Form judges module, for calling JS function, for judging the Document processing software product that current document uses;
Function interface interchange module, for calling function interface corresponding with described Document processing software product in described interface module, for realizing the function of described function command request.
On this basis, further, also comprise:
Background processing module, for the data transmittal and routing form according to described Document processing software, preserves described current document.
On this basis, further, described background processing module comprises:
Preserve module, for the document content of described current document and document information separately being preserved, described document information at least comprises the preservation path of described document content.
On this basis, further, described background processing module also comprises:
Read module, for receiving the reading command that user sends;
Call read functions interface, for according to the described preservation path in described document information, reading described document content.
On the basis of above-mentioned any embodiment, further, described background processing module comprises:
Encryption module, for according to encryption algorithm, by described document content encrypting storing.
The invention has the beneficial effects as follows:
The present invention provides a kind of interface functional realiey method and device, in advance by the function interface encapsulation of different document process software in interface module, after the instruction receiving the calling function interface that user sends, call the Document processing software product that JS function uses to judge current document, function interface corresponding with Document processing software product in interface module is called, to realize interface function according to Document processing software product. By the function interface encapsulation of different Document processing software in an interface module, do not need system development side to go to develop box drain with Document processing software more logical, adaptive, solve different document process software product and cause again adaptive problem because function Interface realization is different; The mode calling the function interface being encapsulated in interface module that Document processing software provides by directly calling or combine is to complete the unified call function to different document process software interface, do not need user that other plug-in unit is installed again and can complete calling of function interface, convenient for users to use, it is to increase the efficiency of document process.
Accompanying drawing explanation
Below in conjunction with drawings and Examples, the present invention is further described.
Fig. 1 is the function connection interface of a kind of Document processing software.
Fig. 2 is the schema of a kind of interface functional realiey method that the embodiment of the present invention provides.
In figure, 1. function interface, 2. creates interface, 3. preserves interface, 4. inserts interface, 5. cancels interface, 6. document content input frame; S101. receiving step, S102. form determining step, S103. function interface interchange step.
Embodiment
In order to make the object of the present invention, technical scheme and advantage clearly understand, below in conjunction with drawings and Examples, the present invention is further elaborated. It is to be understood that specific embodiment described herein is only in order to explain the present invention, it is not intended to limit the present invention.
Fig. 1 shows the function connection interface of a kind of Document processing software, and the documents button such as " establishment ", " preservation ", " insertion ", " cancelling " is the function interface realizing various documents editing function that Document processing software provides. Use these function interfaces, it is possible to process document in systems in which. The unification of the motherland call of function interface, such as, realize preserving the equal called after of the interface " preservation " of this function.
Fig. 2 shows the schema of a kind of interface functional realiey method that the embodiment of the present invention provides.
In S101, receiving the function instruction that user sends, the function of function command request is by function Interface realization, and multiple function interface encapsulation is in interface module.
In S102, call JS function, for judging the Document processing software product that current document uses.
In S103, call function interface corresponding with Document processing software product in interface module, for the function of practical function command request.
For " preservation " this function interface, " preservation " function module that Kingsoft WPS provides and " preservation " function module package that Yongzhong office provides are in " preservation " interface of interface module. When the function of the function command request that user sends in WPS word is for preserving, interface module receives " preservation " instruction, call JS function, judge the process software product that current document uses, i.e. WPS word processor, call " preservation " interface corresponding with WPS word processor in interface module afterwards, complete hold function, the automatic physics file cryptographic storage in backstage.
Further, function interface comprises standard interface and self defined interface, and wherein, standard interface is the function interface directly called; Self defined interface is the function interface that standard interface is called in combination. That is, the function interface being integrated in interface module by directly calling that standard interface provides for Document processing software; Self defined interface for Document processing software provide by combination, to call standard interface integrated to the function interface in interface module. Such as " preservation " interface is a kind of standard interface that can directly call, and when the function of the function command request that user sends in WPS word is for preserving, by directly calling " preservation " interface corresponding with WPS word in interface module, completes hold function; Such as " adding and tilt " interface thick is that one can combine the self defined interface calling " adding thick " and " inclination " two standard interfaces, when the function command request that user sends in WPS word function for add thick and when tilting, called " adding thick " interface corresponding with WPS word in interface module and " inclination " interface by combination, complete to add function that is thick and that tilt.
On the basis of above-mentioned any embodiment, further, when the function of the function command request that user sends is for preserving, call function interface corresponding with Document processing software product in interface module, after functional steps for practical function command request, also comprise: according to the data transmittal and routing form of Document processing software, current document is preserved. The data transmittal and routing form of different document process software is different, it may be that data stream, it is also possible to data packet, data according to different data forms, can be processed by interface module.
On this basis, further, data transmittal and routing form is: data stream or data packet.
On the basis of above-mentioned any embodiment, further, the step that current document preserves is comprised: the document content of document and document information are separately preserved, document information at least comprises the preservation path of document content. Document is adopted separate type to store by interface module, and namely document content and document information preserve respectively, and when document is excessive, the mode that dispersion stores is more convenient and flexible.
On this basis, further, also comprise: receive the reading command that user sends; Call read functions interface, for according to the preservation path in document information, reading document content. After receiving the reading command that user sends, read document content according to the preservation path of document information, it is to increase the efficiency that document reads.
On the basis of above-mentioned any embodiment, further, the step that current document preserves is comprised: according to encryption algorithm, by document content encrypting storing. Preservation process adopts encryption algorithm, it is to increase the security of document storing.
On this basis, further, algorithm is encrypted for circulation encryption algorithm. Such as adopt circulation encryption algorithm, concrete: using front 10 bytes of document as seed, produce randomized number, this randomized number is for being encrypted these 10 bytes, and then read ensuing 10 bytes as seed, producing randomized number, these 10 bytes are encrypted by this randomized number, analogize with this.
On the basis of above-mentioned any embodiment, further, also comprise: receive the recovery instruction that user sends; Call restore funcitons interface, for according to recovery algorithms, recovering document content. After the instruction receiving the recovery encrypted document that user sends, according to recovery algorithms, recover the document content encrypted so that the document content of encryption is read.
On the basis of above-mentioned any embodiment, further, interface module can also provide " affixing one's seal " interface, for affixing one's seal for format document.
Present invention also offers a kind of interface functional realiey device, comprising: receiver module, for receiving the function instruction that user sends, the function of function command request is by function Interface realization, and multiple function interface encapsulation is in interface module; Form judges module, for calling JS function, for judging the Document processing software product that current document uses; Function interface interchange module, for calling function interface corresponding with Document processing software product in interface module, for the function of practical function command request. By the function interface encapsulation of different Document processing software in an interface module, do not need system development side to go to develop box drain with Document processing software more logical, adaptive, solve different document process software product and cause again adaptive problem because function Interface realization is different; The mode calling the function interface being encapsulated in interface module that Document processing software provides by directly calling or combine is to complete the unified call function to different document process software interface, do not need user that other plug-in unit is installed again and can complete calling of function interface, convenient for users to use, it is to increase the efficiency of document process.
On this basis, further, also comprise: background processing module, for the data transmittal and routing form according to Document processing software, current document is preserved.The data transmittal and routing form of different document process software is different, it may be that data stream, it is also possible to data packet, data according to different data forms, can be processed by interface module.
On this basis, further, background processing module comprises: preserve module, for the document content of current document and document information separately being preserved, at least comprises the preservation path of document content in document information. Document is adopted separate type to store by interface module, and namely document content and document information preserve respectively, and when document is excessive, the mode that dispersion stores is more convenient and flexible.
On this basis, further, background processing module also comprises: read module, for receiving the reading command that user sends; Call read functions interface, for according to the preservation path in document information, reading document content. After receiving the reading command that user sends, read document content according to the preservation path of document information, it is to increase the efficiency that document reads.
On the basis of above-mentioned any embodiment, further, background processing module comprises: encryption module, for according to encryption algorithm, by document content encrypting storing. Preservation process adopts encryption algorithm, it is to increase the security of document storing.
Although present invention has been description to a certain degree, it is evident that when not departing from the spirit and scope of the present invention, can carry out the suitable change of each condition. It can be appreciated that the invention is not restricted to described embodiment, and being attributed to the scope of claim, it comprises the equivalent replacement of each factor described.