Authority control method of application program and terminal equipment

By configuring preset modules on terminal devices to store the access rights types of applications, the problem of insufficient or excessive authority control in the existing technology is solved, and the refined permission management of applications is realized, which enhances user privacy data security and the application is running normally.

CN119066630APending Publication Date: 2024-12-03HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310645899.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-01
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

The application permission control method of existing terminal devices has a rough control over permissions, which leads to excessive authorization or excessive restrictions, which may lead to user privacy data leakage or application functions being restricted, affecting user experience.

Method used

By configuring preset modules on the terminal device, the access permission types of the application, including all data and some data types, and returning corresponding permissions based on this type, the refined permission control of the application is realized and user privacy data security is ensured. Sex and application use properly.

Benefits of technology

It realizes refined control of application permissions, enhances the security of user privacy data, improves user experience, and avoids the limitation of functions or data leakage caused by misconfiguration of permissions by applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119066630A_ABST
    Figure CN119066630A_ABST
Patent Text Reader

Abstract

The invention provides a permission control method of an application program and terminal equipment, which can realize refined management and control of permissions, and enhance the privacy data security of a user while ensuring that the user normally uses the application program. The method comprises the steps that under the condition that a first application has the permission to access target data, a data access request is initiated to a target data storage module through the first application, and the data access request is used for requesting to access the target data; based on the data access request, a first permission query request is initiated to a first preset module through a target data storage module, the first permission query request is used for querying the access permission type of the first application, and the access permission type of the first application is stored in the first preset module; and returning data corresponding to the access permission type of the first application to the first application through the target data storage module.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a permission control method for an application and a terminal device. Background Art

[0002] With the development of smart terminals, a large number of applications (APPs) have emerged. Users install these applications through terminal devices. When users use the applications, the applications may apply for permissions from the terminal devices. For example, applications usually ask the terminal devices whether to allow access to storage, read calendars, obtain location information, and obtain sensor data.

[0003] At present, when an application applies for permission from a terminal device, the terminal device usually configures the application to be allowed the above permission or to be prohibited from the above permission based on the user's operation. For example, application A applies to the terminal device for permission to access the calendar, and the terminal device configures application A to be allowed to read and write calendar data based on the user's setting operation of allowing access, or the terminal device configures application A to be prohibited from reading and writing calendar data based on the user's setting operation of denying access.

[0004] The above permission control method has a relatively rough control over permissions, which may result in over-authorization or over-restriction of the above applications. In the case of over-authorization of applications, some malicious applications may secretly read the data created by applications on terminal devices, resulting in leakage of user privacy data. In the case of over-restriction of the above applications, users may not be able to use the applications normally, resulting in a poor user experience. Summary of the invention

[0005] The present application provides an application permission control method and terminal device, which can realize refined management and control of permissions, enhance the security of users' privacy data while ensuring users' normal use of applications, thereby improving user experience.

[0006] In a first aspect, a method for controlling permission of an application is provided, which is applied to a terminal device installed with a first application, the method comprising: initiating a data access request to a target data storage module through the first application when the first application has permission to access target data, the data access request being used to request access to the target data; based on the data access request, initiating a first permission query request to a first preset module through the target data storage module, the first permission query request being used to query the access permission type of the first application, the first preset module storing the access permission type of the first application, the access permission type comprising a first type for accessing all target data and a second type for accessing part of the target data; and returning data corresponding to the access permission type of the first application to the first application through the target data storage module.

[0007] It should be understood that the target data may include data involving user privacy information such as calendar, storage, sensor, phone, text message, address book, call log, camera, location information, microphone, floating window, etc. The target data storage module is a functional module for storing target data, which belongs to the application framework layer in the Android structure, for example, it may be a calendar provider, a media provider, or a sensor provider. The first application may be an application program that needs to access the target data when implementing some functions of the application, and accessing the target data may include reading the target data and / or writing data in the target data, and writing data includes adding, deleting, and modifying.

[0008] For example, the target data may be schedule information in a calendar, and the target data storage module may be Figure 2 The calendar provider shown in the figure stores schedule information in the calendar. The first application may be a video application that needs to read the schedule information in the calendar and add schedule information in the calendar when booking a live program. If the video application has the authority to read the schedule information in the calendar, the video application requests the calendar provider to read the schedule information in the calendar, and if the video application has the authority to add schedule information in the calendar, the video application requests the calendar provider to add schedule information in the calendar.

[0009] The permission control method for an application provided in the present application is applied to a terminal device on which a first application is installed. By configuring a first preset module on the terminal device, the first preset module stores the access permission type for the first application to access the target data, and the access permission type includes a first type for accessing all the target data and a second type for accessing part of the target data. When the first application accesses the target data, the terminal device can return data corresponding to the access permission type to the first application based on the access permission type. In this way, in the subsequent scenario where the user sets the first application to only access the second type of data, the first application can only access part of the target data, but not all of the target data, thereby achieving refined control of permissions and enhancing the security of the user's privacy data.

[0010] In combination with the first aspect, in certain implementations of the first aspect, before initiating a data access request to the target data storage module through the first application, the method also includes: initiating a second permission query request to the package management service module through the first application, the second permission query request being used to request whether the first application has permission to access the target data; based on the second permission query request, querying through the package management service module whether the first application has permission to access the target data.

[0011] In combination with the first aspect, in certain implementations of the first aspect, before initiating a data access request to the target data storage module through the first application, the method also includes: based on the current business scenario, determining through the first application whether the first application needs to have the first type of access rights; when the first application needs to have the first type of access rights, initiating a third permission query request to the first preset module through the first application, the third permission query request being used to query whether the first application has the first type of access rights; initiating a data access request to the target data storage module through the first application, including: when the first application needs to have the first type of access rights and the first application has the first type of access rights, initiating a data access request to the target data storage module through the first application.

[0012] By adding the judgment of the business scenario, it is helpful to avoid the problem that the first application cannot access the target data in the business scenario when the first application needs to have the first type of access rights but does not have the first type of access rights.

[0013] In combination with the first aspect, in certain implementations of the first aspect, the method also includes: when the first application needs to have the first type of access rights and the first application does not have the first type of access rights, the terminal device displays a first interface, and the first interface includes information for prompting the user that the first application needs to have the first type of access rights.

[0014] In combination with the first aspect, in some implementations of the first aspect, the first interface further includes: a button for selecting a first type of access permission, a button for selecting a second type of access permission, and a button for not allowing access.

[0015] Through the settings of the first interface, it is convenient for users to set access permissions, thereby improving the user experience.

[0016] In combination with the first aspect, in some implementations of the first aspect, the first interface further includes: a switch button for turning on or off the first type of access rights.

[0017] In combination with the first aspect, in certain implementations of the first aspect, before initiating a data access request to the target data storage module through the first application, the method also includes: based on the current business scenario, determining through the first application whether the first application needs to have the first type of access rights; initiating a data access request to the target data storage module through the first application, including: initiating a data access request to the target data storage module through the first application when the first application does not need to have the first type of access rights.

[0018] In combination with the first aspect, in certain implementations of the first aspect, a data access request is used to request the addition of new data to the target data, and the data access request carries the data to be added; after initiating data corresponding to the access permission type of the first application to the first application through the target data storage module, the method also includes: querying through the first application whether the data corresponding to the access permission type of the first application includes the data to be added; if the data corresponding to the access permission type of the first application does not include the data to be added, writing the data to be added to the target data storage module through the first application.

[0019] By checking whether the data corresponding to the access permission type of the first application includes the data to be added, the data to be added is written only when the data corresponding to the access permission type of the first application does not include the data to be added, which helps to avoid duplication problems when the first application adds data in the target data storage.

[0020] In combination with the first aspect, in certain implementations of the first aspect, writing the data to be added to a target data storage module through a first application includes: calling a package management service module through the first application to check whether the first application has write permission to the target data, and obtaining a first check result; when the first check result is that the first application has write permission to the target data, initiating a data write request to the target data storage module through the first application, the data write request is used to add the data of the first application to the target data, and the data write request carries the data to be added; calling a package management service module through the target data storage module to check whether the first application has write permission to the target data, and obtaining a second check result; when the second check result is that the first application has write permission to the target data, the target data storage module stores the data to be added.

[0021] In combination with the first aspect, in certain implementations of the first aspect, a data access request is used to request modification or deletion of target data, and the data access request carries data to be modified or data to be deleted; after returning the data corresponding to the access permission type of the first application to the first application through the target data storage module, the method also includes: querying through the first application whether the data corresponding to the access permission type of the first application includes data to be modified or data to be deleted; and when the data corresponding to the access permission type of the first application includes data to be modified or data to be deleted, calling the target data storage module through the first application to modify or delete the corresponding data.

[0022] By checking whether the data corresponding to the access permission type of the first application includes data to be modified or data to be deleted, corresponding modifications and deletions are performed only when the data corresponding to the access permission type of the first application includes data to be modified or data to be deleted. This helps to solve the problem of not being able to find the corresponding data when the first application needs to modify or delete data later.

[0023] In combination with the first aspect, in certain implementations of the first aspect, calling a target data storage module by a first application to modify or delete corresponding data includes: calling a package management service module by the first application to check whether the first application has write permission for the target data, and obtaining a first check result; when the first check result is that the first application has write permission for the target data, the first application initiates a data write request to the target data storage module, the data write request is used to modify or delete data in the target data, and the data write request carries data to be modified or data to be deleted; calling a package management service module by the target data storage module to check whether the first application has write permission for the target data, and obtaining a second check result; when the second check result is that the first application has write permission for the target data, calling a first preset module by the target data storage module to check the write permission type of the first application, the write permission type including a third type that allows modification or deletion of all data in the target data and a fourth type that allows modification or deletion of part of the target data; based on the write permission type of the first application, modifying or deleting the corresponding data by the target data storage module.

[0024] By checking the write permission type and modifying or deleting the data in the target data storage module accordingly based on the write permission type, it is possible to implement refined management and control of the write permission of the target data of the first application, which is beneficial to improving the data security in the target data storage module.

[0025] In combination with the first aspect, in certain implementations of the first aspect, before initiating a data write request to the target data storage module through the first application, the method also includes: based on the current business scenario, determining through the first application whether the first application needs to have the third type of write permission; when the first application needs to have the third type of write permission, calling the first preset module through the first application to check whether the first application has the third type of write permission; initiating a data write request to the target data storage module through the first application, including: when the first application needs to have the third type of write permission and the first application has the third type of write permission, initiating a data write request to the target data storage module through the first application.

[0026] By adding judgment of business scenarios, it is helpful to avoid the problem that the first application cannot delete or modify data in the target data when the first application needs to have the third type of write permission but does not have the third type of access permission.

[0027] In combination with the first aspect, in certain implementations of the first aspect, before initiating a data access request to the target data storage module through the first application, the method also includes: based on the current business scenario, determining through the first application whether the first application needs to have the third type of write permission; initiating a data write request to the target data storage module through the first application, including: initiating a data write request to the target data storage module through the first application when the first application does not need to have the third type of write permission.

[0028] When the first application does not need the third type of write permission, initiating a data write request to the target data storage module through the first application can save the check process of the write permission type of the first application, which is beneficial to improving the response rate of the terminal device and improving the user experience.

[0029] In combination with the first aspect, in some implementations of the first aspect, the target data is calendar data, and the target data storage module is a calendar provider.

[0030] In combination with the first aspect, in some implementations of the first aspect, the target data is sensor data, and the target data storage module is a sensor provider.

[0031] In combination with the first aspect, in some implementations of the first aspect, the data corresponding to the second type of access permission is the data of the first application in the target data storage module.

[0032] In combination with the first aspect, in some implementations of the first aspect, the target data is memory data, and the target data storage module is a media provider.

[0033] In combination with the first aspect, in some implementations of the first aspect, data corresponding to the second type of access permission is a file of a preset type in the media provider.

