Permission migration method and device, storage medium and computer program product

By generating permission inheritance trees and dynamically adjusting processing strategies based on event flag bits, the problems of high resource consumption and low efficiency in the existing technology are solved, and efficient permission migration and system performance improvement are achieved.

CN120354446APending Publication Date: 2025-07-22SHENZHEN JIUNIU YIMAO INTELLIGENT IOT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510411763.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-02
Publication Date
2025-07-22

AI Technical Summary

Technical Problem

With the rapid growth of enterprise data volume in the prior art, the permission migration scheme of the SMB/CIFS protocol has led to a large amount of redundant calculations and resource consumption, and lacks a dynamic processing mechanism, so it is unable to respond to permission changes efficiently.

Method used

By generating a permission inheritance tree, selecting the highest priority permission inheritance tree, scanning based on the event flag selection processing method, combining jump scan, full scan and tree split operations, dynamically adjusting the processing strategy to reduce the demand for system resources.

Benefits of technology

On the basis of reducing resource consumption, the permission migration efficiency is improved, and processing strategies can be dynamically adjusted to adapt to changes in directories or files, and overall system performance is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120354446A_ABST
    Figure CN120354446A_ABST
Patent Text Reader

Abstract

The invention discloses a permission migration method and device, a storage medium and a computer program product, and relates to the technical field of file management, and the method comprises the following steps: obtaining permission inheritance identifiers of one or more to-be-migrated objects; according to the permission inheritance identifier of each to-be-migrated object, obtaining one or more permission inheritance trees, and taking the to-be-migrated object of which the permission inheritance identifier is that the permission part is inherited to a father node or the permission is not inherited to the father node as a root node of the permission inheritance tree, the to-be-migrated object with the permission inheritance identification as complete inheritance of the permission to the father node is an internal node of the corresponding permission inheritance tree; and selecting the highest priority permission inheritance tree from the permission inheritance trees, and based on the event flag bit of the highest priority permission inheritance tree, selecting a corresponding processing mode to scan the node permission of the highest priority permission inheritance tree to obtain permission migration data. By designing a permission inheritance tree, the requirement for system resources is reduced, and the permission migration efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of file management, and particularly to a permission migration method, apparatus, storage medium, and computer program product. Background Art

[0002] The SMB (Server Message Block) and CIFS (Common Internet File System) protocols provide cross-platform file sharing and efficient permission management functions for users, support multi-user access, allow permission configuration for files or directories, and permission inheritance. The mainstream permission migration solutions based on the SMB / CIFS protocol usually adopt the method of full-scale permission scanning and static processing. Whether the permissions of files or directories are set independently or inherited, each node will be scanned and saved completely. However, with the rapid growth of enterprise data volume and the multiplication of file numbers, full-scale scanning will lead to a large amount of redundant calculation, too low permission migration efficiency, and consume a large amount of storage and computing resources; moreover, the method of full-scale permission scanning and static processing lacks a dynamic processing mechanism, cannot flexibly adjust the scanning strategy according to the change of permissions, and cannot respond to the change of file permissions, thus exacerbating the consumption of computing and storage resources.

[0003] Therefore, how to improve the permission migration efficiency and dynamically adjust the permission migration process on the basis of reducing resource consumption has become an urgent problem to be solved in this application.

[0004] The above content is only used to assist in understanding the technical solution of this application, and does not represent an admission that the above content is prior art. Summary of the Invention

[0005] The main purpose of this application is to provide a permission migration method, apparatus, storage medium, and computer program product, aiming to solve the technical problem of improving the permission migration efficiency and dynamically adjusting the permission migration process on the basis of low resource consumption.

[0006] To achieve the above purpose, this application proposes a permission migration method, and the method includes:

[0007] Obtain the permission inheritance identifiers of one or more objects to be migrated, where the one or more objects to be migrated are directories or files to be migrated on the source device, and the permission inheritance identifier of the object to be migrated is that the permission is fully inherited from the parent node, partially inherited from the parent node, or not inherited from the parent node;

[0008] Obtain one or more permission inheritance trees according to the permission inheritance identifiers of the objects to be migrated, where the objects to be migrated with the permission inheritance identifier indicating that the permission is partially inherited from the parent node or the permission is not inherited from the parent node are used as the root nodes of the permission inheritance trees, and the objects to be migrated with the permission inheritance identifier indicating that the permission is completely inherited from the parent node are used as the internal nodes corresponding to the permission inheritance trees;

[0009] Select the highest-priority permission inheritance tree from the permission inheritance trees, and scan the node permissions of the highest-priority permission inheritance tree based on the event flag bit of the highest-priority permission inheritance tree to obtain permission migration data;

[0010] Migrate the permission migration data to the target device and update the permissions of the target device.

[0011] In one embodiment, after the step of obtaining one or more permission inheritance trees according to the permission inheritance identifiers of the objects to be migrated, the following steps are further included:

[0012] Set a default event flag bit for each of the permission inheritance trees;

[0013] When a preset event flag bit change condition is triggered, reset the event flag bit.

[0014] In one embodiment, the step of selecting the highest-priority permission inheritance tree from the permission inheritance trees, and scanning the node permissions of the highest-priority permission inheritance tree based on the event flag bit of the highest-priority permission inheritance tree to obtain permission migration data includes:

[0015] Set migration weight influence factors in multiple dimensions, and calculate the migration weight of each permission inheritance tree according to the migration weight influence factors;

[0016] Construct a priority queue based on the migration weights of the permission inheritance trees;

[0017] When the priority queue is not empty, select the highest-priority permission inheritance tree from the priority queue;

[0018] Scan the node permissions of the highest-priority permission inheritance tree based on the event flag bit of the highest-priority permission inheritance tree to obtain the permission migration data.

[0019] In one embodiment, after the step of constructing a priority queue based on the migration weights of the permission inheritance trees, the following steps are further included:

[0020] Detect the change instruction of the object to be migrated input by the operator, where the object to be migrated is changed to the change of the name of the object to be migrated, the change of the permission inheritance of the object to be migrated, the addition of the object to be migrated, or the deletion of the object to be migrated;

[0021] Find the corresponding permission inheritance tree in the priority queue according to the change instruction of the object to be migrated;

[0022] If the change instruction of the object to be migrated is the change of the name of the object to be migrated, the addition of the object to be migrated, or the deletion of the object to be migrated, perform addition, deletion, or change operations on the nodes of the corresponding permission inheritance tree and update the priority queue;

[0023] If the change instruction of the object to be migrated is the change of the permission inheritance of the object to be migrated, reset the event flag bit of the corresponding permission inheritance tree.

[0024] In one embodiment, the step of scanning the node permissions of the highest-priority permission inheritance tree to obtain the permission migration data by selecting the corresponding processing method based on the event flag bit of the highest-priority permission inheritance tree includes:

[0025] Determine the status of the event flag bit of the highest-priority permission inheritance tree, where the status of the event flag bit includes the default status, the root node permission change status, the internal node permission change status, and the root node and internal node permission change status;

[0026] When the status of the event flag bit of the highest-priority permission inheritance tree is the default status or the root node permission change status, skip the internal nodes of the highest-priority permission inheritance tree by using the jump scanning method and scan the root node of the highest-priority permission inheritance tree to obtain the permission migration data;

