WO2018094962A1 - Method, apparatus and system for migrating file permission - Google Patents

Method, apparatus and system for migrating file permission Download PDF

Info

Publication number
WO2018094962A1
WO2018094962A1 PCT/CN2017/081337 CN2017081337W WO2018094962A1 WO 2018094962 A1 WO2018094962 A1 WO 2018094962A1 CN 2017081337 W CN2017081337 W CN 2017081337W WO 2018094962 A1 WO2018094962 A1 WO 2018094962A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
information
rights
protocol
target device
Prior art date
Application number
PCT/CN2017/081337
Other languages
French (fr)
Chinese (zh)
Inventor
李学锋
沈序建
刘元兵
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2018094962A1 publication Critical patent/WO2018094962A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/119Details of migration of file systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/26Special purpose or proprietary protocols or architectures

Definitions

  • the present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, and a system for migrating file rights.
  • the permission information of a file in the file system represents the operation authority of different users on the file.
  • Some file systems support two or more protocols. Different protocols support different types of file permissions, so files in the file system can have two or more types of permissions.
  • the different types of rights information of the file are migrated to the target device.
  • the target device After obtaining the permission information of the device to be migrated to the target device later, the target device will perform the rights information migrated to the target device earlier based on the rights information migrated to the target device later. Update. For example, the target device converts the second permission information that is later migrated to the target device according to the inter-privilege conversion rule, obtains the converted first permission information, and replaces the first migration to the target device with the converted first permission information. Permission information.
  • different types of permission information of a file may contain different amounts of information, and rules for permission conversion between different vendors may be different, resulting in permission information that is migrated to the target device earlier according to the permission information that is later migrated to the target device.
  • the updated permission information is inconsistent with the permission information that was migrated to the target device earlier, and the permission information after the file migration is inconsistent with the permission information before the file migration.
  • the embodiment of the invention provides a method, a device and a system for migrating file rights, which are used to solve the problem that the rights information after file migration is inconsistent with the rights information before file migration.
  • the embodiment of the present invention provides a method for migrating file permissions, where the migration server migrates the first permission information and the second permission information of the file in the source device to the target device, and the migration server can respectively pass the first
  • the first protocol information includes the file rights supported by the first protocol
  • the second rights information includes the file rights supported by the second protocol.
  • the method includes the following steps: first, the migration server reads the first permission information of the file from the source device by using the first protocol, and sends the first permission information to the target device by using the first protocol; and, the migration server The target device sends an instruction for locking permission conversion, where the instruction for locking the right conversion is used to instruct the target device to keep the first permission information unchanged when receiving the second permission information of the file, where the The second rights information includes file rights supported by the second protocol; then, the migration server reads the second rights information of the file from the source device by using the second protocol, and The second authority information is sent to the target device; after receiving the second rights information, the target device keeps the first rights information unchanged according to the instruction of the lock permission conversion.
  • the instruction that the migration server sends the lock permission conversion to the target device needs to send the second permission information earlier than the target device, and may send the first permission information earlier than the target device, or may send the first permission to the target device later. information.
  • the migration server respectively uses the first protocol and the second protocol to And the second privilege information is migrated from the source device to the target device, and before the second privilege information migrated to the target device is sent, the migration server sends an instruction for locking privilege conversion to the target device, indicating that the target device migrates after receiving the privilege In the second privilege information, the first privilege information that is migrated first is kept unchanged, and the privilege information of the file in the target device 300 caused by the target device retrieving the first privileged first privilege information according to the second privilege information migrated later is prevented.
  • the problem that the permissions information of the files in the source device is inconsistent is consistent.
  • the target device after receiving the second rights information, saves the second rights information, and sends a rights migration success response to the migration server; the migration server receives the rights After the migration succeeds, the instruction for releasing the permission conversion lock is sent to the target device, where the instruction for releasing the permission conversion lock is used to instruct the target device to receive the second permission information of the file according to the The second authority information updates the first authority information of the file.
  • the migration server determines that the first permission information of the file and the second permission information are successfully migrated from the source device to the target device, the migration server sends an instruction for releasing the permission conversion lock to the target device, so that the user can file the file in the target device.
  • the target device After the second privilege information is updated, the target device can update the first privilege information of the saved file according to the updated second privilege information, and ensure that the first privilege information and the second privilege information of the file in the target device are represented. User permissions remain synchronized.
  • the migration server when the migration server sends the first permission information to the target device by using the first protocol, the data of the file is given to the target device.
  • the implementation method can simultaneously implement the data of the file and the permission information of the file from the source device to the target device, thereby improving the efficiency of file migration.
  • the migration server when the migration server reads the first permission information from the source device by using the first protocol, sending, by the source device, a state lock instruction to the source device, The state locked instruction is used to instruct the source device to reject an update operation on data of the file, the first rights information of the file, and the second rights information of the file.
  • the implementation manner can prevent the data of the file in the source device, the first permission information of the file, and the second permission information from being changed after the migration server reads the first permission information of the file from the source device, so as to avoid the data of the file in the migration server.
  • the permission information of the file is migrated from the source device to the target device.
  • the data of the file or the permission information of the file in the source device is changed, and the data of the file or the file in the target device is inconsistent with the permission information of the file. situation.
  • the migration server after the sending, by the second server, the second right information to the target device, sends an instruction to release the state lock to the source device, where The instruction to release the state lock is used to instruct the source device to accept an update operation on the file, the first rights information of the file, and the second rights information of the file.
  • the rights information of the file is migrated to the target device, the state locking of the file and the permission information of the file in the source device is released, so that the user can update the data of the file or the permission information of the file.
  • the migration server when the migration server reads the second rights information from the source device by using the second protocol, the data of the file is read from the source device; When the migration server sends the second permission information to the target device by using the second protocol, and the data of the file is sent to the target device; the target device receives the file, and determines whether The file is stored, and if so, the file is not saved, otherwise the file is saved.
  • the migration server can migrate the data of the changed file to the target device after the data of the file in the source device is changed, and ensure that the data of the file in the target device and the permission information of the file are consistent with the source device.
  • the first protocol may be a Server Message Block (SMB). Protocol, the first permission information is an Access Control List (ACL) information supported by the SMB protocol; the second protocol may be a Network File System (NFS) protocol, and the second permission information is used for permission control. Mode information.
  • the first protocol is an NFS protocol, the first permission information is Mode information used for rights control, the second protocol is SMB protocol, and the second rights information is ACL information.
  • the embodiments of the present invention provide an apparatus for migrating file permissions, and the apparatus is used to implement the functions of the migration server in the first aspect or any possible implementation of the first aspect.
  • the apparatus comprises means for performing the steps performed by the migration server in the method of any of the first aspect or any of the possible implementations of the first aspect described above.
  • an embodiment of the present invention provides an apparatus for migrating file permissions, and the apparatus is used to implement the functions of the migration server in the first aspect or any possible implementation of the first aspect.
  • the apparatus comprises means for performing the steps performed by the target device in the method of any of the first aspect or the first aspect of the first aspect described above.
  • the embodiment of the present invention provides a migration server, which is used to implement the function of the migration server in the first aspect or any possible implementation of the first aspect.
  • the migration server includes a first communication interface, a second communication interface, and a processor; the first communication interface is configured to communicate with the source device and the target device by using a first protocol; and the second communication interface is configured to The source device and the target device communicate with the second protocol; the processor is configured to: perform, by using the first communication interface and the second communication interface, the migration method by using the first aspect or any of the possible implementations of the first aspect Steps.
  • an embodiment of the present invention provides a computing device, which is used to implement the functions of the target device in any possible implementation of the first aspect or the first aspect.
  • the computing device includes a processor, a memory, and a third communication interface, a fourth communication interface, where the third communication interface is configured to communicate with the migration server by using a first protocol, and the fourth communication interface is used for The migration server communicates with the second protocol; the processor is configured to: perform, by using the third communication interface and the fourth communication interface, the method in any of the foregoing first aspect or any possible implementation of the first aspect
  • the target device performs the steps.
  • the embodiment of the present invention provides a system for migrating file permissions, where the system includes a migration server, a source device, and a target device, where the source device is configured to store first permission information of the file and second permission information of the file;
  • the migration server is configured to perform the steps of the first aspect or any of the possible implementations of the first aspect, wherein the target device is configured to perform the method of any of the first aspect or the first aspect of the first aspect. The step performed by the target device, thereby implementing the migration of the first permission information and the second permission information of the file in the source device to the target device.
  • an embodiment of the present invention provides a computer readable medium for storing a computer program, the computer program comprising instructions for performing the method of the first aspect or any possible implementation of the first aspect.
  • FIG. 1 is a schematic diagram of a file migration system according to an embodiment of the present invention.
  • FIG. 2 is a schematic structural diagram of a migration server according to an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of a target device according to an embodiment of the present invention.
  • FIG. 4 is a schematic flowchart of a method for migrating file permissions according to an embodiment of the present invention
  • FIG. 5 is a schematic diagram of a further refinement process of a method for migrating file permissions according to an embodiment of the present invention
  • FIG. 6 is a schematic structural diagram of an apparatus 500 according to an embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of a device 600 according to an embodiment of the present invention.
  • the source device and the target device are devices of different vendors. It is difficult to directly transfer files and file permission information between devices of different vendors.
  • the third-party migration server needs to implement the source device through a standard protocol supported by the source device and the target device. Migration of files and file permission information between target devices. Specifically, the migration server reads the file and the permission information of the file from the source device, and then writes the read file and the permission information of the file to the target device.
  • the migration server migrates the first permission information from the source device to the target device by using the first protocol supporting the first permission information, and then the source device The first authority information obtained by the migration is converted to obtain the second authority information.
  • the migration server first migrates the first rights information from the source device to the target device by using the first protocol that supports the first rights information, and then migrates the second rights information from the source device to the second device by using the second protocol that supports the second rights information.
  • the target device after obtaining the second permission information migrated, the target device updates the first rights information that is migrated first according to the second permission information, because the target device may default according to a type of the received file.
  • the permission information updates the other types of permission information of the file, so that the user operation rights represented by the various types of permission information of the file are consistent. Therefore, the mode 2 is substantially the same as the mode 1, and the rights migration is implemented according to the rights information of the post migration.
  • the amount of information contained in the different types of rights information of the file may be different, and the rules for the rights conversion between different vendors are different. As a result, the rights information after the migration is inconsistent with the rights information before the migration.
  • the first privilege information of the file is A1
  • the second privilege information of the file is B
  • the second privilege information B is composed of B1 and B2, wherein, according to the conversion rule between the first privilege information and the second privilege information, A1 may Converted to B1, B1 can be converted to A1, so the amount of information of the first privilege is smaller than the amount of information of the second privilege.
  • the migration server migrates the first privilege information A1 from the source device to the target device, and the target device converts the first privilege information A1 according to the privilege conversion rule to generate the second privilege information B1, and uses the generated second privilege information B1 as the target device.
  • File permission information saved in It can be seen that the second right information B1 saved by the target device is lost compared to the second right information B saved in the source device.
  • the user updates the second authority information of the file in the source device to form the rights information B
  • the source device is configured according to the The conversion rule 1 between the rights information and the second rights information converts the rights information B, generates the rights information A1, and uses the rights information A1 as the new first rights information.
  • the migration server migrates the rights information B to the target device, and the target device converts the rights information B according to the conversion rule 2 between the first rights information and the second rights information, generates the rights information A2, and uses the rights information A2 as a new The first permission information. It can be seen that the permission information in the target device is inconsistent with the permission information in the source device.
  • the embodiment of the present invention provides a method, an apparatus, and a system for file rights migration.
  • the technical solutions of the embodiments of the present invention are described in detail below with reference to the accompanying drawings and specific embodiments.
  • the system includes a migration server 100, a source device 200, and a target device 300.
  • the migration server 100, the source device 200, and the target device 300 can each be a computing device of various types. Such as computers, tablets, smartphones, etc.
  • the migration server 100, the source device 200, and the target device 300 jointly support at least two communication protocols.
  • the first protocol and the second protocol are jointly supported by the three as an example to explain the method for migrating file permissions.
  • the first protocol supports the first permission information of the transfer file
  • the second protocol supports the second permission information of the transfer file.
  • the source device 200 is configured to store first rights information of the file and second rights information of the file, where the first rights information includes file rights supported by the first protocol, and the second rights information includes file rights supported by the second protocol;
  • the migration server 100 is configured to: read the first permission information of the file from the source device by using the first protocol, and send the first permission information to the target device by using the first protocol;
  • the target device 300 is configured to: receive, by using the first protocol, the first rights information sent by the migration server 100, and save the first rights information;
  • the migration server 100 is further configured to: send an instruction for locking permission conversion to the target device 300, where the instruction for locking the rights conversion is used to indicate that the target device 300 keeps the first permission information unchanged when receiving the second permission information of the file;
  • the target device 300 is further configured to: receive an instruction for the lock permission conversion
  • the migration server 100 is further configured to: read the second permission information of the file from the source device 200 by using the second protocol, and send the second permission information to the target device 300 by using the second protocol;
  • the target device 300 is further configured to: receive the second permission information, and keep the first permission information unchanged according to the instruction of the locked permission conversion.
  • the migration server 100 migrates the first permission information and the second permission information of the file from the source device 200 to the target device 300 through the first protocol and the second protocol, respectively, and the second rights information to be migrated later Before being sent to the target device 300, the migration server 100 sends an instruction to lock the rights conversion to the target device 300, indicating that the target device 300 keeps the first rights information that is migrated first after receiving the second rights information that is migrated later, and avoids the target. After the device 300 updates the first rights information that is migrated first, the device 300 does not match the rights information of the files in the source device 200 and the file information in the source device 200, and implements the files before and after the migration. Permission information remains the same.
  • the target device 300 is further configured to: save the second permission information, and send a permission migration success response to the migration server 100;
  • the migration server 100 is further configured to: receive the permission migration success response, and send an instruction for releasing the rights conversion lock to the target device 300, where the instruction for releasing the rights conversion lock is used to indicate that the target device 300 is receiving the second rights information of the file. And updating the first permission information of the file according to the second permission information.
  • the migration device After the migration server determines that the first permission information of the file and the second permission information are successfully migrated from the source device to the target device, the migration device sends an instruction to release the permission conversion lock to the second permission information of the file in the target device.
  • the target device After the update, the target device can update the first permission information of the saved file according to the updated second permission information, and ensure that the first permission information of the file in the target device is synchronized with the user authority represented by the second permission information. .
  • the migration server 100 includes a processor 110, a memory 120, a first communication interface 130, and a second communication interface 140.
  • the first communication interface 130 is configured to communicate with the source device 200 and the target device 300 based on the first protocol;
  • the second communication interface 140 is configured to communicate with the source device and the target device based on the second protocol.
  • the first communication interface 130 communicates with the fifth communication interface 230 in the source device 200 based on the first protocol, and communicates with the third communication interface 330 in the target device 300 based on the first protocol;
  • the second communication interface 140 and the source The sixth communication interface 240 in the device 200 communicates based on the second protocol and communicates with the fourth communication interface 340 in the target device 300 based on the first protocol.
  • the memory 120 is configured to store data of the file, file permission information, and instructions; the processor 110 is configured to execute instructions in the memory 120 to perform the following steps when executing the instructions:
  • any one of the first communication interface 130 and the second communication interface 140 is further configured to: receive a rights migration success response sent by the target device 300, where the rights migration success response is performed by the processor 310 of the target device 300 at the target device 300. After the second permission information is saved, it is generated;
  • the processor 110 is further configured to: generate an instruction for releasing the privilege conversion lock, and the instruction for releasing the privilege conversion lock is used to indicate that the target device updates the first privilege information of the file according to the second privilege information when receiving the second privilege information of the file; And transmitting, by the first communication interface 130 or the second communication interface 140, the instruction to release the rights conversion lock to the target device 300.
  • the processor 110 is further configured to: generate a state locked instruction, where the state locked instruction is used to instruct the source device to reject the data of the file, the first permission information of the file, and the update operation of the second permission information of the file;
  • the state locked command is transmitted to the source device 200 through the first communication interface 130 or the second communication interface 140.
  • the instruction that the migration server 100 sends the status lock to the source device 200 may be earlier than the first authority information read from the source device 200, or sent to the source device 200 when the request for reading the first rights information is sent. State locked instruction.
  • the processor 110 is further configured to: after the second communication interface 140 sends the second permission information to the target device 300 by using the second protocol, generate an instruction for releasing the state lock, and the instruction for releasing the state lock is used to indicate the source device. An update operation of the first permission information of the file, the file, and the second authority information of the file is accepted; and the instruction to release the state lock is transmitted to the source device 200 through the first communication interface 130 or the second communication interface 140.
  • the target device 300 includes a processor 310, a memory 320, a third communication interface 330, and a fourth communication interface 340.
  • the third communication interface 330 is configured to communicate with the migration server 100 based on the first protocol; the fourth communication interface 340 is configured to communicate with the migration server 100 based on the second protocol.
  • the memory 320 is configured to store data of the file, file authority information, and instructions; the processor 310 is configured to execute instructions in the memory 320 to first register the third communication interface 330 from the migration server 100 when the executed instruction is executed.
  • the information is stored in the memory 320; and the second authority information of the file received by the fourth communication interface 340 from the migration server 100 is stored in the memory 320; and, in response to the third communication interface 330 or the fourth communication interface 340
  • the instruction of the lock authority conversion received by the migration server 100 keeps the first authority information of the file unchanged when the second authority information of the file is saved in the memory 320, and the instruction for the lock authority conversion is changed by the migration server.
  • the processor 110 of 100 generates and the target device 300 receives the instruction to lock the rights conversion before receiving the second rights information.
  • the processor 310 is further configured to: after the second privilege information of the file is saved in the memory 320, generate a privilege migration success response; and send the privilege migration success response through the third communication interface 330 or the fourth communication interface 340.
  • the migration server 100 To the migration server 100;
  • Any one of the third communication interface 330 or the fourth communication interface 340 is further configured to: receive an instruction to release the rights conversion lock from the migration server 100, the instruction to release the rights conversion lock is generated by the processor 110 of the migration server 100, for indicating The processor 310 updates the first rights information of the file according to the second rights information when the target device 300 receives the second rights information of the file.
  • the source device 200 includes a processor 210 , a memory 220 , a fifth communication interface 230 , and a sixth communication interface 240 .
  • the implementation manner of the source device 200 can be determined according to the implementation manner of the foregoing target device 300. To avoid repetition, the implementation manner of the source device 200 will not be described in detail herein.
  • processor 110 may be one processing element or a collective name of multiple processing elements.
  • the processor may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention, for example, : One or more microprocessors (Digital Singnal Processors, DSPs), or one or more Field Programmable Gate Arrays (FPGAs).
  • DSPs Digital Singnal Processors
  • FPGAs Field Programmable Gate Arrays
  • the memory 120, the memory 220, and the memory 320 may be one storage element or a collective name of a plurality of storage elements.
  • the above memory may include a random access memory (RAM), and may also include a non-volatile memory (NVM), such as a disk memory, a flash memory, or the like.
  • RAM random access memory
  • NVM non-volatile memory
  • the first communication interface 130 and the second communication interface 140 may be integrated into the same communication unit, or may belong to two independent communication units.
  • the fifth communication interface 230 and the sixth communication interface 240 may be integrated in the same communication unit, or may belong to two independent communication units.
  • the third communication interface 330 and the fourth communication interface 340 may be integrated in the same communication unit, or may belong to two independent communication units.
  • the embodiment of the present invention further provides a method for migrating file permissions.
  • the implementation of the migration server, the source device, and the target device in this embodiment may refer to FIG. 1 to FIG. 3.
  • FIG. 4 is a schematic flowchart of the migration file permission method, and the method includes the following steps:
  • Step 401 The migration server reads the first permission information of the file from the source device by using the first protocol, where the first permission information includes file permissions supported by the first protocol.
  • Step 402 The migration server sends the first permission information to the target device by using the first protocol.
  • Step 403 The target device saves the first authority information.
  • Step 404 The migration server sends an instruction for locking permission conversion to the target device, where the instruction for locking the permission conversion is used to indicate that the target device keeps the first permission information when receiving the second permission information of the file, and the second permission includes the second protocol. Supported file permissions.
  • the migration server may send an instruction for locking permission conversion to the target device by using the first protocol, or may send an instruction for locking permission conversion to the target device by using the second protocol, or the migration server passes the first protocol and the second protocol.
  • Other protocols send an instruction to lock the rights transfer to the target device.
  • Step 405 The migration server reads the second permission information of the file from the source device by using the second protocol.
  • Step 406 The migration server sends the second permission information to the target device by using the second protocol.
  • Step 407 The target device saves the second rights information, and keeps the first rights information unchanged according to the instruction of locking the rights conversion.
  • step 404 is performed before step 406, but the sequence between step 401, step 402, step 403 and step 405 is not limited.
  • Step 404 may be step 401, step 402, step 403, step Executing before any of steps 405 and 406 may also be performed after any of steps 401, 402, 403, and 405 and before step 406.
  • the file in the embodiment of the present invention is not limited to one file, and may be two or more files.
  • the migration server first migrates the first permission information of the file from the source device to the target device by using the first protocol, and then migrates the second permission information of the file from the source device to the second device through the second protocol.
  • Target device since the migration server migrates the second permission information of the file from the source device to the target device by using the second protocol, and sends an instruction for locking the rights conversion to the target device, the target device does not according to the second when receiving the second permission information.
  • the permission information updates the first permission information of the saved file, so that the first permission information of the file in the target device is consistent with the first permission information of the file in the source device, and the second permission information and source of the file in the target device.
  • the second permission information of the file in the device is consistent, and the permission information of the file before and after the migration is consistent.
  • the first protocol may be a server information block (SMB) protocol, and the first permission information is an access control list (ACL) information supported by the SMB protocol;
  • the second protocol may be a Network File System (NFS) protocol, and the second permission information is Mode information for permission control.
  • the first protocol is an NFS protocol
  • the first permission information is Mode information used for rights control
  • the second protocol is SMB protocol
  • the second rights information is ACL information.
  • the manner in which the migration server reads the file and the file's permission information from the source device through the SMB protocol and the NFS protocol, and the file information of the file and the file to be sent to the target device through the SMB protocol and the NFS protocol, refer to the prior art.
  • the technical means are not described in detail in the embodiments of the present invention.
  • step 407 the following steps are further included:
  • Step 408 The target device sends a permission migration success response to the migration server.
  • Step 409 The migration server receives the permission migration success response, and sends an instruction for releasing the permission conversion lock to the target device, and the instruction for releasing the permission conversion lock is used to indicate that the target device receives the second permission information of the file according to the second permission information.
  • the first permission information is updated.
  • the migration server After receiving the permission response, the migration server determines that the permission of the file is successfully migrated, and sends an instruction to release the permission conversion lock to the target device, so that after the user updates the second permission information of the file in the target device, the target device can
  • the updated second privilege information updates the first privilege information of the saved file to ensure that the first privilege information of the file in the target device is synchronized with the user privilege represented by the second privilege information.
  • the instruction for locking the rights conversion is further used to indicate that the target device keeps the second permission information of the file when receiving the first permission information of the file; and the instruction for releasing the permission conversion lock is further And indicating, when the first device information of the file is received by the target device, updating the second rights information of the file according to the first rights information.
  • the migration server when the migration server sends the first permission information to the target device by using the first protocol, the data of the file is sent to the target device.
  • the migration server may read the data of the file from the source device when the first permission information is read from the source device by using the first protocol.
  • the migration server when the migration server sends the second permission information to the target device by using the second protocol, the data of the file is given Target device.
  • the migration server may read the data of the file from the source device when the second permission information is read from the source device by using the second protocol.
  • the implementation method can simultaneously implement the data of the file and the permission information of the file from the source device to the target device, thereby improving the efficiency of file migration.
  • the method for migrating file permissions further includes the following steps:
  • Step 410 The migration server sends a state lock instruction to the source device, where the state lock instruction is used to instruct the source device to reject the update operation of the file, the first permission information of the file, and the second permission information of the file.
  • Step 410 may be performed before step 401. Or, in step 401, when the migration server sends a request for acquiring the first permission of the file to the source device by using the first protocol, the state lock command is sent to the source device.
  • the implementation manner can prevent the data of the file, the first permission information of the file, and the second permission information from being changed after the migration server reads the first permission information of the file from the source device, thereby avoiding the data or file of the file in the migration server.
  • the rights information is migrated from the source device to the target device, the data of the file or the permission information of the file in the source device is changed, and the data of the file or the file information of the file in the target device is inconsistent after the migration.
  • step 405 in combination with the solution of step 410, after step 405, the method further includes the following steps:
  • Step 411 The migration server sends an instruction to release the state lock to the source device, and the instruction for releasing the state lock is used to instruct the source device to accept the update operation of the first permission information of the file, the file, and the second permission information of the file.
  • step 411 is limited to be executed after step 405, but the sequence between other steps performed after step 405 is not limited. Step 411 may be performed before step 406 or after step 409.
  • the migration server after the migration server reads the first permission information of the file from the source device by using the first protocol, the user may perform an update operation on the file in the source device.
  • step 405 when the migration server reads the second permission information from the source device by using the second protocol, the data of the file is read from the source device.
  • step 406 when the migration server sends the second permission information to the target device by using the second protocol, the data of the file is sent to the target device;
  • the target device After receiving the data of the file, the target device determines whether the data of the file has been saved, and if it has been saved, discards the data of the received file, and if not, saves the data of the file.
  • the target device is to save the received data of the file, and includes two situations: first, the file is not saved in the target device; second, although the target device has saved the data of the file, the data of the saved file is The data of the received file is inconsistent.
  • the migration server can migrate the data of the changed file to the target device after the data of the file in the source device is changed, and ensure that the data of the file in the target device and the permission information of the file are consistent with the source device.
  • FIG. 6 is a schematic diagram of an apparatus 500 for migrating file rights according to an embodiment of the present invention.
  • the apparatus 500 is used as a migration server, and is configured to migrate first rights information and second rights information of files in a source device to a target device.
  • Apparatus 500 includes:
  • the first reading module 501 is configured to read the first permission information of the file from the source device by using the first protocol, where the first permission information includes file permissions supported by the first protocol;
  • the first sending module 502 is configured to send the first rights information to the target device by using the first protocol
  • the second sending module 503 is configured to send an instruction for locking permission conversion to the target device, where the instruction for locking the rights conversion is used to indicate that the target device keeps the first permission information when receiving the second permission information of the file, and the second permission information Includes file permissions supported by the second protocol;
  • a second reading module 504 configured to read second permission information of the file from the source device by using the second protocol
  • the third sending module 505 is configured to send the second rights information to the target device by using the second protocol.
  • the apparatus 500 further includes:
  • the first receiving module 506 is configured to receive a permission migration success response sent by the target device.
  • the fourth sending module 507 is configured to send an instruction for releasing the rights conversion lock to the target device, where the instruction for releasing the rights conversion lock is used to indicate that the target device receives the second right information of the file, and the first file is based on the second right information.
  • the permission information is updated.
  • the first sending module 502 is further configured to: send data of the file to the target device by using the first protocol.
  • the apparatus 500 further includes:
  • the fifth sending module 508 is configured to: when the first reading module reads the first permission information from the source device by using the first protocol, send a state locking instruction to the source device, where the state locking instruction is used to indicate that the source device rejects the file The data, the first permission information of the file, and the update operation of the second permission information of the file.
  • the apparatus 500 further includes:
  • the sixth sending module 509 is configured to: after the third sending module sends the second right information to the target device by using the second protocol, send an instruction to cancel the state locking to the source device, where the instruction for releasing the state locking is used to indicate that the source device accepts the pair The file, the first permission information of the file, and the update operation of the second permission information of the file.
  • each module in the above device 500 reference may be made to the implementation of the steps performed by the migration server in FIGS. 4 and 5.
  • FIG. 7 is a device 600 for migrating file rights according to an embodiment of the present invention.
  • the device 600 is used as a target device, and is configured to receive first rights information and second rights information of a file migrated from a source device from a migration server.
  • Apparatus 600 includes:
  • the first receiving module 601 is configured to receive, by using the first protocol, the first rights information of the file from the migration server, where the first rights information includes file rights supported by the first protocol;
  • the second receiving module 602 is configured to receive an instruction for the lock permission conversion sent by the migration server, where the instruction for locking the rights conversion is used to instruct the device to keep the first permission information unchanged when receiving the second permission information of the file, and the second permission information Includes file permissions supported by the second protocol;
  • the third receiving module 603 is configured to receive second permission information of the file from the migration server by using the second protocol
  • the instruction response module 604 is configured to: after the third receiving module receives the second permission information, keep the first permission information unchanged according to the instruction of locking the right conversion.
  • the apparatus 600 further includes:
  • the sending module 605 is configured to send a permission migration success response to the migration server after the third receiving module receives the second permission information.
  • the fourth receiving module 606 is configured to receive an instruction for releasing the rights conversion lock sent by the migration server, where the instruction for releasing the rights conversion lock is used to instruct the device to receive the first right information of the file according to the second rights information.
  • the permission information is updated.
  • each module in the above device 600 can refer to the steps performed by the target device in FIG. 4 and FIG. Method to realize.
  • the embodiment of the invention further provides a computer readable medium for storing a computer program, the computer program comprising instructions for executing the file permission migration method corresponding to FIG. 4 and FIG.
  • embodiments of the embodiments of the invention may be provided as a method, system, or computer program product.
  • embodiments of the invention may be in the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware.
  • embodiments of the invention may take the form of a computer program product embodied on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • Embodiments of the invention are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowcharts and/or block diagrams, and combinations of flows and/or blocks in the flowcharts and/or ⁇ RTIgt;
  • the instructions of these computer programs can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine such that instructions are executed by a processor of a computer or other programmable data processing device Means for implementing the functions specified in one or more flows of the flowchart or in a block or blocks of the flowchart.