[0034] In a second aspect, the present application provides a method for controlling application permissions, which is applied to a terminal device installed with a first application, the method comprising: when the first application has permission to access calendar data, initiating a data access request to a calendar provider through the first application, the data access request being used to request access to calendar data; based on the data access request, initiating a first permission query request to a first preset module through the calendar provider, the first permission query request being used to query the access permission type of the first application, the first preset module storing the access permission type of the first application, the access permission type comprising a first type for accessing all schedule information of the calendar data and a second type for accessing part of the schedule information of the calendar data; returning data corresponding to the access permission type of the first application to the first application through the calendar provider.

[0035] The application permission control method provided in the present application, through the refined control of the first application's access to calendar data, is helpful in preventing the developer of the application that the user does not trust from maliciously obtaining or tampering with the user's calendar data. On the other hand, when the user manages the schedule information through the first application, the user can only manage the authorized part of the schedule information, which is helpful in improving the user's management efficiency of the schedule information.

[0036] According to a third aspect, a terminal device is provided, comprising a processing module, wherein the processing module is used to initiate a data access request to a target data storage module through a first application when the first application has the permission to access the target data, the data access request being used to request access to the target data; based on the data access request, initiate a first permission query request to a first preset module through the target data storage module, the first permission query request being used to query the access permission type of the first application, the first preset module storing the access permission type of the first application, the access permission type comprising a first type for accessing all the target data and a second type for accessing part of the target data; and return data corresponding to the access permission type of the first application to the first application through the target data storage module.

[0037] In one design, the terminal device can execute the method / operation / step / action described in the first aspect above through a processing module. The processing module can be a hardware circuit, software, or a combination of hardware circuit and software.

[0038] In a fourth aspect, a terminal device is provided, comprising: a processor and a memory, wherein the processor is used to read instructions stored in the memory to execute a method in any possible implementation of the first aspect or the second aspect.

[0039] Optionally, there are one or more processors and one or more memories.

[0040] Optionally, the memory may be integrated with the processor, or the memory may be provided separately from the processor.

[0041] In the specific implementation process, the memory can be a non-transitory memory, such as a read-only memory (ROM), which can be integrated with the processor on the same chip or can be set on different chips respectively. The embodiments of the present application do not limit the type of memory and the setting method of the memory and the processor.

[0042] The terminal device in the third aspect mentioned above can be a chip, and the processor can be implemented by hardware or by software. When implemented by hardware, the processor can be a logic circuit, an integrated circuit, etc.; when implemented by software, the processor can be a general-purpose processor, which is implemented by reading the software code stored in the memory. The memory can be integrated in the processor or can be located outside the processor and exist independently.

[0043] In a fifth aspect, a computer program product is provided, which includes: a computer program (also referred to as code, or instruction), which, when executed, enables a computer to execute a method in any possible implementation of the first aspect or the second aspect.

[0044] In a sixth aspect, a computer-readable storage medium is provided, which stores a computer program (also referred to as code, or instructions). When the computer-readable storage medium is run on a computer, the computer executes a method in any possible implementation of the first aspect or the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 is a schematic diagram of the structure of a terminal device according to an embodiment of the present application;

[0046] Figure 2 is a software structure block diagram of a terminal device in an embodiment of the present application;

[0047] Figure 3 This is a schematic diagram of the relationship between an application and data provided in an embodiment of the present application;

[0048] Figure 4 is a schematic diagram of the relationship between another application and data provided in an embodiment of the present application;

[0049] Figure 5 is a schematic flow chart of a method for controlling permissions of an application program provided in an embodiment of the present application;

[0050] Figure 6 It is an interactive schematic diagram of another method for controlling permissions of an application program provided in an embodiment of the present application;

[0051] Figure 7 It is an interactive schematic diagram of another method for controlling permissions of an application program provided in an embodiment of the present application;

[0052] Figure 8 is an interactive schematic diagram of another application program permission control method provided in an embodiment of the present application;

[0053] Fig. 9 It is an interactive schematic diagram of another permission control method for an application program provided in an embodiment of the present application;

[0054] Fig.10 This is a schematic diagram of a mobile phone interface change provided by an embodiment of the present application;

[0055] Fig.11 is a schematic diagram of interface changes of another mobile phone provided in an embodiment of the present application;

[0056] Fig.12 is a schematic diagram of interface changes of yet another mobile phone provided in an embodiment of the present application;

[0057] Fig.13 It is a schematic diagram of the interface display of another mobile phone provided in an embodiment of the present application;

[0058] Fig.14 is a schematic flow chart of another permission control method provided in an embodiment of the present application;

[0059] Fig.15 It is a schematic block diagram of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0060] The technical solution in this application will be described below in conjunction with the accompanying drawings.

[0061] In order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with substantially the same functions and effects. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit the difference.

[0062] It should be noted that, in this application, words such as "exemplarily" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplarily" or "for example" in this application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present related concepts in a specific way.

[0063] In addition, "at least one" means one or more, and "plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can mean: a, or b, or c, or a and b, or a and c, or b and c, or a, b and c, where a, b, c can be single or multiple.

[0064] In the embodiments of the present application, descriptions such as "when...", "in the case of...", "if" and "if" all mean that the device will make corresponding processing under certain objective circumstances. It does not limit the time, nor does it require the device to have a judgment action when implementing it, nor does it mean that there are other limitations.

[0065] In order to better understand the terminal device in the embodiment of the present application, Figure 1 The hardware structure of the terminal device in the embodiment of the present application is described in detail.

[0066] Figure 1 This is a schematic diagram of the structure of the terminal device 100 provided in the embodiment of the present application. Figure 1 As shown, the terminal device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0067] It is understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0068] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0069] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0070] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0071] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0072] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface, thereby realizing the touch function of the terminal device 100.

[0073] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.

[0074] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface to realize the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0075] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.

[0076] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the terminal device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the terminal device 100.

[0077] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0078] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the terminal device 100, and can also be used to transmit data between the terminal device 100 and peripheral devices. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other terminal devices, such as AR devices, etc.

[0079] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0080] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the terminal device 100. While the charging management module 140 is charging the battery 142, it may also power the terminal device through the power management module 141.

[0081] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0082] The wireless communication function of the terminal device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0083] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0084] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the terminal device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0085] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0086] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the terminal device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0087] In some embodiments, the antenna 1 of the terminal device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the terminal device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0088] The terminal device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.

[0089] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light emitting diode or an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the terminal device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0090] The terminal device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0091] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.

[0092] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the terminal device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0093] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the terminal device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0094] Video codecs are used to compress or decompress digital videos. The terminal device 100 may support one or more video codecs. Thus, the terminal device 100 may play or record videos in various coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0095] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of the terminal device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0096] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0097] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the terminal device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the terminal device 100 by running instructions stored in the internal memory 121, and / or instructions stored in a memory provided in the processor.

[0098] The terminal device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0099] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.

[0100] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The terminal device 100 can listen to music or listen to a hands-free call through the speaker 170A.

[0101] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the terminal device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the ear.

[0102] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The terminal device 100 can be provided with at least one microphone 170C. In other embodiments, the terminal device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the terminal device 100 can also be provided with three, four or more microphones 170C to realize the collection of sound signals, noise reduction, identification of sound sources, realization of directional recording function, etc.

[0103] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0104] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The terminal device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the terminal device 100 detects the touch operation intensity according to the pressure sensor 180A. The terminal device 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.

[0105] The gyroscope sensor 180B can be used to determine the motion posture of the terminal device 100. In some embodiments, the angular velocity of the terminal device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the terminal device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the terminal device 100 through reverse movement to achieve anti-shake. The gyroscope sensor 180B can also be used for navigation and somatosensory game scenes.

[0106] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the terminal device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.

[0107] The magnetic sensor 180D includes a Hall sensor. The terminal device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. In some embodiments, when the terminal device 100 is a flip phone, the terminal device 100 can detect the opening and closing of the flip cover according to the magnetic sensor 180D. Then, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, the flip cover automatic unlocking and other features are set.

[0108] The acceleration sensor 180E can detect the magnitude of the acceleration of the terminal device 100 in various directions (generally three axes). When the terminal device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the terminal device and applied to applications such as horizontal and vertical screen switching and pedometers.

[0109] The distance sensor 180F is used to measure the distance. The terminal device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the terminal device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.

[0110] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The terminal device 100 emits infrared light outward through the light emitting diode. The terminal device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the terminal device 100. When insufficient reflected light is detected, the terminal device 100 can determine that there is no object near the terminal device 100. The terminal device 100 can use the proximity light sensor 180G to detect that the user holds the terminal device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode, and pocket mode automatically unlocks and locks the screen.

[0111] The ambient light sensor 180L is used to sense the ambient light brightness. The terminal device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the terminal device 100 is in a pocket to prevent accidental touch.

[0112] The fingerprint sensor 180H is used to collect fingerprints. The terminal device 100 can use the collected fingerprint characteristics to achieve fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.

[0113] The temperature sensor 180J is used to detect temperature. In some embodiments, the terminal device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the terminal device 100 reduces the performance of the processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the terminal device 100 heats the battery 142 to avoid abnormal shutdown of the terminal device 100 due to low temperature. In other embodiments, when the temperature is lower than another threshold, the terminal device 100 performs a boost on the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.

[0114] The touch sensor 180K is also called a "touch control device". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch control screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the terminal device 100, which is different from the position of the display screen 194.

[0115] The bone conduction sensor 180M can obtain a vibration signal. In some embodiments, the bone conduction sensor 180M can obtain a vibration signal of a vibrating bone block of the vocal part of the human body. The bone conduction sensor 180M can also contact the human pulse to receive a blood pressure beat signal. In some embodiments, the bone conduction sensor 180M can also be set in an earphone and combined into a bone conduction earphone. The audio module 170 can parse out a voice signal based on the vibration signal of the vibrating bone block of the vocal part obtained by the bone conduction sensor 180M to realize a voice function. The application processor can parse the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180M to realize a heart rate detection function.

[0116] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The terminal device 100 may receive key input and generate key signal input related to user settings and function control of the terminal device 100.

[0117] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0118] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power changes, messages, missed calls, notifications, etc.

[0119] The SIM card interface 195 is used to connect the SIM card. The SIM card can be connected to and separated from the terminal device 100 by inserting the SIM card interface 195 or pulling it out from the SIM card interface 195. The terminal device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM card, Micro SIM card, SIM card, etc. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The terminal device 100 interacts with the network through the SIM card to realize functions such as calls and data communications. In some embodiments, the terminal device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the terminal device 100 and cannot be separated from the terminal device 100. The software system of the terminal device 100 can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system with a layered architecture as an example to illustrate the software structure of the terminal device 100.

[0120] Figure 2 This is a software structure block diagram of the terminal device 100 according to an embodiment of the present application.

[0121] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely, the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.

[0122] The application layer can include a series of application packages. Figure 2 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, music, system settings, short message, permission controller, A application, settings, etc.

[0123] The application framework layer provides application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions. Figure 2As shown, the application framework layer may include a window identifier, a content provider, a view system, a phone manager, a resource manager, a notification manager, an input manager, a package manager, a calendar provider, a media provider, a sensor provider, a permission recommendation service, a permission management extension service (HnAppOpsService), and the like.

[0124] The window identifier is used to store the flag status, create snapshots, and identify the user's gesture operation. The snapshot can be used to store information, such as the name of the installation package. The user's gesture operation can be identified, specifically, to determine whether the user's gesture operation is the same as the preset gesture operation.

[0125] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0126] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

[0127] The phone manager is used to provide communication functions of the terminal device 100, such as management of call status (including connection, disconnection, etc.).

[0128] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0129] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, the terminal device vibrates, the indicator light flashes, etc.