[0027] When the status of the event flag bit of the highest-priority permission inheritance tree is the internal node permission change status, decompose the highest-priority permission inheritance tree by using the tree splitting operation method to obtain the permission migration data;

[0028] When the status of the event flag bit of the highest-priority permission inheritance tree is the root node and internal node permission change status, scan the node permissions of the highest-priority permission inheritance tree by using the full-scale scanning method to obtain the permission migration data.

[0029] In one embodiment, the step of decomposing the highest-priority permission inheritance tree by using the tree splitting operation method to obtain the permission migration data includes:

[0030] Obtain the permission inheritance identifiers of each node of the highest-priority permission inheritance tree, where the permission inheritance identifiers of each node of the highest-priority permission inheritance tree are that the permission is fully inherited from the parent node, the permission is partially inherited from the parent node, or the permission is not inherited from the parent node;

[0031] Based on the permission inheritance identifiers of each node of the highest-priority permission inheritance tree, perform a secondary tree decomposition on the highest-priority permission inheritance tree using a tree splitting operation method, where the nodes in the highest-priority permission inheritance tree with the permission inheritance identifier being that the permission is partially inherited from the parent node or the permission is not inherited from the parent node are used as the root nodes of the sub-permission inheritance trees, and the nodes in the highest-priority permission inheritance tree with the permission inheritance identifier being that the permission is fully inherited from the parent node are used as the internal nodes of the corresponding sub-permission inheritance trees;

[0032] If the secondary tree decomposition operation is successful, set the event flag bits of the multiple sub-permission inheritance trees obtained from the secondary tree decomposition operation to the default state;

[0033] Recalculate the migration weights of the sub-permission inheritance trees, and re-add the sub-permission inheritance trees to the priority queue, and return to execute the step: when the priority queue is not empty, select the highest-priority permission inheritance tree from the priority queue;

[0034] If the secondary tree decomposition operation fails, skip the internal nodes of the highest-priority permission inheritance tree using the jump scanning method, and scan the root nodes of the highest-priority permission inheritance tree to obtain the permission migration data.

[0035] In an embodiment, after the step of selecting the highest-priority permission inheritance tree from the permission inheritance tree, and scanning the node permissions of the highest-priority permission inheritance tree to obtain the permission migration data based on the event flag bit of the highest-priority permission inheritance tree, the following steps are further included:

[0036] Delete the highest-priority permission inheritance tree from the priority queue, and determine whether the priority queue after the deletion operation is empty;

[0037] If the priority queue after the deletion operation is empty, terminate the execution;

[0038] If the priority queue after the deletion operation is not empty, return to execute the step: select the highest-priority permission inheritance tree from the permission inheritance tree.

[0039] In addition, to achieve the above object, the present application also proposes a permission migration device, and the permission migration device includes:

[0040] A permission inheritance tree generation module is used to obtain the permission inheritance identifiers of one or more objects to be migrated. The one or more objects to be migrated are directories or files to be migrated on a source device. The permission inheritance identifier of the object to be migrated is that the permission is fully inherited from the parent node, partially inherited from the parent node, or not inherited from the parent node. According to the permission inheritance identifiers of the objects to be migrated, one or more permission inheritance trees are obtained. Among them, the object to be migrated with the permission inheritance identifier of the permission being partially inherited from the parent node or not inherited from the parent node is used as the root node of the permission inheritance tree, and the object to be migrated with the permission inheritance identifier of the permission being fully inherited from the parent node is used as the internal node corresponding to the permission inheritance tree;

[0041] A permission scanning module is used to select the highest-priority permission inheritance tree from the permission inheritance trees, and based on the event flag bit of the highest-priority permission inheritance tree, select the corresponding processing method to scan the node permissions of the highest-priority permission inheritance tree to obtain permission migration data;

[0042] A permission migration module is used to migrate the permission migration data to a target device and update the permissions of the target device.

[0043] In addition, to achieve the above object, the present application also proposes a storage medium. The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the permission migration method described above are implemented.

[0044] In addition, to achieve the above object, the present application also provides a computer program product. The computer program product includes a computer program. When the computer program is executed by a processor, the steps of the permission migration method described above are implemented.

[0045] One or more technical solutions proposed by the present application have at least the following technical effects:

[0046] Obtain the permission inheritance identifiers of one or more objects to be migrated. The one or more objects to be migrated are directories or files to be migrated on the source device. The permission inheritance identifiers of the objects to be migrated include that the permissions are fully inherited from the parent node, partially inherited from the parent node, and not inherited from the parent node. According to the permission inheritance identifiers of each object to be migrated, obtain one or more permission inheritance trees. Among them, the objects to be migrated with permission inheritance identifiers of partially inherited from the parent node or not inherited from the parent node are used as the root nodes of the permission inheritance trees, and the objects to be migrated with permission inheritance identifiers of fully inherited from the parent node are used as the internal nodes of the corresponding permission inheritance trees. Select the highest-priority permission inheritance tree from the obtained one or more permission inheritance trees, and select the corresponding processing method according to the event flag bit of the highest-priority permission inheritance tree to scan the node permissions of the highest-priority permission inheritance tree to obtain permission migration data. By generating multiple permission inheritance trees for the directories or files to be migrated on the source device, according to the priority order, select corresponding processing methods such as skip scanning permissions, full scanning permissions, and secondary decomposition of the permission inheritance tree according to the event flag bit of each permission inheritance tree to scan the node permissions of the permission inheritance tree, reduce the processing of the internal nodes of the permission inheritance tree, reduce the demand for system resources, and improve the overall system performance in an environment with limited resources. At the same time, by modifying the data structure of the permission inheritance tree and selecting the corresponding processing method in combination with the event flag bit of the permission inheritance tree, the processing strategy can be dynamically adjusted to adapt to the changes of directories or files and the changes of directory or file permissions, further improving the migration efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] The accompanying drawings herein are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present application and, together with the specification, are used to explain the principles of the present application.

[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0049] Figure 1 It is a schematic flowchart of the first embodiment provided for the permission migration method of the present application;

[0050] Figure 2 It is an example diagram of the tree structure of the source device directory and files provided by the present application;

[0051] Figure 3 It is a schematic diagram of the permission inheritance tree structure;

[0052] Figure 4Schematic flowchart of the second embodiment provided for the permission migration method of this application;

[0053] Figure 5 Schematic flowchart of the third embodiment provided for the permission migration method of this application;

[0054] Figure 6 Schematic flowchart of the fourth embodiment provided for the permission migration method of this application;

[0055] Figure 7 Schematic flowchart of the sixth embodiment provided for the permission migration method of this application document;

[0056] Figure 8 Overall flowchart of the permission migration method of this application;

[0057] Figure 9 Schematic diagram of the module structure of the permission migration device in the embodiment of this application;

[0058] Figure 10 Schematic diagram of the device structure of the hardware operating environment involved in the permission migration method in the embodiment of this application.

[0059] The implementation, functional features, and advantages of this application will be further described in combination with the embodiments with reference to the accompanying drawings. Detailed implementation manners

[0060] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of this application and are not used to limit this application.

[0061] To better understand the technical solutions of this application, the following will be described in detail in combination with the accompanying drawings of the specification and specific implementation manners.

[0062] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication, and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device, a permission migration device, etc. that can implement the above functions. The following takes the permission migration device as an example to illustrate this embodiment and the following embodiments.

[0063] Based on this, the embodiment of this application provides a permission migration method, referring to Figure 1 , Figure 1 Schematic flowchart of the first embodiment of the permission migration method of this application.

