Summary of the invention
The embodiment of the invention provides a kind of document right control method and device, with realization various types of documents is carried out control of authority, and does not change the unfolding mode of document acquiescence.
The embodiment of the invention provides a kind of document right control method, comprising:
When the user checks the document that authority is set,, obtain and preserve the authority that said user has said document from server according to said user's information;
In the filename of said document, add sign, and in the corresponding document process of said document, open said document, wherein, said sign is unique;
Search the corresponding document window handle of said document according to said sign, set up and preserve the corresponding relation of the authority that said document window handle, said document and said user have said document;
When one of at least two documents opening in to said document process as said user are operated; Document window handle according to current operation document; In the corresponding relation of preserving, search; Obtain the authority that said user has said current operation document, and according to the operation of the said user of said control of authority to said current operation document.
The embodiment of the invention also provides a kind of document control of authority device, comprising:
The authority acquiring module is used for when the user checks the document that authority is set, and according to said user's information, obtains the authority that said user has said document from server;
Preserve module, be used to preserve the authority that said authority acquiring module is obtained;
Add module, be used for adding sign at the filename of said document, wherein, said sign is unique;
Open module, be used for opening said document in the corresponding document process of said document;
Search module, be used for searching the corresponding document window handle of said document according to the sign that said interpolation module is added;
Set up module, be used to set up said search module searches to the corresponding relation of document window handle, said document and said user authority that said document is had;
Said preservation module also is used to preserve the said corresponding relation that module is set up of setting up;
Obtain module; When one of at least two documents that are used for as said user said document process being opened are operated; Document window handle according to current operation document; In the corresponding relation that said preservation module is preserved, search, obtain the authority that said user has said current operation document;
Control module, the said user of control of authority who is used for obtaining according to said acquisition module is to the operation of said current operation document.
The embodiment of the invention is added sign in the filename of document, search the corresponding document window handle of document according to this sign, sets up and preserve the corresponding relation of the authority that document window handle, document and user have the document; When one of at least two documents opening in the document process of this user to the document correspondence are operated; Document window handle according to current operation document; In the corresponding relation of preserving, search; Obtain the authority that this user has current operation document, and then can be according to the operation of this control of authority user to document.Thereby realized various types of documents are carried out control of authority, and do not changed the unfolding mode of document acquiescence, when opening a plurality of document, avoided the increase of system overhead and resource consumption.
Embodiment
For the purpose, technical scheme and the advantage that make the embodiment of the invention clearer; To combine the accompanying drawing in the embodiment of the invention below; Technical scheme in the embodiment of the invention is carried out clear, intactly description; Obviously, described embodiment is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, the every other embodiment that those of ordinary skills are obtained under the prerequisite of not making creative work belongs to the scope that the present invention protects.
Fig. 1 is the process flow diagram of an embodiment of document right control method of the present invention, and as shown in Figure 1, this embodiment can comprise:
The authority that this user has the document is obtained and preserved to step 101 when the user checks the document that authority is set, according to this user's information, from server.
In the present embodiment, document author or document administrator are provided with after the authority that the user has document, and client uploads onto the server the user who is provided with to the authority that document has, by this authority of server for saving.Particularly; Document author or document administrator can be provided with the authority that the user has document according to user's rank; For example: domestic consumer has read-only authority to the document, and intermediate users has the modification authority to the document, and advanced level user has total-control authority etc. to the document; The authority that can be in database or the data file corresponding user who preserves different stage of server has the document; When the user checks the document that authority is set; Client can be sent to server with this user's information; Confirm this user's rank according to this user's information at server; And then confirm that according to this user's rank after the authority that this user has the document, client can be obtained the authority that this user has the document from server, this user of obtaining of client storage authority that the document is had then; Wherein, this user's information can identify the information of this user identity for this user's user name or ID etc.It below only is a kind of implementation of present embodiment; The embodiment of the invention is not limited in this; The embodiment of the invention does not limit from the mode that server obtains the document authority the set-up mode of document authority, the mode and the client of server for saving document authority; As long as client can be obtained this user from server the authority that the document has is got final product according to user's information.
Step 102 is added sign in the filename of the document, and in the corresponding document process of the document, opens the document.
In the present embodiment, the window title of document system acquiescence document is the filename of the document, and client is added in the filename of the document after the sign, can comprise this sign automatically in the window title of the document.This sign can generate according to the comspec of the document; Particularly, client can be passed through information-summary 5 (Message-Digest Algorithm 5 according to the comspec of document; Hereinafter to be referred as MD5) algorithm generates should sign.Because the comspec of document is unique in Windows operating system, therefore being identified at of comspec generation according to the document also is unique in the Windows operating system.
Certainly the embodiment of the invention is not limited in this; Client also can adopt other mode to generate above-mentioned sign; As long as being identified in the operating system of generating is unique; Operating system in the embodiment of the invention also is not limited in Windows operating system, and this operating system can also be Linux or Unix operating system, but the embodiment of the invention is that example describes with Windows operating system.
In the present embodiment, client can adopt " the many documents of one process " mode of document system acquiescence, in the corresponding document process of the document, opens above-mentioned document.
Step 103 is searched the corresponding document window handle of the document according to this sign, sets up and preserve the corresponding relation of the authority that the document window handle, the document and this user have the document.
In the present embodiment,, therefore can uniquely find the corresponding document window handle of the document according to this sign owing to be unique in the above-mentioned Windows of the being identified at operating system.The document window handle is unique in Windows operating system, and the document window handle can document of unique identification.
After the corresponding relation of setting up and preserve the authority that the document window handle, the document and this user have the document, client can revert to the window title of document the filename of document system acquiescence.
Step 104; When one of at least two documents opening in to above-mentioned document process as this user are operated; Document window handle according to current operation document; In the corresponding relation of preserving, search, obtain the authority that this user has current operation document, and according to the operation of this user of control of authority who obtains to current operation document.
One of at least two documents opening in to above-mentioned document process above-mentioned user print, duplicate or during operation such as preservation; Client can be according to the document window handle of current operation document; In the corresponding relation of preserving, search; Obtain the authority that this user has this current operation document, client can be according to the operation of this user of control of authority who obtains to this current operation document then; Particularly, client can be passed through windows messaging hook (Windows Hook) technology, and this user of control of authority who in the corresponding document process of the document, according to this user current operation document is had is to the operation of this current operation document.
In the present embodiment, the type of document can be Office or Portable Document format (PortableDocument Format; Hereinafter to be referred as: all kinds such as PDF); The document can be the safety encipher document, also can be non-encrypted document.
In the foregoing description, client is added sign in the filename of document, searches the corresponding document window handle of document according to this sign, sets up and preserve the corresponding relation of the authority that document window handle, document and user have the document; When one of at least two documents opening in the document process of this user to the document correspondence are operated; Document window handle according to current operation document; In the corresponding relation of preserving, search; Obtain the authority that this user has current operation document, and then can be according to the operation of this control of authority user to current operation document.Thereby realized various types of documents are carried out control of authority, and do not changed the unfolding mode of document acquiescence, when opening a plurality of document, avoided the increase of system overhead and resource consumption.
Fig. 2 is the process flow diagram of another embodiment of document right control method of the present invention, and present embodiment is the safety encipher document with the document, and operating system is that example describes for Windows operating system.As shown in Figure 2, this embodiment can comprise:
Step 201, when the user checked the safety encipher document that authority is set, the authority that this user has this safety encipher document is obtained and preserved to client according to this user's information from server.
In the present embodiment, document author or document administrator are provided with after the authority that the user has the safety encipher document, and client uploads onto the server the user who is provided with to the authority that the safety encipher document has, by this authority of server for saving.Particularly; Document author or document administrator can be provided with the authority that the user has the safety encipher document according to user's rank; For example: domestic consumer has read-only authority to this safety encipher document; Intermediate users has the modification authority to this safety encipher document, and advanced level user has total-control authority etc. to this safety encipher document; The authority that can be in database or the data file corresponding user who preserves different stage of server has this safety encipher document; When the user checks the safety encipher document that authority is set; Client can be sent to server with this user's information; Confirm this user's rank according to this user's information at server; And then confirm that according to this user's rank after the authority that this user has this safety encipher document, client can be obtained the authority that this user has this safety encipher document from server, this user of obtaining of client storage authority that this safety encipher document is had then; Wherein, this user's information can identify the information of this user identity for this user's user name or ID etc.
It below only is a kind of implementation of the present invention; The embodiment of the invention is not limited in this; The embodiment of the invention does not limit from the mode that server obtains safety encipher document authority the set-up mode of safety encipher document authority, the mode and the client of server for saving safety encipher document authority; As long as client can be obtained this user from server the authority that this safety encipher document has is got final product according to user's information.
Step 202, client increase sign in the filename of this safety encipher document.
In the present embodiment, the window title of document system acquiescence safety encipher document is the filename of this safety encipher document, and client increases in the filename of this safety encipher document after the sign, can comprise this sign automatically in the window title of this safety encipher document.
Wherein, client can adopt the method that provides in the present invention's step 102 embodiment illustrated in fig. 1 when generating this sign, repeats no more at this.
Step 203, client is deciphered this safety encipher document, in the corresponding document process of this safety encipher document, the operation of opening this safety encipher document.
In the present embodiment, client can adopt " the many documents of one process " mode of document system acquiescence in the operation of opening the safety encipher document.
Step 204, client is searched the corresponding document window handle of this safety encipher document according to sign, sets up and preserve the corresponding relation of the authority that the document window handle, this safety encipher document and this user have this safety encipher document.
In the present embodiment,, therefore can uniquely find the corresponding document window handle of the document according to this sign owing to be unique in the above-mentioned Windows of the being identified at operating system.The document window handle is unique in Windows operating system, and the document window handle can document of unique identification.
Step 205, client revert to the window title of safety encipher document the filename of document system acquiescence.
At this moment, client is shown to the user with the safety encipher document of opening.
Step 206; When one of at least two safety encipher documents opening in to above-mentioned document process as this user are operated; Document window handle according to current operation document; In the corresponding relation of preserving, search, obtain the authority that this user has current operation document, and according to the operation of this user of control of authority who obtains to current operation document.
In the present embodiment; One of at least two safety encipher documents opening in to above-mentioned document process as the user print, duplicate or during operation such as preservation; Client can be according to the document window handle of current operation document; Corresponding relation preserving is searched, and obtains the authority that this user has this current operation document, and client can be according to the operation of this control of authority user to this current operation document then; Particularly, client can be through Windows Hook technology, and the control of authority user who in the corresponding document process of this safety encipher document, according to the user current operation document is had is to the operation of this current operation document.
In the present embodiment, the type of this safety encipher document can be all kinds such as Office or PDF.
In the foregoing description; Client is added sign in the filename of safety encipher document; Search the corresponding document window handle of this safety encipher document according to this sign, set up and preserve the corresponding relation of the authority that document window handle, this safety encipher document and user have this safety encipher document; When one of at least two safety encipher documents opening in the document process of this user to this safety encipher document correspondence are operated; Document window handle according to current operation document; In the corresponding relation of preserving, search; Obtain the authority that this user has current operation document, and then can be according to the operation of this control of authority user to current operation document.Thereby realized various types of documents are carried out control of authority, and do not changed the unfolding mode of document acquiescence, when opening a plurality of document, avoided the increase of system overhead and resource consumption.
One of ordinary skill in the art will appreciate that: all or part of step that realizes said method embodiment can be accomplished through the relevant hardware of programmed instruction; Aforesaid program can be stored in the computer read/write memory medium; This program the step that comprises said method embodiment when carrying out; And aforesaid storage medium comprises: various media that can be program code stored such as ROM, RAM, magnetic disc or CD.
Fig. 3 is the structural representation of an embodiment of document control of authority device of the present invention, and the document control of authority device in the present embodiment can be used as client, or the part of client, realizes the present invention's flow process embodiment illustrated in fig. 1.The document control of authority device that present embodiment provides can be used for operating systems such as Windows, Linux or Unix, but present embodiment is that example describes with Windows operating system.
As shown in Figure 3, the document control of authority device can comprise: authority acquiring module 31, preserve module 32, add module 33, open module 34, search module 35, set up module 36, obtain module 37 and control module 38.
Wherein, authority acquiring module 31 is used for when the user checks the document that authority is set, and according to this user's information, obtains the authority that this user has the document from server.
Preserve module 32, be used to preserve the authority that authority acquiring module 31 is obtained.
In the present embodiment, document author or document administrator are provided with after the authority that the user has document, and this authority is uploaded to server, by this authority of server for saving.Particularly; Document author or document administrator can be provided with the authority that the user has document according to user's rank; For example: domestic consumer has read-only authority to the document, and intermediate users has the modification authority to the document, and advanced level user has total-control authority etc. to the document; The authority that can be in database or the data file corresponding user who preserves different stage of server has the document; When the user checks the document that authority is set; Authority acquiring module 31 can be sent to server with this user's information; Confirm this user's rank according to this user's information at server; And then confirm that according to this user's rank after the authority that this user has the document, authority acquiring module 31 can be obtained the authority that this user has the document from server, preserve module 32 then and can preserve the authority that this user that authority acquiring module 31 obtains has the document; Wherein, this user's information can identify the information of this user identity for this user's user name or ID etc.It below only is a kind of implementation of present embodiment; The embodiment of the invention is not limited in this; The embodiment of the invention does not limit from the mode that server obtains the document authority the set-up mode of document authority, the mode and the authority acquiring module 31 of server for saving document authority; As long as authority acquiring module 31 can be obtained this user from server the authority that the document has is got final product according to user's information.
Add module 33, be used for adding sign at the filename of the document; In the present embodiment, the window title of document system acquiescence document is the filename of the document, adds module 33 and in the filename of the document, adds after the sign, can comprise this sign automatically in the window title of the document.
Open module 34, be used for opening the document in the corresponding document process of the document.
Search module 35, be used for searching the corresponding document window handle of the document according to the sign of adding module 33 interpolations; In the present embodiment, be unique, therefore search module 35 and can uniquely find the corresponding document window handle of the document according to this sign owing to add module 33 being identified in the Windows operating system of interpolation.The document window handle is unique in Windows operating system, and the document window handle can document of unique identification.
Set up module 36, be used to set up the corresponding relation of the authority that the document window handle, the document and this user that search module 35 and find have the document.At this moment, preserve module 32 and also be used to preserve the corresponding relation of setting up module 36 foundation.After preserving the above-mentioned corresponding relation of module 32 preservations, client can revert to the window title of document the filename of document system acquiescence.
Obtain module 37; When one of at least two documents that are used for as the user above-mentioned document process being opened are operated; According to the document window handle of current operation document, in the corresponding relation of preserving module 32 preservations, search, obtain the authority that this user has this current operation document.
Control module 38 is used for the operation to this current operation document according to this user of control of authority who obtains module 37 acquisitions.Particularly, control module 38 can be through Windows Hook technology, in above-mentioned document process according to obtain that module 37 obtains this user of control of authority to the operation of this current operation document.
Fig. 4 is the structural representation of another embodiment of document control of authority device of the present invention, and the document control of authority device in the present embodiment can be used as client, or the part of client, realizes Fig. 1 of the present invention or flow process embodiment illustrated in fig. 2.
Compare with document control of authority device shown in Figure 3, different is that document control of authority device shown in Figure 4 can further include: generation module 39.
Wherein, generation module 39 is used for generating above-mentioned sign according to the comspec of the document.Particularly, generation module 39 can generate and should identify through the MD5 algorithm according to the comspec of document.Because the comspec of document is unique in Windows operating system, therefore being identified at of comspec generation according to the document also is unique in the Windows operating system.Certainly the embodiment of the invention is not limited in this, and client also can adopt other mode to generate above-mentioned sign, as long as being identified in the operating system of generating is unique.
Above-mentioned document control of authority device has been realized various types of documents are carried out control of authority, and does not change the unfolding mode of document acquiescence, when opening a plurality of document, has avoided the increase of system overhead and resource consumption.
The embodiment of the invention provides a kind of document right control method and device, can under " the many documents of one process " mode of document system acquiescence, according to the document window handle, realize the control to the document authority; And when opening a plurality of document, do not change " the many documents of one process " mode of document system acquiescence, therefore can open a plurality of documents, avoided the increase of system overhead and resource consumption in same document process; And the embodiment of the invention is not limited in Office document and PDF document, can support various Doctypes; And the document right control method that the embodiment of the invention provides not only can be used for Windows operating system with device, also can be used for Linux or Unix operating system.
It will be appreciated by those skilled in the art that accompanying drawing is the synoptic diagram of a preferred embodiment, module in the accompanying drawing or flow process might not be that embodiment of the present invention is necessary.
It will be appreciated by those skilled in the art that the module in the device among the embodiment can be distributed in the device of embodiment according to the embodiment description, also can carry out respective change and be arranged in the one or more devices that are different from present embodiment.The module of the foregoing description can be merged into a module, also can further split into a plurality of submodules.
What should explain at last is: above embodiment is only in order to explaining technical scheme of the present invention, but not to its restriction; Although with reference to previous embodiment the present invention has been carried out detailed explanation, those of ordinary skill in the art is to be understood that: it still can be made amendment to the technical scheme that aforementioned each embodiment put down in writing, and perhaps part technical characterictic wherein is equal to replacement; And these are revised or replacement, do not make the spirit and the scope of the essence disengaging various embodiments of the present invention technical scheme of relevant art scheme.