[0130] The input manager is used to obtain and transmit various input information of the user. For example, the user's operation gesture can be received and sent to the desktop launcher.

[0131] The package manager is used to manage the installation packages of various applications installed in the terminal device, such as installation packages of music, video, navigation and other applications.

[0132] The calendar provider is used to store schedule information created by various applications. For example, when a user schedules a live program on a video application, or when a user creates a meeting on a conference application, the calendar provider can store the live program and meeting schedule information in the calendar provider.

[0133] Media providers are used to store media files. For example, media providers store videos, pictures, music, word files, pdf files, etc. created by applications.

[0134] The sensor provider is used for sensor data generated by sensors, such as sensor data generated by shaking the terminal device through an application.

[0135] The permission recommendation service is used to save the permission recommendation data and send the recommendation data to the permission controller.

[0136] The permission management extension service is used to store and monitor the permission control information set by the user. For example, the user sets the video application to have the permission to access the calendar, and the permission management extension service stores the permission value of the video application to access the calendar as allow and monitors the change of the permission value.

[0137] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

[0138] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

[0139] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0140] The system library may include multiple functional modules, such as surface manager, media libraries, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0141] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.

[0142] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0143] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis and layer processing.

[0144] A 2D graphics engine is a drawing engine for 2D drawings.

[0145] The kernel layer is a layer between hardware and software. The kernel layer is used to drive the hardware to make the hardware work. The kernel layer at least includes display driver, screen driver, graphics processing unit (GPU) driver, camera, and sensor driver, etc., which are not limited in the embodiments of the present application. For example, the screen driver can drive the screen to turn on or off.

[0146] With the development of smart terminals, a large number of applications (APPs) have emerged. Users install these applications through terminal devices. When users use the applications, the applications may apply for permissions from the terminal devices. For the convenience of description, "applications" will be referred to as "apps" in the following.

[0147] It should be understood that after the user installs the application on the terminal device, the application is configured to grant permissions based on the default value when applying for some access permissions, and the default value is to allow or deny. When applying for other access permissions, the application is asked, that is, a pop-up window is displayed on the terminal device to prompt the user to set permissions, and the application permissions are configured based on the user's settings. For example, the application usually asks the terminal device whether to allow access to storage, whether to allow reading calendars, whether to allow obtaining location information, whether to allow obtaining sensor data, etc.

[0148] At present, when an application applies for permission from a terminal device, the terminal device usually configures the application to be allowed the above permission or to be prohibited from the above permission based on the user's operation. For example, application A applies to the terminal device for permission to access the calendar, and the terminal device configures application A to be allowed to read and write calendar data based on the user's setting operation of allowing access, or the terminal device configures application A to be prohibited from reading and writing calendar data based on the user's setting operation of denying access.

[0149] The above-mentioned permission control method has a coarse control granularity for permission, which may cause excessive authorization or excessive restriction of the above-mentioned applications. In the case of excessive authorization of applications, some malicious applications may secretly read the data created by applications on the terminal device, causing the leakage of user privacy data. For example, the data on the calendar includes the schedule information created by applications A, B, and C on the calendar application. After application A is configured to allow reading and writing calendar data, application A can obtain all schedule information on the calendar. If the developer of application A analyzes and uses all the schedule information, it will cause the user's privacy data to be leaked. In the case of excessive restrictions on the above-mentioned applications, users may not be able to use the applications normally, and the user experience is poor. For example, if a user schedules a live program on a video application, if the video application is configured not to allow reading and writing calendar data, the function of scheduling live programs in the video application cannot be used normally.

[0150] The following example uses an application accessing a calendar (i.e., an application reading and writing schedule information stored in a calendar provider) as an example. Figure 3 and Figure 4 Describes in detail the relationship between an application and the data when the application is configured to allow access to the calendar's data.

[0151] Figure 3 A schematic diagram of the relationship between an application and data provided in an embodiment of the present application. Figure 3 The two-layer structure of the application layer and the application framework layer is shown. The application layer includes application A, application B, and application C, etc., and the application framework layer includes a calendar provider. The calendar provider includes data A, data B, and data C, etc. The data A is generated by application A and stored in the calendar provider, the data B is generated by application B and stored in the calendar provider, and the data C is generated by application C and stored in the calendar provider.

[0152] When application A is configured to allow access to calendar data, application A can access data A, data B, and data C stored in the calendar provider. When application B is configured to allow access to calendar data, application B can access data A, data B, and data C stored in the calendar provider. When application C is configured to allow access to calendar data, application C can access data A, data B, and data C stored in the calendar provider. In this way, when application A reads and analyzes data B and data C, user privacy data may be leaked.

[0153] In order to solve the above problems, it is necessary to fine-tune the access rights of applications.

[0154] Figure 4This is a schematic diagram of another relationship between an application and data provided in an embodiment of the present application. Figure 4 A two-layer structure of an application layer and an application framework layer is shown. The application layer includes application A, application B, and application C, etc., and the application framework layer includes a calendar provider. The calendar provider includes data A, data B, and data C, etc. The data A is generated by application A and stored in the calendar provider, the data B is generated by application B and stored in the calendar provider, and the data C is generated by application C and stored in the calendar provider. To achieve refined control over the access rights of applications, it is necessary to configure application A to only access data A stored in the calendar provider, configure application B to only access data B stored in the calendar provider, and configure application C to only access data C stored in the calendar provider.

[0155] It should be understood that in actual business scenarios, it also includes applications being configured to allow access to stored data, applications being configured to allow access to sensor data, etc. In different business scenarios, the relationship between an application and the data obtained by the application is the same as the relationship between an application and the data obtained by the application in the business scenario of the application accessing calendar data mentioned above, and will not be repeated here.

[0156] At present, in order to achieve the above functions, some terminal manufacturers usually define control items on the native control mechanism of Android to carry out refined permission control, but each time a permission control item is added, a control item identifier needs to be defined. With the upgrade of the Android version, the number of native permission control items of Android will continue to increase, which may cause conflicts between the native permission control item identifiers of Android and the permission control item identifiers defined by the terminal manufacturer, resulting in errors in permission control. For example, the native permission control item identifiers of Android are 1, 2, ..., 2000, and the control item identifiers defined by the terminal manufacturer are 5000, 5001, ..., 6000. When the native permission control item identifiers of Android are increased to 1, 2, ..., 6000, the control item identifiers of the native permission control item identifiers of Android are 5000, 50001, ..., 6000, which will conflict with the control item identifiers defined by the terminal manufacturer. This requires the terminal manufacturer to redefine the control item identifiers, so that the manufacturer needs to invest a lot of time and money in code modification, which is very inconvenient to achieve refined permission control.

[0157] To this end, the present application proposes a permission control method for an application program, by configuring a first preset module on a terminal device, the first preset module storing the access permission type for the first application to access the target data, the access permission type including the first type for accessing all the target data and the second type for accessing part of the target data; when the first application accesses the target data, the terminal device can return the data corresponding to the access permission type to the first application based on the access permission type. In this way, in the subsequent scenario where the user sets the first application to only access the second type of data, the first application can only access part of the target data, but not all of the target data, thereby achieving refined control of permissions and enhancing the security of the user's privacy data.

[0158] The following specific embodiments are used to describe in detail the technical solution of the present application and how the technical solution of the present application solves the above technical problems. The following specific embodiments can be implemented independently or in combination with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0159] Figure 5 1 is a schematic flow chart of a method 500 for controlling the permissions of an application program provided in an embodiment of the present application. The method 500 is applied to the above-mentioned terminal device. The hardware structure of the terminal device involved in the method 500 can be as follows: Figure 1 As shown, the software structure can be as follows Figure 2 shown.

[0160] S501 , when the first application has the authority to access the target data, a data access request is initiated to a target data storage module through the first application, where the data access request is used to request access to the target data.

[0161] It should be understood that the target data may include data involving user privacy information such as calendar, storage, sensor, phone, text message, address book, call log, camera, location information, microphone, floating window, etc. The target data storage module is a functional module for storing target data, which belongs to the application framework layer in the Android structure, for example, it may be a calendar provider, a media provider, or a sensor provider. The first application may be an application program that needs to access the target data when implementing some functions of the application, and accessing the target data may include reading the target data and / or writing data in the target data, and writing data includes adding, deleting, and modifying.

[0162] For example, the target data may be schedule information in a calendar, and the target data storage module may be Figure 2The calendar provider shown in the figure stores schedule information in the calendar. The first application may be a video application that needs to read the schedule information in the calendar and add schedule information in the calendar when booking a live program. If the video application has the authority to read the schedule information in the calendar, the video application requests the calendar provider to read the schedule information in the calendar, and if the video application has the authority to add schedule information in the calendar, the video application requests the calendar provider to add schedule information in the calendar.

[0163] S502: Based on the data access request, initiate a first permission query request to a first preset module through a target data storage module, where the first permission query request is used to query the access permission type of the first application.

[0164] Specifically, the first preset module stores access permission types of the first application, and the access permission types include a first type for accessing all data of the target data and a second type for accessing part of the target data.

[0165] Optionally, the first permission query request carries the application identifier of the first application and the target data permission control identifier, and the target data permission control identifier is used to indicate what permission the first application has to access what target data; the first preset module stores the application access permission type correspondence relationship, and the application access permission type correspondence relationship includes the correspondence relationship between the application, the target data permission control item, and the permission value. Among them, one application can correspond to multiple target data permission control items, and each target data permission control item corresponds to a permission value. The first preset module queries the permission value corresponding to the application identifier and the target data permission control identifier of the first application in the application access permission type correspondence table, and determines the access permission type of the first application based on the permission value.

[0166] It should be understood that the above-mentioned permission values ​​may include a first type and a second type, and the permission values ​​may also include yes and no. The setting of the permission value is related to the target data permission control item defined by the specific R&D personnel, and this application does not impose any restrictions on this.

[0167] In one possible implementation, the developer defines a target data permission control item to indicate what permission the first application has to access the target data, and the permission values ​​corresponding to the target data permission control item are "first type" and "second type".

[0168] In another possible implementation, the developer can define a target data permission control item to indicate whether the first application has all permissions to access the target data. Correspondingly, the permission value corresponding to the target data permission control item is "yes" or "no". The permission value of "yes" indicates that the first application can access all the target data, that is, the access permission type of the first application is the first type, and the permission value of "no" indicates that the first application cannot access all the target data, that is, the first application accesses part of the target data, that is, the access permission type of the first application is the second type.

[0169] Exemplarily, the corresponding relationship of application access types can be shown in Table 1, which includes 3 groups of data, and the 3 groups of data are all access permission information corresponding to application A. The first group of data with serial number 1 indicates that the target data permission control item corresponding to application A is "read_calander_all", and the corresponding permission value is false, that is, application A does not have full permission to read calendar data, which can also be understood as the access permission type of application A to calendar data is the second type. The second group of data with serial number 2 indicates that the target data permission control item corresponding to application A is "read_sensor_all", and the corresponding permission value is true, that is, application A has full permission to read sensor data, which can also be understood as the access permission type of application A to sensor data is the first type. The third group of data with serial number 3 indicates that the target data permission control item corresponding to application A is "write_calander_all", and the corresponding permission value is true, that is, application A has the permission to delete or modify all calendar data, which can also be understood as the write permission type of application A to calendar data is the first type.

[0170] Table 1

[0171]

[0172]

[0173] Optionally, the target data is calendar data, and the target data storage module is a calendar provider.

[0174] Optionally, the target data is sensor data, and the target data storage module is a sensor provider.

[0175] In a possible implementation manner, the data corresponding to the second type of access permission is the data of the first application in the target data storage module.

[0176] Exemplarily, the calendar provider includes A data created by application A and B data created by application B. The access permission of application A to the calendar data is of the second type, and the data corresponding to the second type of access permission is A data.

[0177] Optionally, the target data is storage data, and the target data storage module is a media provider.