Abstract

A method, apparatus and system for migrating a file permission. The method comprises: a migration server reading first permission information about a file from a source device according to a first protocol (401); sending the first permission information to a target device according to the first protocol (402); the target device storing the first permission information (403); the migration server sending an instruction for locking permission switch to the target device (404); the migration server reading second permission information about the file from the source device according to a second protocol (405); sending the second permission information to the target device according to the second protocol (406); and the target device storing the second permission information, and keeping the first permission information unchanged according to the instruction for locking permission switch (407). The method solves the problem that permission information after file migration is inconsistent with permission information before file migration.

Description

一种迁移文件权限的方法、装置以及系统Method, device and system for migrating file permissions 技术领域Technical field
本发明涉及计算机技术领域,特别涉及一种迁移文件权限的方法、装置以及系统。The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, and a system for migrating file rights.
背景技术Background technique
文件系统中文件的权限信息表征不同用户对文件的操作权限。一些文件系统支持两种或以上的协议,不同的协议支持的文件权限的类型不同,因而文件系统中的文件可以具有两种或两种以上类型的权限。The permission information of a file in the file system represents the operation authority of different users on the file. Some file systems support two or more protocols. Different protocols support different types of file permissions, so files in the file system can have two or more types of permissions.
在将文件系统中文件从源设备迁移至目标设备时,需要将文件的权限信息一并迁移至目标设备。权限信息的迁移需要通过支持该权限信息的协议进行,在文件具有第一权限信息以及第二权限信息时,需要通过支持第一权限信息的第一协议将文件的第一权限信息迁移至目标设备,以及通过支持第二权限信息的第二协议将第二权限信息迁移至目标设备。When migrating files from a source device to a target device, you need to migrate the file's permission information to the target device. The migration of the rights information needs to be performed by the protocol supporting the rights information. When the file has the first rights information and the second rights information, the first rights information of the file needs to be migrated to the target device by using the first protocol that supports the first rights information. And migrating the second rights information to the target device by the second protocol supporting the second rights information.
文件的不同类型的权限信息先后迁移至目标设备,目标设备在获得较晚迁移至目标设备的权限信息后,会根据较晚迁移至目标设备的权限信息对较早迁移至目标设备的权限信息进行更新。例如,目标设备根据权限间转换规则对较晚迁移至目标设备的第二权限信息进行转换,获得转换后第一权限信息,用转换后的第一权限信息替换较早迁移至目标设备的第一权限信息。The different types of rights information of the file are migrated to the target device. After obtaining the permission information of the device to be migrated to the target device later, the target device will perform the rights information migrated to the target device earlier based on the rights information migrated to the target device later. Update. For example, the target device converts the second permission information that is later migrated to the target device according to the inter-privilege conversion rule, obtains the converted first permission information, and replaces the first migration to the target device with the converted first permission information. Permission information.
但是,文件的不同类型的权限信息所包含的信息量可能不同,而且不同厂商间权限转换的规则也不同,导致根据较晚迁移至目标设备的权限信息对较早迁移至目标设备的权限信息进行更新时,更新后的权限信息与较早迁移至目标设备的权限信息不一致,导致文件迁移后的权限信息与文件迁移前的权限信息不一致。However, different types of permission information of a file may contain different amounts of information, and rules for permission conversion between different vendors may be different, resulting in permission information that is migrated to the target device earlier according to the permission information that is later migrated to the target device. When the update is performed, the updated permission information is inconsistent with the permission information that was migrated to the target device earlier, and the permission information after the file migration is inconsistent with the permission information before the file migration.
发明内容Summary of the invention
本发明实施例提供一种迁移文件权限的方法、装置以及系统,用于解决文件迁移后的权限信息与文件迁移前的权限信息不一致的问题。The embodiment of the invention provides a method, a device and a system for migrating file rights, which are used to solve the problem that the rights information after file migration is inconsistent with the rights information before file migration.
第一方面,本发明实施例提供一种迁移文件权限的方法,该方法用于迁移服务器将源设备中文件的第一权限信息以及第二权限信息迁移至目标设备,该迁移服务器能够分别通过第一协议以及第二协议与源设备以及目标设备进行通信,第一权限信息包括所述第一协议支持的文件权限,第二权限信息包括所述第二协议支持的文件权限。该方法包括如下步骤:首先,迁移服务器通过第一协议从源设备读取文件的第一权限信息,并通过所述第一协议将所述第一权限信息发送给目标设备;以及,迁移服务器向所述目标设备发送锁定权限转换的指令,所述锁定权限转换的指令用于指示所述目标设备在接收所述文件的第二权限信息时,保持所述第一权限信息不变,所述第二权限信息包括第二协议支持的文件权限;然后,所述迁移服务器通过所述第二协议从所述源设备读取所述文件的所述第二权限信息,并通过所述第二协议将所述第二权限信息发送给所述目标设备;所述目标设备在接收所述第二权限信息之后,根据所述锁定权限转换的指令保持所述第一权限信息不变。其中,迁移服务器向所述目标设备发送锁定权限转换的指令需早于向目标设备发送第二权限信息,可以早于向目标设备发送第一权限信息,也可以晚于向目标设备发送第一权限信息。In a first aspect, the embodiment of the present invention provides a method for migrating file permissions, where the migration server migrates the first permission information and the second permission information of the file in the source device to the target device, and the migration server can respectively pass the first The first protocol information includes the file rights supported by the first protocol, and the second rights information includes the file rights supported by the second protocol. The method includes the following steps: first, the migration server reads the first permission information of the file from the source device by using the first protocol, and sends the first permission information to the target device by using the first protocol; and, the migration server The target device sends an instruction for locking permission conversion, where the instruction for locking the right conversion is used to instruct the target device to keep the first permission information unchanged when receiving the second permission information of the file, where the The second rights information includes file rights supported by the second protocol; then, the migration server reads the second rights information of the file from the source device by using the second protocol, and The second authority information is sent to the target device; after receiving the second rights information, the target device keeps the first rights information unchanged according to the instruction of the lock permission conversion. The instruction that the migration server sends the lock permission conversion to the target device needs to send the second permission information earlier than the target device, and may send the first permission information earlier than the target device, or may send the first permission to the target device later. information.
本实现方式中,迁移服务器分别通过第一协议以及第二协议将文件的第一权限信息以 及第二权限信息从源设备迁移至目标设备,且在将后迁移的第二权限信息发送至目标设备之前,迁移服务器向目标设备发送锁定权限转换的指令,指示目标设备在接收到后迁移的第二权限信息时,保持先迁移的第一权限信息不变,避免目标设备根据后迁移的第二权限信息对先迁移的第一权限信息进行更新所导致的目标设备300中文件的权限信息与源设备中文件的权限信息不一致的问题,实现了迁移前后文件的权限信息保持一致。In this implementation manner, the migration server respectively uses the first protocol and the second protocol to And the second privilege information is migrated from the source device to the target device, and before the second privilege information migrated to the target device is sent, the migration server sends an instruction for locking privilege conversion to the target device, indicating that the target device migrates after receiving the privilege In the second privilege information, the first privilege information that is migrated first is kept unchanged, and the privilege information of the file in the target device 300 caused by the target device retrieving the first privileged first privilege information according to the second privilege information migrated later is prevented. The problem that the permissions information of the files in the source device is inconsistent is consistent.
在一种可选的实现方式中,所述目标设备接收所述第二权限信息后,保存该第二权限信息,向所述迁移服务器发送权限迁移成功响应;所述迁移服务器在接收所述权限迁移成功响应后,向所述目标设备发送解除权限转换锁定的指令,所述解除权限转换锁定的指令用于指示所述目标设备在接收所述文件的所述第二权限信息时,根据所述第二权限信息对所述文件的所述第一权限信息更新。本实现方式中,迁移服务器在确定文件的第一权限信息以及第二权限信息从源设备成功迁移至目标设备后,向目标设备发送解除权限转换锁定的指令,以便在用户对目标设备中文件的第二权限信息进行更新后,目标设备能够根据更新后的第二权限信息对保存的文件的第一权限信息进行对应更新,保证目标设备中文件的第一权限信息与第二权限信息所表征的用户权限保持同步。In an optional implementation manner, after receiving the second rights information, the target device saves the second rights information, and sends a rights migration success response to the migration server; the migration server receives the rights After the migration succeeds, the instruction for releasing the permission conversion lock is sent to the target device, where the instruction for releasing the permission conversion lock is used to instruct the target device to receive the second permission information of the file according to the The second authority information updates the first authority information of the file. In this implementation manner, after the migration server determines that the first permission information of the file and the second permission information are successfully migrated from the source device to the target device, the migration server sends an instruction for releasing the permission conversion lock to the target device, so that the user can file the file in the target device. After the second privilege information is updated, the target device can update the first privilege information of the saved file according to the updated second privilege information, and ensure that the first privilege information and the second privilege information of the file in the target device are represented. User permissions remain synchronized.
在一种可选的实现方式中,所述迁移服务器通过所述第一协议将所述第一权限信息发送给目标设备时,一并将所述文件的数据给所述目标设备。本实现方式能够实现同时将文件的数据以及文件的权限信息从源设备迁移至目标设备,提高文件迁移的效率。In an optional implementation manner, when the migration server sends the first permission information to the target device by using the first protocol, the data of the file is given to the target device. The implementation method can simultaneously implement the data of the file and the permission information of the file from the source device to the target device, thereby improving the efficiency of file migration.
在一种可选的实现方式中,所述迁移服务器通过所述第一协议从所述源设备读取所述第一权限信息时,一并向所述源设备发送状态锁定的指令,所述状态锁定的指令用于指示所述源设备拒绝对所述文件的数据、所述文件的所述第一权限信息以及所述文件的所述第二权限信息的更新操作。本实现方式能够在迁移服务器从源设备读取文件的第一权限信息后,保持源设备中文件的数据、文件的第一权限信息以及第二权限信息不变,避免在迁移服务器将文件的数据或文件的权限信息从源设备迁移至目标设备的过程中,源设备中文件的数据或文件的权限信息发生变更所导致的迁移后源设备与目标设备中文件的数据或文件的权限信息不一致的情形。In an optional implementation manner, when the migration server reads the first permission information from the source device by using the first protocol, sending, by the source device, a state lock instruction to the source device, The state locked instruction is used to instruct the source device to reject an update operation on data of the file, the first rights information of the file, and the second rights information of the file. The implementation manner can prevent the data of the file in the source device, the first permission information of the file, and the second permission information from being changed after the migration server reads the first permission information of the file from the source device, so as to avoid the data of the file in the migration server. Or the permission information of the file is migrated from the source device to the target device. The data of the file or the permission information of the file in the source device is changed, and the data of the file or the file in the target device is inconsistent with the permission information of the file. situation.
在一种可选的实现方式中,所述迁移服务器在通过所述第二协议将所述第二权限信息发送给所述目标设备后,向所述源设备发送解除状态锁定的指令,所述解除状态锁定的指令用于指示所述源设备接受对所述文件、所述文件的所述第一权限信息以及所述文件的所述第二权限信息的更新操作。本实现方式能够在将文件的权限信息迁移至目标设备后,解除源设备中文件以及文件的权限信息的状态锁定,使得用户能够对文件的数据或文件的权限信息进行更新操作。In an optional implementation manner, after the sending, by the second server, the second right information to the target device, the migration server sends an instruction to release the state lock to the source device, where The instruction to release the state lock is used to instruct the source device to accept an update operation on the file, the first rights information of the file, and the second rights information of the file. In this implementation manner, after the rights information of the file is migrated to the target device, the state locking of the file and the permission information of the file in the source device is released, so that the user can update the data of the file or the permission information of the file.
在一种可选的实现方式中,所述迁移服务器通过所述第二协议从所述源设备读取所述第二权限信息时,一并从所述源设备读取所述文件的数据;所述迁移服务器通过所述第二协议将所述第二权限信息发送给目标设备时,一并将所述文件的数据给所述目标设备;所述目标设备接收所述文件,并判断是否已存储所述文件,若是,则不保存所述文件,否则,保存所述文件。本实现方式中,迁移服务器能够在源设备中文件的数据被更改后,将更改后文件的数据迁移至目标设备,保证目标设备中文件的数据以及文件的权限信息与源设备中一致。In an optional implementation manner, when the migration server reads the second rights information from the source device by using the second protocol, the data of the file is read from the source device; When the migration server sends the second permission information to the target device by using the second protocol, and the data of the file is sent to the target device; the target device receives the file, and determines whether The file is stored, and if so, the file is not saved, otherwise the file is saved. In this implementation manner, the migration server can migrate the data of the changed file to the target device after the data of the file in the source device is changed, and ensure that the data of the file in the target device and the permission information of the file are consistent with the source device.
在一种可选的实现方式中,第一协议可以为服务器信息块(Server Message Block,SMB) 协议,第一权限信息为SMB协议所支持的访问控制列表(Access Control List,ACL)信息;第二协议可以为网络文件系统(Network File System,NFS)协议,第二权限信息为用于权限控制的模式(Mode)信息。或者,第一协议为NFS协议,第一权限信息为用于权限控制的Mode信息,第二协议为SMB协议,第二权限信息为ACL信息。In an optional implementation manner, the first protocol may be a Server Message Block (SMB). Protocol, the first permission information is an Access Control List (ACL) information supported by the SMB protocol; the second protocol may be a Network File System (NFS) protocol, and the second permission information is used for permission control. Mode information. Alternatively, the first protocol is an NFS protocol, the first permission information is Mode information used for rights control, the second protocol is SMB protocol, and the second rights information is ACL information.
第二方面,本发明实施例提供迁移文件权限的装置,该装置用于实现第一方面或第一方面的任意可能的实现中迁移服务器的功能。具体的,该装置包括用于执行上述第一方面或第一方面的任意可能的实现中的方法中由迁移服务器执行步骤的模块。In a second aspect, the embodiments of the present invention provide an apparatus for migrating file permissions, and the apparatus is used to implement the functions of the migration server in the first aspect or any possible implementation of the first aspect. In particular, the apparatus comprises means for performing the steps performed by the migration server in the method of any of the first aspect or any of the possible implementations of the first aspect described above.
第三方面,本发明实施例提供迁移文件权限的装置,该装置用于实现第一方面或第一方面的任意可能的实现中迁移服务器的功能。具体的,该装置包括用于执行上述第一方面或第一方面的任意可能的实现中的方法中由目标设备执行步骤的模块。In a third aspect, an embodiment of the present invention provides an apparatus for migrating file permissions, and the apparatus is used to implement the functions of the migration server in the first aspect or any possible implementation of the first aspect. In particular, the apparatus comprises means for performing the steps performed by the target device in the method of any of the first aspect or the first aspect of the first aspect described above.
第四方面,本发明实施例提供一种迁移服务器,用于实现第一方面或第一方面的任意可能的实现中迁移服务器的功能。具体的,迁移服务器包括第一通信接口、第二通信接口和处理器;所述第一通信接口,用于与源设备以及目标设备以第一协议通信;所述第二通信接口,用于与源设备以及目标设备以第二协议通信;所述处理器,用于:通过第一通信接口以及第二通信接口执行上述第一方面或第一方面的任意可能的实现中的方法中由迁移服务器执行步骤。In a fourth aspect, the embodiment of the present invention provides a migration server, which is used to implement the function of the migration server in the first aspect or any possible implementation of the first aspect. Specifically, the migration server includes a first communication interface, a second communication interface, and a processor; the first communication interface is configured to communicate with the source device and the target device by using a first protocol; and the second communication interface is configured to The source device and the target device communicate with the second protocol; the processor is configured to: perform, by using the first communication interface and the second communication interface, the migration method by using the first aspect or any of the possible implementations of the first aspect Steps.
第五方面,本发明实施例提供一种计算设备,用于实现第一方面或第一方面的任意可能的实现中目标设备的功能。具体的,计算设备包括处理器、存储器以及第三通信接口、第四通信接口;所述第三通信接口,用于与迁移服务器以第一协议通信;所述第四通信接口,用于与所述迁移服务器以第二协议通信;所述处理器,用于:通过所述第三通信接口以及所述第四通信接口执行上述第一方面或第一方面的任意可能的实现中的方法中由目标设备执行步骤。In a fifth aspect, an embodiment of the present invention provides a computing device, which is used to implement the functions of the target device in any possible implementation of the first aspect or the first aspect. Specifically, the computing device includes a processor, a memory, and a third communication interface, a fourth communication interface, where the third communication interface is configured to communicate with the migration server by using a first protocol, and the fourth communication interface is used for The migration server communicates with the second protocol; the processor is configured to: perform, by using the third communication interface and the fourth communication interface, the method in any of the foregoing first aspect or any possible implementation of the first aspect The target device performs the steps.
第六方面,本发明实施例提供一种迁移文件权限的系统,该系统包括迁移服务器、源设备以及目标设备,其中,源设备用于存储文件的第一权限信息以及文件的第二权限信息;迁移服务器用于执行上述第一方面或第一方面的任意可能的实现中的方法中由迁移服务器执行的步骤,目标设备用于执行上述第一方面或第一方面的任意可能的实现中的方法中由目标设备执行的步骤,进而实现将源设备中文件的第一权限信息以及第二权限信息迁移至目标设备。In a sixth aspect, the embodiment of the present invention provides a system for migrating file permissions, where the system includes a migration server, a source device, and a target device, where the source device is configured to store first permission information of the file and second permission information of the file; The migration server is configured to perform the steps of the first aspect or any of the possible implementations of the first aspect, wherein the target device is configured to perform the method of any of the first aspect or the first aspect of the first aspect. The step performed by the target device, thereby implementing the migration of the first permission information and the second permission information of the file in the source device to the target device.
第七方面,本发明实施例提供一种计算机可读介质,用于存储计算机程序,该计算机程序包括用于执行第一方面或第一方面的任意可能的实现中的方法的指令。In a seventh aspect, an embodiment of the present invention provides a computer readable medium for storing a computer program, the computer program comprising instructions for performing the method of the first aspect or any possible implementation of the first aspect.
本发明在上述各方面提供的实现的基础上,还可以进行进一步组合以提供更多实现。Further on the basis of the implementations provided by the above aspects, the invention may be further combined to provide further implementation.
附图说明DRAWINGS
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简要介绍。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly described below.
图1为本发明实施例中文件迁移系统的示意图;1 is a schematic diagram of a file migration system according to an embodiment of the present invention;
图2为本发明实施例中迁移服务器的结构示意图;2 is a schematic structural diagram of a migration server according to an embodiment of the present invention;
图3为本发明实施例中目标设备的结构示意图;3 is a schematic structural diagram of a target device according to an embodiment of the present invention;
图4为本发明实施例中迁移文件权限方法的流程示意图; 4 is a schematic flowchart of a method for migrating file permissions according to an embodiment of the present invention;
图5为本发明实施例中迁移文件权限方法的进一步细化流程示意图;FIG. 5 is a schematic diagram of a further refinement process of a method for migrating file permissions according to an embodiment of the present invention; FIG.
图6为本发明实施例中装置500的结构示意图;FIG. 6 is a schematic structural diagram of an apparatus 500 according to an embodiment of the present invention;
图7为本发明实施例中装置600的结构示意图。FIG. 7 is a schematic structural diagram of a device 600 according to an embodiment of the present invention.
具体实施方式detailed description
通常,源设备与目标设备为不同厂商的设备,不同厂商设备之间难以直接进行文件以及文件权限信息的迁移,需要第三方的迁移服务器通过源设备与目标设备均支持的标准协议实现源设备与目标设备之间文件以及文件权限信息的迁移。具体的,迁移服务器从源设备读取文件以及文件的权限信息,然后将读取的文件以及文件的权限信息写入目标设备。Generally, the source device and the target device are devices of different vendors. It is difficult to directly transfer files and file permission information between devices of different vendors. The third-party migration server needs to implement the source device through a standard protocol supported by the source device and the target device. Migration of files and file permission information between target devices. Specifically, the migration server reads the file and the permission information of the file from the source device, and then writes the read file and the permission information of the file to the target device.
现有技术中,通常采用如下方式进行文件权限信息的迁移:In the prior art, the migration of file permission information is usually performed as follows:
方式1,在文件系统支持类型不同的第一权限信息以及第二权限信息时,迁移服务器通过支持第一权限信息的第一协议将第一权限信息从源设备迁移至目标设备,然后,源设备对迁移获得的第一权限信息转换获得第二权限信息。Mode 1, when the file system supports the first permission information and the second permission information of different types, the migration server migrates the first permission information from the source device to the target device by using the first protocol supporting the first permission information, and then the source device The first authority information obtained by the migration is converted to obtain the second authority information.
方式2,迁移服务器先通过支持第一权限信息的第一协议将第一权限信息从源设备迁移至目标设备,然后通过支持第二权限信息的第二协议将第二权限信息从源设备迁移至目标设备,但是,目标设备在获得后迁移的第二权限信息后,会根据第二权限信息对先迁移的第一权限信息进行更新,这是因为目标设备会默认根据接收的文件的一种类型的权限信息对文件的其他类型的权限信息进行更新,以使得文件的各类权限信息表征的用户操作权限保持一致。因此,方式2实质上与方式1相同,为根据后迁移的权限信息实现权限迁移。In the mode 2, the migration server first migrates the first rights information from the source device to the target device by using the first protocol that supports the first rights information, and then migrates the second rights information from the source device to the second device by using the second protocol that supports the second rights information. The target device, however, after obtaining the second permission information migrated, the target device updates the first rights information that is migrated first according to the second permission information, because the target device may default according to a type of the received file. The permission information updates the other types of permission information of the file, so that the user operation rights represented by the various types of permission information of the file are consistent. Therefore, the mode 2 is substantially the same as the mode 1, and the rights migration is implemented according to the rights information of the post migration.
然而,文件的不同类型的权限信息所包含的信息量可能不同,而且不同厂商间权限转换的规则也不同,导致上述两种迁移权限方式中,迁移后的权限信息与迁移前的权限信息不一致。However, the amount of information contained in the different types of rights information of the file may be different, and the rules for the rights conversion between different vendors are different. As a result, the rights information after the migration is inconsistent with the rights information before the migration.
例如,文件的第一权限信息为A1,文件的第二权限信息为B,第二权限信息B由B1以及B2组成,其中,根据第一权限信息与第二权限信息间的转换规则,A1可以转换为B1,B1可以转换为A1,因此,第一权限的信息量小于第二权限的信息量。迁移服务器将第一权限信息A1从源设备迁移至目标设备,目标设备根据权限转换规则对第一权限信息A1进行转换,生成第二权限信息B1,将生成的该第二权限信息B1作为目标设备中保存的文件权限信息。可见,目标设备保存的第二权限信息B1相较于源设备中保存的第二权限信息B发生信息丢失。For example, the first privilege information of the file is A1, the second privilege information of the file is B, and the second privilege information B is composed of B1 and B2, wherein, according to the conversion rule between the first privilege information and the second privilege information, A1 may Converted to B1, B1 can be converted to A1, so the amount of information of the first privilege is smaller than the amount of information of the second privilege. The migration server migrates the first privilege information A1 from the source device to the target device, and the target device converts the first privilege information A1 according to the privilege conversion rule to generate the second privilege information B1, and uses the generated second privilege information B1 as the target device. File permission information saved in . It can be seen that the second right information B1 saved by the target device is lost compared to the second right information B saved in the source device.
又例如,在源设备与目标设备中第一权限信息与第二权限信息之间的转换规则不同时,用户对源设备中文件的第二权限信息进行更新,形成权限信息B,源设备根据第一权限信息与第二权限信息之间的转换规则1对权限信息B进行转换,生成权限信息A1,将该权限信息A1作为新的第一权限信息。然后,迁移服务器将权限信息B迁移至目标设备,目标设备根据第一权限信息与第二权限信息之间的转换规则2对权限信息B进行转换,生成权限信息A2,将该权限信息A2作为新的第一权限信息。可见,目标设备中的权限信息与源设备中的权限信息不一致。For example, when the conversion rule between the first authority information and the second authority information in the source device and the target device is different, the user updates the second authority information of the file in the source device to form the rights information B, and the source device is configured according to the The conversion rule 1 between the rights information and the second rights information converts the rights information B, generates the rights information A1, and uses the rights information A1 as the new first rights information. Then, the migration server migrates the rights information B to the target device, and the target device converts the rights information B according to the conversion rule 2 between the first rights information and the second rights information, generates the rights information A2, and uses the rights information A2 as a new The first permission information. It can be seen that the permission information in the target device is inconsistent with the permission information in the source device.
为了解决现有技术中存在的上述文件迁移后的权限信息与文件迁移前的权限信息不一致的问题,本发明实施例提供一种文件权限迁移的方法、装置以及系统。下面通过附图以及具体实施例对本发明实施例技术方案做详细的说明。 In order to solve the problem that the rights information after the file migration in the prior art is inconsistent with the rights information before the file migration, the embodiment of the present invention provides a method, an apparatus, and a system for file rights migration. The technical solutions of the embodiments of the present invention are described in detail below with reference to the accompanying drawings and specific embodiments.
图1为本发明实施例中文件迁移系统的示意图,该系统包括迁移服务器100、源设备200以及目标设备300,迁移服务器100、源设备200以及目标设备300均可以为各种类型的计算设备,如计算机、平板电脑、智能手机等。迁移服务器100、源设备200以及目标设备300共同支持至少两种通信协议,为了便于说明,本发明实施例中以三者共同支持第一协议以及第二协议为例对迁移文件权限的方法予以说明,其中,第一协议支持传输文件的第一权限信息,第二协议支持传输文件的第二权限信息。1 is a schematic diagram of a file migration system according to an embodiment of the present invention. The system includes a migration server 100, a source device 200, and a target device 300. The migration server 100, the source device 200, and the target device 300 can each be a computing device of various types. Such as computers, tablets, smartphones, etc. The migration server 100, the source device 200, and the target device 300 jointly support at least two communication protocols. For convenience of description, in the embodiment of the present invention, the first protocol and the second protocol are jointly supported by the three as an example to explain the method for migrating file permissions. The first protocol supports the first permission information of the transfer file, and the second protocol supports the second permission information of the transfer file.
其中,源设备200用于存储文件的第一权限信息以及文件的第二权限信息,该第一权限信息包括第一协议支持的文件权限,该第二权限信息包括第二协议支持的文件权限;The source device 200 is configured to store first rights information of the file and second rights information of the file, where the first rights information includes file rights supported by the first protocol, and the second rights information includes file rights supported by the second protocol;
迁移服务器100用于:通过该第一协议从源设备读取文件的第一权限信息,以及通过该第一协议将该第一权限信息发送给目标设备;The migration server 100 is configured to: read the first permission information of the file from the source device by using the first protocol, and send the first permission information to the target device by using the first protocol;
目标设备300用于:通过该第一协议接收迁移服务器100发送的该第一权限信息,并保存该第一权限信息;The target device 300 is configured to: receive, by using the first protocol, the first rights information sent by the migration server 100, and save the first rights information;
迁移服务器100还用于:向目标设备300发送锁定权限转换的指令,该锁定权限转换的指令用于指示目标设备300在接收该文件的第二权限信息时,保持该第一权限信息不变;The migration server 100 is further configured to: send an instruction for locking permission conversion to the target device 300, where the instruction for locking the rights conversion is used to indicate that the target device 300 keeps the first permission information unchanged when receiving the second permission information of the file;
目标设备300还用于:接收该锁定权限转换的指令;The target device 300 is further configured to: receive an instruction for the lock permission conversion;
迁移服务器100还用于:通过该第二协议从源设备200读取该文件的该第二权限信息,并通过该第二协议将该第二权限信息发送给目标设备300;The migration server 100 is further configured to: read the second permission information of the file from the source device 200 by using the second protocol, and send the second permission information to the target device 300 by using the second protocol;
目标设备300还用于:接收该第二权限信息,并根据该锁定权限转换的指令保持该第一权限信息不变。The target device 300 is further configured to: receive the second permission information, and keep the first permission information unchanged according to the instruction of the locked permission conversion.
上述文件迁移系统中,迁移服务器100分别通过第一协议以及第二协议将文件的第一权限信息以及第二权限信息从源设备200迁移至目标设备300,且在将后迁移的第二权限信息发送至目标设备300之前,迁移服务器100向目标设备300发送锁定权限转换的指令,指示目标设备300在接收到后迁移的第二权限信息时,保持先迁移的第一权限信息不变,避免目标设备300根据后迁移的第二权限信息对先迁移的第一权限信息进行更新所导致的目标设备300中文件的权限信息与源设备200中文件的权限信息不一致的问题,实现了迁移前后文件的权限信息保持一致。In the above file migration system, the migration server 100 migrates the first permission information and the second permission information of the file from the source device 200 to the target device 300 through the first protocol and the second protocol, respectively, and the second rights information to be migrated later Before being sent to the target device 300, the migration server 100 sends an instruction to lock the rights conversion to the target device 300, indicating that the target device 300 keeps the first rights information that is migrated first after receiving the second rights information that is migrated later, and avoids the target. After the device 300 updates the first rights information that is migrated first, the device 300 does not match the rights information of the files in the source device 200 and the file information in the source device 200, and implements the files before and after the migration. Permission information remains the same.
可选的,在文件迁移系统中,目标设备300还用于:保存该第二权限信息,并向迁移服务器100发送权限迁移成功响应;Optionally, in the file migration system, the target device 300 is further configured to: save the second permission information, and send a permission migration success response to the migration server 100;
迁移服务器100还用于:接收该权限迁移成功响应,向目标设备300发送解除权限转换锁定的指令,该解除权限转换锁定的指令用于指示目标设备300在接收该文件的该第二权限信息时,根据该第二权限信息对该文件的该第一权限信息更新。The migration server 100 is further configured to: receive the permission migration success response, and send an instruction for releasing the rights conversion lock to the target device 300, where the instruction for releasing the rights conversion lock is used to indicate that the target device 300 is receiving the second rights information of the file. And updating the first permission information of the file according to the second permission information.
由于迁移服务器在确定文件的第一权限信息以及第二权限信息从源设备成功迁移至目标设备后,向目标设备发送解除权限转换锁定的指令,以便在用户对目标设备中文件的第二权限信息进行更新后,目标设备能够根据更新后的第二权限信息对保存的文件的第一权限信息进行对应更新,保证目标设备中文件的第一权限信息与第二权限信息所表征的用户权限保持同步。After the migration server determines that the first permission information of the file and the second permission information are successfully migrated from the source device to the target device, the migration device sends an instruction to release the permission conversion lock to the second permission information of the file in the target device. After the update, the target device can update the first permission information of the saved file according to the updated second permission information, and ensure that the first permission information of the file in the target device is synchronized with the user authority represented by the second permission information. .
参照图1以及图2,迁移服务器100包括处理器110、存储器120、第一通信接口130以及第二通信接口140。Referring to FIGS. 1 and 2, the migration server 100 includes a processor 110, a memory 120, a first communication interface 130, and a second communication interface 140.
其中,第一通信接口130用于与源设备200以及目标设备300基于第一协议通信;第 二通信接口140用于与源设备以及目标设备基于第二协议通信。具体的,第一通信接口130与源设备200中的第五通信接口230基于第一协议通信,以及与目标设备300中的第三通信接口330基于第一协议通信;第二通信接口140与源设备200中的第六通信接口240基于第二协议通信,以及与目标设备300中的第四通信接口340基于第一协议通信。The first communication interface 130 is configured to communicate with the source device 200 and the target device 300 based on the first protocol; The second communication interface 140 is configured to communicate with the source device and the target device based on the second protocol. Specifically, the first communication interface 130 communicates with the fifth communication interface 230 in the source device 200 based on the first protocol, and communicates with the third communication interface 330 in the target device 300 based on the first protocol; the second communication interface 140 and the source The sixth communication interface 240 in the device 200 communicates based on the second protocol and communicates with the fourth communication interface 340 in the target device 300 based on the first protocol.
存储器120用于存储文件的数据、文件权限信息以及指令;处理器110用于执行存储器120中的指令,以在执行的指令时执行如下步骤:The memory 120 is configured to store data of the file, file permission information, and instructions; the processor 110 is configured to execute instructions in the memory 120 to perform the following steps when executing the instructions:
通过第一通信接口130以第一协议从源设备200读取文件的第一权限信息,以及,通过第一通信接口130以第一协议将文件的第一权限信息发送至目标设备300;以及,通过第二通信接口140以第二协议从源设备200读取文件的第二权限信息,以及,通过第二通信接口140以第二协议将文件的第二权限信息发送至目标设备300;以及,在通过第二通信接口140以第二协议将文件的第二权限信息发送至目标设备300之前,通过第一通信接口130或第二通信接口140向目标设备300发送锁定权限转换的指令,该锁定权限转换的指令用于指示目标设备300在接收文件的第二权限信息时,保持文件的第一权限信息不变。Reading the first authority information of the file from the source device 200 through the first communication interface 130 in the first protocol, and transmitting the first rights information of the file to the target device 300 in the first protocol through the first communication interface 130; Reading the second right information of the file from the source device 200 in the second protocol through the second communication interface 140, and transmitting the second right information of the file to the target device 300 in the second protocol through the second communication interface 140; Before transmitting the second right information of the file to the target device 300 through the second communication interface 140 in the second protocol, the instruction for locking the right conversion is transmitted to the target device 300 through the first communication interface 130 or the second communication interface 140, the locking The privilege conversion instruction is used to indicate that the target device 300 keeps the first privilege information of the file unchanged when receiving the second privilege information of the file.
可选的,第一通信接口130与第二通信接口140中任一还用于:接收目标设备300发送的权限迁移成功响应,该权限迁移成功响应由目标设备300的处理器310在目标设备300保存该第二权限信息后生成;Optionally, any one of the first communication interface 130 and the second communication interface 140 is further configured to: receive a rights migration success response sent by the target device 300, where the rights migration success response is performed by the processor 310 of the target device 300 at the target device 300. After the second permission information is saved, it is generated;
处理器110还用于:生成解除权限转换锁定的指令,解除权限转换锁定的指令用于指示目标设备在接收文件的第二权限信息时,根据第二权限信息对文件的第一权限信息更新;以及通过第一通信接口130或第二通信接口140将该解除权限转换锁定的指令发送至目标设备300。The processor 110 is further configured to: generate an instruction for releasing the privilege conversion lock, and the instruction for releasing the privilege conversion lock is used to indicate that the target device updates the first privilege information of the file according to the second privilege information when receiving the second privilege information of the file; And transmitting, by the first communication interface 130 or the second communication interface 140, the instruction to release the rights conversion lock to the target device 300.
可选的,处理器110还用于:生成状态锁定的指令,状态锁定的指令用于指示源设备拒绝对文件的数据、文件的第一权限信息以及文件的第二权限信息的更新操作;并通过第一通信接口130或第二通信接口140将该状态锁定的指令发送给源设备200。其中,迁移服务器100向源设备200发送该状态锁定的指令可以早于从源设备200读取第一权限信息,或者在向源设备200发送读取第一权限信息的请求时,一并发送该状态锁定的指令。Optionally, the processor 110 is further configured to: generate a state locked instruction, where the state locked instruction is used to instruct the source device to reject the data of the file, the first permission information of the file, and the update operation of the second permission information of the file; The state locked command is transmitted to the source device 200 through the first communication interface 130 or the second communication interface 140. The instruction that the migration server 100 sends the status lock to the source device 200 may be earlier than the first authority information read from the source device 200, or sent to the source device 200 when the request for reading the first rights information is sent. State locked instruction.
可选的,处理器110还用于:在第二通信接口140通过第二协议将第二权限信息发送给目标设备300后,生成解除状态锁定的指令,解除状态锁定的指令用于指示源设备接受对文件、文件的第一权限信息以及文件的第二权限信息的更新操作;并通过第一通信接口130或第二通信接口140将该解除状态锁定的指令发送至源设备200。Optionally, the processor 110 is further configured to: after the second communication interface 140 sends the second permission information to the target device 300 by using the second protocol, generate an instruction for releasing the state lock, and the instruction for releasing the state lock is used to indicate the source device. An update operation of the first permission information of the file, the file, and the second authority information of the file is accepted; and the instruction to release the state lock is transmitted to the source device 200 through the first communication interface 130 or the second communication interface 140.
请参照图1以及图3,目标设备300包括处理器310、存储器320、第三通信接口330以及第四通信接口340。Referring to FIG. 1 and FIG. 3, the target device 300 includes a processor 310, a memory 320, a third communication interface 330, and a fourth communication interface 340.
其中,第三通信接口330用于与迁移服务器100基于第一协议通信;第四通信接口340用于与迁移服务器100基于第二协议通信。The third communication interface 330 is configured to communicate with the migration server 100 based on the first protocol; the fourth communication interface 340 is configured to communicate with the migration server 100 based on the second protocol.
存储器320用于存储文件的数据、文件权限信息以及指令;处理器310用于执行存储器320中的指令,以在执行的指令时将第三通信接口330从迁移服务器100接收的文件的第一权限信息保存在存储器320之中;以及,将第四通信接口340从迁移服务器100接收的文件的第二权限信息保存在存储器320之中;以及,响应第三通信接口330或第四通信接口340从迁移服务器100接收的锁定权限转换的指令,在将文件的第二权限信息保存在存储器320之中时,保持文件的第一权限信息不变,该锁定权限转换的指令由迁移服务器 100的处理器110生成且目标设备300在接收第二权限信息之前接收该锁定权限转换的指令。The memory 320 is configured to store data of the file, file authority information, and instructions; the processor 310 is configured to execute instructions in the memory 320 to first register the third communication interface 330 from the migration server 100 when the executed instruction is executed. The information is stored in the memory 320; and the second authority information of the file received by the fourth communication interface 340 from the migration server 100 is stored in the memory 320; and, in response to the third communication interface 330 or the fourth communication interface 340 The instruction of the lock authority conversion received by the migration server 100 keeps the first authority information of the file unchanged when the second authority information of the file is saved in the memory 320, and the instruction for the lock authority conversion is changed by the migration server. The processor 110 of 100 generates and the target device 300 receives the instruction to lock the rights conversion before receiving the second rights information.
可选的,处理器310还用于:将文件的第二权限信息保存在存储器320后,生成权限迁移成功响应;并通过第三通信接口330或第四通信接口340将该权限迁移成功响应发送至迁移服务器100;Optionally, the processor 310 is further configured to: after the second privilege information of the file is saved in the memory 320, generate a privilege migration success response; and send the privilege migration success response through the third communication interface 330 or the fourth communication interface 340. To the migration server 100;
第三通信接口330或第四通信接口340中任一还用于:从迁移服务器100接收解除权限转换锁定的指令,该解除权限转换锁定的指令由迁移服务器100的处理器110生成,用于指示处理器310在目标设备300接收文件的第二权限信息时,根据第二权限信息对文件的第一权限信息更新。Any one of the third communication interface 330 or the fourth communication interface 340 is further configured to: receive an instruction to release the rights conversion lock from the migration server 100, the instruction to release the rights conversion lock is generated by the processor 110 of the migration server 100, for indicating The processor 310 updates the first rights information of the file according to the second rights information when the target device 300 receives the second rights information of the file.
请参照图1,本发明的实施例中,源设备200包括处理器210、存储器220、第五通信接口230以及第六通信接口240。本领域普通技术人员可以根据上述目标设备300的实现方式确定源设备200的实现方式,为避免重复,在此不再对源设备200的实现方式进行详述。Referring to FIG. 1 , in an embodiment of the present invention, the source device 200 includes a processor 210 , a memory 220 , a fifth communication interface 230 , and a sixth communication interface 240 . The implementation manner of the source device 200 can be determined according to the implementation manner of the foregoing target device 300. To avoid repetition, the implementation manner of the source device 200 will not be described in detail herein.
需要说明的是,上述处理器110、处理器210以及处理器310可以为一个处理元件,也可以为多个处理元件的统称。上述处理器可以是中央处理器(Central Processing Unit,CPU),也可以是特定集成电路(Application Specific Intergrated Circuit,ASIC),或者是被配置成实施本发明实施例的一个或多个集成电路,例如:一个或多个微处理器(Digital Singnal Processor,DSP),或,一个或者多个现场可编程门阵列(Field Programmable Gate Array,FPGA)。It should be noted that the processor 110, the processor 210, and the processor 310 may be one processing element or a collective name of multiple processing elements. The processor may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention, for example, : One or more microprocessors (Digital Singnal Processors, DSPs), or one or more Field Programmable Gate Arrays (FPGAs).
存储器120、存储器220以及存储器320可以是一个存储元件,也可以是多个存储元件的统称。上述存储器可以包括随机存储器(Random-Access Memory,RAM),也可以包括非易失性存储器(Non-Volatile Memory,NVM),例如磁盘存储器,闪存(Flash)等。The memory 120, the memory 220, and the memory 320 may be one storage element or a collective name of a plurality of storage elements. The above memory may include a random access memory (RAM), and may also include a non-volatile memory (NVM), such as a disk memory, a flash memory, or the like.
第一通信接口130与第二通信接口140可以集成在同一个通信单元之中,也可以分别属于两个独立的通信单元。同理,第五通信接口230与第六通信接口240可以集成在同一个通信单元之中,也可以分别属于两个独立的通信单元。第三通信接口330与第四通信接口340可以集成在同一个通信单元之中,也可以分别属于两个独立的通信单元。The first communication interface 130 and the second communication interface 140 may be integrated into the same communication unit, or may belong to two independent communication units. Similarly, the fifth communication interface 230 and the sixth communication interface 240 may be integrated in the same communication unit, or may belong to two independent communication units. The third communication interface 330 and the fourth communication interface 340 may be integrated in the same communication unit, or may belong to two independent communication units.
本发明实施例还提供一种迁移文件权限方法,本实施例中迁移服务器、源设备以及目标设备的实现可以参照图1至图3。图4为该迁移文件权限方法的流程示意图,该方法包括如下步骤:The embodiment of the present invention further provides a method for migrating file permissions. The implementation of the migration server, the source device, and the target device in this embodiment may refer to FIG. 1 to FIG. 3. FIG. 4 is a schematic flowchart of the migration file permission method, and the method includes the following steps:
步骤401:迁移服务器通过第一协议从源设备读取文件的第一权限信息,第一权限信息包括第一协议支持的文件权限。Step 401: The migration server reads the first permission information of the file from the source device by using the first protocol, where the first permission information includes file permissions supported by the first protocol.
步骤402:迁移服务器通过第一协议将第一权限信息发送给目标设备。Step 402: The migration server sends the first permission information to the target device by using the first protocol.
步骤403:目标设备保存第一权限信息。Step 403: The target device saves the first authority information.
步骤404:迁移服务器向目标设备发送锁定权限转换的指令,锁定权限转换的指令用于指示目标设备在接收文件的第二权限信息时,保持第一权限信息不变,第二权限包括第二协议支持的文件权限。Step 404: The migration server sends an instruction for locking permission conversion to the target device, where the instruction for locking the permission conversion is used to indicate that the target device keeps the first permission information when receiving the second permission information of the file, and the second permission includes the second protocol. Supported file permissions.
其中,迁移服务器可以通过第一协议向目标设备发送锁定权限转换的指令,也可以通过第二协议向目标设备发送锁定权限转换的指令,或者,迁移服务器通过第一协议、第二协议之外的其他协议向目标设备发送锁定权限转换的指令。The migration server may send an instruction for locking permission conversion to the target device by using the first protocol, or may send an instruction for locking permission conversion to the target device by using the second protocol, or the migration server passes the first protocol and the second protocol. Other protocols send an instruction to lock the rights transfer to the target device.
步骤405:迁移服务器通过第二协议从源设备读取文件的第二权限信息。 Step 405: The migration server reads the second permission information of the file from the source device by using the second protocol.
步骤406:迁移服务器通过第二协议将第二权限信息发送给目标设备。Step 406: The migration server sends the second permission information to the target device by using the second protocol.
步骤407:目标设备保存第二权限信息,并根据锁定权限转换的指令保持第一权限信息不变。Step 407: The target device saves the second rights information, and keeps the first rights information unchanged according to the instruction of locking the rights conversion.
需要说明的是,步骤404在步骤406之前执行,但不限定其与步骤401、步骤402、步骤403以及步骤405之间的先后顺序,如步骤404可以在步骤401、步骤402、步骤403、步骤405以及步骤406中任一步骤之前执行,也可以在步骤401、步骤402、步骤403、步骤405中任一步骤之后且在步骤406之前执行。另外,本发明实施例中的文件不限定为一个文件,也可以为两个或两个以上的文件。It should be noted that step 404 is performed before step 406, but the sequence between step 401, step 402, step 403 and step 405 is not limited. Step 404 may be step 401, step 402, step 403, step Executing before any of steps 405 and 406 may also be performed after any of steps 401, 402, 403, and 405 and before step 406. In addition, the file in the embodiment of the present invention is not limited to one file, and may be two or more files.
上述步骤401至步骤407的技术方案中,迁移服务器先通过第一协议将文件的第一权限信息从源设备迁移至目标设备,再通过第二协议将文件的第二权限信息从源设备迁移至目标设备。由于迁移服务器在通过第二协议将文件的第二权限信息从源设备迁移至目标设备,向目标设备发送锁定权限转换的指令,因此,目标设备在接收第二权限信息时,不会根据第二权限信息对已保存的文件的第一权限信息进行更新,这样,目标设备中的文件的第一权限信息与源设备中文件的第一权限信息一致,目标设备中文件的第二权限信息与源设备中文件的第二权限信息一致,实现了迁移前后文件的权限信息保持一致。In the technical solution of the foregoing steps 401 to 407, the migration server first migrates the first permission information of the file from the source device to the target device by using the first protocol, and then migrates the second permission information of the file from the source device to the second device through the second protocol. Target device. Since the migration server migrates the second permission information of the file from the source device to the target device by using the second protocol, and sends an instruction for locking the rights conversion to the target device, the target device does not according to the second when receiving the second permission information. The permission information updates the first permission information of the saved file, so that the first permission information of the file in the target device is consistent with the first permission information of the file in the source device, and the second permission information and source of the file in the target device The second permission information of the file in the device is consistent, and the permission information of the file before and after the migration is consistent.
可选的,本发明实施例中,第一协议可以为服务器信息块(Server Message Block,SMB)协议,第一权限信息为SMB协议所支持的访问控制列表(Access Control List,ACL)信息;第二协议可以为网络文件系统(Network File System,NFS)协议,第二权限信息为用于权限控制的模式(Mode)信息。或者,第一协议为NFS协议,第一权限信息为用于权限控制的Mode信息,第二协议为SMB协议,第二权限信息为ACL信息。Optionally, in the embodiment of the present invention, the first protocol may be a server information block (SMB) protocol, and the first permission information is an access control list (ACL) information supported by the SMB protocol; The second protocol may be a Network File System (NFS) protocol, and the second permission information is Mode information for permission control. Alternatively, the first protocol is an NFS protocol, the first permission information is Mode information used for rights control, the second protocol is SMB protocol, and the second rights information is ACL information.
迁移服务器通过SMB协议、NFS协议从源设备读取文件以及文件的权限信息的方式,以及通过SMB协议、NFS协议将文件以及文件的权限信息发送至目标设备的实现方式请参照现有技术中各种技术手段,本发明实施例不予详述。The manner in which the migration server reads the file and the file's permission information from the source device through the SMB protocol and the NFS protocol, and the file information of the file and the file to be sent to the target device through the SMB protocol and the NFS protocol, refer to the prior art. The technical means are not described in detail in the embodiments of the present invention.
可选的,本发明实施例中,请参照图5,在步骤407之后,还包括如下步骤:Optionally, in the embodiment of the present invention, referring to FIG. 5, after step 407, the following steps are further included:
步骤408:目标设备向迁移服务器发送权限迁移成功响应。Step 408: The target device sends a permission migration success response to the migration server.
步骤409:迁移服务器接收权限迁移成功响应,向目标设备发送解除权限转换锁定的指令,解除权限转换锁定的指令用于指示目标设备在接收文件的第二权限信息时,根据第二权限信息对文件的第一权限信息更新。Step 409: The migration server receives the permission migration success response, and sends an instruction for releasing the permission conversion lock to the target device, and the instruction for releasing the permission conversion lock is used to indicate that the target device receives the second permission information of the file according to the second permission information. The first permission information is updated.
迁移服务器在接收该权限迁移成功响应后,确定文件的权限迁移成功,向目标设备发送解除权限转换锁定的指令,以便在用户对目标设备中文件的第二权限信息进行更新后,目标设备能够根据更新后的第二权限信息对保存的文件的第一权限信息进行对应更新,保证目标设备中文件的第一权限信息与第二权限信息所表征的用户权限保持同步。After receiving the permission response, the migration server determines that the permission of the file is successfully migrated, and sends an instruction to release the permission conversion lock to the target device, so that after the user updates the second permission information of the file in the target device, the target device can The updated second privilege information updates the first privilege information of the saved file to ensure that the first privilege information of the file in the target device is synchronized with the user privilege represented by the second privilege information.
可选的,本发明实施例中,该锁定权限转换的指令还用于指示目标设备在接收文件的第一权限信息时,保持文件的第二权限信息不变;该解除权限转换锁定的指令还用于指示目标设备在接收文件的第一权限信息时,根据第一权限信息对文件的第二权限信息更新。Optionally, in the embodiment of the present invention, the instruction for locking the rights conversion is further used to indicate that the target device keeps the second permission information of the file when receiving the first permission information of the file; and the instruction for releasing the permission conversion lock is further And indicating, when the first device information of the file is received by the target device, updating the second rights information of the file according to the first rights information.
可选的,本发明实施例中,迁移服务器通过第一协议将第一权限信息发送给目标设备时,将文件的数据给目标设备。其中,迁移服务器可以在通过第一协议从源设备读取第一权限信息时,从源设备读取文件的数据。Optionally, in the embodiment of the present invention, when the migration server sends the first permission information to the target device by using the first protocol, the data of the file is sent to the target device. The migration server may read the data of the file from the source device when the first permission information is read from the source device by using the first protocol.
或者,迁移服务器通过第二协议将第二权限信息发送给目标设备时,将文件的数据给 目标设备。其中,迁移服务器可以在通过第二协议从源设备读取第二权限信息时,从源设备读取文件的数据。Or, when the migration server sends the second permission information to the target device by using the second protocol, the data of the file is given Target device. The migration server may read the data of the file from the source device when the second permission information is read from the source device by using the second protocol.
本实现方式能够实现同时将文件的数据以及文件的权限信息从源设备迁移至目标设备,提高文件迁移的效率。The implementation method can simultaneously implement the data of the file and the permission information of the file from the source device to the target device, thereby improving the efficiency of file migration.
可选的,本发明实施例中,请继续参照图5,迁移文件权限方法还包括如下步骤:Optionally, in the embodiment of the present invention, referring to FIG. 5, the method for migrating file permissions further includes the following steps:
步骤410:迁移服务器向源设备发送状态锁定的指令,状态锁定的指令用于指示源设备拒绝对文件、文件的第一权限信息以及文件的第二权限信息的更新操作。Step 410: The migration server sends a state lock instruction to the source device, where the state lock instruction is used to instruct the source device to reject the update operation of the file, the first permission information of the file, and the second permission information of the file.
步骤410可以在步骤401之前执行,或者,在执行步骤401,迁移服务器通过第一协议向源设备发送获取文件的第一权限的请求时,一并向源设备发送该状态锁定的指令。Step 410 may be performed before step 401. Or, in step 401, when the migration server sends a request for acquiring the first permission of the file to the source device by using the first protocol, the state lock command is sent to the source device.
本实现方式能够在迁移服务器从源设备读取文件的第一权限信息后,保持文件的数据、文件的第一权限信息以及第二权限信息不变,避免在迁移服务器将文件的数据或文件的权限信息从源设备迁移至目标设备的过程中,源设备中文件的数据或文件的权限信息发生变更所导致的迁移后源设备与目标设备中文件的数据或文件的权限信息不一致的情形。The implementation manner can prevent the data of the file, the first permission information of the file, and the second permission information from being changed after the migration server reads the first permission information of the file from the source device, thereby avoiding the data or file of the file in the migration server. When the rights information is migrated from the source device to the target device, the data of the file or the permission information of the file in the source device is changed, and the data of the file or the file information of the file in the target device is inconsistent after the migration.
可选的,本发明实施例中,结合步骤410的方案,在步骤405之后,还包括如下步骤:Optionally, in the embodiment of the present invention, in combination with the solution of step 410, after step 405, the method further includes the following steps:
步骤411:迁移服务器向源设备发送解除状态锁定的指令,解除状态锁定的指令用于指示源设备接受对文件、文件的第一权限信息以及文件的第二权限信息的更新操作。Step 411: The migration server sends an instruction to release the state lock to the source device, and the instruction for releasing the state lock is used to instruct the source device to accept the update operation of the first permission information of the file, the file, and the second permission information of the file.
需要说明的是,步骤411限定在步骤405之后执行,但不限定其于步骤405之后执行的其他步骤之间的先后顺序,如步骤411可以在步骤406之前执行,也可以在步骤409之后执行。It should be noted that step 411 is limited to be executed after step 405, but the sequence between other steps performed after step 405 is not limited. Step 411 may be performed before step 406 or after step 409.
本实现方式能够在将文件的权限信息迁移至目标设备后,解除源设备中文件以及文件的权限信息的状态锁定,使得用户能够对文件的数据或文件的权限信息进行更新操作。In this implementation manner, after the rights information of the file is migrated to the target device, the state locking of the file and the permission information of the file in the source device is released, so that the user can update the data of the file or the permission information of the file.
本发明实施例的另一可选实现方式中,在步骤401,迁移服务器通过第一协议从源设备读取文件的第一权限信息之后,用户可以对源设备中的文件进行更新操作;In another optional implementation manner of the embodiment of the present invention, after the migration server reads the first permission information of the file from the source device by using the first protocol, the user may perform an update operation on the file in the source device.
步骤405中,迁移服务器通过第二协议从源设备读取第二权限信息时,从源设备读取文件的数据;In step 405, when the migration server reads the second permission information from the source device by using the second protocol, the data of the file is read from the source device.
步骤406中,迁移服务器通过第二协议将第二权限信息发送给目标设备时,将文件的数据给目标设备;In step 406, when the migration server sends the second permission information to the target device by using the second protocol, the data of the file is sent to the target device;
目标设备在接收文件的数据之后,判断是否已保存该文件的数据,如果已保存,则舍弃接收的该文件的数据,如果未保存,则保存该文件的数据。其中,目标设备为保存接收的该文件的数据,包括两种情形:其一,目标设备中没有保存该文件;其二,虽然目标设备已保存该文件的数据,但是已保存的文件的数据与接收的文件的数据不一致。After receiving the data of the file, the target device determines whether the data of the file has been saved, and if it has been saved, discards the data of the received file, and if not, saves the data of the file. The target device is to save the received data of the file, and includes two situations: first, the file is not saved in the target device; second, although the target device has saved the data of the file, the data of the saved file is The data of the received file is inconsistent.
本实现方式中,迁移服务器能够在源设备中文件的数据被更改后,将更改后文件的数据迁移至目标设备,保证目标设备中文件的数据以及文件的权限信息与源设备中一致。In this implementation manner, the migration server can migrate the data of the changed file to the target device after the data of the file in the source device is changed, and ensure that the data of the file in the target device and the permission information of the file are consistent with the source device.
图6为本发明实施例提供的一种迁移文件权限的装置500的示意图,该装置500作为迁移服务器,用于将源设备中文件的第一权限信息以及第二权限信息迁移至目标设备。装置500包括:FIG. 6 is a schematic diagram of an apparatus 500 for migrating file rights according to an embodiment of the present invention. The apparatus 500 is used as a migration server, and is configured to migrate first rights information and second rights information of files in a source device to a target device. Apparatus 500 includes:
第一读取模块501,用于通过第一协议从源设备读取文件的第一权限信息,第一权限信息包括第一协议支持的文件权限;The first reading module 501 is configured to read the first permission information of the file from the source device by using the first protocol, where the first permission information includes file permissions supported by the first protocol;
第一发送模块502,用于通过第一协议将第一权限信息发送给目标设备; The first sending module 502 is configured to send the first rights information to the target device by using the first protocol;
第二发送模块503,用于向目标设备发送锁定权限转换的指令,锁定权限转换的指令用于指示目标设备在接收文件的第二权限信息时,保持第一权限信息不变,第二权限信息包括第二协议支持的文件权限;The second sending module 503 is configured to send an instruction for locking permission conversion to the target device, where the instruction for locking the rights conversion is used to indicate that the target device keeps the first permission information when receiving the second permission information of the file, and the second permission information Includes file permissions supported by the second protocol;
第二读取模块504,用于通过第二协议从源设备读取文件的第二权限信息;a second reading module 504, configured to read second permission information of the file from the source device by using the second protocol;
第三发送模块505,用于通过第二协议将第二权限信息发送给目标设备。The third sending module 505 is configured to send the second rights information to the target device by using the second protocol.
可选的,本发明实施例中,装置500还包括:Optionally, in the embodiment of the present invention, the apparatus 500 further includes:
第一接收模块506,用于接收目标设备发送的权限迁移成功响应;The first receiving module 506 is configured to receive a permission migration success response sent by the target device.
第四发送模块507,用于向目标设备发送解除权限转换锁定的指令,解除权限转换锁定的指令用于指示目标设备在接收文件的第二权限信息时,根据第二权限信息对文件的第一权限信息更新。The fourth sending module 507 is configured to send an instruction for releasing the rights conversion lock to the target device, where the instruction for releasing the rights conversion lock is used to indicate that the target device receives the second right information of the file, and the first file is based on the second right information. The permission information is updated.
可选的,本发明实施例中,第一发送模块502还用于:通过第一协议将文件的数据给目标设备。Optionally, in the embodiment of the present invention, the first sending module 502 is further configured to: send data of the file to the target device by using the first protocol.
可选的,本发明实施例中,装置500还包括:Optionally, in the embodiment of the present invention, the apparatus 500 further includes:
第五发送模块508,用于在第一读取模块通过第一协议从源设备读取第一权限信息时,向源设备发送状态锁定的指令,状态锁定的指令用于指示源设备拒绝对文件的数据、文件的第一权限信息以及文件的第二权限信息的更新操作。The fifth sending module 508 is configured to: when the first reading module reads the first permission information from the source device by using the first protocol, send a state locking instruction to the source device, where the state locking instruction is used to indicate that the source device rejects the file The data, the first permission information of the file, and the update operation of the second permission information of the file.
可选的,本发明实施例中,装置500还包括:Optionally, in the embodiment of the present invention, the apparatus 500 further includes:
第六发送模块509,用于在第三发送模块通过第二协议将第二权限信息发送给目标设备后,向源设备发送解除状态锁定的指令,解除状态锁定的指令用于指示源设备接受对文件、文件的第一权限信息以及文件的第二权限信息的更新操作。The sixth sending module 509 is configured to: after the third sending module sends the second right information to the target device by using the second protocol, send an instruction to cancel the state locking to the source device, where the instruction for releasing the state locking is used to indicate that the source device accepts the pair The file, the first permission information of the file, and the update operation of the second permission information of the file.
上述装置500中各模块的实现可以参照图4以及图5中由迁移服务器所执行的各步骤的实现方式。For the implementation of each module in the above device 500, reference may be made to the implementation of the steps performed by the migration server in FIGS. 4 and 5.
图7为本发明实施例提供的迁移文件权限的装置600,装置600作为目标设备,用于从迁移服务器接收从源设备迁移的文件的第一权限信息以及第二权限信息。装置600包括:FIG. 7 is a device 600 for migrating file rights according to an embodiment of the present invention. The device 600 is used as a target device, and is configured to receive first rights information and second rights information of a file migrated from a source device from a migration server. Apparatus 600 includes:
第一接收模块601,用于通过第一协议从迁移服务器接收文件的第一权限信息,第一权限信息包括第一协议支持的文件权限;The first receiving module 601 is configured to receive, by using the first protocol, the first rights information of the file from the migration server, where the first rights information includes file rights supported by the first protocol;
第二接收模块602,用于接收迁移服务器发送的锁定权限转换的指令,锁定权限转换的指令用于指示装置在接收文件的第二权限信息时,保持第一权限信息不变,第二权限信息包括第二协议支持的文件权限;The second receiving module 602 is configured to receive an instruction for the lock permission conversion sent by the migration server, where the instruction for locking the rights conversion is used to instruct the device to keep the first permission information unchanged when receiving the second permission information of the file, and the second permission information Includes file permissions supported by the second protocol;
第三接收模块603,用于通过第二协议从迁移服务器接收文件的第二权限信息;The third receiving module 603 is configured to receive second permission information of the file from the migration server by using the second protocol;
指令响应模块604,用于在第三接收模块接收第二权限信息之后,根据锁定权限转换的指令保持第一权限信息不变。The instruction response module 604 is configured to: after the third receiving module receives the second permission information, keep the first permission information unchanged according to the instruction of locking the right conversion.
可选的,本发明实施例中,装置600还包括:Optionally, in the embodiment of the present invention, the apparatus 600 further includes:
发送模块605,用于在第三接收模块接收第二权限信息后,向迁移服务器发送权限迁移成功响应;The sending module 605 is configured to send a permission migration success response to the migration server after the third receiving module receives the second permission information.
第四接收模块606,用于接收迁移服务器发送的解除权限转换锁定的指令,解除权限转换锁定的指令用于指示装置在接收文件的第二权限信息时,根据第二权限信息对文件的第一权限信息更新。The fourth receiving module 606 is configured to receive an instruction for releasing the rights conversion lock sent by the migration server, where the instruction for releasing the rights conversion lock is used to instruct the device to receive the first right information of the file according to the second rights information. The permission information is updated.
上述装置600中各模块的实现可以参照图4以及图5中由目标设备所执行的各步骤的 实现方式。The implementation of each module in the above device 600 can refer to the steps performed by the target device in FIG. 4 and FIG. Method to realize.
本发明实施例还提供一种计算机可读介质,用于存储计算机程序,该计算机程序包括用于执行图4以及图5对应的文件权限迁移方法的指令。The embodiment of the invention further provides a computer readable medium for storing a computer program, the computer program comprising instructions for executing the file permission migration method corresponding to FIG. 4 and FIG.
本领域内的技术人员应明白,本发明实施例的实施例可提供为方法、系统、或计算机程序产品。因此,本发明实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the embodiments of the invention may be provided as a method, system, or computer program product. Thus, embodiments of the invention may be in the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, embodiments of the invention may take the form of a computer program product embodied on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
本发明实施例是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序的指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序的指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。Embodiments of the invention are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowcharts and/or block diagrams, and combinations of flows and/or blocks in the flowcharts and/or <RTIgt; The instructions of these computer programs can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine such that instructions are executed by a processor of a computer or other programmable data processing device Means for implementing the functions specified in one or more flows of the flowchart or in a block or blocks of the flowchart.
显然,本领域的技术人员可以对本发明实施例进行各种改动和变型而不脱离本发明实施例的精神和范围。这样,倘若本发明实施例的这些修改和变型属于本发明实施例权利要求及其等同技术的范围之内,则本发明实施例也意图包含这些改动和变型在内。 It is apparent that those skilled in the art can make various modifications and variations to the embodiments of the invention without departing from the spirit and scope of the embodiments of the invention. Therefore, it is intended that the present invention cover the modifications and variations of the embodiments of the present invention.