[0064] In this embodiment, the permission migration method includes steps S10 to S40:

[0065] Step S10: Obtain the permission inheritance identifiers of one or more objects to be migrated. The one or more objects to be migrated are directories or files on the source device that are to be migrated. The permission inheritance identifier of the object to be migrated indicates that the permissions are fully inherited from the parent node, partially inherited from the parent node, or not inherited from the parent node.

[0066] An object to be migrated refers to a directory or file on the source device that is planned to be migrated to the target device. The permission inheritance identifier is used to describe how the permission settings of the object to be migrated are associated with its parent node. The types of permission inheritance identifiers include: Permissions fully inherited from the parent node: The permission settings of the object to be migrated completely follow the permission settings of its parent node. Permissions partially inherited from the parent node: Some of the permission settings of the object to be migrated are inherited from the parent node, while the other part of the permission settings are independently set. This means that some permissions may change with the change of the parent node, while other permissions remain unchanged. Permissions not inherited from the parent node: The permission settings of the object to be migrated are completely independent of its parent node.

[0067] Specifically, the permission migration device traverses with the top-level directory of the source device as the root, obtains the permission inheritance identifiers of one or more objects to be migrated. Exemplarily, record the permission inheritance identifier of each object to be migrated in the form of a list or a database for reference during the migration process.

[0068] Step S20: Obtain one or more permission inheritance trees according to the permission inheritance identifiers of each object to be migrated. Among them, use the object to be migrated whose permission inheritance identifier is that the permissions are partially inherited from the parent node or not inherited from the parent node as the root node of the permission inheritance tree, and use the object to be migrated whose permission inheritance identifier is that the permissions are fully inherited from the parent node as the internal node corresponding to the permission inheritance tree.

[0069] A permission inheritance tree is a data structure used to represent the permission inheritance relationship of files and directories. In this tree structure, the root node represents a directory with independent permission settings, while the internal nodes (child nodes or leaf nodes) represent files or directories whose permissions are inherited from the parent node.

[0070] The permission migration device traverses with the top-level directory of the source device as the root to generate n permission inheritance trees. The generation rule of the permission inheritance tree is: Use the object to be migrated whose permission inheritance identifier is that the permissions are partially inherited from the parent node or not inherited from the parent node as the root node of the permission inheritance tree, and use the object to be migrated whose permission inheritance identifier is that the permissions are fully inherited from the parent node as the internal node corresponding to the permission inheritance tree.

[0071] Exemplarily, as Figure 2 shown, Figure 2This is an example diagram of the source device directory and file tree structure provided by this application. There are directories or files A, B, C, D, E, F, G, H, I, and J on the source device. Among them, A is the top-level directory, B, C, and D are subdirectories of the top-level directory A, E, F, and G are files in subdirectory B, H and I are files in subdirectory C, and J is a file in subdirectory D.

[0072] Among them, the permission of directory A is "fully non-inherited permission" (the permission inheritance flag indicates that the permission is not inherited from the parent node), and the permission of directory B is "fully non-inherited permission" (the permission inheritance flag indicates that the permission is not inherited from the parent node). The permissions of files E, F, and G are "fully inherited permissions" (the permission inheritance flag indicates that the permission is fully inherited from the parent node), the permission of directory C is "fully non-inherited permission" (the permission inheritance flag indicates that the permission is not inherited from the parent node), the permissions of files H and I are "fully inherited permissions" (the permission inheritance flag indicates that the permission is fully inherited from the parent node), the permission of directory D is "combined permission of full inheritance and non-inheritance" (the permission inheritance flag indicates that the permission is partially inherited from the parent node), and the permission of file J is "fully inherited permission" (the permission inheritance flag indicates that the permission is fully inherited from the parent node).

[0073] The permission migration device, based on the permission inheritance flag of the object to be migrated as described above, uses the object to be migrated with the permission inheritance flag indicating that the permission is partially inherited from the parent node or the permission is not inherited from the parent node as the root node of the permission inheritance tree, and uses the object to be migrated with the permission inheritance flag indicating that the permission is fully inherited from the parent node as the internal node corresponding to the permission inheritance tree, and generates Figure 3 the 4 permission inheritance trees as shown in Figure 3 which is a schematic diagram of the permission inheritance tree structure diagram.

[0074] Step S30: Select the highest-priority permission inheritance tree from the permission inheritance trees, and based on the event flag bit of the highest-priority permission inheritance tree, select the corresponding processing method to scan the node permissions of the highest-priority permission inheritance tree to obtain permission migration data;

[0075] The file permission migration device selects the highest-priority permission inheritance tree from the obtained multiple permission inheritance trees and checks the event flag bit of this highest-priority permission inheritance tree. According to the status of the event flag bit, it selects the corresponding processing method for permission scanning. The processing methods include skip scanning, full-scale scanning, incremental scanning, tree splitting operations, etc. After the scanning is completed, the file permission migration device will generate a scan data set containing the permission information that needs to be migrated for this permission inheritance tree, that is, the permission migration data.

[0076] Step S40: Migrate the permission migration data to the target device and update the permissions of the target device.

[0077] Migrate the permission migration data to the target device. The migration process involves operations such as data transmission, decoding, and storage. Once the permission migration data is successfully migrated to the target device, the permission migration device will use the scanned data to update the permission settings on the target device, thus ensuring the consistency of permissions between the target device and the source device.

[0078] Exemplarily, permission migration can be performed by setting a migration threshold or directly adopting the method of migrating scanned data. Specifically, set a migration threshold. This threshold can be permission data that has accumulated to a specific number of bytes, or other metrics related to data migration. During the migration process, continuously monitor the changes in the data. When the accumulated data volume reaches or exceeds the set threshold, trigger the migration operation.

[0079] When directly migrating the permission migration data to the target device, it is necessary to preprocess the obtained data after scanning to ensure its suitability for migration. According to the characteristics of the data and the migration requirements, formulate a suitable migration strategy. The migration strategy includes selecting the migration method (such as online migration, offline migration), migration time, migration order, etc. According to the migration strategy, migrate the prepared data from the source device to the target device.

[0080] This embodiment provides a permission migration method, which obtains the permission inheritance identifiers of one or more objects to be migrated. The one or more objects to be migrated are directories or files to be migrated on a source device. The permission inheritance identifiers of the objects to be migrated include one or more of completely inheriting permissions from the parent node, partially inheriting permissions from the parent node, and not inheriting permissions from the parent node. According to the permission inheritance identifiers of each object to be migrated, one or more permission inheritance trees are obtained. Among them, the objects to be migrated with the permission inheritance identifier of partially inheriting permissions from the parent node or not inheriting permissions from the parent node are used as the root nodes of the permission inheritance trees, and the objects to be migrated with the permission inheritance identifier of completely inheriting permissions from the parent node are used as the internal nodes of the corresponding permission inheritance trees. The highest-priority permission inheritance tree is selected from the one or more obtained permission inheritance trees, and the node permissions of the highest-priority permission inheritance tree are scanned according to the corresponding processing method selected based on the event flag bit of the highest-priority permission inheritance tree to obtain permission migration data. By generating multiple permission inheritance trees for the directories or files to be migrated on the source device, and according to the priority order, selecting corresponding processing methods such as jump scanning permissions, full-scale scanning permissions, and secondary decomposition of the permission inheritance tree to scan the node permissions of the permission inheritance tree based on the event flag bit of each permission inheritance tree, the processing of the internal nodes of the permission inheritance tree is reduced, the demand for system resources is reduced, and the overall system performance is improved in an environment with tight resources. At the same time, by modifying the data structure of the permission inheritance tree and selecting the corresponding processing method in combination with the event flag bit of the permission inheritance tree, the processing strategy can be dynamically adjusted to adapt to changes in directories or files and changes in directory or file permissions, further improving the migration efficiency.