[0178] In a possible implementation manner, the data corresponding to the second type of access permission may be a file of a preset type in the access media provider.

[0179] Exemplarily, the media provider stores media files such as video, audio, and pictures, and common files such as word, pdf, and excel. The preset type of file can be the common file, that is, the common file is the data corresponding to the second type of access right. When the first application accesses the media data, the first application can be configured to access only the common files in the media provider.

[0180] S503: Send data corresponding to the access permission type of the first application to the first application through the target data storage module.

[0181] Optionally, when the data corresponding to the access permission type of the first application is data corresponding to the first type of access permission, the terminal device sends all the data in the target data storage module to the first application through the target data storage module.

[0182] Optionally, when the data corresponding to the access permission type of the first application is data corresponding to the second type of access permission, the terminal device sends the data written by the first application in the target data storage module to the first application through the target data storage module.

[0183] The permission control method for an application provided in the present application is applied to a terminal device on which a first application is installed. By configuring a first preset module on the terminal device, the first preset module stores the access permission type for the first application to access the target data, and the access permission type includes a first type for accessing all the target data and a second type for accessing part of the target data. When the first application accesses the target data, the terminal device can return data corresponding to the access permission type to the first application based on the access permission type. In this way, in the subsequent scenario where the user sets the first application to only access the second type of data, the first application can only access part of the target data, but not all of the target data, thereby achieving refined control of permissions and enhancing the security of the user's privacy data.

[0184] Figure 6 6 is a schematic flow chart of another permission control method 600 for an application program provided in an embodiment of the present application. The method 600 is applied to the above-mentioned terminal device. The hardware structure of the terminal device involved in the method 600 can be as follows: Figure 1 As shown, the software structure can be as follows Figure 2 shown.

[0185] S601, when the first application has the authority to access calendar data, the first application initiates a data access request to the calendar provider, the data access request is used to request access to the calendar data, and correspondingly, the calendar provider receives the data access request.

[0186] S602, based on the data access request, the calendar provider initiates a first permission query request to the first preset module, the first permission query request is used to query the access permission type of the first application, and correspondingly, the first preset module receives the first permission query request.

[0187] S603: The first preset module obtains the access permission type of the first application based on the first permission query request.

[0188] S604: The first preset module sends the access permission type of the first application to the calendar provider, and correspondingly, the calendar provider receives the access permission type of the first application.

[0189] S605: The calendar provider determines data corresponding to the access permission type based on the access permission type.

[0190] S606: The calendar provider returns data corresponding to the access permission type of the first application to the first application.

[0191] The application permission control method provided in the present application, through the refined control of the first application's access to calendar data, is helpful in preventing the developer of the application that the user does not trust from maliciously obtaining or modifying the user's calendar data. On the other hand, when the user manages the schedule information through the first application, the user can only manage the authorized part of the schedule information, which is helpful in improving the user's management efficiency of the schedule information.

[0192] Below, we will take the first application reading calendar data as an example. Figure 7 The permission control method of this application is further explained.

[0193] Figure 7 700 is an interactive diagram of a permission control method for an application provided in an embodiment of the present application. The method 700 is applied to the above-mentioned terminal device. The hardware structure of the terminal device involved in the method 700 can be as follows: Figure 1 As shown, the software structure can be as follows Figure 2 shown.

[0194] S701: In response to a user operation on a first control of a first application, the first application sends a first read permission check request to a package management service module, and correspondingly, the package management service module receives the first read permission check request. The first read permission request carries an application identifier of the first application and an identifier of native calendar read permission control.

[0195] Specifically, the first application may be an application that needs to read calendar data. The first control may be a button for the first application that triggers a first read permission check request based on a click or slide operation of the user. The first read permission check request is used by the first application to check whether the first application has permission to read calendar data. The application identifier of the first application may be the package name and ID of the first application, or the application identifier of the first application may be the ID of the first application. The native calendar read permission control item identifier may be the name of the native calendar read permission control item or the ID of the native calendar read permission control item.

[0196] For example, when the first application is application A that allows the terminal device to schedule live programs, the first control may be a "booking" button on application A that can implement the booking function. After the terminal device responds to the user's click operation on the "booking" button, application A is triggered to check whether application A has the permission to read calendar data. The package name of the first application may be test.com, the ID of the first application may be "123", the name of the native calendar read permission control item may be read_calander, and the ID of the native calendar read permission control item may be "0001".

[0197] S702: The package management service module obtains first read permission data based on the first read permission check request. The first read permission data is used to indicate whether the first application has permission to read calendar data.

[0198] Optionally, the first read permission data may be “deny” or “allow”.

[0199] Exemplarily, the first read permission data may be “allow” or “deny”.

[0200] S703: The package management service module returns the first read permission data to the first application, and correspondingly, the first application receives the first read permission data.

[0201] S704: The first application determines whether the first application has permission to read calendar data based on the first reading permission data.

[0202] Exemplarily, when the first read permission data is "allow", the first application determines that the first application has the permission to read the calendar data. When the first read permission data is "deny", the first application determines that the first application does not have the permission to read the calendar data.

[0203] S705: When the first application has the permission to read calendar data, the first application checks whether the first application needs to read all the data of the calendar based on the current business scenario.

[0204] It should be understood that in some business scenarios, the first application only needs to read the data written by the first application to the calendar. In other business scenarios, the first application needs to read all the data of the calendar. This requires the developers of the first application to adapt and develop based on the needs of the business scenario.

[0205] For example, in a business scenario where a video application schedules a live program, the video application only needs to read the data written to the calendar by the video application to implement the reservation function. In a business scenario where a schedule management application synchronizes all schedule information of the system calendar, the schedule management application needs to be able to read all calendar data to implement the schedule management function.

[0206] It should also be understood that when the first application does not have permission to read calendar data, a pop-up window may be displayed to prompt the user to set calendar permissions.

[0207] The following discusses the above two business scenarios separately.

[0208] Scenario 1: The first application needs to read all the data of the calendar. That is, the first application needs to read all the data of the calendar to implement business functions. For example, in the business scenario where a schedule management application synchronizes all the schedule information of the system calendar, the schedule management application needs to be able to read all the data of the calendar in order to manage the data in the calendar, that is, to implement the schedule management function.

[0209] S706: When the first application needs to have permission to read all data of the calendar, the first application sends a second read permission check request to the permission management extension service module, and correspondingly, the permission management extension service module receives the second read permission check request. The second read permission request carries the application identifier of the first application and the identifier of the newly added calendar read permission control item.

[0210] Specifically, the second read permission check request is used to check whether the first application has permission to read all data of the calendar. The identifier of the newly added calendar read permission control item can be the name of the newly added calendar read permission control item or the ID of the newly added calendar read permission control item.

[0211] It should be understood that the first application having the permission to read all calendar data can also be understood as the first application having the above-mentioned first type of access rights, and the first application not having the permission to read all calendar data can also be understood as the first application having the above-mentioned second type of access rights.

[0212] Exemplarily, the name of the newly added calendar read permission control item may be read_calander, and the ID of the newly added calendar read permission control item may be “2000”.

[0213] S707: The permission management extension service module obtains second read permission data based on the second read permission check request.

[0214] S708: The permission management extension service module returns the second read permission data to the first application, and correspondingly, the first application receives the second read permission data.

[0215] S709: The first application determines whether the first application has permission to read all data of the calendar based on the second reading permission data.

[0216] S710: When the first application has the permission to read all the data of the calendar, the first application sends a request to read the calendar data to the calendar provider. Correspondingly, the calendar provider receives the request to read the calendar data.

[0217] It should be understood that there may be many ways to implement the above-mentioned method of determining whether the first application has the permission to read all data of the calendar through the second reading permission data, and this application does not impose any limitation on this.

[0218] In a possible implementation, developers can define a new calendar read permission control item to check whether the first application has the permission to read all data of the calendar. Correspondingly, the second read permission data is "yes" or "no". If the second permission data is "yes", the check result is that the first application has the permission to read all data of the calendar; if the second permission data is "no", the check result is that the first application does not have the permission to read all data of the calendar.

[0219] For example, developers can define a new calendar read permission control item as "read_calander_all", and the second read permission data can be "true" or "false". If the second permission data is "true", the check result is that the first application has the permission to read all calendar data; if the second permission data is "false", the check result is that the first application does not have the permission to read all calendar data.

[0220] In another possible implementation, developers can define a new calendar read permission control item to check what permissions the first application has to read calendar data. Correspondingly, the second read permission data is "all" or "single application". When the second read permission data is "all", the check result is that the first application has full data permissions to read the calendar. When the second read permission data is "single application", the check result is that the first application does not have full data permissions to read the calendar.

[0221] For example, developers can define a new calendar read permission control item as "read_calander", and the second read permission data can be "only" or "all". If the second permission data is "all", the check result is that the first application has full data permission to read the calendar; if the second permission data is "only", the check result is that the first application does not have full data permission to read the calendar.

[0222] It should also be understood that when the first application determines that the first application does not have the permission to read all data of the calendar based on the second read permission data, a pop-up window prompts the user to set the calendar permission. The user can also be reminded to set it through the setting page of the terminal device.

[0223] Scenario 2: The first application does not need to have the permission to read all the data in the calendar, that is, the first application only needs to read the data written by the first application to the calendar, and does not need to read other data in the calendar to implement the business function. For example, in the business scenario of a video application booking a live program, the video application only needs to read the data written by the video application to the calendar to implement the booking function.

[0224] S711, when the first application does not need to have the authority to read all the data of the calendar, the first application sends a request to read the calendar data to the calendar provider, and correspondingly, the calendar provider receives the request to read the calendar data.

[0225] Based on different business scenarios, after executing any of the above two situations, the following steps can be performed. However, it should be understood that the above S705 to S711 are optional steps. In another possible implementation, the first application may not distinguish between business scenarios. After S704, if the first application has read permission, the first application can directly send a request to read calendar data to the calendar provider.

[0226] S712: The calendar provider sends a third read permission check request to the package management service module based on the request to read the calendar data, and the package management service module receives the third read permission check request. The third read permission check request carries the application identifier of the first application and the identifier of the native calendar read permission control.

[0227] Specifically, the third read permission check request is used by the calendar provider to check whether the first application has the permission to read calendar data.

[0228] S713: The package management service module obtains third read permission data based on the third read permission check request. The third read permission data is used to indicate whether the first application has permission to read calendar data.

[0229] Optionally, the third read permission data may be “deny” or “allow”.

[0230] Exemplarily, the third read permission data may be “allow” or “deny”.

[0231] S714: The package management service module returns the third read permission data to the calendar provider, and correspondingly, the calendar provider receives the third read permission data.

[0232] S715: The calendar provider determines whether the first application has permission to read calendar data based on the third reading permission data.

[0233] Specifically, the calendar provider determines whether the first application has the permission to read the calendar data based on the third reading permission data in the same manner as in the above S704, which will not be described in detail herein.

[0234] S716: When the first application has permission to read calendar data, the calendar provider sends a fourth read permission check request to the permission management extension service module, and correspondingly, the permission management extension service module receives the fourth read permission check request. The fourth read permission check request carries the application identifier of the first application and the identifier of the newly added calendar read permission control item.

[0235] Specifically, the fourth read permission check request is used to check whether the first application has the permission to read all data of the calendar.

[0236] It should be understood that in an actual business scenario, if the first application does not have permission to read calendar data, the terminal device reminds the user of the current access error, or the first application crashes.

[0237] S717: The permission management extension service module obtains fourth reading permission data based on the fourth reading permission check request.

[0238] S718: The permission management extension service module returns the fourth read permission data to the calendar provider, and correspondingly, the calendar provider receives the fourth read permission data.

[0239] S719: The calendar provider determines, based on the fourth read permission data, whether the first application has permission to read the single application data of the calendar or permission to read all data of the calendar.