Claims (15)

  1. 一种迁移文件权限的方法,其特征在于,所述方法包括:A method for migrating file permissions, the method comprising:
    迁移服务器通过第一协议从源设备读取文件的第一权限信息,第一权限信息包括所述第一协议支持的文件权限;The migration server reads the first permission information of the file from the source device by using the first protocol, where the first permission information includes file permissions supported by the first protocol;
    所述迁移服务器通过所述第一协议将所述第一权限信息发送给目标设备;Transmitting, by the migration server, the first rights information to the target device by using the first protocol;
    所述迁移服务器向所述目标设备发送锁定权限转换的指令,所述锁定权限转换的指令用于指示所述目标设备在接收所述文件的第二权限信息时,保持所述第一权限信息不变,所述第二权限信息包括第二协议支持的文件权限;The migration server sends an instruction for locking permission conversion to the target device, where the instruction for locking the rights conversion is used to indicate that the target device keeps the first permission information when receiving the second permission information of the file Changing, the second rights information includes file rights supported by the second protocol;
    所述迁移服务器通过所述第二协议从所述源设备读取所述文件的所述第二权限信息,并通过所述第二协议将所述第二权限信息发送给所述目标设备;The migration server reads the second permission information of the file from the source device by using the second protocol, and sends the second permission information to the target device by using the second protocol;
    所述目标设备在接收所述第二权限信息之后,根据所述锁定权限转换的指令保持所述第一权限信息不变。After receiving the second rights information, the target device keeps the first rights information unchanged according to the instruction of the lock rights conversion.
  2. 根据权利要求1所述的方法,其特征在于,还包括:The method of claim 1 further comprising:
    所述目标设备保存所述第二权限信息,向所述迁移服务器发送权限迁移成功响应;The target device saves the second rights information, and sends a rights migration success response to the migration server;
    所述迁移服务器接收所述权限迁移成功响应,向所述目标设备发送解除权限转换锁定的指令,所述解除权限转换锁定的指令用于指示所述目标设备在接收所述文件的所述第二权限信息时,根据所述第二权限信息对所述文件的所述第一权限信息更新。The migration server receives the permission migration success response, and sends an instruction to release the rights conversion lock to the target device, where the instruction for releasing the rights conversion lock is used to indicate that the target device is receiving the second file. And the first right authority information of the file is updated according to the second authority information.
  3. 根据权利要求1或2所述的方法,其特征在于,还包括:The method according to claim 1 or 2, further comprising:
    所述迁移服务器通过所述第一协议将所述第一权限信息发送给目标设备时,将所述文件的数据给所述目标设备。When the migration server sends the first permission information to the target device by using the first protocol, the data of the file is given to the target device.
  4. 根据权利要求3所述的方法,其特征在于,还包括:The method of claim 3, further comprising:
    所述迁移服务器通过所述第一协议从所述源设备读取所述第一权限信息时,向所述源设备发送状态锁定的指令,所述状态锁定的指令用于指示所述源设备拒绝对所述文件的数据、所述文件的所述第一权限信息以及所述文件的所述第二权限信息的更新操作。And when the migration server reads the first rights information from the source device by using the first protocol, sending, by the source device, a state lock instruction, where the state lock command is used to indicate that the source device rejects An update operation on data of the file, the first authority information of the file, and the second authority information of the file.
  5. 根据权利要求4所述的方法,其特征在于,还包括:The method of claim 4, further comprising:
    所述迁移服务器在通过所述第二协议将所述第二权限信息发送给所述目标设备后,向所述源设备发送解除状态锁定的指令,所述解除状态锁定的指令用于指示所述源设备接受对所述文件、所述文件的所述第一权限信息以及所述文件的所述第二权限信息的更新操作。After the second server transmits the second rights information to the target device by using the second protocol, the migration server sends an instruction to release the state lock to the source device, where the command to release the state lock is used to indicate the The source device accepts an update operation on the file, the first rights information of the file, and the second rights information of the file.
  6. 根据要求1至5中任一项所述的方法,其特征在于,所述第一协议为服务器信息块SMB协议、网络文件系统NFS协议中的一个,所述第二协议为另一个;在所述第一协议为SMB协议、所述第二协议为NFS协议时,所述第一权限信息为访问控制列表ACL信息,所述第二权限信息为用于权限控制的模式Mode信息;在所述第一协议为NFS协议、所述第二协议为SMB协议时,所述第一权限信息为用于权限控制的Mode信息,所述第二权限信息为ACL信息。The method according to any one of claims 1 to 5, wherein the first protocol is one of a server information block SMB protocol, a network file system NFS protocol, and the second protocol is another; When the first protocol is the SMB protocol, and the second protocol is the NFS protocol, the first rights information is access control list ACL information, and the second rights information is mode mode information used for rights control; When the first protocol is the NFS protocol and the second protocol is the SMB protocol, the first privilege information is Mode information used for privilege control, and the second privilege information is ACL information.
  7. 一种迁移文件权限的装置,其特征在于,包括:An apparatus for migrating file permissions, comprising:
    第一读取模块,用于通过第一协议从源设备读取文件的第一权限信息,第一权限信息包括所述第一协议支持的文件权限;a first reading module, configured to read first permission information of the file from the source device by using the first protocol, where the first permission information includes file permissions supported by the first protocol;
    第一发送模块,用于通过所述第一协议将所述第一权限信息发送给目标设备;a first sending module, configured to send the first right information to the target device by using the first protocol;
    第二发送模块,用于向所述目标设备发送锁定权限转换的指令,所述锁定权限转换的 指令用于指示所述目标设备在接收所述文件的第二权限信息时,保持所述第一权限信息不变,所述第二权限信息包括第二协议支持的文件权限;a second sending module, configured to send, to the target device, an instruction for locking permission conversion, where the locking authority is converted The instruction is used to indicate that the target device keeps the first rights information unchanged when receiving the second rights information of the file, where the second rights information includes file rights supported by the second protocol;
    第二读取模块,用于通过所述第二协议从所述源设备读取所述文件的所述第二权限信息;a second reading module, configured to read the second permission information of the file from the source device by using the second protocol;
    第三发送模块,用于通过所述第二协议将所述第二权限信息发送给所述目标设备。And a third sending module, configured to send the second right information to the target device by using the second protocol.
  8. 根据权利要求7所述的装置,其特征在于,还包括:The device according to claim 7, further comprising:
    第一接收模块,用于接收所述目标设备发送的权限迁移成功响应;a first receiving module, configured to receive a permission migration success response sent by the target device;
    第四发送模块,用于向所述目标设备发送解除权限转换锁定的指令,所述解除权限转换锁定的指令用于指示所述目标设备在接收所述文件的所述第二权限信息时,根据所述第二权限信息对所述文件的所述第一权限信息更新。a fourth sending module, configured to send, to the target device, an instruction to release the rights conversion lock, where the instruction for releasing the rights conversion lock is used to instruct the target device to receive the second rights information of the file according to the The second rights information is updated to the first rights information of the file.
  9. 根据权利要求7或8所述的装置,其特征在于,Device according to claim 7 or 8, characterized in that
    所述第一发送模块还用于:通过所述第一协议将所述文件的数据给所述目标设备。The first sending module is further configured to: send the data of the file to the target device by using the first protocol.
  10. 根据权利要求9所述的装置,其特征在于,还包括:The device according to claim 9, further comprising:
    第五发送模块,用于在所述第一读取模块通过所述第一协议从所述源设备读取所述第一权限信息时,向所述源设备发送状态锁定的指令,所述状态锁定的指令用于指示所述源设备拒绝对所述文件的数据、所述文件的所述第一权限信息以及所述文件的所述第二权限信息的更新操作。a fifth sending module, configured to send a state locking instruction to the source device when the first reading module reads the first permission information from the source device by using the first protocol, where the state The locked instruction is used to instruct the source device to reject an update operation on data of the file, the first permission information of the file, and the second permission information of the file.
  11. 根据权利要求10所述的装置,其特征在于,还包括:The device according to claim 10, further comprising:
    第六发送模块,用于在所述第三发送模块通过所述第二协议将所述第二权限信息发送给所述目标设备后,向所述源设备发送解除状态锁定的指令,所述解除状态锁定的指令用于指示所述源设备接受对所述文件、所述文件的所述第一权限信息以及所述文件的所述第二权限信息的更新操作。a sixth sending module, configured to send, after the third sending module sends the second right information to the target device by using the second protocol, to send an instruction to release the state locking to the source device, where the releasing The state locked instruction is used to instruct the source device to accept an update operation on the file, the first rights information of the file, and the second rights information of the file.
  12. 一种迁移文件权限的装置,其特征在于,包括:An apparatus for migrating file permissions, comprising:
    第一接收模块,用于通过第一协议从迁移服务器接收文件的第一权限信息,所述第一权限信息包括所述第一协议支持的文件权限;a first receiving module, configured to receive, by using a first protocol, first rights information of a file from a migration server, where the first rights information includes file rights supported by the first protocol;
    第二接收模块,用于接收所述迁移服务器发送的锁定权限转换的指令,所述锁定权限转换的指令用于指示所述装置在接收所述文件的第二权限信息时,保持所述第一权限信息不变,所述第二权限信息包括第二协议支持的文件权限;a second receiving module, configured to receive an instruction for locking authority conversion sent by the migration server, where the instruction for locking the rights conversion is used to indicate that the device keeps the first when receiving the second rights information of the file The permission information is unchanged, and the second permission information includes file permissions supported by the second protocol;
    第三接收模块,用于通过所述第二协议从所述迁移服务器接收所述文件的所述第二权限信息;a third receiving module, configured to receive, by using the second protocol, the second right information of the file from the migration server;
    指令响应模块,用于在所述第三接收模块接收所述第二权限信息之后,根据所述锁定权限转换的指令保持所述第一权限信息不变。The instruction response module is configured to: after the third receiving module receives the second permission information, keep the first permission information unchanged according to the instruction of the locking authority conversion.
  13. 根据权利要求12所述的装置,其特征在于,还包括:The device according to claim 12, further comprising:
    发送模块,用于在所述第三接收模块接收所述第二权限信息后,向所述迁移服务器发送权限迁移成功响应;a sending module, configured to send a rights migration success response to the migration server after the third receiving module receives the second rights information;
    第四接收模块,用于接收所述迁移服务器发送的解除权限转换锁定的指令,所述解除权限转换锁定的指令用于指示所述装置在接收所述文件的所述第二权限信息时,根据所述第二权限信息对所述文件的所述第一权限信息更新。a fourth receiving module, configured to receive an instruction for releasing the rights conversion lock sent by the migration server, where the instruction for releasing the rights conversion lock is used to instruct the device to receive the second rights information of the file according to the The second rights information is updated to the first rights information of the file.
  14. 一种迁移文件权限的系统,其特征在于,包括迁移服务器、源设备以及目标设备; A system for migrating file permissions, comprising: a migration server, a source device, and a target device;
    其中,所述源设备用于存储文件的第一权限信息以及文件的第二权限信息,所述第一权限信息包括第一协议支持的文件权限,所述第二权限信息包括第二协议支持的文件权限;The source device is configured to store first rights information of the file and second rights information of the file, where the first rights information includes file rights supported by the first protocol, and the second rights information includes file permission;
    所述迁移服务器用于:通过所述第一协议从源设备读取文件的第一权限信息,以及通过所述第一协议将所述第一权限信息发送给目标设备;The migration server is configured to: read the first permission information of the file from the source device by using the first protocol, and send the first permission information to the target device by using the first protocol;
    所述目标设备用于:通过所述第一协议接收所述迁移服务器发送的所述第一权限信息,并保存所述第一权限信息;The target device is configured to: receive, by using the first protocol, the first rights information sent by the migration server, and save the first rights information;
    所述迁移服务器还用于:向所述目标设备发送锁定权限转换的指令,所述锁定权限转换的指令用于指示所述目标设备在接收所述文件的第二权限信息时,保持所述第一权限信息不变;The migration server is further configured to: send an instruction for locking permission conversion to the target device, where the instruction for locking the permission conversion is used to indicate that the target device maintains the first information when receiving the second permission information of the file A permission information is unchanged;
    所述目标设备还用于:接收所述锁定权限转换的指令;The target device is further configured to: receive the instruction for locking the right conversion;
    所述迁移服务器还用于:通过所述第二协议从所述源设备读取所述文件的所述第二权限信息,并通过所述第二协议将所述第二权限信息发送给所述目标设备;The migration server is further configured to: read, by the second protocol, the second rights information of the file from the source device, and send the second rights information to the Target device
    所述目标设备还用于:接收所述第二权限信息,并根据所述锁定权限转换的指令保持所述第一权限信息不变。The target device is further configured to: receive the second permission information, and keep the first permission information unchanged according to the instruction for locking the right conversion.
  15. 根据权利要求14所述的系统,其特征在于,还包括:The system of claim 14 further comprising:
    所述目标设备还用于:保存所述第二权限信息,并向所述迁移服务器发送权限迁移成功响应;The target device is further configured to: save the second rights information, and send a rights migration success response to the migration server;
    所述迁移服务器还用于:接收所述权限迁移成功响应,向所述目标设备发送解除权限转换锁定的指令,所述解除权限转换锁定的指令用于指示所述目标设备在接收所述文件的所述第二权限信息时,根据所述第二权限信息对所述文件的所述第一权限信息更新。 The migration server is further configured to: receive the permission migration success response, and send an instruction for releasing the rights conversion lock to the target device, where the instruction for releasing the rights conversion lock is used to indicate that the target device is receiving the file. And the second rights information is updated according to the second rights information to the first rights information of the file.
