Applet permission synchronization method and device based on a honkong system
By implementing cross-device synchronization and hierarchical dynamic authorization of mini-program permissions in the HarmonyOS system, the fragmentation problem of permission management in distributed scenarios is solved, ensuring the security and convenience of privacy data interaction, and improving the collaborative security and user experience of mini-programs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHUHAI FANTAI GEEK TECH CO LTD
- Filing Date
- 2026-01-26
- Publication Date
- 2026-06-26
AI Technical Summary
In the distributed application scenarios of HarmonyOS, the mini-program permission management suffers from fragmentation and insufficient hierarchical collaboration, leading to duplicate authorization or permission omissions in privacy data interaction, increasing the risk of privacy leakage.
The method of mini-program permission synchronization based on HarmonyOS is adopted. By obtaining the permission status of the second terminal and updating the permission status of the first terminal through the inter-device communication mechanism, cross-device permission synchronization and hierarchical dynamic authorization are realized. Hierarchical permission configuration is adopted to correspond different permission levels to different functional scenarios, and a risk warning mechanism is provided.
It enables real-time synchronization of permission status across devices, avoids privacy leaks, ensures the security and ease of use of highly sensitive permissions, and improves the security and user experience of mini programs in distributed scenarios.
Smart Images

Figure CN121580386B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of collaborative permission management, and more specifically, to a method and apparatus for synchronizing permissions for mini-programs based on the HarmonyOS system. Background Technology
[0002] In the distributed application scenarios of HarmonyOS, mini-programs often need to run collaboratively across devices and modules, involving multi-dimensional privacy data interaction. Therefore, precise control over their privacy permissions is necessary to balance functionality and user privacy security. For example, mini-programs that collaborate across devices may simultaneously access different levels of permissions, such as local storage, location information, and device hardware, requiring a unified permission control mechanism.
[0003] In existing technologies, permission management for mini-programs mostly adopts a single-device independent authorization mode, that is, each device or module sets up permission application and approval processes separately, and completes permission verification through local system interfaces. Some solutions are supplemented by simple cloud permission filing.
[0004] However, this type of solution has significant drawbacks: First, in distributed scenarios, permission control is fragmented, and the permission status is not synchronized among multiple devices and modules, which can easily lead to duplicate authorization or permission omissions, resulting in the risk of privacy leakage; Second, it lacks a hierarchical collaborative verification mechanism, making it difficult to ensure the security of the use of highly sensitive permissions. Summary of the Invention
[0005] The main purpose of this application is to provide a method and device for synchronizing mini-program permissions based on the HarmonyOS system, in order to solve the problems of fragmented permission management and insufficient hierarchical collaboration of mini-programs in the distributed scenario of HarmonyOS system. It can realize cross-device permission synchronization and hierarchical dynamic authorization, while taking into account privacy and security as well as ease of use.
[0006] To achieve the above objectives, the first aspect of this application proposes a method for synchronizing mini-program permissions based on the HarmonyOS system, comprising: obtaining the permission status of a second terminal when the target mini-program is logged in on a first terminal, wherein the second terminal is a historical login terminal of the target mini-program; updating the permission status of the first terminal according to the permission status of the second terminal through the inter-device communication mechanism of the HarmonyOS system; wherein the target mini-program adopts hierarchical permission configuration, with different permission levels corresponding to different functional scenarios, and different permission levels corresponding to different privacy sensitivities.
[0007] According to the method for synchronizing mini-program permissions based on HarmonyOS provided in this application, the hierarchical permission configuration includes a first level range and a second level range, wherein the privacy sensitivity of the permission level in the second level range is higher than that of the permission level in the first level range; the step of updating the permission status of the first terminal according to the permission status of the second terminal includes: when the first terminal is a mobile terminal and the second terminal is a desktop terminal, retaining the status settings of the permission levels in the first level range according to the permission status of the second terminal, and initializing the status settings of the permission levels in the second level range.
[0008] According to the method for synchronizing mini-program permissions based on the HarmonyOS system provided in this application, the step of updating the permission status of the first terminal according to the permission status of the second terminal includes: when the first terminal is a desktop and the second terminal is a mobile terminal, updating the permission status of the first functional scenario in the first terminal according to the permission status of the second terminal, and updating the permission status of the second functional scenario to an authorized status; wherein, the second functional scenario refers to a functional scenario adapted to the interactive characteristics of the desktop terminal, and the first functional scenario refers to a general functional scenario that is independent of the terminal type.
[0009] According to the method for synchronizing permissions of a mini-program based on the HarmonyOS system provided in this application, the second functional scenario includes at least one of the following: file access and external device invocation.
[0010] According to the method for synchronizing mini-program permissions based on the HarmonyOS system provided in this application, after updating the permission status of the first terminal through the device communication mechanism of the HarmonyOS system, the method further includes: outputting permission warning information when preset risk warning conditions are met; wherein, the preset risk warning conditions include the target mini-program simultaneously initiating a synchronization request for permission levels within the second level range on multiple unrelated terminals, simultaneously granting permissions within the second level range to the first terminal when the permission status of the second terminal contains abnormal change records, simultaneously requesting permissions for a second functional scenario when the physical distance between the first terminal and the second terminal exceeds a preset threshold, and the synchronized permission range exceeding the functional range of the target mini-program, the permission warning information is used to remind the user that the target mini-program has a risk of abnormal use of privacy permissions.
[0011] According to the method for synchronizing permissions of a mini-program based on the HarmonyOS system provided in this application, the method further includes: collecting the permission synchronization log of the target mini-program; and displaying historical permission update information according to the permission synchronization log when a user's query instruction is received.
[0012] This application also provides a mini-program permission synchronization device based on the HarmonyOS system, comprising the following modules: an acquisition module and a processing module; the acquisition module is used to acquire the permission status of a second terminal when the first terminal is logged into the target mini-program, the second terminal being a historical login terminal of the target mini-program; the processing module is used to update the permission status of the first terminal according to the permission status of the second terminal through the inter-device communication mechanism of the HarmonyOS system; wherein, the target mini-program adopts hierarchical permission configuration, with different permission levels corresponding to different functional scenarios, and different permission levels corresponding to different privacy sensitivities.
[0013] According to the mini-program permission synchronization device based on HarmonyOS provided in this application, the hierarchical permission configuration includes a first level range and a second level range, wherein the privacy sensitivity of the permission level in the second level range is higher than that of the permission level in the first level range; the processing module is used to retain the status settings of the permission level in the first level range according to the permission status of the second terminal when the first terminal is a mobile terminal and the second terminal is a desktop terminal, and initialize the status settings of the permission level in the second level range.
[0014] According to the mini-program permission synchronization device based on HarmonyOS provided in this application, the processing module is used to update the permission status of the first functional scenario in the first terminal according to the permission status of the second terminal when the first terminal is a desktop terminal and the second terminal is a mobile terminal, and update the permission status of the second functional scenario to an authorized status; wherein, the second functional scenario refers to a functional scenario adapted to the interactive characteristics of the desktop terminal, and the first functional scenario refers to a general functional scenario that is independent of the terminal type.
[0015] According to the mini-program permission synchronization device based on HarmonyOS provided in this application, the second functional scenario includes at least one of the following: file access and external device invocation.
[0016] According to the mini-program permission synchronization device based on the HarmonyOS system provided in this application, after the permission status of the first terminal is updated through the device communication mechanism of the HarmonyOS system, the processing module is used to output permission warning information when preset risk warning conditions are met; wherein, the preset risk warning conditions include the target mini-program simultaneously initiating a synchronization request for permission levels within the second level range on multiple unrelated terminals, simultaneously granting permissions within the second level range to the first terminal when the permission status of the second terminal contains abnormal change records, simultaneously requesting permissions for a second functional scenario when the physical distance between the first terminal and the second terminal exceeds a preset threshold, and the synchronized permission range exceeding the functional range of the target mini-program, the permission warning information is used to remind the user that the target mini-program has a risk of abnormal use of privacy permissions.
[0017] According to the mini-program permission synchronization device based on HarmonyOS provided in this application, the processing module is used to collect the permission synchronization log of the target mini-program; when receiving a user's query command, it displays historical permission update information according to the permission synchronization log.
[0018] This application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the mini-program permission synchronization method based on HarmonyOS as described above.
[0019] This application also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the mini-program permission synchronization method based on HarmonyOS as described above.
[0020] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the mini-program permission synchronization method based on HarmonyOS as described above.
[0021] The technical solutions provided by the embodiments of this application may include the following beneficial effects:
[0022] Because the permission status of the second terminal is obtained when the first terminal logs into the target mini program, and the permission status of the first terminal is updated through the inter-device communication mechanism of the HarmonyOS system, real-time synchronization of permission status across devices can be achieved. This solves the risk of duplicate authorization or omission caused by fragmented permission management and asynchronous permissions of multiple devices in the distributed scenario in the existing technology, and can avoid privacy leakage.
[0023] Furthermore, because the target mini-program adopts a hierarchical permission configuration, with different functional scenarios corresponding to different privacy sensitivity permission levels, it can achieve precise control over highly sensitive permissions, making up for the lack of hierarchical collaborative verification in existing technologies and ensuring the security of using highly sensitive permissions.
[0024] In this way, unified control of permissions can be achieved in distributed scenarios, while balancing the ease of use of mini-program functions with user privacy and security, thereby improving the security and user experience of cross-device collaboration of mini-programs in the HarmonyOS system. Attached Figure Description
[0025] The accompanying drawings, which form part of this application, are used to provide a further understanding of the application and to make other features, objects, and advantages of the application more apparent. The illustrative embodiments and descriptions of this application are used to explain the application and do not constitute an undue limitation of the application. In the drawings:
[0026] Figure 1 One of the flowcharts illustrating the method for synchronizing mini-program permissions based on the HarmonyOS system provided in this application;
[0027] Figure 2 The second flowchart illustrating the method for synchronizing mini-program permissions based on the HarmonyOS system provided in this application;
[0028] Figure 3 This is a schematic diagram of the structure of the mini-program permission synchronization device based on the HarmonyOS system provided by the present invention;
[0029] Figure 4 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0030] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present application.
[0031] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0032] In this application, the terms "upper," "lower," "left," "right," "front," "rear," "top," "bottom," "inner," "outer," "middle," "vertical," "horizontal," "lateral," and "longitudinal" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. These terms are primarily for the purpose of better describing this application and its embodiments, and are not intended to limit the indicated device, element, or component to having a specific orientation, or to be constructed and operated in a specific orientation.
[0033] Furthermore, in addition to indicating location or positional relationship, some of the aforementioned terms may also have other meanings. For example, the term "above" may also be used in some cases to indicate a certain dependency or connection relationship. Those skilled in the art can understand the specific meaning of these terms in this application based on the specific circumstances.
[0034] Furthermore, the terms "installation," "setup," "equipped with," "connection," "linked," and "socketing" should be interpreted broadly. For example, "connection" can be a fixed connection, a detachable connection, or an integral structure; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, or an internal connection between two devices, components, or parts. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.
[0035] This application describes some exemplary embodiments for illustrative purposes. It should be understood that this application may be implemented in other ways not specifically shown in the accompanying drawings.
[0036] like Figure 1 As shown, this application provides a method for synchronizing mini-program permissions based on the HarmonyOS system. This method can be applied to a device for synchronizing mini-program permissions based on the HarmonyOS system, which can be a first terminal. The method can include steps S101-S102:
[0037] S101. When the target mini-program is logged in on the first terminal, the mini-program permission synchronization device based on the HarmonyOS system obtains the permission status of the second terminal.
[0038] The second terminal mentioned above is the historical login terminal of the target mini-program.
[0039] Specifically, such as Figure 2 As shown, after the target mini-program is launched, the mini-program permission synchronization device can query the historical login device records of the target mini-program through the distributed account association mechanism of the HarmonyOS system, and filter out the second terminal that has completed identity authentication and is currently online, that is, the target mini-program is in a multi-terminal login state; then, it sends a permission status query request to the second terminal through the secure inter-device communication channel built into the HarmonyOS system. The permission status query request can include the unique identifier of the target mini-program and the permission query scope; after receiving the request, the second terminal verifies the legality and completeness of the request, and extracts the full permission authorization record of the target mini-program stored in its own storage, including the authorization status, authorization time and permission level of each permission, and finally feeds it back to the first terminal through encrypted transmission to ensure that the permission data is not tampered with or leaked during the transmission process.
[0040] S102. The mini-program permission synchronization device based on the HarmonyOS system updates the permission status of the first terminal according to the permission status of the second terminal through the inter-device communication mechanism of the HarmonyOS system.
[0041] The aforementioned target mini-programs employ tiered permission configurations, with different permission levels corresponding to different functional scenarios, and different permission levels corresponding to different levels of privacy sensitivity.
[0042] Specifically, such as Figure 2 As shown, after receiving the permission status data from the second terminal, the mini-program permission synchronization device can first decrypt and verify the data. After confirming that the data is complete and correct, it can extract the authorization status of each permission and the corresponding permission level information. Then, it can update the permission status of the first terminal through the device communication mechanism of the HarmonyOS system.
[0043] Optionally, the hierarchical permission configuration includes a first level range and a second level range, wherein the privacy sensitivity of the permission level in the second level range is higher than that of the permission level in the first level range.
[0044] It should be noted that the second level range is a set of high privacy sensitivity permission levels, and the corresponding permissions include location information access, camera access, contact list reading, SMS viewing, etc. The first level range is a set of medium to low privacy sensitivity permission levels, and the corresponding permissions include basic network access, device model acquisition, system time reading, etc.
[0045] Optionally, updating the permission status of the first terminal according to the permission status of the second terminal includes:
[0046] When the first terminal is a mobile terminal and the second terminal is a desktop terminal, the permission level status settings in the first level range are retained according to the permission status of the second terminal, and the permission level status settings in the second level range are initialized.
[0047] When the first terminal is a desktop and the second terminal is a mobile terminal, the permission status of the first functional scenario in the first terminal is updated according to the permission status of the second terminal, and the permission status of the second functional scenario is updated to an authorized status. The second functional scenario refers to a functional scenario adapted to the interaction characteristics of the desktop terminal, while the first functional scenario refers to a general functional scenario independent of the terminal type. The second functional scenario includes at least one of the following: file access and external device invocation.
[0048] Specifically, such as Figure 2 As shown, the mini-program permission synchronization device can first determine the terminal type and identify the differences in device attributes between the two types of terminals. When the first terminal is a mobile terminal and the second terminal is a desktop terminal, for the first level of permissions with low to medium privacy sensitivity, the mini-program permission synchronization device can directly use the authorization status of the second terminal to ensure the consistency of permission control. For the second level of permissions with high privacy sensitivity, the mini-program permission synchronization device can initialize its status to the default restricted state, and then expand the scope of open permissions after the user actively confirms it, so as to avoid excessive opening of permissions.
[0049] When the first terminal is a desktop and the second terminal is a mobile terminal, the mini-program permission synchronization device first distinguishes between functional scenarios. The first functional scenario includes general scenarios that do not rely on terminal interaction features, such as account login verification, basic data display, and network request initiation. The permission status of these scenarios is completely synchronized with the authorization configuration of the second terminal, maintaining a consistent user experience across terminals. The second functional scenario includes scenarios that are compatible with desktop keyboard and mouse operation and hardware expansion capabilities, such as local file reading and writing, printer and other peripheral device calls, and large-screen display adaptation. When the mini-program permission synchronization device detects that the desktop hardware supports the scenario and the functional scenario matches, it automatically updates the permission status of this type of scenario to an authorized status, while restricting the scope of permission use. For example, file access is only allowed in specified directories, and peripheral device calls are only supported on adapted devices. This satisfies the need for efficient desktop operation while avoiding the risk of permission abuse.
[0050] Optionally, the mini-program permission synchronization device can write the processed permission configuration into the mini-program permission storage module of the first terminal through the permission management interface of the HarmonyOS system, complete the permission status update, and generate a permission synchronization log to record information such as synchronization time, synchronization source terminal, and permission changes.
[0051] Optionally, the mini-program permission synchronization device can collect the permission synchronization log of the target mini-program; when a user's query command is received, historical permission update information is displayed according to the permission synchronization log.
[0052] Specifically, the mini-program permission synchronization device can rely on the logging function of the first terminal to collect permission synchronization logs in real time during the mini-program's operation. After collection, the log data is encrypted using the SM3 encryption algorithm to ensure data security before being stored in a local log file, preventing unauthorized modification or leakage of log content. When a user initiates a query, the mini-program permission synchronization device can extract corresponding data from the encrypted permission synchronization logs according to the user-specified filtering conditions, decrypt it, and display it in a structured list format. This enables traceable querying of permission synchronization, allowing users to clearly understand the mini-program's permission synchronization status.
[0053] Optionally, after updating the permission status of the first terminal through the device communication mechanism of the HarmonyOS system, the mini-program permission synchronization device can also output permission warning information when preset risk warning conditions are met. The preset risk warning conditions include: the target mini-program simultaneously initiates a synchronization request for permission levels within the second level range on multiple unrelated terminals; when the permission status of the second terminal contains abnormal change records, it simultaneously grants permissions within the second level range to the first terminal; the physical distance between the first terminal and the second terminal exceeds a preset threshold, but the first terminal simultaneously requests permissions for a second functional scenario; and the scope of synchronized permissions exceeds the functional scope of the target mini-program. The permission warning information is used to remind the user that the target mini-program has a risk of abnormal use of privacy permissions.
[0054] Specifically, when a permission synchronization action triggers a preset risk warning condition, the mini-program permission synchronization device can immediately trigger a risk warning mechanism. For example, if the same target mini-program initiates permission synchronization requests on three or more unrelated terminals within a short period of time, and the synchronization requests include requests for permissions with high privacy sensitivity; if the physical distance between the first terminal and the second terminal exceeds a preset threshold, but they simultaneously request permissions requiring close-range collaboration, such as cross-device file transfer or remote hardware control; or if a non-map mini-program simultaneously requests high-precision location permissions, or a non-office mini-program simultaneously requests full directory file access permissions, etc.
[0055] The risk warning mechanism triggered by the mini-program permission synchronization device can manifest as follows: pushing permission warning information to users through the message center of the cloud drive application. The information can clearly indicate the risk type, the permission level involved, and the corresponding functional scenario, so as to remind users that there is a risk of abnormal use of privacy permissions in the current mini-program.
[0056] In this embodiment, the permission status of the second terminal is obtained when the first terminal logs into the target mini-program, and the permission status of the first terminal is updated through the HarmonyOS inter-device communication mechanism. This enables real-time synchronization of permission status across devices, solving the risks of fragmented permission management and asynchronous permissions across multiple devices in distributed scenarios, which can lead to duplicate authorizations or omissions and prevent privacy leaks. Furthermore, because the target mini-program uses hierarchical permission configuration, with different functional scenarios corresponding to different privacy-sensitive permission levels, precise control can be achieved for highly sensitive permissions. This overcomes the shortcomings of existing technologies that lack hierarchical collaborative verification, ensuring the security of highly sensitive permissions. Thus, unified permission management can be achieved in distributed scenarios, balancing the convenience of mini-program functionality with user privacy and security, thereby improving the security and user experience of cross-device collaboration of mini-programs within the HarmonyOS system.
[0057] The foregoing mainly describes the solutions provided by the embodiments of this application from a methodological perspective. To achieve the above functions, it includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, in conjunction with the units and algorithm steps of the various examples described in the embodiments disclosed herein, the embodiments of this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0058] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0059] It should be noted that the device in the embodiments of this application includes a virtual device and a physical device. The virtual device can be a mini-program permission synchronization device based on the HarmonyOS system, and the physical device can include electronic devices, computer storage media, and computer program products.
[0060] The mini-program permission synchronization method based on HarmonyOS provided in this application embodiment can be executed by a mini-program permission synchronization device based on HarmonyOS, or a control module for mini-program permission synchronization based on HarmonyOS within that device. This application embodiment uses the execution of the mini-program permission synchronization method based on HarmonyOS by a mini-program permission synchronization device as an example to illustrate the mini-program permission synchronization device based on HarmonyOS provided in this application embodiment.
[0061] It should be noted that, according to the above method examples, the functional modules of the mini-program permission synchronization device based on the HarmonyOS system can be divided. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into one processing module. The integrated modules can be implemented in hardware or as software functional modules. Optionally, the module division in this embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.
[0062] like Figure 3 As shown, this application embodiment provides a mini-program permission synchronization device 300 based on the HarmonyOS system. The HarmonyOS-based mini-program permission synchronization device 300 includes: an acquisition module 301 and a processing module 302; the acquisition module 301 is used to acquire the permission status of a second terminal when the first terminal logs into the target mini-program, the second terminal being a historical login terminal of the target mini-program; the processing module 302 is used to update the permission status of the first terminal according to the permission status of the second terminal through the inter-device communication mechanism of the HarmonyOS system; wherein, the target mini-program adopts a hierarchical permission configuration, with different permission levels corresponding to different functional scenarios, and different permission levels corresponding to different privacy sensitivities.
[0063] Optionally, the hierarchical permission configuration includes a first level range and a second level range, wherein the privacy sensitivity of the permission level in the second level range is higher than that of the permission level in the first level range; the processing module 302 is used to retain the status settings of the permission level in the first level range according to the permission status of the second terminal when the first terminal is a mobile terminal and the second terminal is a desktop terminal, and to initialize the status settings of the permission level in the second level range.
[0064] Optionally, the processing module 302 is configured to update the permission status of the first functional scenario in the first terminal according to the permission status of the second terminal when the first terminal is a desktop terminal and the second terminal is a mobile terminal, and update the permission status of the second functional scenario to an authorized status; wherein, the second functional scenario refers to a functional scenario adapted to the interactive characteristics of the desktop terminal, and the first functional scenario refers to a general functional scenario that is independent of the terminal type.
[0065] Optionally, the second functional scenario includes at least one of the following: file access and external device invocation.
[0066] Optionally, after updating the permission status of the first terminal through the device communication mechanism of the HarmonyOS system, the processing module 302 is used to output permission warning information when preset risk warning conditions are met; wherein, the preset risk warning conditions include the target mini-program simultaneously initiating a synchronization request for permission levels within the second level range on multiple unrelated terminals, simultaneously granting permission levels within the second level range to the first terminal when the permission status of the second terminal contains abnormal change records, simultaneously requesting permission for the second functional scenario when the physical distance between the first terminal and the second terminal exceeds a preset threshold, and the synchronized permission range exceeding the functional range of the target mini-program, the permission warning information is used to remind the user that the target mini-program has a risk of abnormal use of privacy permissions.
[0067] Optionally, the processing module 302 is used to collect the permission synchronization log of the target mini-program; when a user's query instruction is received, the historical permission update information is displayed according to the permission synchronization log.
[0068] In this embodiment, the permission status of the second terminal is obtained when the first terminal logs into the target mini-program, and the permission status of the first terminal is updated through the HarmonyOS inter-device communication mechanism. This enables real-time synchronization of permission status across devices, solving the risks of fragmented permission management and asynchronous permissions across multiple devices in distributed scenarios, which can lead to duplicate authorizations or omissions and prevent privacy leaks. Furthermore, because the target mini-program uses hierarchical permission configuration, with different functional scenarios corresponding to different privacy-sensitive permission levels, precise control can be achieved for highly sensitive permissions. This overcomes the shortcomings of existing technologies that lack hierarchical collaborative verification, ensuring the security of highly sensitive permissions. Thus, unified permission management can be achieved in distributed scenarios, balancing the convenience of mini-program functionality with user privacy and security, thereby improving the security and user experience of cross-device collaboration of mini-programs within the HarmonyOS system.
[0069] Figure 4 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 4As shown, the electronic device may include: a processor 410, a communications interface 420, a memory 430, and a communication bus 440, wherein the processor 410, communications interface 420, and memory 430 communicate with each other through the communication bus 440. The processor 410 can call logical instructions in the memory 430 to execute a mini-program permission synchronization method based on the HarmonyOS system. This method includes: when the first terminal is logged into the target mini-program, obtaining the permission status of a second terminal, the second terminal being a historical login terminal of the target mini-program; updating the permission status of the first terminal according to the permission status of the second terminal through the inter-device communication mechanism of the HarmonyOS system; wherein the target mini-program adopts hierarchical permission configuration, with different permission levels corresponding to different functional scenarios, and different permission levels corresponding to different privacy sensitivities.
[0070] Furthermore, the logical instructions in the aforementioned memory 430 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0071] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the mini-program permission synchronization method based on the HarmonyOS system provided by the above methods. The method includes: obtaining the permission status of a second terminal when the first terminal logs into the target mini-program, the second terminal being a historical login terminal of the target mini-program; updating the permission status of the first terminal according to the permission status of the second terminal through the inter-device communication mechanism of the HarmonyOS system; wherein the target mini-program adopts hierarchical permission configuration, with different permission levels corresponding to different functional scenarios, and different permission levels corresponding to different privacy sensitivities.
[0072] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the method for synchronizing the permissions of a mini-program based on the HarmonyOS system provided by the above methods. The method includes: when a target mini-program is logged in on a first terminal, obtaining the permission status of a second terminal, wherein the second terminal is a historical login terminal of the target mini-program; updating the permission status of the first terminal according to the permission status of the second terminal through the inter-device communication mechanism of the HarmonyOS system; wherein the target mini-program adopts a hierarchical permission configuration, with different permission levels corresponding to different functional scenarios, and different permission levels corresponding to different privacy sensitivities.
[0073] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0074] Obviously, those skilled in the art should understand that the various units or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device, or fabricating them separately as individual integrated circuit modules, or fabricating multiple modules or steps into a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.
[0075] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for synchronizing mini-program permissions based on the HarmonyOS system, applied to a first terminal, characterized in that: include: If the target mini-program is logged in on the first terminal, the permission status of the second terminal is obtained, and the second terminal is the historical login terminal of the target mini-program; According to the permission status of the second terminal, the permission status of the first terminal is updated through the device communication mechanism of the HarmonyOS system; The target mini-program adopts a hierarchical permission configuration, with different permission levels corresponding to different functional scenarios, and different permission levels corresponding to different levels of privacy sensitivity. The hierarchical permission configuration includes a first level range and a second level range, wherein the privacy sensitivity of the permission level in the second level range is higher than that of the permission level in the first level range. The step of updating the permission status of the first terminal according to the permission status of the second terminal through the inter-device communication mechanism of the HarmonyOS system includes: When the first terminal is a mobile terminal and the second terminal is a desktop terminal, the permission level status settings in the first level range are retained according to the permission status of the second terminal, and the permission level status settings in the second level range are initialized. When the first terminal is a desktop and the second terminal is a mobile terminal, the permission status of the first functional scenario in the first terminal is updated according to the permission status of the second terminal, and the permission status of the second functional scenario is updated to the authorized status. The second functional scenario refers to a functional scenario adapted to the interactive characteristics of the desktop terminal, while the first functional scenario refers to a general functional scenario that is independent of the terminal type.
2. The method for synchronizing mini-program permissions based on the HarmonyOS system according to claim 1, characterized in that, The second functional scenario includes at least one of the following: file access and external device invocation.
3. The method for synchronizing mini-program permissions based on the HarmonyOS system according to claim 1, characterized in that, After updating the permission status of the first terminal through the device communication mechanism of the HarmonyOS system, the method further includes: When the preset risk warning conditions are met, an access warning message is output. The preset risk warning conditions include: the target mini-program simultaneously initiating a synchronization request for permission levels within the second level range on multiple unrelated terminals; simultaneously granting permission levels within the second level range to the first terminal when the permission status of the second terminal contains abnormal change records; simultaneously requesting permission for a second functional scenario when the physical distance between the first and second terminals exceeds a preset threshold; and the synchronized permission range exceeding the functional range of the target mini-program. The permission warning information is used to alert the user that the target mini-program has a risk of abnormal use of privacy permissions.
4. The method for synchronizing mini-program permissions based on the HarmonyOS system according to claim 1, characterized in that, The method further includes: Collect the permission synchronization logs of the target mini-program; Upon receiving a user's query command, the system displays historical permission update information based on the permission synchronization log.
5. A WeChat Mini Program permission synchronization device based on the HarmonyOS system, characterized in that, Applied to the first terminal, it includes: an acquisition module and a processing module; The acquisition module is used to acquire the permission status of a second terminal when the first terminal is logged into the target mini-program, wherein the second terminal is a historical login terminal of the target mini-program; The processing module is used to update the permission status of the first terminal according to the permission status of the second terminal through the device communication mechanism of the HarmonyOS system. The target mini-program adopts a hierarchical permission configuration, with different permission levels corresponding to different functional scenarios, and different permission levels corresponding to different levels of privacy sensitivity. The hierarchical permission configuration includes a first level range and a second level range, wherein the privacy sensitivity of the permission level in the second level range is higher than that of the permission level in the first level range. The step of updating the permission status of the first terminal according to the permission status of the second terminal through the inter-device communication mechanism of the HarmonyOS system includes: When the first terminal is a mobile terminal and the second terminal is a desktop terminal, the permission level status settings in the first level range are retained according to the permission status of the second terminal, and the permission level status settings in the second level range are initialized. When the first terminal is a desktop and the second terminal is a mobile terminal, the permission status of the first functional scenario in the first terminal is updated according to the permission status of the second terminal, and the permission status of the second functional scenario is updated to the authorized status. The second functional scenario refers to a functional scenario adapted to the interactive characteristics of the desktop terminal, while the first functional scenario refers to a general functional scenario that is independent of the terminal type.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the mini-program permission synchronization method based on the HarmonyOS system as described in any one of claims 1 to 4.
7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the mini-program permission synchronization method based on the HarmonyOS system as described in any one of claims 1 to 4.
8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the mini-program permission synchronization method based on the HarmonyOS system as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Application permission synchronization method and related equipment
CN116340900A