[0240] It should be understood that if the calendar provider determines based on the fourth read permission data that the first application does not have the permission to read all data of the calendar, it means that the first application has the permission to read the single application data of the calendar. The calendar provider determines based on the fourth read permission data whether the first application has the permission to read the single application data of the calendar or the permission to read all data of the calendar, which is the same as the implementation method of S709 above, and this application will not elaborate on it here.

[0241] It should also be understood that the first application having the single application data permission to read the calendar can be understood as the first application having the above-mentioned second type of access permission.

[0242] S720: The calendar provider determines schedule information corresponding to the permission to read calendar data according to the permission to read calendar data of the first application.

[0243] It should be understood that the calendar provider stores an application-schedule correspondence table. The application-schedule correspondence table includes the correspondence between applications and schedules. One application corresponds to at least one schedule information. When the first application sends a request to read calendar data to the calendar provider, it carries the application identifier of the first application.

[0244] It should also be understood that, according to the permission of the first application to read calendar data, there are the following two situations for determining the schedule information corresponding to the permission to read calendar data.

[0245] Case 1: When the first application's permission to read calendar data is permission to read single application data, the calendar provider obtains the schedule information corresponding to the first application by looking up the table according to the application identifier of the first application.

[0246] Exemplarily, the correspondence between application schedules is shown in Table 2. When the first application is application A, the schedule information determined by the calendar provider is "AAA competition, May 19, 2023 10:00" and "BBB competition, May 18, 2023 10:00".

[0247] Table 2

[0248] application App ID schedule A Application 0001 AAA Competition, May 19, 2023 10:00 A Application 0001 BBB Contest, May 18, 2023 10:00 B Application 0002 CCC meeting, May 20, 2023 at 10:00 B Application 0002 DDD Conference, May 21, 2023 at 10:00

[0249] Case 2: When the first application's permission to read calendar data is permission to read all calendar data, the calendar provider obtains all schedule information stored in the schedule correspondence table.

[0250] Exemplarily, the schedule information determined by the calendar provider is all the schedule information in Table 2 above.

[0251] S721, the calendar provider sends schedule information to the first application. Correspondingly, the first application receives the schedule information.

[0252] Optionally, S722, the first application may display the schedule information on an interface of the first application.

[0253] By checking the permission of the first application to read data in the permission management extension service, based on different permission check results, the first application reads different calendar data, thereby realizing refined management and control of calendar permissions. While ensuring the normal use of the user's application, the user's privacy data security is enhanced, thereby improving the user experience.

[0254] Next, take the example of adding schedule information to the calendar in the first application. Figure 8 The permission control method of this application is described in detail.

[0255] Figure 8 800 is an interactive diagram of another application program permission control method 800 provided in an embodiment of the present application. The method 800 is applied to the above-mentioned terminal device. The hardware structure of the terminal device involved in the method 800 can be as follows: Figure 1 As shown, the software structure can be as follows Figure 2 shown.

[0256] In a business scenario, the terminal device first needs to query the read permission and read the schedule information before executing method 800. The query of the read permission and the reading of the schedule information are specifically shown in S701 to 721 in method 700, which will not be repeated here. After executing S701 to 721, the first application determines whether the schedule information returned by the calendar provider includes the schedule information to be added (also referred to as the schedule information to be written). If the schedule information returned by the calendar provider does not include the schedule information to be added, execute S801 to S811.

[0257] In another business scenario, the terminal device may directly execute S801 to S811.

[0258] S801: A first application sends a first write permission check request to a package management service module, and correspondingly, the package management service module receives the first write permission check request. The first write permission check request carries an application identifier of the first application and an identifier of native calendar write permission control.

[0259] Specifically, the first application is an application that can add schedule information to the calendar. The first control can be a button on the first application that triggers a first write permission check request based on a user's click or slide operation. The first write permission check request is used by the first application to check whether the first application has write permission for calendar data. The native calendar write permission control item identifier can be the name of the native calendar write permission control item or the ID of the native calendar write permission control item.

[0260] Exemplarily, the name of the native calendar write permission control item may be write_calander, and the ID of the native calendar write permission control item may be "3001".

[0261] S802: The package management service module obtains first write permission data based on the first write permission check request. The first write permission data is used to indicate whether the first application has the write permission for the calendar data.

[0262] Optionally, the first write permission data may be “deny” or “allow”.

[0263] Exemplarily, the first write permission data may be “allow” or “deny”.

[0264] S803: The package management service module returns the first write permission data to the first application, and correspondingly, the first application receives the first write permission data.

[0265] S804: The first application determines whether the first application has permission to write calendar data based on the first write permission data.

[0266] Exemplarily, when the first write permission data is "allow", the first application determines that the first application has the write permission for the calendar data. When the first write permission data is "deny", the first application determines that the first application does not have the write permission for the calendar data.

[0267] S805: When the first application has the permission to write calendar data, the first application sends a request to write calendar data to the calendar provider, and correspondingly, the calendar provider receives the request to write calendar data.

[0268] Specifically, the request to write the calendar data carries the schedule information to be written.

[0269] It should also be understood that when the first application does not have permission to read the calendar, a pop-up window will prompt the user to set calendar permissions.

[0270] S806: The calendar provider sends a third write permission check request to the package management service module based on the write request for the calendar data, and the package management service module receives the third write permission check request. The third write permission check request carries the application identifier of the first application and the identifier of the native calendar write permission control.

[0271] Specifically, the third write permission check request is used by the calendar provider to check whether the first application has the permission to write calendar data.

[0272] S807: The package management service module obtains third write permission data based on the third write permission check request. The third write permission data is used to indicate whether the first application has the write permission for the calendar data.

[0273] Optionally, the third write permission data may be “deny” or “allow”.

[0274] Exemplarily, the third write permission data may be “allow” or “deny”.

[0275] S808: The package management service module returns the third write permission data to the calendar provider, and correspondingly, the calendar provider receives the third write permission data.

[0276] S809: The calendar provider determines whether the first application has the permission to write calendar data based on the third write permission data.

[0277] Specifically, the calendar provider determines whether the first application has the permission to write calendar data based on the third write permission data in the same manner as the first application determines whether the first application has the permission to write calendar data based on the first write permission data, which will not be repeated here.

[0278] S810: When the first application has the permission to write calendar data, the calendar provider stores the schedule information to be written.

[0279] It should be understood that the schedule information to be written can also be understood as the schedule information to be added in the scenario of adding a schedule.

[0280] S811, the calendar provider sends a write success message to the first application, and correspondingly, the first application receives the write success message.

[0281] The above describes the internal interaction process in the terminal device when the first application adds schedule information to the calendar.

[0282] Next, take the first application updating schedule information in the calendar as an example, combined with Fig. 9 The permission control method of this application is described in detail.

[0283] Specifically, updating the schedule information may be deleting or modifying the schedule information.

[0284] Fig. 9 900 is an interactive diagram of another application program permission control method provided in an embodiment of the present application. The method 900 is applied to the above-mentioned terminal device. The hardware structure of the terminal device involved in the method 900 can be as follows: Figure 1 As shown, the software structure can be as follows Figure 2 shown.

[0285] In a business scenario, the terminal device first needs to query the read permission and read the schedule information before executing method 900. The query of the read permission and the reading of the schedule information are specifically shown in S701 to 721 in method 700, which will not be repeated here. After executing S701 to 721, the first application determines whether the schedule information returned by the calendar provider includes the schedule information to be updated (also referred to as the schedule information to be written). If the schedule information returned by the calendar provider includes the schedule information to be updated, execute S901 to S922.

[0286] In another business scenario, the terminal device may directly execute S901 to S922.

[0287] S901, a first application sends a first write permission check request to a package management service module, and correspondingly, the package management service module receives the first write permission check request. The first write permission request carries an application identifier of the first application and an identifier of native calendar write permission control.

[0288] S902: The package management service module obtains first write permission data based on the first write permission check request. The first write permission data is used to indicate whether the first application has the write permission for the calendar data.

[0289] S903: The package management service module returns the first write permission data to the first application, and correspondingly, the first application receives the first write permission data.

[0290] S904: The first application determines, based on the first write permission data, whether the first application has permission to write calendar data.

[0291] S905, when the first application has the permission to read the calendar, the first application checks whether the first application needs to have the permission to update all the data of the calendar based on the current business scenario.

[0292] It should be understood that having the authority to update all calendar data does not necessarily mean updating all the data, and all the data in the calendar data may be updated, or part of the data in the calendar data may be updated.

[0293] It should be understood that having the permission to update all calendar data can also be understood as the third type of write permission type, under which the first application is allowed to modify or delete all data in the calendar data. Not having the permission to update all calendar data can also be understood as the fourth type of write permission type, under which the first application is allowed to modify or delete part of the calendar data, that is, the first application is allowed to modify or delete the schedule information written by the first application in the calendar provider.

[0294] It should also be understood that in some business scenarios, the first application only needs to have the permission to update the data written by the first application to the calendar. In other business scenarios, the first application needs to have the permission to update all the data of the calendar. This requires the developers of the first application to adapt and develop based on the needs of the business scenario.

[0295] For example, in a business scenario where a scheduled live program is canceled on a video application, the video application only needs to delete the data written to the calendar by the video application to cancel the reservation. In a business scenario where a schedule management application deletes or modifies the schedule information of the system calendar, the schedule management application needs to have the permission to delete or modify all data of the calendar to implement the schedule management function.

[0296] It should also be understood that when the first application does not have permission to write calendar data, a pop-up window will prompt the user to set calendar permissions.

[0297] The following discusses the above two business scenarios separately.

[0298] Scenario 1: The first application needs to have the permission to update all calendar data. That is, the first application can update all data in the calendar, but not necessarily all data in the calendar. It can only update part of the calendar data. For example, in a business scenario where a schedule management application deletes or modifies the schedule information of the system calendar, the schedule management application needs to have the permission to delete or modify all calendar data to implement the schedule management function. That is, the schedule management application can update all schedule information in the system calendar, but may only update part of the schedule information.

[0299] S906: When the first application has all data permissions to update the calendar, the first application sends a second write permission check request to the permission management extension service module, and the permission management extension service module receives the second write permission check request. The second write permission request carries the application identifier of the first application and the identifier of the newly added calendar write permission control item.

[0300] Specifically, the second write permission check request is used to check whether the first application has permission to update all data of the calendar. The identifier of the newly added calendar write permission control item can be the name of the newly added calendar write permission control item or the ID of the newly added calendar write permission control item.

[0301] Exemplarily, the name of the newly added calendar write permission control item may be write_calander, and the ID of the newly added calendar write permission control item may be "3000".

[0302] S907: The permission management extension service module obtains second write permission data based on the second write permission check request.

[0303] S908: The permission management extension service module returns the second write permission data to the first application, and correspondingly, the first application receives the second write permission data.

[0304] S909: The first application determines, based on the second write permission data, whether the first application has permission to update all calendar data.

[0305] S910: When the first application has the authority to update all calendar data, the first application sends a request to update calendar data to a calendar provider. Correspondingly, the calendar provider receives the request to update calendar data.

[0306] It should be understood that there may be many ways to implement the above-mentioned method of determining whether the first application has full data permission to update the calendar through the second write permission check request and the second write permission data, and this application does not impose any limitation on this.

[0307] In a possible implementation, developers can define a new calendar write permission control item to check whether the first application has the permission to update all calendar data. Correspondingly, the second write permission data is "yes" or "no". If the second permission data is "yes", the check result is that the first application has the permission to update all calendar data; if the second permission data is "no", the check result is that the first application does not have the permission to update all calendar data.

[0308] For example, the developer can define a new calendar write permission control item as "read_calander_all", and the second write permission data can be "true" or "false". If the second write permission data is "true", the check result is that the first application has the permission to update all the data of the calendar; if the second write permission data is "false", the check result is that the first application does not have the permission to update all the data of the calendar.