PCT/CN2017/081337 2016-11-25 2017-04-21 Method, apparatus and system for migrating file permission WO2018094962A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201611055336.3A CN106649600B (en) 2016-11-25 2016-11-25 A kind of method, apparatus and system of migrated file permission
CN201611055336.3 2016-11-25

Publications (1)

Publication Number Publication Date
WO2018094962A1 true WO2018094962A1 (en) 2018-05-31

Family

ID=58812082

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/081337 WO2018094962A1 (en) 2016-11-25 2017-04-21 Method, apparatus and system for migrating file permission

Country Status (2)

Country Link
CN (1) CN106649600B (en)
WO (1) WO2018094962A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10997132B2 (en) 2017-02-07 2021-05-04 Oracle International Corporation Systems and methods for live data migration with automatic redirection
CN110086836B (en) * 2018-01-25 2020-12-15 华为技术有限公司 Method and device for acquiring metadata
CN108446337B (en) * 2018-02-28 2019-09-13 新华三云计算技术有限公司 A kind of lock resources control permission moving method and device
CN109446825B (en) * 2018-10-22 2021-08-31 郑州云海信息技术有限公司 Method and device for expanding access control authority
CN110941599A (en) * 2019-11-12 2020-03-31 浪潮电子信息产业股份有限公司 Authority control method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090174891A1 (en) * 2008-01-09 2009-07-09 Fuji Xerox Co., Ltd. Right information managing device, information processing system, and computer readable medium
CN102170440A (en) * 2011-03-24 2011-08-31 北京大学 Method suitable for safely migrating data between storage clouds
CN102696040A (en) * 2010-03-29 2012-09-26 雅马哈株式会社 Relay device and file sharing method
US20130290248A1 (en) * 2012-04-25 2013-10-31 Hitachi, Ltd. File storage system and file cloning method
CN105843554A (en) * 2016-03-11 2016-08-10 中国联合网络通信集团有限公司 Object storage-based method for data migration and system thereof

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101626378B (en) * 2009-08-14 2012-10-17 成都市华为赛门铁克科技有限公司 Method, device and system for managing authority information
CN102281141B (en) * 2011-07-26 2013-11-06 华为数字技术(成都)有限公司 Document permission management method, apparatus and system
CN102369713B (en) * 2011-08-29 2014-04-02 华为技术有限公司 Automatic removing method and device of system configuration items
CN103037008B (en) * 2012-12-24 2016-03-30 珠海金山办公软件有限公司 A kind of right management method of Synchronization Network dish and system
US9336406B2 (en) * 2013-11-14 2016-05-10 Futurewei Technologies, Inc. Multiprotocol access control list with guaranteed protocol compliance

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090174891A1 (en) * 2008-01-09 2009-07-09 Fuji Xerox Co., Ltd. Right information managing device, information processing system, and computer readable medium
CN102696040A (en) * 2010-03-29 2012-09-26 雅马哈株式会社 Relay device and file sharing method
CN102170440A (en) * 2011-03-24 2011-08-31 北京大学 Method suitable for safely migrating data between storage clouds
US20130290248A1 (en) * 2012-04-25 2013-10-31 Hitachi, Ltd. File storage system and file cloning method
CN105843554A (en) * 2016-03-11 2016-08-10 中国联合网络通信集团有限公司 Object storage-based method for data migration and system thereof

