IP Library Granted Patent US 11,995,451
Granted Patent B2
US 11,995,451 · App. 17/041,942 · Granted May 28, 2024

Resource permission processing method and apparatus, storage medium, and chip

Inventors: Fuzhou Xiao (Beijing, CN); Youzhan Yin (Beijing, CN); Li Chen (Beijing, CN)
Assignee: HUAWEI TECHNOLOGIES CO., LTD.
G06F9/44505G06F8/71G06F9/5061G06F16/90344
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,995,451
App. No.
17/041,942
Granted
May 28, 2024
Kind
B2
Abstract

A resource permission processing method and apparatus, a storage medium, and a chip are disclosed, to update a resource label in a terminal device based on a first resource permission configuration file when a system software version in the terminal device is upgraded. The first resource permission configuration file covers only path information in which a label changes before and after the system software version is upgraded. Therefore, in a process of updating the resource label stored in the terminal device, a matching amount is greatly reduced when path information that matches traversal path information of a resource is searched for in the first resource permission configuration file, and therefore time consumed for labeling the stored resource can be reduced. The reduced time for labeling the stored resource improves labeling efficiency, reduces time consumed for the system software version upgrade, and improves efficiency of the system software version upgrade.

Claims (49)

1. A resource permission processing method, comprising:

when a system software version in a terminal device is upgraded, obtaining a first resource permission configuration file, wherein the first resource permission configuration file comprises at least one piece of first path information and a label corresponding to the at least one piece of the first path information in a second resource permission configuration file, the second resource permission configuration file corresponding to a new system software version, and the label corresponding to the first path information in the second resource permission configuration file is different from a previous label corresponding to the first path information in a third resource permission configuration file that corresponds to an earlier system software version; and

updating a resource label in the terminal device based on the first resource permission configuration file.

2. The method according to claim 1 , wherein before the obtaining the first resource permission configuration file, the method further comprises:

obtaining the second resource permission configuration file and the third resource permission configuration file;

comparing a label corresponding to each piece of path information in the second resource permission configuration file with a label corresponding to each piece of the path information in the third resource permission configuration file, and using the path information with different labels as the first path information;

generating the first resource permission configuration file based on each piece of the first path information and a label corresponding to each piece of the first path information in the second resource permission configuration file; and

storing the first resource permission configuration file.

3. The method according to claim 2 , wherein before the storing the first resource permission configuration file, the method further comprises:

encrypting and signing the first resource permission configuration file.

4. The method according to claim 2 , wherein the obtaining the second resource permission configuration file and the third resource permission configuration file comprises:

before a system software version upgrade package is parsed, obtaining the third resource permission configuration file stored in the terminal device; and

when the system software version upgrade package is parsed, obtaining the second resource permission configuration file carried in the system software version upgrade package.

5. The method according to claim 1 , wherein the updating the resource label in the terminal device based on the first resource permission configuration file comprises:

when the first path information comprises a regular expression character, updating all resource labels in an upper-level path of a first path based on the label corresponding to the first path information in the second resource permission configuration file.

6. The method according to claim 1 , wherein the updating the resource label in the terminal device based on the first resource permission configuration file comprises:

when the first path information comprises a regular expression character string in a preset format, updating all resource labels in a first path based on the label corresponding to the first path information in the second resource permission configuration file.

7. The method according to claim 1 , wherein the method further comprises:

when the first resource permission configuration file fails to be obtained, updating the resource label in the terminal device based on the second resource permission configuration file.

8. The method according to claim 1 , wherein the method further comprises:

when duration for updating the resource label in the terminal device exceeds preset duration, restarting the terminal device, and re-obtaining the first resource permission configuration file.

9. The method according to claim 1 , wherein an operating system of the terminal device is a Linux operating system, and the method further comprises:

after an operation of updating the resource label in the terminal device is completed, updating, by using a hash value corresponding to the second resource permission configuration file, a hash value corresponding to a currently used resource permission configuration file stored in the terminal device.

10. A resource permission processing apparatus, comprising:

a processor; and