[0309] In another possible implementation, developers can define a new calendar write permission control item to check what permissions the first application has to update calendar data. Correspondingly, the second write permission data is "all" or "single application". When the second write permission data is "all", the check result is that the first application has all data permissions to update the calendar. When the second write permission data is "single application", the check result is that the first application does not have all data permissions to update the calendar.

[0310] For example, developers can define a new calendar write permission control item as "read_calander", and the third write permission data can be "only" or "all". If the second write permission data is "all", the check result is that the first application has the permission to update all calendar data; if the second write permission data is "only", the check result is that the first application does not have the permission to update all calendar data.

[0311] It should also be understood that when the first application determines that the first application does not have full data permission to update the calendar based on the second write permission data, a pop-up window prompts the user to set calendar permissions. The user can also be reminded to set through the settings page of the terminal device.

[0312] Scenario 2: The first application does not need to have the permission to update all the data in the calendar. That is, the first application only needs to update the data written by the first application in the calendar, and does not need to update other data in the calendar to implement the business function. For example, in the business scenario of canceling a scheduled live program on a video application, the video application only needs to update the data written by the video application to the calendar to implement the cancellation function.

[0313] S911, when the first application does not need to have the authority to update all the data of the calendar, the first application sends a request for updating the calendar to the calendar provider, and correspondingly, the calendar provider receives the request for updating the calendar.

[0314] Based on different business scenarios, after executing either of the above two situations, you can then execute the following steps.

[0315] However, it should be understood that the above steps S905 to S911 are optional steps. In another possible implementation, the first application may not distinguish between business scenarios, and after S904, if the first application has write permission, the first application may directly send a request to write calendar data to the calendar provider.

[0316] S912: The calendar provider sends a third write permission check request to the package management service module based on the request to update the calendar, and the package management service module receives the third write permission check request, which carries the application identifier of the first application and the identifier of the native calendar permission control.

[0317] Specifically, the third write permission check request is used by the calendar provider to check whether the first application has the permission to write calendar data.

[0318] S913: The package management service module obtains third write permission data based on the third write permission check request. The third write permission data is used to indicate whether the first application has the write permission for the calendar data.

[0319] Optionally, the third write permission data may be “deny” or “allow”.

[0320] Exemplarily, the third write permission data may be “allow” or “deny”.

[0321] S914: The package management service module returns the third write permission data to the calendar provider, and correspondingly, the calendar provider receives the third write permission data.

[0322] S915: The calendar provider determines whether the first application has the permission to write calendar data based on the third write permission data.

[0323] Specifically, the calendar provider determines whether the first application has the permission to write calendar data based on the third write permission data in the same manner as the first application determines whether the first application has the permission to write calendar data based on the first write permission data, which will not be repeated here.

[0324] S916: When the first application has the permission to write calendar data, the calendar provider sends a fourth write permission check request to the permission management extension service module, and correspondingly, the permission management extension service module receives the fourth write permission check request. The fourth write permission check request carries the application identifier of the first application and the identifier of the newly added calendar write permission control item.

[0325] Specifically, the fourth write permission check request is used to check whether the first application has the single application data permission to update the calendar or has the full data permission to update the calendar.

[0326] It should be understood that in an actual business scenario, if the first application does not have permission to read the calendar, the terminal device reminds the user of the current access error, or the first application crashes.

[0327] S917: The permission management extension service module obtains fourth write permission data based on the fourth write permission check request.

[0328] S918: The permission management extension service module returns the fourth write permission data to the calendar provider, and correspondingly, the calendar provider receives the fourth write permission data.

[0329] S919: The calendar provider determines, based on the fourth write permission data, whether the first application has permission to update single application data of the calendar or permission to update all data of the calendar.

[0330] It should be understood that if the calendar provider determines that the first application does not have the permission to update all data of the calendar based on the fourth write permission data, it means that the first application has the single application data permission to update the calendar. The calendar provider determines whether the first application has the single application data permission to update the calendar or the full data permission to update the calendar based on the fourth write permission check request and the fourth write permission data, which is implemented in the same way as the above S909 in which the second write permission check request and the second write permission data determine whether the first application has the full data permission to update the calendar, and this application will not elaborate on it here.

[0331] S920: The calendar provider determines, according to the permission of the first application to update calendar data, schedule information corresponding to the permission to update calendar data.

[0332] Optionally, the permission to update calendar data of the first application includes permission to update single application data and permission to update all calendar data.

[0333] According to the permission of the first application to update calendar data, there are the following two situations for determining the schedule information corresponding to the permission to update calendar data.

[0334] Case 1: When the first application's permission to update calendar data is permission to update single application data, the calendar provider obtains the schedule information corresponding to the first application by looking up the table based on the application identifier of the first application. The schedule information corresponding to the first application is the schedule information corresponding to the permission to update calendar data.

[0335] Exemplarily, the application schedule correspondence is shown in Table 3. When the first application is application A, the schedule information corresponding to the update calendar data permission determined by the calendar provider is "AAA competition, May 19, 2023 10:00" and "BBB competition, May 18, 2023 10:00".

[0336] Table 3

[0337]

[0338]

[0339] In case 2, when the first application's permission to update calendar data is permission to update all calendar data, the calendar provider obtains all schedule information stored in the schedule correspondence table, where all schedule information is schedule information corresponding to the permission to update calendar data.

[0340] Exemplarily, the schedule information determined by the calendar provider is all the schedule information in Table 3 above.

[0341] S921, the calendar provider searches for the schedule information to be updated in the schedule information corresponding to the update calendar data permission, and updates the schedule information to obtain the updated schedule information.

[0342] Optionally, after the calendar provider searches for the schedule information to be updated in the schedule information corresponding to the update calendar data permission, it deletes or modifies the schedule information to be updated according to business scenario requirements to obtain updated schedule information.

[0343] It should be understood that there are the following two situations in which the schedule information to be updated is queried in the schedule information corresponding to the update calendar data permission to obtain the updated schedule information.

[0344] In the example of situation 1 above, the user cancels the scheduled live show "AAA Contest" on application A. The updated calendar data in this scenario is to delete the schedule information of "AAA Contest". The calendar provider queries the schedule information to be deleted "AAA Contest, May 19, 2023 10:00" from the two data "AAA Contest, May 19, 2023 10:00" and "BBB Contest, May 18, 2023 10:00", and deletes it, and the updated schedule information is "BBB Contest, May 18, 2023 10:00".

[0345] In the example of situation 2 above, the user cancels the scheduled live broadcast program "AAA Contest" on application A. The updated calendar data in this scenario is to delete the schedule information of "AAA Contest". The calendar provider queries the schedule information to be deleted "AAA Contest, May 19, 2023 10:00" from the four data in Table 3 above, and deletes it. The updated schedule information is the remaining three schedule information.

[0346] S922, the calendar provider sends a message indicating that the update is successful to the first application, and correspondingly, the first application receives the message indicating that the update is successful.

[0347] By checking the permission of the first application to update data in the permission management extension service as described above, based on different permission check results, the first application updates the calendar data corresponding to different permissions, thereby achieving refined management and control of calendar permissions. While ensuring the normal use of the application by the user, the security of the user's privacy data is enhanced, thereby improving the user experience.

[0348] It should be understood that the size of the sequence number of each process in the above method 700, method 800, and method 900 does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic. The above method 700 is a process for the first application to read calendar data, and the above method 800 is a process for the first application to write data when adding new schedule information to the calendar. The above method 900 is a process for the first application to write data when updating schedule information on the calendar. In an actual business scenario, the first application can execute method 700, method 800, and method 900 separately, or it can execute method 700 first and then method 800, or it can execute method 700 first and then method 900. Depending on the business scenario, there can be multiple possible implementation methods for the combination of different orders, and this application does not limit this.

[0349] Optionally, when the first application does not have access rights to the target data, the terminal device displays a first interface including information for prompting the user that the first application needs to have access rights to the target data.

[0350] Optionally, when the first application needs to have the first type of access rights and does not have the first type of access rights, the terminal device displays a first interface including information for prompting the user that the first application needs to have the first type of access rights.

[0351] In a first possible implementation manner, the first interface includes a button for selecting a first type of access permission, a button for selecting a second type of access permission, and a button for not allowing access.

[0352] Below, we will take the terminal device as a mobile phone, the first application as a video application A on the terminal device that can book live programs, and the user needs to book a live program on the A application as an example to illustrate the interface display of the first application in the above process.

[0353] Specifically, to schedule a live program on application A, application A first reads and then writes the schedule information in the calendar. In this business scenario, application A does not need to read all the schedule information in the calendar to implement the reservation function.

[0354] Fig.10 A schematic diagram of interface changes of a terminal device provided in an embodiment of the present application. Fig.10 In the interface a shown, the navigation bar at the bottom of the interface displays the label items of "Home", "Follow", and "My". The navigation bar at the top of the interface displays the label items of "TV Series", "Documentary", "Sports", "Culture", and "Live Broadcast", among which the text of the label item of "Live Broadcast" is displayed in bold, indicating that the current page is under the label item of Live Broadcast. The title of "Live Broadcast Calendar" is displayed in the middle of the interface, and the cover of the "News" live broadcast program is displayed under the title of Live Broadcast Calendar. The time item "May 08 18:30" is displayed below the cover of the "News" live broadcast program, indicating that the "News" will be broadcast live at 18:30 on May 8. A "Reservation" button is displayed below the time item. The user clicks the "Reservation" button, and in one possible implementation, the terminal device displays a "Reservation" button in response to the user's click operation. Fig.10 Interface c. Fig.10 In interface c, the "Booking" button below the cover of the "News" live program is displayed as "Booked". In another possible implementation, the terminal device displays a Fig.10 Interface b. Fig.10In the interface b shown, a prompt is displayed at the top of the interface: "Instructions for use of permissions. In order to schedule live broadcasts or program broadcasts and remind you to watch them in time, please allow application A to obtain calendar permissions." A pop-up window is displayed at the bottom of the interface. A calendar icon is displayed at the top of the pop-up window, and a prompt text "Allow application A to access your calendar?" is displayed below the calendar icon. Below the prompt text are three options: "Only allow access to calendars written by application A (recommended)", "Allow access to all calendars", and "Do not allow". Users can set application A to only allow access to calendars written by application A by clicking the "Only allow access to calendars written by application A (recommended)" option; or users can set application A to have access to all calendar permissions by clicking the "Allow access to all calendars" option; or users can set application A to not have access to calendar permissions by clicking the "Do not allow" option. The user clicks the "Only allow access to calendars written by application A (recommended)" or "Allow access to all calendars" option, and the terminal device displays the option in response to the user's click. Fig.10 The interface shown is c.

[0355] It should be understood that if application A has the permission to access calendar data (read calendar data or add data to calendar data), the terminal device displays the calendar data in response to the user's click on the "book" operation. Fig.10 In the case where application A does not have permission to access the calendar (for example, in the above S704, it is determined that the first application does not have permission to read calendar data, in the above S804, it is determined that the first application does not have permission to write calendar data, and in the above S904, it is determined that the first application does not have permission to write calendar data), the terminal device responds to the user's click "Appointment" operation and displays Fig.10 Interface b shown.

[0356] The above is a business scenario in which a user adds schedule information to the calendar through the first application. In actual business scenarios, the user can also update (modify or delete) the schedule information on the calendar through the first application. Below, taking the terminal device as a mobile phone, the first application as a video application A on the terminal device that can cancel the scheduled live program, and the user needs to cancel a scheduled live program on the A application as an example, the interface display of the first application in the above process is exemplified.

[0357] It should be understood that canceling a scheduled live program is to delete the schedule information of the scheduled live program.