[0081] Based on the first embodiment of this application, the second embodiment of this application is proposed. In the second embodiment of this application, refer to Figure 4 , Figure 4 which is the schematic flowchart of the second embodiment provided for the permission migration method of this application.

[0082] In this embodiment, after step S20, steps S231 to S232 are further included:

[0083] Step S231, set a default event flag bit for each of the permission inheritance trees;

[0084] The event flag bit is used to track or mark the change status related to the permissions of the permission inheritance tree. Setting a default event flag bit for each permission inheritance tree, for example, the default event flag bit can be represented by 0x00. By setting the default event flag bit for each permission inheritance tree, the file permission migration device can start tracking the specific event status of each permission inheritance tree.

[0085] Step S232, when the preset event flag bit change condition is triggered, reset the event flag bit.

[0086] The preset event flag change conditions include, but are not limited to: cases where the root node permissions of the permission inheritance tree change, and the internal node permissions of the permission inheritance tree change, caused by, for example, the system operator manually triggering changes such as the name change of the object to be migrated, the change of permission inheritance of the object to be migrated, the addition of the object to be migrated, and the deletion operation of the object to be migrated.

[0087] When the preset event flag change condition is triggered, reset the event flag. Exemplarily, if the permissions of the root node of the permission inheritance tree change, the event flag will be reset (for example, reset it to 0x01). If the permissions of the internal nodes of the permission inheritance tree change, the event flag will be reset (for example, reset it to 0x02). If the permissions of both the root node and the internal nodes of the permission inheritance tree change, the event flag will be reset (for example, reset it to 0x03).

[0088] In this embodiment, a default event flag is set for each permission inheritance tree. When the preset event flag change condition is triggered, the event flag is reset, effectively identifying which permission inheritance trees have changed during the migration process, reducing unnecessary scanning and processing operations, and improving the migration efficiency. By setting the event flag and allowing it to be reset according to the change conditions, the migration process can dynamically adapt to changes in directories or files on the source device. This flexibility enables the system to remain efficient and stable in the face of a frequently changing environment, enhancing the overall performance and adaptability.

[0089] Based on the first embodiment and / or the second embodiment of the present application, the third embodiment of the present application is proposed. In the third embodiment of the present application, refer to Figure 5 , Figure 5 which is the schematic flowchart of the third embodiment provided for the permission migration method of the present application. In this embodiment, step S30 may include steps S31 to S34:

[0090] Step S31, set the migration weight influencing factors in multiple dimensions, and calculate the migration weight of each permission inheritance tree according to the migration weight influencing factors;

[0091] The migration weight influencing factor refers to various factors and dimensions considered when calculating the migration weight of each permission inheritance tree. These factors and dimensions are used to evaluate the importance and priority of the permission inheritance tree during the migration process.

[0092] Exemplarily, the migration weight influencing factors can be set from the following perspectives:

[0093] Total number of nodes: The number of nodes in the permission inheritance tree is an important consideration. The more the total number of nodes, the greater the amount of data to be processed, so a higher migration priority may be required.

[0094] Level depth: The level depth of the permission inheritance tree reflects the complexity of the directory structure. The deeper the level, the more time-consuming it may be to process, so its migration priority also needs to be considered.

[0095] Historical change frequency of the event flag bit in the previous migration cycle: To more accurately evaluate the priority of the permission inheritance tree during migration, query and record the historical change frequency of the event flag bit for each permission inheritance tree in the previous migration cycle. The historical change frequency of the dynamically changing flag bit reflects the frequency of permission changes for this permission inheritance tree over a period of time.

[0096] Comprehensively considering migration weight influencing factors such as historical change frequency, level depth, and total number of nodes, calculate the migration weight of each permission inheritance tree. This migration weight reflects the importance and urgency of the subtree during migration and is the basis for constructing the priority queue.

[0097] Step S32, construct a priority queue based on the migration weight of the permission inheritance tree;

[0098] The permission migration device sorts the obtained n permission inheritance trees according to the migration weight of each permission inheritance tree to form a priority queue.

[0099] In the first feasible implementation, a heap structure can be used to construct the migration priority queue. Specifically: Sort the permission inheritance trees according to the migration weight of each permission inheritance tree. Use a heap structure (such as a max heap or a min heap) to store these sorted permission inheritance trees. The heap structure can efficiently support operations such as insertion, deletion, and finding the maximum (or minimum) element, and is suitable for implementing a priority queue.

[0100] In the second feasible implementation, a priority queue can be used to construct the migration priority queue. Specifically: Use the priority queue data structure to store these permission inheritance trees with configured migration weights. The priority queue can sort elements according to their priorities and allows efficient insertion, deletion, and access to the highest (or lowest) priority elements. Sort each permission inheritance tree according to its migration weight and insert the sorted permission inheritance trees into the priority queue in sequence. The permission inheritance tree with the highest migration weight will be placed at the head of the priority queue, that is, it has the highest priority.

[0101] Step S33, when the priority queue is not empty, select the permission inheritance tree with the highest priority from the priority queue;

[0102] The permission migration device first needs to check whether the priority queue is empty. If the queue is empty, subsequent selection operations cannot be performed. Due to the characteristics of the priority queue, the element at the head of the queue is always the element with the highest priority. Therefore, when the priority queue is not empty, the head of the queue is first accessed and returned as the highest priority permission inheritance tree.

[0103] Step S34, based on the event flag of the highest priority permission inheritance tree, select the corresponding processing method to scan the node permissions of the highest priority permission inheritance tree to obtain the permission migration data.

[0104] The permission migration device selects the corresponding processing method according to the status of the event flag for permission scanning. The processing methods include skip scanning, full-scale scanning, incremental scanning, tree splitting operations, etc. After the scanning is completed, the permission migration device generates a scan data set containing the permission information that needs to be migrated for this permission inheritance tree, that is, the permission migration data.

[0105] In this embodiment, the migration weight influence factor is set in multiple dimensions, and the migration weight of each permission inheritance tree is calculated according to the migration weight influence factor to accurately evaluate the importance and urgency of each permission inheritance tree during the migration process; a priority queue is constructed to ensure that the permission inheritance trees with high weights and great importance are processed first, thus effectively reducing unnecessary scanning and processing operations and reducing the consumption of computing resources, storage resources, and network resources; when the priority queue is not empty, the highest priority permission inheritance tree is selected from the priority queue, and the corresponding processing method is selected based on the event flag of the highest priority permission inheritance tree to achieve dynamic response to permission changes. This dynamic adjustment mechanism makes the system more flexible and adaptable when facing a frequently changing environment, and can adjust the migration strategy in real time to ensure the smooth progress of the migration process.

[0106] Based on the above embodiments of the present application, the fourth embodiment of the present application is proposed. In the fourth embodiment of the present application, the same or similar content as the above embodiments can be referred to the above introduction and will not be repeated hereinafter.