a memory coupled to the processor to store instructions, which when executed by the processor, cause the processor to:

when a system software version in a terminal device is upgraded, obtain a first resource permission configuration file, wherein the first resource permission configuration file comprises at least one piece of first path information and a label corresponding to the at least one piece of the first path information in a second resource permission configuration file, the second resource permission configuration file corresponding to a new system software version, and the label corresponding to the first path information in the second resource permission configuration file is different from a previous label corresponding to the first path information in a third resource permission configuration file that corresponds to an earlier system software version; and

update a resource label in the terminal device based on the first resource permission configuration file.

11. The apparatus according to claim 10 , wherein the processor is further to:

before the apparatus obtains the first resource permission configuration file, obtain the second resource permission configuration file and the third resource permission configuration file;

compare a label corresponding to each piece of path information in the second resource permission configuration file with a label corresponding to each piece of the path information in the third resource permission configuration file, use the path information with different labels as the first path information, and generate the first resource permission configuration file based on each piece of the first path information and a label corresponding to each piece of the first path information in the second resource permission configuration file; and

store the first resource permission configuration file.

12. The apparatus according to claim 11 , wherein the processor is further to encrypt and sign the first resource permission configuration file before the apparatus stores the first resource permission configuration file.

13. The apparatus according to claim 11 , wherein the processor is to: before a system software version upgrade package is parsed, obtain the third resource permission configuration file stored in the terminal device; and when the system software version upgrade package is parsed, obtain the second resource permission configuration file carried in the system software version upgrade package.

14. The apparatus according to claim 10 , wherein the processor is to: when the first path information comprises a regular expression character, update all resource labels in an upper-level path of a first path based on the label corresponding to the first path information in the second resource permission configuration file.

15. The apparatus according to claim 10 , wherein the processor is to: when the first path information comprises a regular expression character string in a preset format, update all resource labels in a first path based on the label corresponding to the first path information in the second resource permission configuration file.

16. The apparatus according to claim 10 , wherein the processor is further to: when the apparatus fails to obtain the first resource permission configuration file, update the resource label in the terminal device based on the second resource permission configuration file.

17. The apparatus according to claim 10 , wherein the processor is further to:

restart the terminal device when duration in which the apparatus updates the resource label in the terminal device exceeds preset duration, wherein

the processor is further to re-obtain the first resource permission configuration file.

18. The apparatus according to claim 10 , wherein an operating system of the terminal device is a Linux operating system, and the processor is further to: after an operation of updating the resource label in the terminal device is completed, update, by using a hash value corresponding to the second resource permission configuration file, a hash value corresponding to a currently used resource permission configuration file stored in the terminal device.

19. A non-transitory machine-readable storage medium having instructions stored therein, which when executed by a processor, cause the processor to perform operations, the operations comprising:

when a system software version in a terminal device is upgraded, obtaining a first resource permission configuration file, wherein the first resource permission configuration file comprises at least one piece of first path information and a label corresponding to the at least one piece of the first path information in a second resource permission configuration file, the second resource permission configuration file corresponding to a new system software version, and the label corresponding to the first path information in the second resource permission configuration file is different from a previous label corresponding to the first path information in a third resource permission configuration file that corresponds to an earlier system software version; and

updating a resource label in the terminal device based on the first resource permission configuration file.

20. The non-transitory machine-readable storage medium according to claim 19 , wherein the operations further comprises:

obtaining the second resource permission configuration file and the third resource permission configuration file;

comparing a label corresponding to each piece of path information in the second resource permission configuration file with a label corresponding to each piece of the path information in the third resource permission configuration file, and using the path information with different labels as the first path information;

generating the first resource permission configuration file based on each piece of the first path information and a label corresponding to each piece of the first path information in the second resource permission configuration file; and

storing the first resource permission configuration file.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 18, 2020
From: XIAO, FUZHOU; YIN, YOUZHAN; CHEN, LI
To: HUAWEI TECHNOLOGIES CO., LTD.
Reel/Frame 054691/0238 →
Continuity (1)
Related Publication 20210081217A1 · Mar 18, 2021