Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are used merely to distinguish one device, module, or unit from another device, module, or unit, and are not intended to limit the order or interdependence of the functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
Example 1
The embodiment of the disclosure provides an online document authority control method, a flow diagram of which is shown in fig. 1, and the method comprises the following steps:
s101, receiving a first message sent by a first client for indicating permission change of an online document.
In an embodiment of the disclosure, the user corresponding to the first client includes at least one of an owner of the online document and an editor of the online document.
S102, according to the first message, the identification ID of the online document is sent to a server.
In the embodiment of the disclosure, the identification ID of the online document is a unique identification of the online document and is equivalent to an identity card of the online document. One online document has only one ID, and the IDs of all online documents are different.
S103, receiving the ID of at least one second client sent by the server, wherein the second client is a client for accessing the online document.
In the embodiment of the disclosure, the ID of the second client is a user ID corresponding to the second client, and the user ID is a unique identity of the user.
S104, determining the second client with changed online document authority according to the ID of at least one second client and the ID of the online document.
S105, the ID of the second client with the changed online document authority is sent to the server, so that the server sends a second message for indicating the changed online document authority to the second client.
In the embodiment of the disclosure, the first client and the second client are various browsers, and the first client and the second client can open the online document.
In the embodiment of the disclosure, the websocket server of the long-chain server may actively broadcast a notification to the first client and the second client, and the first client and the second client may also actively send information to the websocket server of the long-chain server.
In the embodiment of the disclosure, a first message sent by a first client for indicating permission change of an online document is received; according to the first message, sending the identification ID of the online document to a server; receiving an ID of at least one second client sent by a server, wherein the second client is a client for accessing an online document; determining a second client with changed online document authority according to the ID of at least one second client and the ID of the online document; and sending the ID of the second client with the changed online document authority to the server, so that the server sends a second message for indicating the changed online document authority to the second client. Therefore, after the online document is opened by at least one second client, the second message of the permission change of the online document can be sent to the second client with the permission change of the online document in time.
In an embodiment of the present disclosure, the rights change of the online document includes at least one of:
the second client is endowed with a first authority, and the first authority comprises an access authority, an editing authority or a sharing authority;
the second client is cancelled with a first authority, wherein the first authority comprises an access authority, an editing authority or a sharing authority;
the authority of the second client is updated from the first authority to the second authority, wherein the first authority comprises an access authority, an editing authority or a sharing authority, and the second authority comprises the access authority, the editing authority or the sharing authority.
In the embodiment of the disclosure, the user corresponding to the first client includes at least one of an owner of the online document and an editor of the online document; the ID of the second client is the user ID corresponding to the second client.
In the embodiment of the disclosure, after the ID of the second client with the changed online document authority is sent to the server, confirmation information sent by the second client with the changed online document authority is received, where the confirmation information is used for confirming that the online document authority is changed by the second client with the changed online document authority.
In the embodiment of the disclosure, before the permission control system permission receives a first message sent by a first client and used for indicating permission change of an online document, the server is used for establishing a mapping relationship between an ID of the second client and an ID of the online document.
Another method for controlling authority of online document is provided in the embodiments of the present disclosure, and a flow chart of the method is shown in fig. 2, where the method includes:
step 1, a user opens an online document, a second client corresponding to the user sends a user ID (the ID of the second client) and the online document ID to a long-chain server websocket server, and the second client corresponding to the user and the long-chain server websocket server establish a long-chain relationship. The websocket server records a mapping relationship between a document ID and a user ID, so that the current online document can be known which user is opened. The client clients in fig. 2 include a first client and a second client.
In the embodiment of the present disclosure, the ID of the second client is a user ID corresponding to the second client.
And 2, the permission control system permission receives notification of permission change of the online document sent by the online document owner or a client corresponding to the online document editor.
In the embodiment of the disclosure, a client corresponding to an online document owner or an online document editor is a first client.
And 3, sending the online document ID to a websocket server by using the permission control system permission, and acquiring a set of user IDs of the online document currently opened by using the permission control system permission to call the websocket server. The permission control system permission logic calculates the change of the permission of the online document corresponding to the user ID. For example, if the current online document a is opened by user 1, user 2, user 3, user 4, user 5, user 6, user 7, and user 8 together, then websocket server would record that online document a was opened by 8 users; however, at this time, the rights of the user 6 and the user 7 are changed, so that after permission control system permission calls websocket server, it can be known that 8 users open the current online document a, and only the rights of the user 6 and the user 7 are changed.
And 4, transmitting the document ID and the user ID with the changed corresponding authority to the websocket server by the permission control system permission.
And 5, after the long-chain server websocket server receives the authority change message of the online document, the authority change message of the online document can be broadcasted only for specific users. For example, the current online document a is opened by the user 1, the user 2, the user 3, the user 4, the user 5, the user 6, the user 7 and the user 8 together, but at this time, the rights of the user 6 and the user 7 are changed, and only two clients corresponding to the user 6 and the user 7 receive a message that the rights of the online document a are changed.
In the embodiment of the present disclosure, both the clients corresponding to the user 6 and the user 7 are the second client.
And 6, completing broadcast notification, and acquiring the updated authority information of the online document by the authority control system permission.
In the embodiment of the disclosure, if the online document is opened by 10 thousands of people, after the online document authority is changed, the authority control system permasson sequentially transmits the information of the online document authority change to the client side of the online document authority change, so that the instant concurrent flow problem can not be generated. Meanwhile, the call of a request is reduced, so that the message of the right change can be perceived by the client with the right change faster. The client side with the changed online document authority is a second client side.
In the embodiment of the disclosure, after the authority of the user is recovered, the user cannot normally open the document; the user's rights change from editing to readable, then the user cannot continue editing the document; the user's rights change from reading to editable, and the user can edit the document.
The application of the embodiment of the disclosure has at least the following beneficial effects:
after the online document is opened by at least one second client, the second message of the permission change of the online document can be sent to the second client of which the permission of the online document is changed in at least one second client, so that information leakage can be prevented, and meanwhile, the stability of permission control system permission and long-chain server websocket server service is ensured.
Example two
Based on the same inventive concept, the embodiment of the present disclosure further provides an online document rights control apparatus, a schematic structural diagram of which is shown in fig. 3, where the online document rights control apparatus 30 includes a first processing module 301, a second processing module 302, a third processing module 303, a fourth processing module 304, and a fifth processing module 305.
A first processing module 301, configured to receive a first message sent by a first client and used to indicate permission change of an online document;
a second processing module 302, configured to send, according to the first message, an identification ID of the online document to the server;
a third processing module 303, configured to receive an ID of at least one second client sent by the server, where the second client is a client accessing the online document;
a fourth processing module 304, configured to determine, according to the ID of at least one second client and the ID of the online document, a second client whose online document authority is changed;
the fifth processing module 305 is configured to send the ID of the second client with the changed online document permission to the server, so that the server sends a second message to the second client, where the second message indicates that the online document permission is changed.
In an embodiment of the present disclosure, the rights change of the online document includes at least one of:
the second client is endowed with a first authority, and the first authority comprises an access authority, an editing authority or a sharing authority;
the second client is cancelled with a first authority, wherein the first authority comprises an access authority, an editing authority or a sharing authority;
the authority of the second client is updated from the first authority to the second authority, wherein the first authority comprises an access authority, an editing authority or a sharing authority, and the second authority comprises the access authority, the editing authority or the sharing authority.
In the embodiment of the disclosure, the user corresponding to the first client includes at least one of an owner of the online document and an editor of the online document; the ID of the second client is the user ID corresponding to the second client.
In this embodiment of the present disclosure, after sending the ID of the second client with the changed online document permission to the server, the fifth processing module 305 is specifically configured to receive the confirmation information sent by the second client with the changed online document permission, where the confirmation information is used for the second client with the changed online document permission to confirm that the online document permission is changed.
In the embodiment of the disclosure, before the permission control system permission receives the first message sent by the first client and used for indicating permission change of the online document, the server is used for establishing a mapping relationship between the ID of the second client and the ID of the online document.
The application of the embodiment of the disclosure has at least the following beneficial effects:
receiving a first message sent by a first client for indicating permission change of an online document; according to the first message, sending the identification ID of the online document to a server; receiving an ID of at least one second client sent by a server, wherein the second client is a client for accessing an online document; determining a second client with changed online document authority according to the ID of at least one second client and the ID of the online document; and sending the ID of the second client with the changed online document authority to the server, so that the server sends a second message for indicating the changed online document authority to the second client. Therefore, after the online document is opened by at least one second client, the second message of the permission change of the online document can be sent to the second client with the permission change of the online document in time.
The content of the online document permission control device provided in the embodiment of the present disclosure, which is not described in detail, may refer to the online document permission control method provided in the first embodiment, and the beneficial effects that the online document permission control device provided in the embodiment of the present disclosure can achieve are the same as those of the online document permission control method provided in the first embodiment, which is not described herein again.
Example III
Referring now to fig. 4, a schematic diagram of an electronic device 800 suitable for use in implementing embodiments of the present disclosure is shown. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 4 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
An electronic device includes: a memory and a processor, where the processor may be referred to as a processing device 801 described below, the memory may include at least one of a Read Only Memory (ROM) 802, a Random Access Memory (RAM) 803, and a storage device 808 described below, as shown in fig. 4 in particular:
the electronic device 800 may include a processing means (e.g., a central processor, a graphics processor, etc.) 801 that may perform various appropriate actions and processes in accordance with programs stored in a Read Only Memory (ROM) 802 or loaded from a storage 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 are also stored. The processing device 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to the bus 804.
In general, the following devices may be connected to the I/O interface 805: input devices 806 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, and the like; an output device 807 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, etc.; storage 808 including, for example, magnetic tape, hard disk, etc.; communication means 809. The communication means 809 may allow the electronic device 800 to communicate wirelessly or by wire with other devices to exchange data. While fig. 4 shows an electronic device 800 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via communication device 809, or installed from storage device 808, or installed from ROM 802. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 801.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: receiving a first message sent by a first client for indicating permission change of an online document; according to the first message, sending the identification ID of the online document to a server; receiving an ID of at least one second client sent by a server, wherein the second client is a client for accessing an online document; determining a second client with changed online document authority according to the ID of at least one second client and the ID of the online document; and sending the ID of the second client with the changed online document authority to the server, so that the server sends a second message for indicating the changed online document authority to the second client.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules or units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. Where the name of a module or unit does not in some cases constitute a limitation of the unit itself.
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to one or more embodiments of the present disclosure, an embodiment one provides an online document rights control method, including:
receiving a first message sent by a first client for indicating permission change of an online document;
according to the first message, sending the identification ID of the online document to a server;
receiving an ID of at least one second client sent by a server, wherein the second client is a client for accessing an online document;
determining a second client with changed online document authority according to the ID of at least one second client and the ID of the online document;
and sending the ID of the second client with the changed online document authority to the server, so that the server sends a second message for indicating the changed online document authority to the second client.
In an embodiment of the present disclosure, the rights change of the online document includes at least one of:
the second client is endowed with a first authority, and the first authority comprises an access authority, an editing authority or a sharing authority;
the second client is cancelled with a first authority, wherein the first authority comprises an access authority, an editing authority or a sharing authority;
the authority of the second client is updated from the first authority to the second authority, wherein the first authority comprises an access authority, an editing authority or a sharing authority, and the second authority comprises the access authority, the editing authority or the sharing authority.
In the embodiment of the disclosure, the user corresponding to the first client includes at least one of an owner of the online document and an editor of the online document; the ID of the second client is the user ID corresponding to the second client.
In the embodiment of the disclosure, after the ID of the second client with the changed online document authority is sent to the server, confirmation information sent by the second client with the changed online document authority is received, where the confirmation information is used for confirming that the online document authority is changed by the second client with the changed online document authority.
In the embodiment of the disclosure, before the permission control system permission receives the first message sent by the first client and used for indicating permission change of the online document, the server is used for establishing a mapping relationship between the ID of the second client and the ID of the online document.
According to one or more embodiments of the present disclosure, a second embodiment provides an online document rights control apparatus, including:
the first processing module is used for receiving a first message sent by the first client and used for indicating the permission change of the online document;
the second processing module is used for sending the identification ID of the online document to the server according to the first message;
the third processing module is used for receiving the ID of at least one second client sent by the server, wherein the second client is a client for accessing the online document;
the fourth processing module is used for determining the second client with changed online document authority according to the ID of at least one second client and the ID of the online document;
and the fifth processing module is used for sending the ID of the second client with the changed online document authority to the server so that the server sends a second message for indicating the changed online document authority to the second client.
In an embodiment of the present disclosure, the rights change of the online document includes at least one of:
the second client is endowed with a first authority, and the first authority comprises an access authority, an editing authority or a sharing authority;
the second client is cancelled with a first authority, wherein the first authority comprises an access authority, an editing authority or a sharing authority;
the authority of the second client is updated from the first authority to the second authority, wherein the first authority comprises an access authority, an editing authority or a sharing authority, and the second authority comprises the access authority, the editing authority or the sharing authority.
In the embodiment of the disclosure, the user corresponding to the first client includes at least one of an owner of the online document and an editor of the online document; the ID of the second client is the user ID corresponding to the second client.
In the embodiment of the disclosure, after the ID of the second client with the changed online document authority is sent to the server, the fifth processing module is specifically configured to receive the confirmation information sent by the second client with the changed online document authority, where the confirmation information is used for confirming that the online document authority is changed by the second client with the changed online document authority.
In the embodiment of the disclosure, before the permission control system permission receives the first message sent by the first client and used for indicating permission change of the online document, the server is used for establishing a mapping relationship between the ID of the second client and the ID of the online document.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims.