Control method and device for accessing photo album by application, electronic equipment and storage medium
In response to the application of the application's album access request, obtain its authority information, and determine the scope of the album access according to the type of permissions, solve the problem of no different access to the user's photos and videos to increase the risk of privacy leakage, and realize the protection and application of user privacy. Programming.
Patent Information
- Application Number
- CN202411314375.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2025-01-24
AI Technical Summary
In the prior art, applications can access all personal photos and videos of users without distinction when obtaining storage permissions, increasing the risk of personal privacy leakage.
Obtain the permission information of the application by responding to its album access request. If the permission is dedicated album access permission, determine the target dedicated album corresponding to the application from the preset dedicated albums, and perform data reading and writing operations. If the permission is Storage permission, the application is allowed to access the default photo album.
By setting the application of a special album, it limits its access to the terminal's default album. It only allows the content of the dedicated album to read and write, thereby protecting the privacy of the user, and at the same time to ensure the functionality and user experience of the application of the application.
Smart Images

Figure CN119358014A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data security technology, and in particular to a control method, device, equipment and storage medium for application access to a photo album. Background Art
[0002] In the terminal device, when the application is started for the first time, it will request user authorization to obtain various permissions in the mobile phone, including location services, address book access, photo album access, etc.
[0003] Currently, applications require users to authorize storage permissions when running, and album access permissions are usually bundled with storage permissions. Applications with storage permissions can indiscriminately access all personal photos and videos of the user, increasing the risk of personal privacy leakage. Summary of the invention
[0004] Based on this, it is necessary to provide a control method, device, electronic device and storage medium for an application to access an album in order to solve the above technical problems.
[0005] In a first aspect, an embodiment of the present disclosure provides a method for controlling an application to access an album, including:
[0006] In response to a photo album access request from a first application, obtaining permission information of the first application;
[0007] In a case where the permission information of the first application is a dedicated album access permission, determining a target dedicated album corresponding to the first application from at least one preset dedicated album;
[0008] Performing corresponding data read and write operations on the target dedicated album through the album access request;
[0009] In the case where the permission information of the first application is storage permission, the first application is allowed to access the default album, so as to perform corresponding data read and write operations on the default album through the album access request.
[0010] In a second aspect, an embodiment of the present disclosure provides a control device for an application to access an album, including:
[0011] An acquisition module, configured to acquire permission information of a first application in response to an album access request of the first application;
[0012] a determination module, configured to determine a target dedicated album corresponding to the first application from at least one preset dedicated album when the permission information of the first application is dedicated album access permission;
[0013] A first processing module, configured to execute corresponding data read and write operations on the target dedicated photo album through the photo album access request;
[0014] The second processing module is used to allow the first application to access the default album when the permission information of the first application is storage permission, so as to perform corresponding data read and write operations on the default album through the album access request.
[0015] In a third aspect, an embodiment of the present disclosure provides an electronic device, comprising: a processor; a memory for storing executable instructions of the processor; the processor is used to read the executable instructions from the memory and execute the instructions to implement the control method for application access to a photo album as described in the first aspect above.
[0016] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the control method for an application accessing a photo album as described in the first aspect above is implemented.
[0017] Compared with the prior art, the technical solution provided by the disclosed embodiment has the following advantages: in response to the album access request of the first application, the permission information of the first application is obtained, and when the permission information of the first application is the dedicated album access permission, the target dedicated album corresponding to the first application is determined from at least one preset dedicated album, and the corresponding data read and write operations are performed on the target dedicated album through the album access request. Therefore, by setting the application dedicated album, the application is restricted from accessing the default album of the terminal, and only the application is allowed to read and write the content of the dedicated album, which solves the problem of the application indiscriminately accessing all the photos and videos of the user and increasing the risk of personal privacy leakage, and can protect the user's privacy, while ensuring that the application's access to the album functionality and user experience are not affected. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0019] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0020] Figure 1 A flowchart of a method for controlling an application to access an album provided by an embodiment of the present disclosure;
[0021] Figure 2 A schematic diagram of a process for applying for album access rights provided in an embodiment of the present disclosure;
[0022] Figure 3 A business process diagram provided by an embodiment of the present disclosure;
[0023] Figure 4 A schematic diagram of the structure of a control device for application accessing a photo album provided by an embodiment of the present disclosure;
[0024] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solution and advantages of the present disclosure more clear, the present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present disclosure and are not used to limit the present disclosure.
[0026] In one embodiment, Figure 1 As shown, a method for controlling an application to access an album is provided, the method comprising the following steps:
[0027] Step 102: In response to the album access request of the first application, obtain the permission information of the first application.
[0028] In this embodiment, the first application is an application that initiates an album access request. When the application needs to access the album to read or write data, the application initiates an album access request, and then, in response to the first application's album access request, the permission information of the first application is obtained.
[0029] Among them, the permission information is used to indicate the permissions that the application has. For example, when the application has phone permissions, the application can read call status and mobile network information, make calls, and use call forwarding. Permission information includes storage permissions, phone permissions, location permissions, camera permissions, etc. In this embodiment, the permission information also includes dedicated album access permissions. When the application has storage permissions, the application is allowed to access photos, media content, and files on the device. The dedicated album access permission is a pre-set permission. When the application has dedicated album access permissions, the application is only allowed to access images in the dedicated album, and the application is not allowed to access data in the default album and other media content and files on the device. What permissions the permission information of the first application includes can be determined based on user authorization.
[0030] Step 104 , when the permission information of the first application is a dedicated album access permission, determine a target dedicated album corresponding to the first application from at least one preset dedicated album.
[0031] In this embodiment, the dedicated album is different from the default album on the device and is generated when the application applies for permission and obtains the dedicated album access right. When the dedicated album is generated, a corresponding relationship between the dedicated album and the application is established. Furthermore, when the permission information of the first application is the dedicated album access right, the pre-established corresponding relationship is queried to determine the target dedicated album corresponding to the first application from at least one preset dedicated album.
[0032] The following describes how to determine the target dedicated album.
[0033] In one embodiment of the present disclosure, when the permission information of the first application is a dedicated album access permission, determining a target dedicated album corresponding to the first application from at least one preset dedicated album includes: judging whether the permission information of the first application is a dedicated album access permission through an access control list; if the permission information of the first application is a dedicated album access permission, routing the album access request to the sandbox environment of the target dedicated album.
[0034] The access control list is used to define and implement access control rules to ensure that applications cannot access storage space outside the sandbox environment. When an application applies for access to a dedicated album, the sandbox environment corresponding to the application is obtained, and the sandbox environment only includes the dedicated album corresponding to the application.
[0035] As an example, the identification information of the first application is obtained, and it is determined whether the identification information of the first application is in the preset list. If the identification information of the first application is in the preset list, the album access request is routed to the sandbox environment of the target dedicated album. In this example, the preset list is used to add the identification information of the application to the list when the application applies for access to the dedicated album, and to delete the identification information of the application from the list when the application cancels the access to the dedicated album.
[0036] As another example, the permission information of the first application is directly obtained. If the permission information of the first application is a dedicated album access permission, the album access request is routed to the sandbox environment of the target dedicated album.
[0037] Step 106: Perform corresponding data read and write operations on the target dedicated album through the album access request.
[0038] In this embodiment, when the album access request is used to request writing image data to the target dedicated album, the image data to be written is obtained and stored in the target dedicated album; when the album access request is used to request reading image data from the target dedicated album, the image data to be read is obtained from the target dedicated album and sent to the first application. Optionally, the target dedicated album of the first application may be empty initially, and the QR code image data generated by the first application during operation is written into the target dedicated album. When the first application needs to use the QR code image data later, the QR code image data is obtained by accessing the target dedicated album.
[0039] Since the dedicated album is in an independent sandbox environment, for applications that do not have storage permissions but have access to the dedicated album, the access control list is used to ensure that when the application requests access to the album, the system automatically redirects the request to the dedicated album in the application's sandbox environment, ensuring that the application can only access, modify, and delete the content in the dedicated album. Therefore, personal privacy information such as photos stored in the default album will not be obtained by the application, and the application's access to the native album is restricted through technical means.
[0040] Step 108 , when the permission information of the first application is storage permission, the first application is allowed to access the default album, so as to perform corresponding data read and write operations on the default album through an album access request.
[0041] In this embodiment, when the album access request is used to request writing image data to the default album, the image data to be written is obtained and stored in the default album; when the album access request is used to request reading image data from the default album, the image data to be read is obtained from the default album and sent to the first application. The default album is the native album of the terminal.
[0042] According to the technical solution of the embodiment of the present disclosure, in response to the album access request of the first application, the permission information of the first application is obtained. When the permission information of the first application is the dedicated album access permission, the target dedicated album corresponding to the first application is determined from at least one preset dedicated album, and the corresponding data read and write operations are performed on the target dedicated album through the album access request. Therefore, by setting the application dedicated album, the application's access to the terminal default album is restricted, and the application is only allowed to read and write the content of the dedicated album, which solves the problem of the application's indiscriminate access to all the user's photos and videos, increasing the risk of personal privacy leakage, and can protect user privacy, while ensuring that the application's access to the album functionality and user experience are not affected.
[0043] The following describes how an application can apply for storage permissions or dedicated album access permissions.
[0044] Based on the above embodiments, Figure 2 A schematic diagram of a process for applying for album access rights provided by an embodiment of the present disclosure, such as Figure 2 As shown, the following steps are included:
[0045] Step 202: In response to the permission application request of the second application, an authorization interface is displayed.
[0046] In this embodiment, the authorization interface displays a first option for authorizing access to the dedicated album and a second option for authorizing storage permissions. Optionally, when the application requests storage permissions for the first time, the authorization interface is displayed, and the authorization interface may include options for authorizing permissions, and the authorization interface also includes prompt text for informing the user of the concept and scope of use of the dedicated album and requesting user authorization.
[0047] Step 204: When confirmation information for the first option is detected, a sandbox environment and a dedicated album corresponding to the second application are determined.
[0048] In this embodiment, the user checks the first option in the authorization interface and clicks the confirmation control. At this time, the terminal determines that the confirmation information for the first option is detected, and determines the sandbox environment corresponding to the second application, which includes a dedicated album corresponding to the second application.
[0049] In one embodiment of the present disclosure, when confirmation information for the first option is detected, a sandbox environment corresponding to the second application is created, and a dedicated album corresponding to the second application is generated in the sandbox environment.
[0050] As an example, for each application that applies for a dedicated photo album access right, a corresponding sandbox environment is created for each application, and a dedicated photo album corresponding to the application is generated in the sandbox environment. In this example, N dedicated photo albums can be generated for N applications.
[0051] In one embodiment of the present disclosure, when confirmation information for the first option is detected, a dedicated album corresponding to the second application is selected from pre-generated dedicated albums. In this embodiment, selecting a dedicated album corresponding to the second application from pre-generated dedicated albums includes: pre-generating multiple dedicated albums, and setting corresponding security levels for the pre-generated multiple dedicated albums, wherein the pre-generated multiple dedicated albums correspond to the multiple security levels one by one; and then, obtaining the security level of the second application, and determining a dedicated album that matches the security level of the second application from the pre-generated multiple dedicated albums.
[0052] As an example, three sandbox environments are created and three dedicated photo albums are pre-generated. Each sandbox environment includes a dedicated photo album. The three dedicated photo albums correspond to the first security level, the second security level, and the third security level in descending order of security level. When an application applies for access to a dedicated photo album, a risk assessment is performed on the application to determine the security level of the application, and the security level of the application is compared with the preset first security level, second security level, and third security level to obtain a dedicated photo album corresponding to a security level with a consistent comparison result as the dedicated photo album corresponding to the application. Thus, the dedicated photo album of the corresponding security level can be determined through the risk assessment of the application, so that risky applications can only access the corresponding dedicated photo album, further improving security.
[0053] Step 206: When confirmation information for the second option is detected, determine that the permission information of the second application is storage permission.
[0054] In this embodiment, the user checks the second option in the authorization interface and clicks the confirmation control. At this time, the terminal determines that confirmation information for the second option is detected and determines that the permission information of the second application is storage permission.
[0055] Optionally, if confirmation information for the first option or the second option is not detected, for example, if it is detected that the user clicks a cancel control, it is determined that the authorization process is terminated and the user is prompted.
[0056] In the disclosed embodiment, by setting up a dedicated album for an application, the application's access to the default album of the terminal is restricted, and the application is only allowed to read and write the contents of the dedicated album. This can protect user privacy while ensuring that the functionality of the application's access to the album and the user experience are not affected.
[0057] Further, if Figure 3 As shown, after user authorization, when the application initiates an album access request to try to access the album, the operating system receives the album access request and analyzes the target data location, and performs permission verification to determine whether it complies with the access control list rules. Album access requests that comply with the access control list rules are routed to the sandbox environment of the dedicated album for data reading or writing, and the data is automatically encrypted and decrypted when reading and writing; for album access requests that do not comply with the access control list rules, access is denied and the attempt is recorded.
[0058] In one embodiment of the present disclosure, corresponding data read and write operations are performed on a target dedicated album through an album access request, including: when the album access request is used to request to write image data to the target dedicated album, the image data to be written is obtained, and the image data to be written is encrypted using a preset encryption algorithm to obtain encrypted image data; the encrypted image data is stored in the target dedicated album.
[0059] As an example, a QR code image is generated during the running of an application. When the application writes the QR code image to a dedicated album, the system routes the album access request to the corresponding sandbox environment, encrypts the QR code image using an encryption algorithm, and stores the encrypted QR code image in the dedicated album.
[0060] In one embodiment of the present disclosure, corresponding data read and write operations are performed on a target dedicated album through an album access request, including: when the album access request is used to request to read image data from the target dedicated album, the image data to be read is obtained from the target dedicated album, and the image data to be read is decrypted using a preset decryption algorithm to obtain decrypted image data; and the decrypted image data is sent to the first application.
[0061] As an example, when a QR code image is called during the running of an application and the application reads the QR code image from a dedicated album, the system routes the album access request to the corresponding sandbox environment, uses a decryption algorithm to decrypt the QR code image read from the dedicated album, and sends the decrypted QR code image to the application.
[0062] Therefore, by encrypting the data in the application's dedicated album, it is ensured that even if the data in the dedicated album is illegally accessed, it is difficult to be deciphered, thereby further improving data security.
[0063] It should be understood that although Figure 1 and Figure 2 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 and Figure 2 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0064] In one embodiment, Figure 4 As shown, a control device for an application to access an album is provided, comprising: an acquisition module 41 , a determination module 42 , a first processing module 43 , and a second processing module 44 .
[0065] The acquisition module 41 is used to obtain the permission information of the first application in response to the album access request of the first application;
[0066] A determination module 42, configured to determine a target dedicated album corresponding to the first application from at least one preset dedicated album when the permission information of the first application is dedicated album access permission;
[0067] A first processing module 43 is used to perform corresponding data read and write operations on a target dedicated album through an album access request;
[0068] The second processing module 44 is used to allow the first application to access the default album when the permission information of the first application is storage permission, so as to perform corresponding data read and write operations on the default album through the album access request.
[0069] In one embodiment, the apparatus further comprises:
[0070] The permission application module is used to respond to the permission application request of the second application and display an authorization interface; the authorization interface displays a first option for authorizing the access right of the dedicated album and a second option for authorizing the storage right;
[0071] When confirmation information for the first option is detected, a sandbox environment corresponding to the second application is created, and a dedicated photo album corresponding to the second application is generated in the sandbox environment;
[0072] Alternatively, when confirmation information for the first option is detected, a dedicated album corresponding to the second application is selected from pre-generated dedicated albums;
[0073] When confirmation information for the second option is detected, it is determined that the permission information of the second application is storage permission.
[0074] In one embodiment, the permission application module is specifically used to:
[0075] Pre-generate multiple dedicated photo albums; the pre-generated multiple dedicated photo albums correspond to multiple security levels one by one;
[0076] The security level of the second application is obtained, and a dedicated photo album matching the security level of the second application is determined from a plurality of pre-generated dedicated photo albums.
[0077] In one embodiment, the determination module 42 is specifically configured to:
[0078] Determining whether the permission information of the first application is a dedicated album access permission through the access control list;
[0079] If the permission information of the first application is a dedicated album access permission, the album access request is routed to the sandbox environment of the target dedicated album.
[0080] In one embodiment, the first processing module 43 is specifically used for:
[0081] When the album access request is used to request writing image data into the target dedicated album, the image data to be written is obtained, and the image data to be written is encrypted using a preset encryption algorithm to obtain encrypted image data;
[0082] Store the encrypted image data into the target dedicated album;
[0083] or,
[0084] When the album access request is used to request to read image data from a target dedicated album, the image data to be read is obtained from the target dedicated album, and the image data to be read is decrypted using a preset decryption algorithm to obtain decrypted image data;
[0085] The decrypted image data is sent to the first application.
[0086] For the specific definition of the control device for application access to the photo album, please refer to the definition of the control method for application access to the photo album above. It has the corresponding functional modules and beneficial effects of the execution method, which will not be repeated here. Each module in the above-mentioned control device for application access to the photo album can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the electronic device in the form of hardware, or can be stored in the memory of the electronic device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0087] In one embodiment, an electronic device is provided. The electronic device may be a terminal or a smart device. The internal structure diagram thereof may be as follows: Figure 5 As shown. The electronic device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the electronic device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a control method for an application to access an album is implemented. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the housing of the electronic device, or an external keyboard, touchpad or mouse, etc.
[0088] Those skilled in the art will understand that Figure 5The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present disclosure, and does not constitute a limitation on the electronic device to which the scheme of the present disclosure is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0089] In one embodiment, the control device for application access to the photo album provided by the present disclosure can be implemented in the form of a computer program. The computer program can be Figure 5 The memory of the electronic device may store various program modules constituting the control device for the application to access the photo album, for example, Figure 4 The computer program composed of the various program modules shown enables the processor to execute the steps of the control method of application access to the photo album in various embodiments of the present disclosure described in this specification.
[0090] For example, Figure 5 The electronic device shown can be Figure 4 The acquisition module 41 in the control device for application access to the album shown executes to respond to the album access request of the first application to obtain the permission information of the first application; the determination module 42 executes to determine the target dedicated album corresponding to the first application from at least one preset dedicated album when the permission information of the first application is the dedicated album access permission; the first processing module 43 executes to perform corresponding data read and write operations on the target dedicated album through the album access request; the second processing module 44 executes to allow the first application to access the default album when the permission information of the first application is the storage permission, so as to perform corresponding data read and write operations on the default album through the album access request.
[0091] In one embodiment, an electronic device is provided, including a memory and a processor, the memory storing a computer program, and the processor implementing the following steps when executing the computer program: in response to an album access request of a first application, obtaining permission information of the first application; when the permission information of the first application is dedicated album access permission, determining a target dedicated album corresponding to the first application from at least one preset dedicated album; performing corresponding data read and write operations on the target dedicated album through the album access request; when the permission information of the first application is storage permission, allowing the first application to access a default album, so as to perform corresponding data read and write operations on the default album through the album access request.
[0092] In one embodiment, the processor can also implement the following steps when executing the computer program: in response to the permission application request of the second application, display an authorization interface; the authorization interface displays a first option for authorizing access rights to the dedicated photo album and a second option for authorizing storage rights; when confirmation information for the first option is detected, create a sandbox environment corresponding to the second application, and generate a dedicated photo album corresponding to the second application in the sandbox environment; or, when confirmation information for the first option is detected, select a dedicated photo album corresponding to the second application from pre-generated dedicated photo albums; when confirmation information for the second option is detected, determine that the permission information of the second application is storage rights.
[0093] In one embodiment, the processor can also implement the following steps when executing the computer program: pre-generate multiple special photo albums; the pre-generated multiple special photo albums correspond one-to-one to multiple security levels; obtain the security level of the second application, and determine the special photo album that matches the security level of the second application from the pre-generated multiple special photo albums.
[0094] In one embodiment, when the processor executes the computer program, the following steps can also be implemented: determining whether the permission information of the first application is a dedicated album access permission through an access control list; if the permission information of the first application is a dedicated album access permission, routing the album access request to the sandbox environment of the target dedicated album.
[0095] In one embodiment, the processor can also implement the following steps when executing the computer program: when the album access request is used to request to write image data to a target dedicated album, the image data to be written is obtained, and the image data to be written is encrypted using a preset encryption algorithm to obtain encrypted image data; the encrypted image data is stored in the target dedicated album; or, when the album access request is used to request to read image data from a target dedicated album, the image data to be read is obtained from the target dedicated album, and the image data to be read is decrypted using a preset decryption algorithm to obtain decrypted image data; and the decrypted image data is sent to the first application.
[0096] According to the electronic device of the embodiment of the present disclosure, by setting up a dedicated album for an application, the application's access to the terminal's default album is restricted, and the application is only allowed to read and write the contents of the dedicated album. This solves the problem of applications indiscriminately accessing all the user's photos and videos, which increases the risk of personal privacy leakage. It can protect user privacy while ensuring that the application's access to the album functionality and user experience are not affected.
[0097] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: in response to an album access request of a first application, obtaining permission information of the first application; when the permission information of the first application is dedicated album access permission, determining a target dedicated album corresponding to the first application from at least one preset dedicated album; performing corresponding data read and write operations on the target dedicated album through the album access request; when the permission information of the first application is storage permission, allowing the first application to access a default album, so as to perform corresponding data read and write operations on the default album through the album access request.
[0098] In one embodiment, when the computer program is executed by the processor, the following steps can also be implemented: in response to the permission application request of the second application, an authorization interface is displayed; the authorization interface displays a first option for authorizing access rights to the dedicated photo album and a second option for authorizing storage rights; when confirmation information for the first option is detected, a sandbox environment corresponding to the second application is created, and a dedicated photo album corresponding to the second application is generated in the sandbox environment; or, when confirmation information for the first option is detected, a dedicated photo album corresponding to the second application is selected from pre-generated dedicated photo albums; when confirmation information for the second option is detected, it is determined that the permission information of the second application is storage rights.
[0099] In one embodiment, when the computer program is executed by the processor, the following steps can also be implemented: pre-generating multiple special photo albums; the pre-generated multiple special photo albums correspond one-to-one to multiple security levels; obtaining the security level of the second application, and determining a special photo album that matches the security level of the second application from the pre-generated multiple special photo albums.
[0100] In one embodiment, when the computer program is executed by the processor, the following steps can also be implemented: determining whether the permission information of the first application is a dedicated album access permission through an access control list; if the permission information of the first application is a dedicated album access permission, routing the album access request to the sandbox environment of the target dedicated album.
[0101] In one embodiment, the computer program can also implement the following steps when executed by the processor: when an album access request is used to request writing image data to a target dedicated album, the image data to be written is obtained, and the image data to be written is encrypted using a preset encryption algorithm to obtain encrypted image data; the encrypted image data is stored in the target dedicated album; or, when the album access request is used to request reading image data from a target dedicated album, the image data to be read is obtained from the target dedicated album, and the image data to be read is decrypted using a preset decryption algorithm to obtain decrypted image data; and the decrypted image data is sent to the first application.
[0102] According to the computer-readable storage medium of the embodiment of the present disclosure, by setting a dedicated album for an application, the application's access to the terminal's default album is restricted, and the application is only allowed to read and write the contents of the dedicated album. This solves the problem of the application's indiscriminate access to all the user's photos and videos, which increases the risk of personal privacy leakage. It can protect user privacy while ensuring that the application's access to the album functionality and user experience are not affected.
[0103] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided by the present disclosure can include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in various forms, such as static random access memory (SRAM) and dynamic random access memory (DRAM).
[0104] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0105] The above-mentioned embodiments only express several implementation methods of the present disclosure, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present disclosure, and these all belong to the protection scope of the present disclosure. Therefore, the protection scope of the patent of the present disclosure shall be subject to the attached claims.
Claims
1. A method for controlling application access to a photo album, characterized in that: include: In response to a photo album access request from a first application, obtaining permission information of the first application; In a case where the permission information of the first application is a dedicated album access permission, determining a target dedicated album corresponding to the first application from at least one preset dedicated album; Performing corresponding data read and write operations on the target dedicated album through the album access request; In the case where the permission information of the first application is storage permission, the first application is allowed to access the default album, so as to perform corresponding data read and write operations on the default album through the album access request.
2. The method according to claim 1, characterized in that The method further comprises: In response to the permission application request of the second application, an authorization interface is displayed; the authorization interface displays a first option for authorizing the dedicated album access permission and a second option for authorizing the storage permission; When confirmation information for the first option is detected, creating a sandbox environment corresponding to the second application, and generating a dedicated photo album corresponding to the second application in the sandbox environment; Alternatively, when confirmation information for the first option is detected, a dedicated album corresponding to the second application is selected from pre-generated dedicated albums; When confirmation information for the second option is detected, it is determined that the permission information of the second application is the storage permission.
3. The method according to claim 2, characterized in that The selecting, from pre-generated dedicated albums, a dedicated album corresponding to the second application includes: Pre-generate multiple dedicated photo albums; the pre-generated multiple dedicated photo albums correspond to multiple security levels one by one; The security level of the second application is obtained, and a dedicated photo album matching the security level of the second application is determined from the pre-generated multiple dedicated photo albums.
4. The method according to claim 1, characterized in that The step of determining a target dedicated photo album corresponding to the first application from at least one preset dedicated photo album when the permission information of the first application is dedicated photo album access permission includes: Determining, through an access control list, whether the permission information of the first application is the dedicated album access permission; If the permission information of the first application is the dedicated album access permission, the album access request is routed to the sandbox environment of the target dedicated album.
5. The method according to claim 1, characterized in that The performing corresponding data reading and writing operations on the target dedicated album through the album access request includes: When the album access request is used to request writing image data into the target dedicated album, the image data to be written is acquired, and the image data to be written is encrypted using a preset encryption algorithm to obtain encrypted image data; storing the encrypted image data in the target dedicated album; or, When the album access request is used to request to read image data from the target dedicated album, the image data to be read is obtained from the target dedicated album, and the image data to be read is decrypted using a preset decryption algorithm to obtain decrypted image data; The decrypted image data is sent to the first application.
6. A control device for an application to access a photo album, characterized in that: include: An acquisition module, configured to acquire permission information of a first application in response to an album access request of the first application; a determination module, configured to determine a target dedicated album corresponding to the first application from at least one preset dedicated album when the permission information of the first application is dedicated album access permission; A first processing module, configured to execute corresponding data read and write operations on the target dedicated photo album through the photo album access request; The second processing module is used to allow the first application to access the default album when the permission information of the first application is storage permission, so as to perform corresponding data read and write operations on the default album through the album access request.
7. The device according to claim 6, characterized in that The device also includes: A permission application module, configured to display an authorization interface in response to a permission application request of the second application; the authorization interface displays a first option for authorizing the dedicated album access permission and a second option for authorizing the storage permission; When confirmation information for the first option is detected, creating a sandbox environment corresponding to the second application, and generating a dedicated photo album corresponding to the second application in the sandbox environment; Alternatively, when confirmation information for the first option is detected, a dedicated album corresponding to the second application is selected from pre-generated dedicated albums; When confirmation information for the second option is detected, it is determined that the permission information of the second application is the storage permission.
8. The device according to claim 6, characterized in that The determination module is specifically used for: Determining, through an access control list, whether the permission information of the first application is the dedicated album access permission; If the permission information of the first application is the dedicated album access permission, the album access request is routed to the sandbox environment of the target dedicated album.
9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.