[0107] On this basis, refer to Figure 6 , Figure 6 FIG. 4 is a schematic flowchart of the fourth embodiment provided for the permission migration method of the present application. In this embodiment, after step S32, steps S321 to S323 are further included:

[0108] Step S321, detecting a change instruction for the object to be migrated input by the operator, where the change of the object to be migrated is a change in the name of the object to be migrated, a change in the permission inheritance of the object to be migrated, an addition of the object to be migrated, or a deletion of the object to be migrated;

[0109] The permission migration device continuously monitors any change operations performed by the operator on the objects to be migrated (including directories and files) on the source device, including: Name change of the object to be migrated: The operator changes the name of a certain directory or file. Change of permission inheritance of the object to be migrated: The operator changes the permission inheritance setting of a certain directory or file, for example, from independent permissions to inheriting the permissions of the parent directory, or from one type of inherited permission to another type of inherited permission. Addition of the object to be migrated: The operator adds a new directory or file on the source device. Deletion of the object to be migrated: The operator deletes a certain directory or file from the source device.

[0110] Step S322, find the corresponding permission inheritance tree in the priority queue according to the object-to-be-migrated change instruction;

[0111] Furthermore, according to the directory or file name specified in the change instruction (if the name has not changed, use the original name; if it has changed, use the new name), perform a match in the permission inheritance tree in the priority queue. The matching process involves traversing the permission inheritance tree in the priority queue until the permission inheritance tree corresponding to the change instruction is found.

[0112] Step S323, if the object-to-be-migrated change instruction is the name change of the object to be migrated, the addition of the object to be migrated, or the deletion of the object to be migrated, perform an addition, or deletion, or change operation on the nodes of the corresponding permission inheritance tree and update the priority queue.

[0113] Perform corresponding addition, deletion, or change operations on the nodes of the found permission inheritance tree. Specifically, if the object-to-be-migrated change instruction is the addition of the object to be migrated, corresponding nodes need to be added to the corresponding permission inheritance tree, and the migration weight and priority queue of this permission inheritance tree need to be updated. For another example, if the object-to-be-migrated change instruction is the deletion of the object to be migrated, corresponding nodes need to be deleted from the corresponding permission inheritance tree, and the migration weight and priority queue of this permission inheritance tree need to be updated. If the object-to-be-migrated change instruction is the name change of the object to be migrated, the permission inheritance relationship and / or name of the corresponding nodes need to be updated in the corresponding permission inheritance tree, and the migration weight and priority queue of this permission inheritance tree need to be updated.

[0114] It can be understood that after the addition, deletion, or change operation is completed, it is necessary to recalculate the migration weight of the affected permission inheritance tree and update the order of the priority queue to ensure that the priority queue always reflects the priority order of the current objects to be migrated.

[0115] Step S324, if the object-to-be-migrated change instruction is the change of permission inheritance of the object to be migrated, reset the event flag bit of the corresponding permission inheritance tree.

[0116] If the instruction for the object to be migrated is a change in the inheritance of the object's permissions, reset the event flag bit of the corresponding permission inheritance tree.

[0117] In this embodiment, detect the instruction for the object to be migrated input by the operator, find the corresponding permission inheritance tree in the priority queue according to the instruction for the object to be migrated, and perform addition, deletion, or modification operations on the nodes of the corresponding permission inheritance tree and update the priority queue, so as to form a response mechanism for the dynamically changing environment.

[0118] Based on the above embodiments of the present application, the fifth embodiment of the present application is proposed. In the fifth embodiment of the present application, for the same or similar content as the above embodiments, reference can be made to the above introduction and will not be repeated hereinafter.

[0119] In this embodiment, step S34 may include steps S341 to S344:

[0120] Step S341, determine the status of the event flag bit of the highest-priority permission inheritance tree, where the status of the event flag bit includes the default state, the root node permission change state, the internal node permission change state, and the root node and internal node permission change state;

[0121] The status of the event flag bit includes: default state (0x00): It is the initial state of the permission inheritance tree after generation, indicating that no changes have occurred since generation. Root node permission change state (0x01): Indicates that the permission of the root node of the permission inheritance tree has changed. Internal node permission change state (0x02): Indicates that when the permission of the internal node (i.e., the child node or leaf node) of the permission inheritance tree has changed. Root node and internal node permission change state (0x03): Indicates that the permissions of both the root node and the internal nodes of the permission inheritance tree have changed.

[0122] By determining the status of the event flag bit, selectively scan and process the permission inheritance tree, so as to dynamically adjust the processing strategy to cope with the changes of the permission inheritance tree.

[0123] Step S342, when the status of the event flag bit of the highest-priority permission inheritance tree is the default state or the root node permission change state, adopt a skip scanning method to skip the internal nodes of the highest-priority permission inheritance tree, and scan the root node of the highest-priority permission inheritance tree to obtain the permission migration data;

[0124] When the event flag bit of the highest - priority permission inheritance tree is 0x00 (i.e., the default state) or the event flag bit is 0x01 (i.e., the root - node permission change state), a jump - scanning method is adopted for the highest - priority permission inheritance tree. The permissions of the root node of the permission inheritance tree are scanned, and the permission information is saved. The internal nodes of the permission inheritance tree are skipped, and the nodes with full - inheritance permissions are not scanned repeatedly or the permission information is not saved.

[0125] Step S343: When the event flag - bit state of the highest - priority permission inheritance tree is the internal - node permission change state, the highest - priority permission inheritance tree is decomposed by means of a tree - splitting operation method to obtain the permission migration data;

[0126] When the event flag bit of the highest - priority permission inheritance tree is 0x02 (i.e., the internal - node permission change state), a tree - splitting operation is performed on the highest - priority permission inheritance tree according to the generation rule of the permission inheritance tree. If the splitting is successful, the event flag bits of the sub - permission inheritance trees obtained after decomposition are initialized, and then the migration weights are recalculated and added to the priority queue. Otherwise, a jump - scanning method is adopted for the permission inheritance tree.

[0127] Specifically, in a feasible implementation manner, step S343 may include steps A1 to A5:

[0128] Step A1: Obtain the permission - inheritance identifiers of each node of the highest - priority permission inheritance tree, where the permission - inheritance identifiers of each node of the highest - priority permission inheritance tree are that the permission is fully inherited from the parent node, the permission is partially inherited from the parent node, or the permission is not inherited from the parent node;

[0129] First, identify and obtain the permission - inheritance identifiers of each node in the highest - priority permission inheritance tree (i.e., the most important or highest - priority permission - tree structure being processed currently). These identifiers indicate how each node inherits permissions from its parent node. The permission - inheritance identifiers of each node include: the permission is fully inherited from the parent node, the permission is partially inherited from the parent node, and the permission is not inherited from the parent node.

[0130] Step A2: Based on the permission - inheritance identifiers of each node of the highest - priority permission inheritance tree, the highest - priority permission inheritance tree is decomposed by means of a tree - splitting operation method for a second - time tree decomposition. Among them, the nodes with the permission - inheritance identifiers of the permission being partially inherited from the parent node or the permission not being inherited from the parent node in the highest - priority permission inheritance tree are used as the root nodes of the sub - permission inheritance trees, and the nodes with the permission - inheritance identifiers of the permission being fully inherited from the parent node in the highest - priority permission inheritance tree are used as the internal nodes of the corresponding sub - permission inheritance trees;

[0131] According to the obtained permission inheritance identifier, perform a tree splitting operation on the highest-priority permission inheritance tree. The principle of decomposition is: Use the nodes whose permissions are partially inherited from the parent node or not inherited from the parent node as the root nodes of the new sub-permission inheritance trees. These nodes represent the change points in permission inheritance and are thus suitable as the starting points of the new trees. Use the nodes whose permissions are fully inherited from the parent node as the internal nodes of the corresponding sub-permission inheritance trees. Since there are no changes in permission inheritance for these nodes, they can be integrated into the subtree containing their change points.

[0132] Step A3, if the secondary tree decomposition operation is successful, set the event flag bits of the multiple sub-permission inheritance trees obtained from the secondary tree decomposition operation to the default state;

[0133] If the secondary tree decomposition operation is successful (i.e., the original highest-priority permission inheritance tree is successfully decomposed into multiple subtrees), then set the event flag bits of the multiple sub-permission inheritance trees obtained from the secondary tree decomposition operation to the default state.

[0134] Step A4, recalculate the migration weights of the sub-permission inheritance trees, and re-add the sub-permission inheritance trees to the priority queue, then return to execute the step: When the priority queue is not empty, select the highest-priority permission inheritance tree from the priority queue;

[0135] For each decomposed sub-permission inheritance tree, its migration weight needs to be recalculated. Then re-add the sub-permission inheritance trees to the priority queue for sorting, and return to execute the step: When the priority queue is not empty, select the highest-priority permission inheritance tree from the priority queue to re-select the highest-priority permission inheritance tree.

[0136] Step A5, if the secondary tree decomposition operation fails, use the jump scanning method to skip the internal nodes of the highest-priority permission inheritance tree, and scan the root node of the highest-priority permission inheritance tree to obtain the permission migration data.

[0137] If the secondary tree decomposition operation fails, still use the jump scanning method to skip the internal nodes of the highest-priority permission inheritance tree and directly scan the root node to obtain the permission migration data.

[0138] Step S344, when the status of the event flag bit of the highest-priority permission inheritance tree is the permission change status of the root node and internal nodes, use the full scan method to scan the node permissions of the highest-priority permission inheritance tree to obtain the permission migration data.

[0139] If the event flag is 0x03 (i.e., the permissions of both the root node and internal nodes of the permission inheritance tree have changed), then a full scan method is adopted for this permission inheritance tree, that is, permission scanning is performed on each node of this permission inheritance tree, and the permission information is saved.

[0140] It can be understood that more fine-grained configuration of the "event flag" for each permission inheritance tree can be carried out, and more abundant "event flags" can be used to indicate what specific changes have occurred to the permissions of the root node and internal nodes of the permission inheritance tree, so as to adopt more appropriate next processing measures to further improve the overall permission migration efficiency. The classification of the states of the event flag is not limited to the default state, the root node permission change state, the internal node permission change state, and the root node and internal node permission change state.

[0141] In this embodiment, according to the state of the event flag of the highest-priority permission inheritance tree, the corresponding processing method is selected for permission scanning. The jump scan method skips the internal nodes with fully inherited permissions and only scans the root node, greatly reducing the consumption of computing and storage resources. The tree splitting operation method reduces the processing of internal nodes and reduces the demand for system resources.

[0142] Based on the above embodiments of the present application, the sixth embodiment of the present application is proposed. In the sixth embodiment of the present application, for the same or similar content as the above embodiments, reference can be made to the above introduction and will not be repeated hereinafter.

[0143] On this basis, refer to Figure 7 , Figure 7 which is the schematic flowchart of the sixth embodiment provided for the permission migration method of the present application document.

[0144] In this embodiment, after step S30, it further includes B10 to B30:

[0145] Step B10, delete the highest-priority permission inheritance tree from the migration priority queue, and determine whether the migration priority queue is empty after the deletion operation;

[0146] After completing the permission scanning of the current highest-priority permission inheritance tree and obtaining the permission migration data of the highest-priority permission inheritance tree, the permission migration device needs to perform a deletion operation to remove this highest-priority permission inheritance tree from the migration priority queue. The deletion operation can be implemented through various data structure operations, specifically depending on the implementation method of the migration priority queue. For example, if the migration priority queue is implemented using a heap structure, then the deletion operation may involve readjusting the structure of the heap to maintain its properties. After deleting the highest-priority permission inheritance tree, the permission migration device needs to check whether the migration priority queue is empty after the deletion operation.

[0147] Step B20, if the migration priority queue is empty after the deletion operation, terminate the execution;

[0148] If the queue is empty, it means that all the permission inheritance trees that need to be migrated have been processed, and the migration process can end.

[0149] Step B30, if the migration priority queue is not empty after the deletion operation, return to execute the step: select the permission inheritance tree with the highest priority from the permission inheritance tree.

[0150] If the migration priority queue is not empty, then the permission migration device needs to continue to take out the next permission inheritance tree with the highest priority from the queue, and return to execute the step: select the permission inheritance tree with the highest priority from the permission inheritance tree. This process will repeat until the queue is empty, that is, all the permission inheritance trees that need to be migrated have been processed.

[0151] In this embodiment, by deleting the processed permission inheritance tree with the highest priority from the queue, it can ensure that the elements in the queue are processed one by one in the order of priority, avoiding omission or duplicate processing. Deleting the processed elements can release the space occupied in the queue and optimize the utilization of memory resources. This is particularly important for processing a large amount of data or in an environment with limited resources.

[0152] The following will combine Figure 8 to elaborate on the overall process of the permission migration method of this application. Among them, Figure 8 is the schematic diagram of the overall process of the permission migration method of this application.

[0153] Generation of permission inheritance tree: Traverse with the top-level directory of the source device as the root to generate n permission inheritance trees. The generation rule of the permission inheritance tree is: use the migration object with the permission inheritance flag indicating that the permission is partially inherited from the parent node or the permission is not inherited from the parent node as the root node of the permission inheritance tree, and use the migration object with the permission inheritance flag indicating that the permission is completely inherited from the parent node as the internal node corresponding to the permission inheritance tree.

[0154] Setting of event flag bit: After each permission inheritance tree is generated, set a default event flag bit, initially 0x00. When the preset event flag bit change condition is triggered, reset the event flag bit.

[0155] Configuration of migration weight of subtree: Configure the migration weight of each subtree. The migration weight influencing factors can be configured according to multiple dimensions. For example, the more nodes in the subtree, the greater the migration weight; the deeper the subtree level, the greater the migration weight; the frequency of changes in the subtree in the previous migration cycle.

[0156] Construct a priority queue: Obtain the migration weights of the above n permission inheritance trees, and construct a migration priority queue according to the migration weights of each permission inheritance tree. For example, use a heap structure to construct the priority queue. Each time, take out the element at the top of the heap, first complete the permission scanning of the subtree on the source device, then migrate it to the target device, and update the permission configuration of the target device.

[0157] Migrate the node permissions of the inherited permission tree: If the priority queue is not empty, obtain the event flag bit of the permission inheritance tree and adopt the corresponding permission scanning method.

[0158] If the event flag bit is 0x00 (i.e., the initial default value) or the event flag bit is 0x01 (i.e., the permissions of the root node of the permission inheritance tree have changed). Then adopt a skip scanning method for this permission inheritance tree, that is, scan the permissions of the root node of this permission inheritance tree and save the permission information. Skip the internal nodes of this permission inheritance tree, that is, do not perform repeated scanning and saving of permission information for the nodes that completely inherit permissions.