Also Published As

Publication number Publication date
CN106649600A (en) 2017-05-10
CN106649600B (en) 2019-07-09

Similar Documents

Publication Publication Date Title
WO2018094962A1 (en) Method, apparatus and system for migrating file permission
US10158582B2 (en) Device-to-device communication for resource sharing
CN108628658B (en) License management method and device for container
US11799644B2 (en) Default password removal
US9916205B2 (en) Secure live virtual machine guest based snapshot recovery
EP3146438B1 (en) Securing a directed acyclic graph
US20230221997A1 (en) System and method for subscription management using composed systems
US20230221784A1 (en) System and method for power state enforced subscription management
US11785082B2 (en) Domain replication across regions
US10404702B1 (en) System and method for tenant network identity-based authentication and authorization for administrative access in a protection storage system
US9607176B2 (en) Secure copy and paste of mobile app data
EP3697053B1 (en) Accessing encrypted user data at a multi-tenant hosted cloud service
US9948632B2 (en) Sharing data between sandboxed applications with certificates
US11630809B2 (en) Method and system for using micro objects
WO2017028517A1 (en) Method for managing data file in cloud, cloud management point, and system
US20240095338A1 (en) Isolated runtime environments for securing secrets used to access remote resources from compute instances
CN110770731B (en) Authorization system
US20240126845A1 (en) Automatic provisioning and onboarding of offline or disconnected machines
US11849037B1 (en) Cross-region replication of secrets
TW201814577A (en) Method and system for preventing malicious alteration of data in computer system
US20160036802A1 (en) Placing a user account in escrow
WO2017181521A1 (en) Method, device and system for acquiring information of cellular internet of things terminal
CN116701007A (en) Data processing method, direct memory access engine and computing device
WO2016188324A1 (en) Method for acquiring machine type communication device information, and device, system, storing medium thereof

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17873552

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17873552

Country of ref document: EP

Kind code of ref document: A1