[0358] Fig.11 This is a schematic diagram of interface changes of another terminal device provided in an embodiment of the present application. Fig.11In the interface a shown, the navigation bar at the bottom of the interface displays the label items of "Home", "Follow", and "My". The navigation bar at the top of the interface displays the label items of "TV Series", "Documentary", "Sports", "Culture", and "Live Broadcast", among which the text of the label item of "Live Broadcast" is displayed in bold, indicating that the current page is under the label item of Live Broadcast. The title of "Live Broadcast Calendar" is displayed in the middle of the interface, and the cover of the "News" live broadcast program is displayed under the title of Live Broadcast Calendar. The time item "May 08 18:30" is displayed below the cover of the "News" live broadcast program, indicating that the "News" will be broadcast live at 18:30 on May 8. A "Scheduled" button is displayed below the time item. The "Scheduled" button indicates that the schedule information of "News from A application on May 08 at 18:30" is stored in the calendar, and the user can cancel the schedule information by clicking the "Scheduled" button. The user clicks the "Scheduled" button, and the terminal device displays in response to the user's click operation. Fig.11 The interface c, in Fig.11 In interface c, the "Scheduled" button below the cover of the "News" live program is displayed as "Scheduled", indicating that the schedule information of "A application 05 / 08 18:30 news" has been canceled.

[0359] It should be understood that if application A has the permission to write calendar data, the terminal device displays the calendar data in response to the user's click on the "book" operation. Fig.11 Interface c.

[0360] Optionally, in the case where application A does not have the permission to write calendar data, the terminal device displays a calendar data entry in response to the user clicking the "Booked" button. Fig.11 Interface b shown. Fig.11 In the interface b shown, a prompt is displayed at the top of the interface: "Instructions for use of permissions. In order to schedule live broadcasts or program broadcasts and remind you to watch them in time, please allow application A to obtain calendar permissions." A pop-up window is displayed at the bottom of the interface. A calendar icon is displayed at the top of the pop-up window, and a prompt text "Allow application A to access your calendar?" is displayed below the calendar icon. Below the prompt text are three options: "Only allow access to calendars written by application A (recommended)", "Allow access to all calendars", and "Do not allow". Users can set application A to only allow access to data in the calendar written by application A by clicking the "Only allow access to calendars written by application A (recommended)" option; or, users can set application A to have access to all calendar data by clicking the "Allow access to all calendars" option; or, users can set application A to not have access to calendar data by clicking the "Do not allow" option. The user clicks the "Only allow access to calendars written by application A (recommended)" or "Allow access to all calendars" option, and the terminal device displays the option in response to the user's click. Fig.11 The interface shown is c.

[0361] Above Fig.10 The interface b and Fig.11 The interface b shown may be the first interface (or permission control interface) mentioned above.

[0362] In a second possible implementation, when application A does not have permission to write calendar data, a first interface pops up. The first interface includes information prompting the user that the first application needs to have permission to access calendar data, and there is no button for directly opening calendar data permission. In this case, the user can set application A's permission to access calendar data through the settings interface of the terminal device.

[0363] Fig.12 Schematic diagram of interface changes of another terminal device provided in the embodiment of the present application. Fig.12 As shown, in Fig.12 In interface a, an arrow-shaped return icon is displayed at the top of the interface, and the page name "Settings" of the interface is displayed to the right of the return icon. List items such as "Bluetooth", "Mobile Network", "Connection Sharing", "Applications", "Permission Management", and "Battery" are displayed in the middle of the page. The user clicks the "Permission Management" list item, and the terminal device responds to the user's click operation by displaying Fig.12 Interface b shown. Fig.12 In the interface b shown, an arrow-shaped return icon is displayed at the top of the interface, and the page name "Permission Management" of the interface is displayed to the right of the return icon. List items such as "Phone", "SMS", "Address Book", "Location", "Calendar", and "Storage" are displayed in the middle of the page. The user clicks on the "Calendar" list item, and the terminal device responds to the user's click operation by displaying Fig.12 In the interface c shown. Fig.12 In the interface c shown, list items such as "Application A", "Application B", and "Application C" are displayed in the middle of the interface. When the user clicks the list item "Application A", the terminal device displays Fig.12 Interface d. Fig.12 In the interface d shown, the application icon of "Application A" is displayed in the middle of the interface, the text title "Calendar Permissions" is displayed above the icon of Application A, the prompt text "Do you allow Application A to access the calendar" is displayed below the icon of Application A, and three options "Only allow access to calendars written by Application A (recommended)", "Allow access to all calendars", and "Do not allow" are displayed below the prompt text. The user can set Application A to only allow access to calendar data written by Application A by clicking the "Only allow access to calendars written by Application A (recommended)" option; or, the user can set Application A to access all calendar data by clicking the "Allow access to all calendars" option; or, the user can set Application A to not be able to access calendar data by clicking the "Do not allow" option.

[0364] It should be understood that application access to the calendar also includes other business scenarios.

[0365] For example, a user can add an email account to a calendar account in a certain email application and log in to the email to automatically write all records in the email to the calendar. A user can make an appointment for a snap-up event in a shopping application to write the snap-up schedule information to the calendar. A user can add other accounts to a calendar account in an enterprise office application to add the schedule information of other accounts to the enterprise office application. A user can import the system calendar in a schedule management application to import the schedule information in the system calendar into the schedule management application.

[0366] The above example describes a scenario in which a user applies for permission to access calendar data when scheduling a live program on application A. In this scenario, application A applies for calendar permission by first applying for read permission and then applying for write permission (which can be called read first and then write).

[0367] The actual business scenarios also include: applying for read permission, applying for write permission, applying for read-write permission, and applying for write-first-then-read permission. Specifically, the display logic of the above pop-up window (also referred to as the first interface) in different scenarios is shown in Table 4. In Table 4, "Single Application" in the pop-up window display means that only the data written by the first application to the target data is allowed to be accessed, "All" in the pop-up window display means that all the data of the target data is allowed to be accessed, and "Forbidden" in the pop-up window display means that access to the target data is not allowed. When the refined switch is turned on, it means that only the data written by the first application to the target data is allowed to be accessed, and when the refined switch is turned off, it means that all the data of the target data is allowed to be accessed.

[0368] Table 4

[0369]

[0370] In addition, the pop-up window display and option authorization logic for the write-first-read-later application scenario are the same as those for the read-first-write-later scenario described above, and will not be repeated here.

[0371] In a third possible implementation manner, the first interface includes: a switch button for turning on or off the first type of access rights.

[0372] The following example takes the first application as application A, the target data as memory data, and application A accessing memory data as an example. Fig.13 When the first application accesses the target data, the first interface is described.

[0373] Optionally, application A accesses the storage data so that the user can send video data in the storage data to others on application A. The user can send the video data by clicking the "video" control in application A and selecting the video data. In this scenario, the terminal device displays the first interface in response to the user's click operation.

[0374] Fig.13 is a schematic diagram of an interface display of another terminal device provided in an embodiment of the present application. Fig.13 In the interface, a pop-up window is displayed at the bottom of the interface, and the application icon of "Application A" is displayed in the middle of the top of the pop-up window. The text "Do you allow Application A to read photos, videos, and other files in the device" is displayed above the icon of Application A, and the text and switch button "Access media files (pictures, videos, music)" are displayed below the text. Two buttons "Allow" and "Forbid" are displayed at the bottom of the pop-up window. Users can set Application A to read all data in the memory by turning on the switch button and clicking the "Allow" button; users can set Application A to read other files in the memory (i.e., the above-mentioned "ordinary files" such as word, pdf, excel, etc.) by turning off the switch button and clicking the "Allow" button; users can set Application A not to access memory data by clicking the "Forbidden" button.

[0375] The above describes the permission control method of the present application when the first application reads calendar data.

[0376] The permission control method of the present application is described below by taking the first application reading sensor data as an example.

[0377] Fig.14 A schematic flow chart of another permission control method provided in the embodiment of the present application. Fig.14 As shown, the first application registers sensor data with the sensor provider (also called the sensor service module). After receiving the registration information, the sensor provider queries the permission extension service management module through the sensor provider for the permission switch state of the first application to access the sensor data. The permission switch state is on, indicating that the first application can access part of the sensor data, and the permission switch state is off, indicating that the first application can access all of the sensor data. Then, after receiving the permission switch state, the sensor service determines the corresponding sensor data based on the permission switch state and returns it to the first application.

[0378] It should be understood that the part of the sensor data that the first application can access is the data that the first application can access and that is stored in the sensor provider by the first application.

[0379] Optionally, the sensor provider may register with the permission management extension service module to monitor the permission switch state. After the permission switch state of the first application in the permission management extension service module changes, the permission management extension service module sends a change in the monitoring permission switch state to the sensor provider, and determines corresponding sensor data based on the permission switch state, including: the sensor provider determines the corresponding sensor data based on the permission switch state after the change.

[0380] Optionally, the user can set the above permission switch state in the settings of the terminal device (also known as "system manager" or "mobile phone manager"). After the user sets the above permission switch state in the settings interface, in response to the user's setting operation, the permission extension management service module changes the permission switch state and returns the permission switch state to the settings interface. The settings interface updates the permission switch state displayed in the settings interface based on the permission switch state.

[0381] Optionally, the terminal device may also include a permission recommendation service module, which stores permission recommendation data. The permission recommendation data is sent to the permission recommendation service module by the cloud. The cloud can update the permission recommendation data according to preset rules. The permission recommendation data can be stored in the cloud in the form of a permission recommendation configuration table.

[0382] For example, Fig.10 Interface b, Fig.11 In interface b, the terminal device can display "recommendation" information next to the corresponding option on the permission control interface, such as Fig.12 As shown in interface d, the terminal device can display "recommendation" information next to the corresponding option on the settings (also known as "system manager" or "mobile phone manager") interface for user reference.

[0383] Optionally, the terminal device may display “recommendation” information for a portion of applications, and not display “recommendation” information for another portion of applications.

[0384] The application that displays the "recommendation" information may be a whitelist application or a top N application in the application market (N may be an integer greater than or equal to 1), which is not limited in the present embodiment of the application. The terminal device may display the "recommendation" information in the following manner: for whitelist applications, "recommendation" is displayed on the option "allow application to access all data of target data" displayed on the terminal device; for the top N applications in the application market, "recommendation" is displayed on the option "allow application to access part of target data" displayed on the terminal device.

[0385] When the application that displays the "recommendation" information displays the recommendation information, both the read permission interface and the write permission interface display the recommendation next to the option "Allow the application to access part of the target data", or both the read permission interface and the write permission interface display "recommendation" next to the option "Allow the application to access all of the target data". The read permission interface may be the first interface displayed by the terminal device when the first application requests the read permission of the target data; the write permission interface may be the first interface displayed by the terminal device when the first application requests the write permission of the target data.

[0386] The above-mentioned read permission and write permission can be applied for separately, but in the Android system, read permission and write permission are displayed as a group, that is, when viewing or setting the permission for the first application to access the target data in the user settings, read permission and write permission are collectively referred to as access permission, displayed in the same interface, and the permission authorization status can be changed through the same pop-up window.

[0387] Optionally, the access rights are displayed on the terminal device as the maximum authorization status of the authorization status of the read permission and the authorization status of the write permission.

[0388] Exemplarily, the interface display logic for application A to access the calendar can be as shown in Table 5. In Table 5, the authorization status of the read permission is "all" (i.e., A is allowed to read all schedule information of the calendar data), the authorization status of the write permission is "single application" (i.e., only A is allowed to update the schedule information written by application A to the calendar), and the status of application A accessing the calendar displayed on the terminal device is "allowed to access all calendars". The authorization status of the read permission is "forbidden", the authorization status of the write permission is "single application" (i.e., only A is allowed to update the schedule information written by application A to the calendar), and the status of application A accessing the calendar displayed on the terminal device is "only access to the calendar of a single application". "Only access to the calendar of a single application" can also be called "only access to the calendar of this application".