[0159] If the event flag bit is 0x02 (i.e., the permissions of the internal nodes of the permission inheritance tree have changed). Then decompose this permission inheritance tree for the second time according to the aforementioned "generation rule of the permission inheritance tree". If the decomposition is successful, first initialize the event flag bit of the decomposed sub-permission inheritance tree (for example, initialize it to 0x00), then calculate the migration weight, and finally add it to the priority queue. Otherwise, adopt a skip scanning method for this permission inheritance tree.

[0160] If the event flag bit is 0x03 (i.e., the permissions of both the root node and the internal nodes of the permission inheritance tree have changed). Then adopt a full-scale scanning method for this permission inheritance tree, that is, scan the permissions of each node of this permission inheritance tree and save the permission information.

[0161] Finally, migrate the scanned data to the target device. Or set a migration threshold, such as migrating a unified amount of permission data reaching a certain number of bytes to the target device and updating the permissions of the target device.

[0162] This application also provides a permission migration device. Please refer to Figure 9 , the permission migration device includes:

[0163] The permission inheritance tree generation module 10 is configured to obtain the permission inheritance identifiers of one or more objects to be migrated. The one or more objects to be migrated are directories or files to be migrated on the source device. The permission inheritance identifier of the object to be migrated is that the permission is fully inherited from the parent node, partially inherited from the parent node, or not inherited from the parent node. According to the permission inheritance identifiers of the objects to be migrated, one or more permission inheritance trees are obtained. Among them, the object to be migrated with the permission inheritance identifier of the permission being partially inherited from the parent node or not inherited from the parent node is used as the root node of the permission inheritance tree, and the object to be migrated with the permission inheritance identifier of the permission being fully inherited from the parent node is used as the internal node corresponding to the permission inheritance tree;

[0164] The permission scanning module 20 is configured to select the highest-priority permission inheritance tree from the permission inheritance trees, and based on the event flag bit of the highest-priority permission inheritance tree, select the corresponding processing method to scan the node permissions of the highest-priority permission inheritance tree to obtain permission migration data;

[0165] The permission migration module 30 is configured to migrate the permission migration data to the target device and update the permissions of the target device.

[0166] The permission migration device provided in this application adopts the permission migration method in the above embodiment, and can solve the technical problem of permission migration. Compared with the prior art, the beneficial effects of the permission migration device provided in this application are the same as those of the permission migration method provided in the above embodiment, and other technical features in the permission migration device are the same as the features disclosed in the above embodiment method, which will not be elaborated here.

[0167] This application provides a permission migration device. The permission migration device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the permission migration method in the first embodiment above.

[0168] Next, refer to Figure 10, which shows a schematic structural diagram of a permission migration device suitable for implementing the embodiments of the present application. The permission migration device in the embodiments of the present application may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistant), PADs (Portable Application Description: tablet computers), PMPs (Portable Media Player: portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 10 The shown permission migration device is merely an example and should not impose any limitation on the functions and usage scope of the embodiments of the present application.

[0169] As Figure 10 shown, the permission migration device may include a processing device 1001 (such as a central processing unit, a graphics processing unit, etc.), which may perform various appropriate actions and processes according to the program stored in the read-only memory (ROM: Read Only Memory) 1002 or the program loaded from the storage device 1003 into the random access memory (RAM: Random Access Memory) 1004. In the RAM 1004, various programs and data required for the operation of the permission migration device are also stored. The processing device 1001, the ROM 1002, and the RAM 1004 are connected to each other through a bus 1005. The input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems may be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 may allow the permission migration device to communicate with other devices wirelessly or wiredly to exchange data. Although the figure shows a permission migration device with various systems, it should be understood that it is not required to implement or have all the shown systems. Instead, more or fewer systems may be implemented or had.

[0170] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product that includes a computer program carried on a computer-readable medium, and the computer program contains program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by a processing device 1001, the above-mentioned functions defined in the methods of the embodiments disclosed in the present application are executed.

[0171] The privilege migration device provided by the present application adopts the privilege migration method in the above embodiments and can solve the technical problems of privilege migration. Compared with the prior art, the beneficial effects of the privilege migration device provided by the present application are the same as those of the privilege migration method provided by the above embodiments, and other technical features in the privilege migration device are the same as the features disclosed in the method of the previous embodiment, which will not be elaborated here.

[0172] It should be understood that each part disclosed in the present application can be implemented by hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in a suitable manner in any one or more embodiments or examples.

[0173] The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present application, and all of them should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

[0174] The present application provides a computer-readable storage medium with computer-readable program instructions (i.e., computer programs) stored thereon, and the computer-readable program instructions are used to execute the privilege migration method in the above embodiments.

[0175] The computer-readable storage medium provided by this application can be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or components, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) or flash memory, optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In this embodiment, the computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, device, or component. The program code contained on the computer-readable storage medium can be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0176] The above computer-readable storage medium can be included in the permission migration device; it can also exist separately and not be assembled into the permission migration device.

[0177] The above computer-readable storage medium carries one or more programs. When the one or more programs are executed by the permission migration device, the permission migration device is caused to: obtain the permission inheritance identifiers of one or more objects to be migrated, where the one or more objects to be migrated are directories or files to be migrated on the source device, and the permission inheritance identifier of the object to be migrated is that the permission is fully inherited from the parent node, partially inherited from the parent node, or not inherited from the parent node; according to the permission inheritance identifiers of the respective objects to be migrated, obtain one or more permission inheritance trees, where the object to be migrated with the permission inheritance identifier of the permission being partially inherited from the parent node or not inherited from the parent node is used as the root node of the permission inheritance tree, and the object to be migrated with the permission inheritance identifier of the permission being fully inherited from the parent node is used as the internal node corresponding to the permission inheritance tree; select the highest-priority permission inheritance tree from the permission inheritance trees, and based on the event flag bit of the highest-priority permission inheritance tree, select the corresponding processing method to scan the node permissions of the highest-priority permission inheritance tree to obtain permission migration data; migrate the permission migration data to the target device and update the permissions of the target device.

[0178] Computer program code for performing the operations of this application can be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, by connecting through the Internet using an Internet service provider).

[0179] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of the code that contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0180] The modules involved in the embodiments described in this application can be implemented in software or in hardware. Among them, the name of the module does not constitute a limitation on the unit itself in some cases.

[0181] The readable storage medium provided in this application is a computer-readable storage medium. The computer-readable storage medium stores computer-readable program instructions (i.e., computer programs) for performing the above-mentioned permission migration method, which can solve the technical problem of permission migration. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the permission migration method provided in the above embodiments, and will not be elaborated here.

[0182] The present application also provides a computer program product, including a computer program, which when executed by a processor implements the steps of the permission migration method as described above.

[0183] The computer program product provided by the present application can solve the technical problem of permission migration. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as those of the permission migration method provided by the above embodiments, and will not be elaborated here.

[0184] The above are only some embodiments of the present application, and thus do not limit the patent scope of the present application. Any equivalent structural transformation made under the technical concept of the present application by using the content of the specification and drawings of the present application, or any direct / indirect application in other related technical fields, is included in the patent protection scope of the present application.

Claims