[0389] Table 5

[0390] Read permission Write permissions Interface display status all all Allow access to all calendars all Single Application Allow access to all calendars all prohibit Allow access to all calendars Single Application all Allow access to all calendars Single Application Single Application Access only a single app's calendar Single Application prohibit Access only a single app's calendar prohibit all Allow access to all calendars prohibit Single Application Access only a single app's calendar prohibit prohibit prohibit

[0391] Optionally, the terminal device also includes a privacy assistant module, which can perform excessive permission detection on the permission of applications in the terminal device to access target data and periodically display it on the terminal device. The duration of the period can be set by the user, and this application does not limit this. The excessive permission detection is used to check whether the application in the terminal device is over-authorized.

[0392] Optionally, the terminal device also includes a "one-key optimization" module, which can optimize over-authorized applications. For over-authorized applications, the logic of one-key optimization is shown in Table 6.

[0393] Exemplarily, when the read permission and write permission of application A to access calendar data are both set to "all", and the terminal device detects that the permission of application A to access calendar data is "excessive permission", the refined switch of read and write permissions can be turned on through the "one-click optimization" function, that is, the access of application A to calendar data is set to only access calendar data written by application A. When the read permission of application A to access calendar data is set to "all", and the write permission is set to "single application", the terminal device detects that the permission of application A to access calendar data is "excessive permission", and the refined switch of read permission can be turned on through the "one-click optimization" function, that is, the access of application A to calendar data is set to only read calendar data written by application A. Similarly, other data groups correspond to different scenarios, and the interface display status of permission detection in different scenarios and the one-click optimization processing method are similar to the above two groups of data, which will not be repeated here.

[0394] Table 6

[0395] Read permission Write permissions Interface display status One-click optimization all all Over-delegation Turn on the fine-grained read and write switch all Single Application Over-delegation Turn on the read refinement switch all prohibit Over-delegation Turn on the read refinement switch Single Application all Over-delegation Turn on the fine-grained writing switch prohibit all Over-delegation Turn on the fine-grained writing switch

[0396] Optionally, after the terminal device is cloned (for example, the data of mobile phone A is copied to mobile phone B), the access rights set on the old terminal device can also be cloned to the new terminal device.

[0397] It should be understood that the sequence numbers of the above processes do not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0398] Combined with the above Figures 5 to 14 , describes in detail the method according to the embodiment of the present application, and will be combined with Fig.15 , describing the terminal device of an embodiment of the present application.

[0399] Fig.15 A terminal device 1500 provided in an embodiment of the present application is shown. The terminal device 1500 includes a processor 1501, a transceiver 1502, and a memory 1503. The processor 1501, the transceiver 1502, and the memory 1503 communicate with each other through an internal connection path, the memory 1503 is used to store instructions, and the processor 1501 is used to execute the instructions stored in the memory 1503 to control the transceiver 1502 to send signals and / or receive signals.

[0400] It should be understood that the terminal device 1500 can be specifically the terminal device in the above embodiment, and can be used to execute the various steps and / or processes corresponding to the terminal device in the above method embodiment. Optionally, the memory 1503 may include a read-only memory and a random access memory, and provide instructions and data to the processor. A part of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type. The processor 1501 may be used to execute instructions stored in the memory, and when the processor 1501 executes the instructions stored in the memory, the processor 1501 is used to execute the various steps and / or processes of the above method embodiment corresponding to the terminal device. The transceiver 1502 may include a transmitter and a receiver, the transmitter may be used to implement the various steps and / or processes corresponding to the above transceiver for performing the sending action, and the receiver may be used to implement the various steps and / or processes corresponding to the above transceiver for performing the receiving action.

[0401] It should be understood that in the embodiments of the present application, the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.

[0402] In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in a processor or an instruction in the form of software. The steps of the method disclosed in conjunction with the embodiment of the present application can be directly embodied as a hardware processor for execution, or a combination of hardware and software modules in a processor for execution. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor executes the instructions in the memory, and completes the steps of the above method in conjunction with its hardware. To avoid repetition, it is not described in detail here.

[0403] The present application also provides a computer-readable storage medium, which is used to store a computer program, and the computer program is used to implement the method corresponding to the terminal device in the above embodiment.

[0404] The present application also provides a computer program product, which includes a computer program (also referred to as code or instruction). When the computer program runs on a computer, the computer can execute the method corresponding to the terminal device shown in the above embodiment.

[0405] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0406] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and modules described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0407] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0408] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0409] In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.

[0410] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0411] The above is only a specific implementation of the present application, but the protection scope of the embodiments of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the embodiments of the present application, which should be included in the protection scope of the embodiments of the present application. Therefore, the protection scope of the embodiments of the present application should be based on the protection scope of the claims.

Claims

1. A method for controlling permissions of an application, characterized in that: Applied to a terminal device having a first application installed, the method includes: In the case where the first application has permission to access the target data, initiating a data access request to a target data storage module through the first application, wherein the data access request is used to request access to the target data; Based on the data access request, a first permission query request is initiated to a first preset module through the target data storage module, where the first permission query request is used to query the access permission type of the first application, and the first preset module stores the access permission type of the first application, where the access permission type includes a first type for accessing all data of the target data and a second type for accessing part of the target data; The target data storage module returns data corresponding to the access permission type of the first application to the first application.

2. The method according to claim 1, characterized in that Before initiating a data access request to a target data storage module through the first application, the method further includes: Initiating a second permission query request to the package management service module through the first application, where the second permission query request is used to query whether the first application has permission to access the target data; Based on the second permission query request, query through the package management service module whether the first application has permission to access the target data.

3. The method according to claim 1 or 2, characterized in that: Before initiating a data access request to a target data storage module through the first application, the method further includes: Based on the current business scenario, determining, through the first application, whether the first application needs to have the first type of access permission; In the case where the first application needs to have the first type of access rights, initiating a third permission query request to the first preset module through the first application, the third permission query request is used to query whether the first application has the first type of access rights; The initiating a data access request to the target data storage module through the first application includes: In a case where the first application needs to have the first type of access rights and the first application has the first type of access rights, the data access request is initiated to the target data storage module through the first application.

4. The method according to claim 3, characterized in that: The method further comprises: When the first application needs to have the first type of access rights and the first application does not have the first type of access rights, the terminal device displays a first interface including information for prompting a user that the first application needs to have the first type of access rights.

5. The method according to claim 4, characterized in that The first interface further includes: a button for selecting the first type of access authority, a button for selecting the second type of access authority, and a button for not allowing access.

6. The method according to claim 4, characterized in that The first interface also includes: a switch button for turning on or off the first type of access permission.

7. The method according to claim 1 or 2, characterized in that: Before initiating a data access request to a target data storage module through the first application, the method further includes: Based on the current business scenario, determining, through the first application, whether the first application needs to have the first type of access permission; The initiating a data access request to the target data storage module through the first application includes: In the case where the first application does not need to have the first type of access permission, the data access request is initiated to the target data storage module through the first application.

8. The method according to any one of claims 1 to 7, characterized in that The data access request is used to request to add new data to the target data, and the data access request carries the data to be added; After the target data storage module is used to store data corresponding to the access permission type of the first application, the method further includes: querying, through the first application, whether the data corresponding to the access permission type of the first application includes the data to be added; When the data corresponding to the access permission type of the first application does not include the data to be added, the data to be added is written into the target data storage module through the first application.

9. The method according to claim 8, characterized in that Writing the to-be-added data into the target data storage module through the first application includes: The first application calls the package management service module to check whether the first application has the write permission of the target data, and obtains a first check result; If the first check result is that the first application has the write permission for the target data, a data write request is initiated to the target data storage module through the first application, the data write request is used to add the data of the first application to the target data, and the data write request carries the data to be added; Calling the package management service module through the target data storage module checks whether the first application has the write permission of the target data, and obtains a second check result; When the second checking result is that the first application has the write permission for the target data, the target data storage module stores the data to be added.

10. The method according to any one of claims 1 to 7, characterized in that The data access request is used to request modification or deletion of the target data, and the data access request carries data to be modified or data to be deleted; After returning the data corresponding to the access permission type of the first application to the first application through the target data storage module, the method further includes: querying, through the first application, whether the data corresponding to the access permission type of the first application includes the data to be modified or the data to be deleted; In a case where the data corresponding to the access permission type of the first application includes the data to be modified or the data to be deleted, the target data storage module is called by the first application to modify or delete the corresponding data.

11. The method according to claim 10, characterized in that The modifying or deleting corresponding data by calling the target data storage module through the first application includes: Calling a package management service module by the first application checks whether the first application has the write permission for the target data, and obtains a first check result; If the first check result is that the first application has the write permission for the target data, the first application initiates a data write request to the target data storage module, the data write request is used to modify or delete data in the target data, and the data write request carries the data to be modified or the data to be deleted; Calling the package management service module through the target data storage module checks whether the first application has the write permission for the target data, and obtains a second check result; If the second check result is that the first application has the write permission of the target data, calling the first preset module through the target data storage module to check the write permission type of the first application, the write permission type including a third type that allows modification or deletion of all data in the target data and a fourth type that allows modification or deletion of part of the data in the target data; Based on the write permission type of the first application, corresponding data is modified or deleted through the target data storage module.

12. The method according to claim 11, characterized in that Before initiating a data write request to the target data storage module through the first application, the method further includes: Based on the current business scenario, determining, through the first application, whether the first application needs to have the third type of write permission; In a case where the first application needs to have the third type of write permission, calling the first preset module by the first application to check whether the first application has the third type of write permission; The initiating a data write request to the target data storage module through the first application includes: In the case that the first application needs to have the third type of write permission and the first application has the third type of write permission, the data write request is initiated to the target data storage module through the first application.

13. The method according to claim 11, characterized in that Before initiating a data access request to a target data storage module through the first application, the method further includes: Based on the current business scenario, determining, through the first application, whether the first application needs to have the third type of write permission; The initiating a data write request to the target data storage module through the first application includes: In the case where the first application does not need to have the third type of write permission, the data write request is initiated to the target data storage module through the first application.

14. The method according to any one of claims 1 to 13, characterized in that The target data is calendar data, and the target data storage module is a calendar provider.

15. The method according to any one of claims 1 to 13, characterized in that The target data is sensor data, and the target data storage module is a sensor provider.

16. The method according to claim 14 or 15, characterized in that The data corresponding to the second type of access permission is the data of the first application in the target data storage module.

17. The method according to any one of claims 1 to 13, characterized in that The target data is memory data, and the target data storage module is a media provider.

18. The method according to claim 17, characterized in that The data corresponding to the second type of access permission is a file of a preset type in the media provider.

19. A method for controlling permissions of an application, characterized in that: Applied to a terminal device having a first application installed, the method includes: In a case where the first application has permission to access the calendar data, initiating a data access request to a calendar provider through the first application, wherein the data access request is used to request access to the calendar data; Based on the data access request, a first permission query request is initiated to a first preset module through the calendar provider, wherein the first permission query request is used to query the access permission type of the first application, and the first preset module stores the access permission type of the first application, and the access permission type includes a first type for accessing all schedule information of the calendar data and a second type for accessing part of the schedule information of the calendar data; The calendar provider returns data corresponding to the access permission type of the first application to the first application.

20. A terminal device, characterized in that: include: A processor, wherein the processor is coupled to a memory, wherein the memory is used to store a computer program, and when the processor calls the computer program, the terminal device executes the method according to any one of claims 1 to 19.

21. A computer-readable storage medium, characterized in that: Used to store a computer program, the computer program comprising instructions for implementing the method according to any one of claims 1 to 19.

22. A computer program product, characterized in that The computer program product comprises a computer program code, and when the computer program code is executed on a computer, the computer is enabled to implement the method according to any one of claims 1 to 19.