1. A permission migration method, characterized in that, The method includes: Obtaining a permission inheritance identifier of one or more objects to be migrated, where the one or more objects to be migrated are directories or files to be migrated on a source device, and the permission inheritance identifier of the object to be migrated is that the permission is fully inherited from the parent node, partially inherited from the parent node, or not inherited from the parent node; According to the permission inheritance identifiers of the objects to be migrated, obtaining one or more permission inheritance trees, where the object to be migrated with the permission inheritance identifier of partially inherited from the parent node or not inherited from the parent node is used as the root node of the permission inheritance tree, and the object to be migrated with the permission inheritance identifier of fully inherited from the parent node is used as an internal node corresponding to the permission inheritance tree; Selecting the highest-priority permission inheritance tree from the permission inheritance trees, and scanning the node permissions of the highest-priority permission inheritance tree based on the event flag bit of the highest-priority permission inheritance tree to select the corresponding processing method to obtain permission migration data; Migrating the permission migration data to a target device and updating the permissions of the target device.

2. The method according to claim 1, characterized in that, After the step of obtaining one or more permission inheritance trees according to the permission inheritance identifiers of the objects to be migrated, it further includes: Setting a default event flag bit for each permission inheritance tree; When a preset event flag bit change condition is triggered, resetting the event flag bit.

3. The method according to claim 1, characterized in that, The step of selecting the highest-priority permission inheritance tree from the permission inheritance trees, and scanning the node permissions of the highest-priority permission inheritance tree based on the event flag bit of the highest-priority permission inheritance tree to select the corresponding processing method to obtain permission migration data includes: Setting migration weight influencing factors in multiple dimensions, and calculating the migration weight of each permission inheritance tree according to the migration weight influencing factors; Constructing a priority queue based on the migration weights of the permission inheritance trees; When the priority queue is not empty, selecting the highest-priority permission inheritance tree from the priority queue; Scanning the node permissions of the highest-priority permission inheritance tree based on the event flag bit of the highest-priority permission inheritance tree to select the corresponding processing method to obtain the permission migration data.

4. The method according to claim 3, wherein After the step of constructing a priority queue based on the migration weights of the permission inheritance trees, it further includes: Detecting a change instruction of the object to be migrated input by an operator, where the change of the object to be migrated is a change in the name of the object to be migrated, a change in the permission inheritance of the object to be migrated, an addition of the object to be migrated, or a deletion of the object to be migrated; Searching for the corresponding permission inheritance tree in the priority queue according to the change instruction of the object to be migrated; If the change instruction of the object to be migrated is a change in the name of the object to be migrated, an addition of the object to be migrated, or a deletion of the object to be migrated, performing an addition, deletion, or change operation on the nodes of the corresponding permission inheritance tree and updating the priority queue; If the change instruction of the object to be migrated is a change in the permission inheritance of the object to be migrated, resetting the event flag bit of the corresponding permission inheritance tree.

5. The method according to claim 3, characterized in that, The step of scanning the node permissions of the highest-priority permission inheritance tree according to the corresponding processing method selected by the event flag bits of the highest-priority permission inheritance tree to obtain the permission migration data includes: Determine the status of the event flag bits of the highest-priority permission inheritance tree, where the status of the event flag bits includes the default status, the root node permission change status, the internal node permission change status, and the root node and internal node permission change status; When the status of the event flag bits of the highest-priority permission inheritance tree is the default status or the root node permission change status, skip the internal nodes of the highest-priority permission inheritance tree by using a jump scanning method, and scan the root node of the highest-priority permission inheritance tree to obtain the permission migration data; When the status of the event flag bits of the highest-priority permission inheritance tree is the internal node permission change status, decompose the highest-priority permission inheritance tree by using a tree splitting operation method to obtain the permission migration data; When the status of the event flag bits of the highest-priority permission inheritance tree is the root node and internal node permission change status, scan the node permissions of the highest-priority permission inheritance tree by using a full-scale scanning method to obtain the permission migration data.

6. The method according to claim 5, characterized in that, The step of decomposing the highest-priority permission inheritance tree by using a tree splitting operation method to obtain the permission migration data includes: Obtain the permission inheritance identifiers of each node of the highest-priority permission inheritance tree, where the permission inheritance identifiers of each node of the highest-priority permission inheritance tree are that the permission is fully inherited from the parent node, the permission is partially inherited from the parent node, or the permission is not inherited from the parent node; Based on the permission inheritance identifiers of each node of the highest-priority permission inheritance tree, perform a secondary tree decomposition on the highest-priority permission inheritance tree by using a tree splitting operation method, where the nodes with the permission inheritance identifiers of the permission being partially inherited from the parent node or the permission not being inherited from the parent node in the highest-priority permission inheritance tree are used as the root nodes of the sub-permission inheritance trees, and the nodes with the permission inheritance identifiers of the permission being fully inherited from the parent node in the highest-priority permission inheritance tree are used as the internal nodes of the corresponding sub-permission inheritance trees; If the secondary tree decomposition operation is successful, set the event flag bits of the multiple sub-permission inheritance trees obtained by the secondary tree decomposition operation to the default status; Recalculate the migration weights of the sub-permission inheritance trees, and re-add the sub-permission inheritance trees to the priority queue, and return to execute the step: when the priority queue is not empty, select the highest-priority permission inheritance tree from the priority queue; If the secondary tree decomposition operation fails, skip the internal nodes of the highest-priority permission inheritance tree by using the jump scanning method, and scan the root node of the highest-priority permission inheritance tree to obtain the permission migration data.

7. The method according to claim 1, wherein After the step of selecting the highest-priority permission inheritance tree from the permission inheritance trees, and scanning the node permissions of the highest-priority permission inheritance tree based on the event flag bit of the highest-priority permission inheritance tree to obtain permission migration data, the following steps are further included: Delete the highest-priority permission inheritance tree from the priority queue, and determine whether the priority queue is empty after the deletion operation; If the priority queue is empty after the deletion operation, terminate the execution; If the priority queue is not empty after the deletion operation, return to execute the step: select the highest-priority permission inheritance tree from the permission inheritance trees.

8. A permission migration device, characterized in that, The device includes: A permission inheritance tree generation module, configured to obtain the permission inheritance identifiers of one or more objects to be migrated. The one or more objects to be migrated are directories or files to be migrated on a source device. The permission inheritance identifier of the object to be migrated is that the permission is fully inherited from the parent node, partially inherited from the parent node, or not inherited from the parent node. According to the permission inheritance identifiers of the objects to be migrated, one or more permission inheritance trees are obtained. Among them, the object to be migrated with the permission inheritance identifier of the permission partially inherited from the parent node or the permission not inherited from the parent node is used as the root node of the permission inheritance tree, and the object to be migrated with the permission inheritance identifier of the permission fully inherited from the parent node is used as the internal node corresponding to the permission inheritance tree; A permission scanning module, configured to select the highest-priority permission inheritance tree from the permission inheritance trees, and scan the node permissions of the highest-priority permission inheritance tree based on the event flag bit of the highest-priority permission inheritance tree to obtain permission migration data; A permission migration module, configured to migrate the permission migration data to a target device and update the permissions of the target device.

9. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the permission migration method described in any one of claims 1 to 7 are implemented.

10. A computer program product, characterized in that, The computer program product includes a computer program. When the computer program is executed by a processor, the steps of the permission migration method described in any one of claims 1 to 7 are implemented.