WO2022199499A1 - 一种访问控制的方法、电子设备及系统 - Google Patents

一种访问控制的方法、电子设备及系统 Download PDF

Info

Publication number
WO2022199499A1
WO2022199499A1 PCT/CN2022/081882 CN2022081882W WO2022199499A1 WO 2022199499 A1 WO2022199499 A1 WO 2022199499A1 CN 2022081882 W CN2022081882 W CN 2022081882W WO 2022199499 A1 WO2022199499 A1 WO 2022199499A1
Authority
WO
WIPO (PCT)
Prior art keywords
instance
caller
sandbox
callee
request
Prior art date
Application number
PCT/CN2022/081882
Other languages
English (en)
French (fr)
Inventor
任兵飞
毛哲文
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP22774160.0A priority Critical patent/EP4280090A1/en
Priority to US18/551,721 priority patent/US20240176872A1/en
Publication of WO2022199499A1 publication Critical patent/WO2022199499A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/52Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow
    • G06F21/53Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow by executing in a restricted environment, e.g. sandbox or secure virtual machine
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/55Detecting local intrusion or implementing counter-measures
    • G06F21/556Detecting local intrusion or implementing counter-measures involving covert channels, i.e. data leakage between processes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/604Tools and structures for managing or administering access control systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network

Definitions

  • the present application relates to the field of computer technology, and in particular, to an access control method, electronic device and system.
  • the application in the terminal operating system (OS) can apply to the user for access authorization of sensitive resources in the form of an independent subject, and can provide the user with corresponding services after the user's authorization is passed.
  • an APP calls the services of another APP
  • the called APP can provide services for the calling APP. If the called APP is called by different caller APPs, the called APP will store data generated by different callers, and the called APP can freely access the data generated by different multiple callers, making the calling APP data security is not guaranteed.
  • the present application provides an access control method, related electronic device and system, which solves the problem that the data of each caller is abused, misused or leaked among the callees, and ensures the data security of different callers.
  • an embodiment of the present application provides an access control method, and the method is applied to a communication system, where the communication system includes a first device, a second device, and a third device, wherein, in the first device A first caller is installed, a callee is installed in the second device, and a second caller is installed in the third device; the first caller, the callee, the second caller A party is an application program or a functional component, the application program is a program entity that implements multiple functions, and the functional component is a program entity that implements a single function.
  • the method includes: the first device sends a first request to the second device, where the first request carries: indication information of the first caller, the callee, and the first service; in response to for the first request, the second device runs a first instance in a first sandbox, the first instance is an instance of the callee, and the first instance is used for the first caller providing the first service; the third device sends a second request to the second device, where the second request carries: the second caller, the callee, and the indication information of the second service; In response to the second request, the second device runs a second instance in a second sandbox, the second instance is an instance of the callee, the second instance is used for the second The caller provides the second service, the second sandbox is different from the first sandbox.
  • the callee when it provides services for different callers, it can run different instances in different sandboxes.
  • the callee on the second device can run the first instance in the first sandbox.
  • the instance provides the first service for the first caller on the first device
  • the callee on the second device can run the second instance in the second sandbox to provide the second service for the second caller on the third device
  • Data isolation between different sandboxes can more effectively reduce the risks of data abuse, confusion, misuse or leakage of each caller, and ensure data security.
  • the method may further include: the first device initiates a third request to the second device, where the third request carries: the first caller, the called party Indication information of the caller and the third service; in response to the third request, the second device runs the first instance in the first sandbox, and the first instance is further used to provide the first instance for the third service.
  • a caller provides the third service, or the second device runs a third instance in the first sandbox, where the third instance is used to provide the third service for the first caller.
  • the method may further include: the first device initiates a fourth request to the second device, where the fourth request carries: the third caller, the called party Indication information of a caller and a fourth service, wherein the third caller is installed in the first device, and the third caller is an application program APP or a functional component; in response to the fourth request, the the second device runs the first instance in the first sandbox, and the first instance is further used to provide the fourth service for the third caller, or the second device is in the A third instance is run in the first sandbox, and the third instance is used to provide the fourth service for the third caller.
  • the method may further include: the fourth device initiates a fifth request to the second device, where the fifth request carries: the first caller, the callee . Indication information of a fifth service, wherein the first caller is installed in the fourth device; in response to the fifth request, the second device runs the first instance in the first sandbox , the first instance is further used to provide the fifth service for the first caller of the fourth device, or the second device runs a third instance in the first sandbox, the first Three instances are used to provide the fourth service to a third caller.
  • the method may further include: the first caller and the second caller are the same.
  • the method may further include: the first device and the third device are the same device.
  • the method before the second device runs the first instance, the method further includes: the second device detects whether the first sandbox exists, and if not, then The second device creates the first sandbox; before the second device runs the second instance, the method further includes: the second device detects whether the second sandbox exists, and if not, then The second device creates the second sandbox.
  • the second device running the first instance in a first sandbox includes: the second device creating the first instance, and running the first instance in the first sandbox run the first instance in the box;
  • the second device running the second instance in the second sandbox includes: the second device creating the second instance and running the second instance in the second sandbox.
  • the method may further include: after the second device creates the first instance, storing a first invocation relationship in the second device, where the first invocation relationship includes: The information of the first caller, the information of the first instance, and the identifier of the first calling relationship; after the second device creates the second instance, the second device stores the second calling relationship , the second invocation relationship includes: the information of the second invocation party, the information of the second instance, and the identifier of the second invocation relationship.
  • the method further includes: the first device stores the first calling relationship; After the third device sends the second request to the second device, the method further includes: the third device stores the second calling relationship.
  • the information of the first caller includes one or more of the following: an application identifier of the first caller, a user identifier UID of the first caller, the The developer signature of the first caller, the account identifier of the first device where the first caller is located, the identifier of the first device, the identifier of the communication system where the first caller is located;
  • the information of an instance includes: the process of the first instance identifies the first PID, and the user of the first instance identifies the first UID; the method further includes: when the second device creates the first instance, The second device assigns the first PID, or the first UID, to the first instance.
  • the information of the first instance further includes one or more of the following: the application identifier of the callee, the user identifier UID of the callee, the callee The developer signature of the party, the account identifier of the second device where the callee is located, the identifier of the second device, and the identifier of the communication system where the first instance is located.
  • the method may further include: the first request further carries the identifier of the first device and the identifier of the second device.
  • the method further includes: the second device generates a first result; the second device returns the first result to the first device; the first device runs the first caller to process the first result.
  • the method before the second device runs the first instance, the method further includes: the second device confirming that the first caller has permission to access the first instance .
  • the method before the second device runs the first instance, the method further includes: the second device confirming that the first caller has the ability to request the callee to provide the the permissions of the first service.
  • the method before the first device sends the first request to the second device, the method further includes: the first device confirming that the first caller has access to all Describe the rights of the callee.
  • the first device, the second device, and the third device are the same device.
  • the second device stores a mapping relationship between the first sandbox and the first caller; the second device stores the second sandbox A mapping relationship with the second caller.
  • an embodiment of the present application provides an access control method, where the method is applied to a second device, where the second device is located in a communication system, and the communication system includes a first device, a second device, a second device, and a second device.
  • the communication system includes a first device, a second device, a second device, and a second device.
  • the method includes: receiving, by the second device, a first request sent by the first device, the first request carrying: indication information of the first caller, the callee, and the first service; a response At the first request, the second device runs a first instance in a first sandbox, the first instance is an instance of the callee, the first instance is used for the first call
  • the second device receives the second request sent by the third device, where the second request carries: the second caller, the callee, the indication of the second service information; in response to the second request, the second device runs a second instance in a second sandbox, the second instance is an instance of the callee, the second instance is used for the A second caller provides the second service, the second sandbox is different from the first sandbox.
  • the callee when it provides services for different callers, it can run different instances in different sandboxes.
  • the callee on the second device can run the first instance in the first sandbox.
  • the instance provides the first service for the first caller on the first device
  • the callee on the second device can run the second instance in the second sandbox to provide the second service for the second caller on the third device
  • Data isolation between different sandboxes can more effectively reduce the risks of data abuse, confusion, misuse or leakage of each caller, and ensure data security.
  • the method further includes: receiving, by the second device, a third request sent by the first device, the third request carrying: the first caller, the Indication information of the called party and the third service; in response to the third request, the second device runs the first instance in the first sandbox, and the first instance is also used for the The first caller provides the third service, or the second device runs a third instance in the first sandbox, where the third instance is used to provide the third service for the first caller.
  • the method further includes: receiving, by the second device, a fourth request sent by the first device, the fourth request carrying: the third caller, the the callee and the indication information of the fourth service, wherein the third caller is installed in the first device, and the third caller is an application program APP or a functional component; in response to the fourth request , the second device runs the first instance in the first sandbox, and the first instance is further used to provide the fourth service for the third caller, or the second device A third instance is run in the first sandbox, the third instance is used to provide the fourth service to a third caller.
  • the method further includes: receiving, by the second device, a fifth request sent by the fourth device, the fifth request carrying: the first caller, the The callee, the indication information of the fifth service, wherein the first caller is installed in the fourth device; in response to the fifth request, the second device runs the first sandbox a first instance, the first instance is further configured to provide the fifth service for the first caller of the fourth device, or the second device runs a third instance in the first sandbox, The third instance is used to provide the fourth service to a third caller.
  • the first caller and the second caller are the same.
  • the first device and the third device are the same device.
  • the method before the second device runs the first instance, the method further includes: the second device detects whether the first sandbox exists, and if not, then The second device creates the first sandbox; before the second device runs the second instance, the method further includes: the second device detects whether the second sandbox exists, and if not, then The second device creates the second sandbox.
  • the second device running the first instance in a first sandbox includes: the second device creating the first instance, and running the first instance in the first sandbox run the first instance in the box;
  • the second device running the second instance in the second sandbox includes: the second device creating the second instance and running the second instance in the second sandbox.
  • the second device after the second device creates the first instance, stores a first call relationship, where the first call relationship includes: the first caller information of the first instance, the identifier of the first invocation relationship; after the second device creates the second instance, the second device stores the second invocation relationship, and the second invocation The relationship includes: the information of the second caller, the information of the second instance, and the identifier of the second calling relationship.
  • the information of the first caller includes one or more of the following: an application identifier of the first caller, a user identifier UID of the first caller, the The developer signature of the first caller, the account identifier of the first device where the first caller is located, the identifier of the first device, the identifier of the communication system where the first caller is located;
  • the information of an instance includes: the process of the first instance identifies the first PID, and the user of the first instance identifies the first UID; the method further includes: when the second device creates the first instance, The second device assigns the first PID, or the first UID, to the first instance.
  • the information of the first instance further includes one or more of the following: the application identifier of the callee, the user identifier UID of the callee, the callee The developer signature of the party, the account identifier of the second device where the callee is located, the identifier of the second device, and the identifier of the communication system where the first instance is located.
  • the first request further carries the identifier of the first device and the identifier of the second device.
  • the method further includes: the second device generates a first result; the second device returns the first result To the first device, the first result is for the first device to run the first caller process.
  • the method before the second device runs the first instance, the method further includes: the second device confirming that the first caller has permission to access the first instance .
  • the method before the second device runs the first instance, the method further includes: the second device confirming that the first caller has the ability to request the callee to provide the the permissions of the first service.
  • the first device, the second device, and the third device are the same device.
  • the second device stores a mapping relationship between the first sandbox and the first caller and a mapping relationship between the second sandbox and the second caller Mapping relations.
  • embodiments of the present application provide an electronic device, which may include: a communication device, a memory, a processor coupled to the memory, multiple application programs, and one or more programs.
  • Computer-executable instructions are stored in the memory, and when the processor executes the instructions, the electronic device can implement any function of the second device in the second aspect.
  • an embodiment of the present application provides a communication system, where the communication system may include the first device, the second device, the third device, and the like described in the foregoing aspects. It can be understood that, based on the same inventive idea, for each step performed by the first device, the second device, and the third device in the communication system of the fourth aspect, reference may be made to the first device, the second device, and the third device in the method of the first aspect. For the steps performed by the device when the corresponding function is implemented, or, for each step performed by the second device, reference may be made to the steps performed by the second device when the corresponding function is implemented in the method of the second aspect, which will not be repeated here.
  • an embodiment of the present application provides a computer storage medium, where a computer program is stored in the storage medium, and the computer program includes executable instructions, which, when executed by a processor, cause the processor to execute as described in Section 1. Operations corresponding to the methods provided in the second aspect.
  • an embodiment of the present application provides a computer program product, which when the computer program product runs on an electronic device, enables the electronic device to execute any of the possible implementations of the second aspect.
  • an embodiment of the present application provides a chip system, the chip system can be applied to an electronic device, the chip includes one or more processors, and the processor is used for invoking a computer instruction to make the electronic device implement as in the second aspect any possible implementation.
  • the same callee can enable multiple sandboxes and use different instances to provide services for different callers. Due to the natural isolation between sandboxes, different sandboxes cannot access data from each other, which can provide a system-level data security mechanism, avoid the abuse, misuse and leakage of data of each caller, and ensure data security.
  • FIG. 1 is a schematic diagram of a communication system provided by an embodiment of the present application.
  • FIG. 2 is a schematic diagram of an application scenario provided by an embodiment of the present application.
  • FIG. 3 is a schematic diagram of a hardware structure of an electronic device provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of a service scenario provided by an embodiment of the present application.
  • FIG. 6 is a schematic diagram of a software architecture provided by an embodiment of the present application.
  • FIG. 7 is a schematic diagram of an access control model provided by an embodiment of the present application.
  • FIG. 8 is a flowchart of a method for access control provided by an embodiment of the present application.
  • FIG. 9 is a flowchart of another access control method provided by an embodiment of the present application.
  • 10(A) to 10(C) are schematic diagrams of three different application data isolation through sandboxes provided by the embodiments of the present application.
  • first and second are only used for descriptive purposes, and should not be construed as implying or implying relative importance or implying the number of indicated technical features. Therefore, the features defined as “first” and “second” may explicitly or implicitly include one or more of the features.
  • a plurality refers to two or more than two.
  • GUI graphical user interface
  • FIG. 1 shows a communication system 10 provided by an embodiment of the present application, which may also be referred to as a distributed system 10 .
  • the distributed system 10 may include a plurality of intelligent terminal devices, and a communication connection 109 is established between the plurality of terminal devices.
  • the terminal device may be a smart phone 101 , a notebook computer 102 , a desktop computer 103 , a tablet computer 104 , a smart speaker 105 , a smart watch 106 , a smart bracelet 107 , an earphone 108 or other types of electronic devices , such as desktop computers, laptop computers, handheld computers, augmented reality (AR) devices, virtual reality (VR) devices, artificial intelligence (artificial intelligence, AI) devices, smart screens, Car machines, game consoles, other smart wearable devices, etc., can also include Internet of things (IoT) devices or smart home devices such as smart water heaters, smart lamps, smart air conditioners, and so on. This application does not make any limitation in this regard.
  • the terminal device may also be referred to as a terminal for short, and the terminal device is usually an intelligent electronic device that can provide a
  • the distributed system 10 When a plurality of electronic devices in the distributed system 10 are devices deployed in a home, the distributed system 10 may also be referred to as a home distributed system.
  • Each terminal device in the distributed system 10 can be mounted on system, system, system, system (HarmonyOS, HOS) or other types of operating systems, the operating systems of each terminal device in the distributed system 10 may be the same or different, which is not limited in this application.
  • each terminal in the distributed system 10 is equipped with system, then the distributed system 10 can be called Super virtual terminal (super virtual device), also known as Hyperterminal refers to integrating the capabilities of multiple terminals through distributed technology and storing them in a virtual hardware resource pool. According to business needs, unified management, scheduling and integration of terminal capabilities are provided to provide services to the outside world. Realize fast connection, mutual assistance and resource sharing.
  • a communication connection 109 is established between each terminal, and the communication connection 109 may be a far-field communication connection.
  • each terminal logs into the same account to realize connection and communication through the Internet.
  • Multiple electronic devices in the distributed system 10 can also log in to different accounts, but are connected in a binding manner.
  • the electronic device 100 and the electronic device 200 may log in to different accounts, and the electronic device 100 binds the electronic device 200 to itself in the device management application, and then connects through the device management application.
  • the electronic device 100 may be any electronic device in the distributed system 10
  • the electronic device 200 may also be any electronic device in the distributed system 10 .
  • the electronic device 100 is a smart phone
  • the electronic device 200 is a smart screen.
  • the communication connection 109 may also be a near field communication connection, such as through a wired connection, such as a universal serial bus (Universal Serial Bus, USB) connection, or a wireless connection, such as a Bluetooth (bluetooth, BT) connection, a wireless connection Fidelity (wireless fidelity, Wi-Fi) connection, etc., to realize communication between terminals without accounts or different accounts.
  • a wireless connection such as a Bluetooth (bluetooth, BT) connection, a wireless connection Fidelity (wireless fidelity, Wi-Fi) connection, etc.
  • the embodiment of the present application does not limit the type of the communication connection.
  • the terminal device may be configured with a Bluetooth (bluetooth, BT) module and/or a wireless local area network (wireless local area networks, WLAN) module.
  • the Bluetooth module can provide one or more Bluetooth communication solutions including classic Bluetooth (Bluetooth 2.1) or Bluetooth low energy (BLE), and the WLAN module can provide wireless fidelity peer-to-peer, Wi-Fi P2P), wireless fidelity local area networks (Wi-Fi LAN) or wireless fidelity software access point (wireless fidelity software access point, Wi-Fi softAP) one of One or more WLAN communication solutions.
  • Wi-Fi P2P refers to allowing devices in a wireless network to connect to each other in a peer-to-peer manner without going through a wireless router.
  • the system may also be called wireless fidelity direct (wireless fidelity direct, Wi-Fi direct).
  • Wi-Fi P2P Devices that establish a Wi-Fi P2P connection can directly exchange data through Wi-Fi (must be in the same frequency band) without connecting to a network or hotspot to realize point-to-point communication, such as transferring files, pictures, videos and other data.
  • Wi-FiP2P has the advantages of faster search speed and transmission speed, and longer transmission distance. Data transmission and interaction can be performed between various terminals through the communication connection 109 .
  • multiple electronic devices in the distributed system 10 may also be connected and communicate in combination with any of the foregoing manners, which is not limited in this embodiment of the present application.
  • each device in the distributed system 10 may install a traditional APP, such as a traditional camera application, a gallery application, a setting application, and so on.
  • a traditional APP such as a traditional camera application, a gallery application, a setting application, and so on.
  • the traditional APP may be referred to as APP for short.
  • distributed system 10 may install distributed applications (distributed applications).
  • distributed applications may be a system application or a third-party application, which is not limited here.
  • APP refers to a computer program that can realize one or more functions, can run independently, usually has a visual user interface, and can interact with users.
  • a distributed application consists of one or more functional components.
  • a functional component is the smallest capability unit that can run independently in an electronic device, and is a concept of abstract encapsulation of a single capability.
  • Traditional APP integrates multiple functions, while functional components take each function as a separate service-based basic capability and exist independently. That is, a functional component is a program entity that implements a single function.
  • Each functional component can be downloaded, installed and run independently. Multiple functional components forming the same distributed application may be deployed in the same electronic device in the distributed system 10, or may be deployed in different electronic devices.
  • Distributed applications can encapsulate functional modules such as remote virtualization, remote invocation, meta-capability management, cross-platform compatibility, security, etc. Distributed applications can invoke computing capabilities that other devices have but this device does not have, and have the ability to disassemble the computing work of this device. The ability to be distributed to multiple devices to complete collaboratively.
  • the distributed system 10 can endow functional components with more flexible features such as orchestration and migration, and the distributed system 10 can orchestrate appropriate functional components to make them work together to complete operations.
  • functional component is only a word used in this embodiment, the meaning of which has been recorded in this embodiment, and its name does not constitute any limitation to this embodiment.
  • functional components may also be referred to as system components, system services, business functions, meta-capabilities/atomic capabilities (Ability) and other terms. Subsequent embodiments of the present application are collectively described as "functional components”.
  • system Functional components in a system can fall into two categories:
  • Atomic ability particle ability, PA
  • PA is a functional component without UI, which can be described as atomized service or atomized functional module/unit, is a program entity that can realize a single function, and is a program fragment that can be executed independently.
  • the PA can provide support for the FA, such as providing computing power as a background service, or providing data access capabilities as a data warehouse.
  • beauty functions, positioning functions, audio and video encoding and decoding functions, etc. can be encapsulated as PA.
  • particle ability (PA) may also be referred to as atomic ability (AA).
  • PA has the characteristics of multi-terminal deployment and distributed execution. PAs only have dependencies on system services and do not have dependencies on other PAs.
  • PA can actually encapsulate remote virtualization, remote invocation, PA management, cross-platform compatibility, security, etc., and open cross-device enabling and evoking services to developers for other devices to invoke the computing capabilities of this device. And cooperate with other devices to complete computing work.
  • PA supports Service Ability, Data Ability, etc. Service Ability is used to provide the ability to run tasks in the background. Data Ability is used to provide a unified data access abstraction to the outside world.
  • the PA can be called by other APPs or FAs or PAs, and the PAs can also call other PAs or FAs or APPs to implement more and more complex functions.
  • FA is a functional component that contains one or several sets of UI, which can provide the ability to interact with the user.
  • UI graphical user interface
  • a navigation interface in a map application a video call interface in an instant messaging application, etc., can be implemented as FA.
  • the FA can be developed based on the MVVM (model-view-view-model) pattern, which separates the view UI and business logic.
  • the business logic code and the view UI code are deployed separately, and the view UI code can be integrated into other apps.
  • the view UI code can communicate with the business logic code to obtain the data required for UI display.
  • FA supports the ability of page templates, such as Empty Ability, Login Ability, Setting Ability, etc.
  • FA can use scripting language (javascript, JS) to provide declarative development mode, adopt HTML-like and cascading style sheet (CSS) declarative programming language as the development language of page layout and page style, and support ECMAScript specification.
  • JS language provides page business logic.
  • FA can have the capabilities of free installation, independent operation, cross-device UI migration, and cross-device binary migration. FA also has the characteristics of multi-terminal deployment and distributed execution.
  • the FA can be called by other APPs or FAs or PAs, and the FAs can also call other PAs or FAs or APPs to implement more and more complex functions.
  • the functional component PA/FA has the characteristics of multi-terminal deployment and distributed execution, that is, a distributed application can contain multiple PA/FA, and multiple PA/FA can be deployed in the same or different terminal devices.
  • Each terminal device in the distributed system 10 can be installed with APP/PA/FA, and the terminal devices in the distributed system 10 can synchronize the PA/FA information of other terminal devices for easy invocation.
  • a PA/FA deployed in a terminal device can be called by an application deployed in the terminal device, and can also be called by an application deployed in other terminal devices in the distributed system 10 .
  • FA and PA are only a word used in this embodiment, and in some other embodiments of this application, they may also be referred to as other nouns.
  • PA may also be referred to as other terms such as atomic capability, atomic application, meta-capability, atomized functional module/unit, etc.
  • PA may also be referred to as meta-service, atomization service, atomic service and other terms in other embodiments
  • FA may also be referred to as feature capability, meta-program, etc. in other embodiments other nouns.
  • Multiple functional components composing a distributed application may be developed or provided by the same developer, or may be developed or provided by multiple developers separately, which is not limited here. Different developers jointly develop functional components, which can improve the development efficiency of distributed applications.
  • the functional component may provide a standardized calling interface to the outside for being called by the caller.
  • the caller refers to the initiator of the call request, and the callee refers to the target object of the call request.
  • a common APP can call functional components, and the called functional components can also call other functional components again. This multi-level call can be called a chain call.
  • the party that initiates the calling function may be called the calling party or the caller, and the party that the called party invokes to provide resources may be called the called party or the callee.
  • the caller or callee can be APP, FA or PA.
  • the initial initiator of the entire call chain may be called the first caller, and the first caller may be, for example, an APP or an FA.
  • the call chain is: APP1 calls PA1, PA1 calls PA2, PA2 calls FA1, then APP1 is the first caller.
  • the call chain is: FA1 calls PA1, PA1 calls PA2, then FA1 is the first caller.
  • the caller may also be referred to as a subject application, and the callee may also be referred to as an object application.
  • each caller, and the callee can be deployed in the same electronic device or in different electronic devices.
  • the device where the caller is located may be called the subject device, and the device where the callee is located may be the object device.
  • each device After each device in the distributed system 10 establishes a communication connection, each device will synchronize the functional component information and APP information of other devices in the distributed system. Specifically, each device can synchronize the identification of the functional components and/or APP installed by itself, and its own device information (such as device identification) to the distributed system 10, which can be seen by other devices, so as to facilitate subsequent use in the distributed system 10.
  • Each device calls each other. Which callers can each functional component or APP be called, and which other functional components or APPs can be called, that is, the calling authority and/or the called authority, can be preset and recorded on each electronic device, and synchronized in the distribution in the system 10.
  • the distributed system 10 includes an electronic device A and an electronic device B, wherein the electronic device A is deployed with an application program A, a functional component A and a functional component B, and the electronic device B is deployed with an application program B and functional components C and functional component D.
  • Each electronic device in the distributed system 10 can learn and invoke functional components on other electronic devices.
  • application A can implement corresponding functions by invoking functional components A, functional components B, and functional components C on electronic device B.
  • application B can implement corresponding functions by calling functional components C, functional components D, etc.
  • functional components can also invoke each other.
  • functional component B deployed on electronic device A can also invoke functional component D deployed on electronic device B.
  • the distributed system 10 may include more or less terminal devices, and each terminal device may deploy more or less distributed applications and/or PA/FA, and each distributed application may include There are more or less PA/FA, and the calling relationship between each APP/PA/FA is also not limited.
  • the electronic device provided in this embodiment of the present application may be any electronic device described in the distributed system 10 shown in FIG. 1 , or may be the electronic device 100 or the electronic device 200 or other electronic devices in subsequent embodiments of the present application, here No restrictions.
  • the electronic device 100 is used as an example for description.
  • the electronic device 100 may include, but is not limited to, a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, as well as cellular phones, personal digital assistants (PDAs), augmented reality (AR) devices, virtual reality (VR) devices, artificial intelligence (AI) devices, wearable devices, In-vehicle equipment, smart home equipment and/or smart city equipment.
  • PDAs personal digital assistants
  • AR augmented reality
  • VR virtual reality
  • AI artificial intelligence
  • wearable devices wearable devices
  • In-vehicle equipment smart home equipment and/or smart city equipment.
  • FIG. 3 is a schematic diagram of a hardware structure of an electronic device 100 according to an embodiment of the present application.
  • the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2 , mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, sensor module 180, buttons 190, motor 191, indicator 192, camera 193, display screen 194, and Subscriber identification module (subscriber identification module, SIM) card interface 195 and so on.
  • SIM Subscriber identification module
  • 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, and ambient light. Sensor 180L, bone conduction sensor 180M, etc.
  • the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100 .
  • the electronic device 100 may include more or less components than shown, or combine some components, or separate some components, or arrange different components.
  • the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (neural-network processing unit, NPU), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • application processor application processor, AP
  • modem processor graphics processor
  • ISP image signal processor
  • controller video codec
  • digital signal processor digital signal processor
  • baseband processor baseband processor
  • neural-network processing unit neural-network processing unit
  • the controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 110 for storing instructions and data.
  • the memory in processor 110 is cache memory. This memory may hold instructions or data that have just been used or recycled by the processor 110 . If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby increasing the efficiency of the system.
  • the processor 110 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transceiver (universal asynchronous transmitter) receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and / or universal serial bus (universal serial bus, USB) interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transceiver
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB universal serial bus
  • the I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL).
  • the processor 110 may contain multiple sets of I2C buses.
  • the processor 110 can be respectively coupled to the touch sensor 180K, the charger, the flash, the camera 193 and the like through different I2C bus interfaces.
  • the processor 110 may couple the touch sensor 180K through the I2C interface, so that the processor 110 and the touch sensor 180K communicate with each other through the I2C bus interface, so as to realize the touch function of the electronic device 100 .
  • the I2S interface can be used for audio communication.
  • the processor 110 may contain multiple sets of I2S buses.
  • the processor 110 may be coupled with the audio module 170 through an I2S bus to implement communication between the processor 110 and the audio module 170 .
  • the audio module 170 can transmit audio signals to the wireless communication module 160 through the I2S interface, so as to realize the function of answering calls through a Bluetooth headset.
  • the PCM interface can also be used for audio communications, sampling, quantizing and encoding analog signals.
  • the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface.
  • the audio module 170 can also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to realize the function of answering calls through the Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
  • the UART interface is a universal serial data bus used for asynchronous communication.
  • the bus may be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication.
  • a UART interface is typically used to connect the processor 110 with the wireless communication module 160 .
  • the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function.
  • the audio module 170 can transmit audio signals to the wireless communication module 160 through the UART interface, so as to realize the function of playing music through the Bluetooth headset.
  • the MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193 .
  • MIPI interfaces include camera serial interface (CSI), display serial interface (DSI), etc.
  • the processor 110 communicates with the camera 193 through a CSI interface, so as to realize the photographing function of the electronic device 100 .
  • the processor 110 communicates with the display screen 194 through the DSI interface to implement the display function of the electronic device 100 .
  • the GPIO interface can be configured by software.
  • the GPIO interface can be configured as a control signal or as a data signal.
  • the GPIO interface may be used to connect the processor 110 with the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like.
  • the GPIO interface can also be configured as I2C interface, I2S interface, UART interface, MIPI interface, etc.
  • the USB interface 130 is an interface that conforms to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like.
  • the USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transmit data between the electronic 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 electronic devices, such as AR devices.
  • the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration, and does not constitute a structural limitation of the electronic device 100 .
  • the electronic device 100 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
  • the charging management module 140 is used to receive charging input from the charger.
  • the charger may be a wireless charger or a wired charger.
  • the charging management module 140 may receive charging input from the wired charger through the USB interface 130 .
  • the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100 . While the charging management module 140 charges the battery 142 , it can also supply power to the electronic device through the power management module 141 .
  • the power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 .
  • the power management module 141 receives the 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 battery capacity, battery cycle times, battery health status (leakage, impedance) and other parameters.
  • the power management module 141 may also be provided in the processor 110 .
  • the power management module 141 and the charging management module 140 may also be provided in the same device.
  • the wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, the baseband processor, and the like.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in electronic device 100 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • the antenna 1 can be multiplexed as a diversity antenna of the wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
  • the mobile communication module 150 may provide wireless communication solutions including 2G/3G/4G/5G etc. applied on the electronic device 100 .
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA) and the like.
  • the mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter and amplify 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 then turn it into an electromagnetic wave for radiation through the antenna 1 .
  • at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110 .
  • at least part of the functional modules of the mobile communication module 150 may be provided in the same device as at least part of the modules of the processor 110 .
  • the modem processor may include a modulator and a demodulator.
  • the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the low frequency baseband signal is processed by the baseband processor and passed to the application processor.
  • the application processor outputs sound signals through audio devices (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or videos through the display screen 194 .
  • the modem processor may be a stand-alone device.
  • the modem processor may be independent of the processor 110, and may be provided in the same device as the mobile communication module 150 or other functional modules.
  • the wireless communication module 160 can provide applications on the electronic device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellites Wireless communication solutions such as global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared technology (IR).
  • WLAN wireless local area networks
  • BT Bluetooth
  • GNSS global navigation satellite system
  • FM frequency modulation
  • NFC near field communication
  • IR infrared technology
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives the electromagnetic wave via the antenna 2, frequency modulates and filters the electromagnetic wave signal, 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 , perform frequency modulation on it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2 .
  • the antenna 1 of the electronic device 100 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the electronic 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), broadband 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, etc.
  • the GNSS may include global positioning system (global positioning system, GPS), global navigation satellite system (global navigation satellite system, GLONASS), Beidou navigation satellite system (beidou navigation satellite system, BDS), quasi-zenith satellite system (quasi -zenith satellite system, QZSS) and/or satellite based augmentation systems (SBAS).
  • global positioning system global positioning system, GPS
  • global navigation satellite system global navigation satellite system, GLONASS
  • Beidou navigation satellite system beidou navigation satellite system, BDS
  • quasi-zenith satellite system quadsi -zenith satellite system, QZSS
  • SBAS satellite based augmentation systems
  • the electronic device 100 implements a display function through a GPU, a display screen 194, an application processor, and the like.
  • the GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
  • Display screen 194 is used to display images, videos, and the like.
  • 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 (active-matrix organic light).
  • LED diode AMOLED
  • flexible light-emitting diode flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (quantum dot light emitting diodes, QLED) and so on.
  • the electronic device 100 may include one or N display screens 194 , where N is a positive integer greater than one.
  • the electronic device 100 may implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
  • the ISP is used to process the data fed back by the camera 193 .
  • the shutter is opened, 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 the ISP for processing, and converts it into an image visible to the naked eye.
  • ISP can also perform algorithm optimization on image noise, brightness, and skin tone.
  • ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be provided in the camera 193 .
  • Camera 193 is used to capture still images or video.
  • the object is projected through the lens to generate an optical image onto the photosensitive element.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal.
  • the ISP outputs the digital image signal to the DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other formats of image signals.
  • the electronic device 100 may include 1 or N cameras 193 , where N is a positive integer greater than 1.
  • a digital signal processor is used to process digital signals, in addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy and so on.
  • Video codecs are used to compress or decompress digital video.
  • the electronic device 100 may support one or more video codecs.
  • the electronic device 100 can play or record videos in various encoding formats, such as: moving picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4 and so on.
  • MPEG moving picture experts group
  • MPEG2 moving picture experts group
  • MPEG3 MPEG4
  • MPEG4 moving picture experts group
  • the NPU is a neural-network (NN) computing processor.
  • NN neural-network
  • Applications such as intelligent cognition of the electronic device 100 can be implemented through the NPU, such as image recognition, face recognition, speech recognition, text understanding, and the like.
  • the internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).
  • RAM random access memories
  • NVM non-volatile memories
  • Random access memory has fast read/write speed and is volatile. Volatile means that data stored in RAM will disappear once power is removed. Typically, random access memory has extremely low static power consumption and relatively high operating power consumption.
  • Non-volatile memory has the characteristics of non-volatile and stable data storage. Non-volatile means that the stored data will not disappear after the power is turned off, and the data can be saved for a long time when the power is turned off.
  • Random access memory can include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronization Dynamic random access memory (double data rate synchronous dynamic random access memory, DDR SDRAM, such as the fifth generation DDR SDRAM is generally called DDR5 SDRAM) and so on.
  • Non-volatile memory may include magnetic disk storage, flash memory, and the like.
  • Disk storage device is a memory with disk as storage medium, which has the characteristics of large storage capacity, high data transmission rate, and long-term storage of stored data.
  • Flash memory can be divided into NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. according to the operating principle, and can include single-level memory cell (SLC), multi-level memory cell (multi-level memory cell, SLC) according to the level of storage cell potential.
  • cell, MLC multi-level memory cell
  • TLC triple-level cell
  • QLC quad-level cell
  • UFS universal flash storage
  • eMMC embedded multimedia memory card
  • the random access memory can be directly read and written by the processor 110, and can be used to store executable programs (eg, machine instructions) of an operating system or other running programs, and can also be used to store data of users and application programs.
  • executable programs eg, machine instructions
  • the random access memory can be directly read and written by the processor 110, and can be used to store executable programs (eg, machine instructions) of an operating system or other running programs, and can also be used to store data of users and application programs.
  • the non-volatile memory can also store executable programs and store data of user and application programs, etc., and can be loaded into the random access memory in advance for the processor 110 to directly read and write.
  • the external memory interface 120 can be used to connect an external non-volatile memory, so as to expand the storage capacity of the electronic device 100 .
  • the external non-volatile memory communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, save music, video, etc. files in external non-volatile memory.
  • the electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playback, recording, etc.
  • the audio module 170 is used for converting digital audio information into analog audio signal output, and also for converting analog audio input into digital audio signal. Audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be provided in the processor 110 , or some functional modules of the audio module 170 may be provided in the processor 110 .
  • Speaker 170A also referred to as a "speaker" is used to convert audio electrical signals into sound signals.
  • the electronic device 100 can listen to music through the speaker 170A, or listen to a hands-free call.
  • the receiver 170B also referred to as "earpiece" is used to convert audio electrical signals into sound signals.
  • the voice can be answered by placing the receiver 170B close to the human ear.
  • the microphone 170C also called “microphone” or “microphone” is used to convert sound signals into electrical signals.
  • the user can make a sound by approaching the microphone 170C through a human mouth, and input the sound signal into the microphone 170C.
  • the electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C, which can implement a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may further be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and implement directional recording functions.
  • the earphone jack 170D is used to connect wired earphones.
  • the earphone interface 170D may be the USB interface 130, or may be a 3.5mm open mobile terminal platform (OMTP) standard interface, a cellular telecommunications industry association of the USA (CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA cellular telecommunications industry association of the USA
  • the pressure sensor 180A is used to sense pressure signals, and can convert the pressure signals into electrical signals.
  • the pressure sensor 180A may be provided on the display screen 194 .
  • the capacitive pressure sensor may be comprised of at least two parallel plates of conductive material.
  • the electronic device 100 determines the intensity of the pressure according to the change in capacitance.
  • a touch operation acts on the display screen 194
  • the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A.
  • the electronic device 100 may also calculate the touched position according to the detection signal of the pressure sensor 180A.
  • touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions.
  • the instruction for viewing the short message is executed.
  • the instruction to create a new short message is executed.
  • the gyro sensor 180B may be used to determine the motion attitude of the electronic device 100 .
  • the angular velocity of electronic device 100 about three axes ie, x, y, and z axes
  • the gyro sensor 180B can be used for image stabilization.
  • the gyro sensor 180B detects the shaking angle of the electronic device 100, calculates the distance that the lens module needs to compensate according to the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse motion to achieve anti-shake.
  • the gyro sensor 180B can also be used for navigation and somatosensory game scenarios.
  • the air pressure sensor 180C is used to measure air pressure.
  • the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist in positioning and navigation.
  • the magnetic sensor 180D includes a Hall sensor.
  • the electronic device 100 can detect the opening and closing of the flip holster using the magnetic sensor 180D.
  • the electronic device 100 can detect the opening and closing of the flip according to the magnetic sensor 180D. Further, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, characteristics such as automatic unlocking of the flip cover are set.
  • the acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes).
  • the magnitude and direction of gravity can be detected when the electronic device 100 is stationary. It can also be used to identify the posture of electronic devices, and can be used in applications such as horizontal and vertical screen switching, pedometers, etc.
  • the electronic device 100 can measure the distance through infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.
  • Proximity light sensor 180G may include, for example, light emitting diodes (LEDs) and light detectors, such as photodiodes.
  • the light emitting diodes may be infrared light emitting diodes.
  • the electronic device 100 emits infrared light to the outside through the light emitting diode.
  • Electronic device 100 uses photodiodes 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 electronic device 100 . When insufficient reflected light is detected, the electronic device 100 may determine that there is no object near the electronic device 100 .
  • the electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power.
  • Proximity light sensor 180G can also be used in holster mode, pocket mode automatically unlocks and locks the screen.
  • the ambient light sensor 180L is used to sense ambient light brightness.
  • the electronic 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 electronic device 100 is in a pocket, so as to prevent accidental touch.
  • the fingerprint sensor 180H is used to collect fingerprints.
  • the electronic device 100 can use the collected fingerprint characteristics to realize fingerprint unlocking, accessing application locks, taking pictures with fingerprints, answering incoming calls with fingerprints, and the like.
  • the temperature sensor 180J is used to detect the temperature.
  • the electronic 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 value, the electronic device 100 reduces the performance of the processor located near the temperature sensor 180J in order to reduce power consumption and implement thermal protection.
  • the electronic device 100 when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 caused by the low temperature.
  • the electronic device 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
  • Touch sensor 180K also called “touch device”.
  • the touch sensor 180K may be disposed on the display screen 194 , and the touch sensor 180K and the display screen 194 form a touch screen, also called a “touch screen”.
  • the touch sensor 180K is used to detect a touch operation 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 touch operations may be provided through display screen 194 .
  • the touch sensor 180K may also be disposed on the surface of the electronic device 100 , which is different from the location where the display screen 194 is located.
  • the bone conduction sensor 180M can acquire vibration signals.
  • the bone conduction sensor 180M can acquire the vibration signal of the vibrating bone mass of the human voice.
  • the bone conduction sensor 180M can also contact the pulse of the human body and receive the blood pressure beating signal.
  • the bone conduction sensor 180M can also be disposed in the earphone, combined with the bone conduction earphone.
  • the audio module 170 can analyze the voice signal based on the vibration signal of the vocal vibration bone block obtained by the bone conduction sensor 180M, so as to realize the voice function.
  • the application processor can analyze the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180M, and realize the function of heart rate detection.
  • the keys 190 include a power-on key, a volume key, and the like. Keys 190 may be mechanical keys. It can also be a touch key.
  • the electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100 .
  • Motor 191 can generate vibrating cues.
  • the motor 191 can be used for vibrating alerts for incoming calls, and can also be used for touch vibration feedback.
  • touch operations acting on different applications can correspond to different vibration feedback effects.
  • the motor 191 can also correspond to different vibration feedback effects for touch operations on different areas of the display screen 194 .
  • Different application scenarios for example: time reminder, receiving information, alarm clock, games, etc.
  • the touch vibration feedback effect can also support customization.
  • the indicator 192 can be an indicator light, which can be used to indicate the charging state, the change of the power, and can also be used to indicate a message, a missed call, a notification, and the like.
  • the SIM card interface 195 is used to connect a SIM card.
  • the SIM card can be contacted and separated from the electronic device 100 by inserting into the SIM card interface 195 or pulling out from the SIM card interface 195 .
  • the electronic device 100 may 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 and so on. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the plurality of cards may 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 is also compatible with external memory cards.
  • the electronic device 100 interacts with the network through the SIM card to implement functions such as call and data communication.
  • the electronic device 100 employs an eSIM, ie: an embedded SIM card.
  • the eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100 .
  • FIG. 4 exemplarily shows a possible distributed remote teaching business scenario.
  • the distributed system includes electronic devices such as smart phones, tablet computers, and smart screens.
  • the various devices in the distributed system are connected to each other in pairs.
  • Smartphones, tablets, and smart screens can be configured with different software operating systems (OS), for example, smart phones and tablets can be configured system, smart screen can be configured system.
  • OS software operating systems
  • the “Online classroom” app is installed on the smartphone.
  • “Online classroom” is an application program installed in an electronic device to provide teachers and students with various functions required for remote classes, and the name of the "online class” is not limited in this embodiment of the present application.
  • “Online classroom” may include the following functional components: blackboard functional components, whiteboard functional components, audio and video codec functional components, and network connection functional components.
  • the blackboard functional components and the whiteboard functional components belong to the FA
  • the audio and video codec functional components and the network connection functional components belong to the PA.
  • the blackboard function component provides the function of teaching courses remotely.
  • the Whiteboard feature component provides the ability to answer questions remotely.
  • the audio and video codec function components provide video and audio codec functions.
  • the blackboard functional component and the whiteboard functional component can also realize the video communication function by invoking the video calling functional component in the smart phone.
  • the video call functional component belongs to the PA.
  • the blackboard functional components can be migrated or switched to the smart screen, so as to explain the course on the smart screen.
  • Migrating or switching functional components from one device A to another device B can include the following two types: 1. UI migration. When the FA's view UI and business logic are separated, when device A can run business logic code, device B can be triggered to run the view UI code, and the user seems to have migrated functional components from device A to device B. 2, the overall migration. The overall migration means that after device B downloads and installs the functional component from device A or from the network, it runs the functional component and provides corresponding functions.
  • the "online classroom” is the caller, and the whiteboard functional component in the tablet computer and the blackboard functional component in the smart screen are the callee.
  • Figure 4 also shows another possible distributed video call service scenario.
  • the smartphone may also be installed with other distributed applications, such as instant messaging applications.
  • Instant messaging applications can provide video calls, voice calls, and other communication features.
  • the instant messaging application may include the following functional components: video calling functional components, audio and video codec functional components, and network connection functional components.
  • the video calling function component of the application can be migrated or switched to a smart screen or tablet, so as to use the camera and display of the smart screen or tablet to make video calls.
  • the instant messaging application is the caller
  • the video call functional component is the callee
  • the distributed system shown in FIG. 4 may include more terminal devices, more or less functional components may be deployed in each device, and each distributed application may include more or less functional components .
  • the resources shared among the devices in the distributed system may include, but are not limited to, software resources, hardware resources, peripherals or accessory resources of the devices, and the like.
  • An application or functional component, the data generated during its operation can include the following two:
  • the memory data is the data in the RAM, which can be read at any time and disappears when the power is turned off.
  • An instance is a running application or functional component.
  • an instance may refer to a process or a thread.
  • a process is an execution of an application or functional component on a computer.
  • a thread is a single sequential flow of control in the execution of an application or functional component.
  • a process can contain multiple threads.
  • Application data refers to the content written during the running of an application or functional component, such as photos or videos obtained by a photographing application, text edited by a user in a document application, and so on. Application data may also be referred to as file data.
  • the application data is the data in the NVM and can be stably stored in the NVM for a long time.
  • the APP in the electronic device applies to the user for access authorization of sensitive resources in the form of an independent subject, and directly provides various services to the user after the authorization is passed.
  • Sandbox also known as sandbox, is a virtual system program with an independent running environment, that is, the virtual system has independent RAM and NVM, allowing APP to run in it.
  • the APP in the sandbox can only access the resources in the sandbox, but cannot access other resources in the device, which ensures the security and stability of the device.
  • FIG. 5 exemplarily shows an implementation manner of providing services through a sandbox when a traditional APP is called in a stand-alone system.
  • APP1 and APP2 are callers and call the service corresponding to APP3.
  • Each APP has a corresponding instance, and each instance is naturally isolated.
  • the electronic device creates a sandbox for the called APP3, APP3 runs its instance in the RAM resource in the sandbox, provides services for APP1 and APP2, and stores the application data generated in the process of running the instance in the database of the sandbox,
  • the sandbox database is a general term for the NVM resources in the sandbox.
  • the database in the sandbox is shared, the data generated when the instance of APP3 in the sandbox provides services to APP1 and APP2 is stored in the database of the sandbox, and the data generated by APP1 and APP2 calling APP3 can only be isolated by APP3 .
  • the sandbox has loopholes or encounters malicious behavior, it will lead to data leakage of APP1 and APP2.
  • the called party APP3 cannot distinguish the identities of different caller APPs (APP1 and APP2), there are still problems such as the inability to trace the calling relationship and the difficulty in recording audit logs.
  • the authorization of permissions is only for the APP that is visible to the user, and the authorization of the functional components that the user cannot directly perceive cannot be authorized. Therefore, when the calling APP calls functional components, there are also data security risks.
  • the called functional component provides shared services for different calling APPs in the sandbox in the form of a single instance.
  • Functional components can generate application data from different devices and different callers, and may abuse or misuse the application data of each caller due to their own vulnerabilities or malicious behavior.
  • the callee functional component does not distinguish the identities of different caller APPs, there are still problems such as the inability to trace the call relationship and the difficulty of recording audit logs.
  • a sandbox is created for the video call capability unit in the smart screen, but the video call capability unit in the smart screen can simultaneously obtain the data of the "online classroom" in the smartphone , and, application data of instant messaging applications, both of which may be leaked.
  • Embodiments of the present application provide an access control method, electronic device, and system, which are used to solve the problems that the memory and application data of each caller are abused, confused, misused, or leaked during a call event.
  • the access control method can be applied in a communication system including a plurality of electronic devices.
  • the same callee can enable multiple sandboxes, and use different sandbox running instances to provide services for different callers. Due to the natural isolation between sandboxes, different sandboxes cannot access memory data and application data from each other, which can provide a system-level data security mechanism, avoid the abuse, misuse and leakage of data of each caller, and ensure that Data Security.
  • Implementing the access control method provided by this application can support the callee to run different instances in different sandboxes when providing services for different callers, and keep the memory data between different instances isolated, which more effectively reduces the The risks of the data of each caller being abused, obfuscated, misused or leaked ensure data security.
  • the following exemplarily introduces the software system architecture of the electronic device 100 provided by the embodiments of the present application.
  • FIG. 6 is a block diagram of the software architecture of the electronic device 100 provided by the embodiment of the present application.
  • the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, a cloud architecture, or the like.
  • the software system of the electronic device 100 includes but is not limited to or other operating systems.
  • the layered architecture divides the software system into several layers, and each layer has a clear role and division of labor. Layers communicate with each other through a software interface (application programming interface, API).
  • API application programming interface
  • the software architecture of the electronic device 100 may include an application layer, an internal module layer, and the like.
  • the application layer may include a series of APPs and functional components.
  • the application layer can include system applications and third-party non-system applications.
  • the application layer may include, but is not limited to, desktop, camera, gallery, call, navigation, WLAN, Bluetooth, music, multiple PAs, FAs, and the like.
  • the internal module layer can provide application programming interface and functional support for the APP and PA/FA of the application layer.
  • the internal module layer can include some predefined functions and/or functional modules/services.
  • the modules in the internal module layer can cooperate to manage the discovery, registration, query, migration of applications or functional components, and the creation and invocation of instances of applications or functional components. These modules can cooperate with other modules in the electronic device to achieve this.
  • the internal module layer may include, but is not limited to, an application information management module, an application startup management module, an instance management module, an application scheduling module, an authority management module, a call relationship management module, a call relationship library, and an application file management module.
  • the application information management module is used to manage the information of each APP or functional component installed in the electronic device 100, so as to facilitate the discovery, registration, installation, and uninstallation of each APP/PA/FA. For example, assign UIDs to each APP or functional component, assign PIDs to instances of each running state, and so on. Another example is to manage the registration information of each APP or PA/FA, such as obtaining, recording, and managing the identity of each APP/PA/FA, as well as the identity of the electronic device that deploys the APP/PA/FA, etc., to facilitate the query of registration information, etc. Function.
  • the application startup management module is used to manage the startup work of each application program or functional component. For example, when the electronic device 100 receives a request from another device to invoke a certain application, the application startup management module can start the application.
  • the instance management module is responsible for dynamically starting or creating an instance based on the caller's information. Specifically, when different devices and/or different callers request to invoke an application or functional component in the electronic device 100, the instance management module will respectively enable an instance of the application or functional component for different devices and/or different callers, Each serves different devices and/or different callers.
  • the instance management module is also used to manage the lifecycle of individual instances enabled, such as starting, stopping, destroying, restarting instances, and so on.
  • the application scheduling module can be responsible for managing calls between APP/PA/FA, for example, it can be used to initiate a call request from the caller to the callee. For example, an APP sends a call request for a PA to the application scheduling module under the trigger of a user operation, and then the application scheduling module can parse and process the call request to obtain the identity of the APP, the identity of the called PA, and the corresponding request parameters.
  • the permission management module can be used to manage the permission information of each APP/PA/FA, and is responsible for controlling the permission of the caller to call the called party and the access permission of each APP/PA/FA to system resources, etc.
  • the rights management module may also be used for synchronizing the rights information and/or authorization information of the APP/PA/FA respectively deployed in multiple terminal devices in the same distributed system.
  • the permission management module can also be used to generate and provide permission-related prompt information to the user.
  • the permission management module can ask the user whether to grant permission to an instance when it obtains an APP that does not have permission to call an instance and initiates a call request for the instance. Permissions, change permissions, or delete malicious apps, etc.
  • the calling relationship management module is responsible for maintaining the calling relationship composed of instances of multiple groups of callers and callees, and storing them in the calling relationship library.
  • the call relationship library can be used to store call relationships composed of multiple groups of callers and callees.
  • Each set of invocation relationships may include invocation relationship identification (identification, ID), caller information, callee information, and the like.
  • the caller information may include the name of the caller, the device ID, the user identification (UID), the developer signature, etc.
  • the callee information may include the name of the callee, the device ID, the UID of the instance, the Process identification (process identification, PID) and other information.
  • the two groups of calling relationships are that APP1 on the electronic device 100 and APP2 on the electronic device 200 respectively call the functional component 3 in the electronic device 300, and the electronic device 300 will enable the two functional components 3 , which are used to serve APP1 and APP2, respectively.
  • the calling relationship shown in Table 1 may be stored not only in the electronic device where the callee is located, but also in the electronic device where the calling party is located, which is not limited here.
  • the sandbox management module is responsible for managing the instances in the sandbox and the application data generated by the instances, and storing the application data generated by the instances in the sandbox in the form of directories.
  • different instances can run in the same sandbox, or different instances in the same sandbox can provide services for multiple callers.
  • the present invention isolates instances of different services in the same sandbox in the form of directories generated application data. Different directories have different identifiers.
  • the identifier of a specific directory can be the name of the caller, the ID of the device where it is located, the user identification (UID), the developer signature, the name of the called party, the ID of the device where it is located, the UID of the instance, the instance of the instance
  • the identity of the directory can be a collection of the above-mentioned multiple identities, such as the set of the developer's signature and the identity of the callee.
  • the sandbox management module stores different data in different directories according to different identifiers, which is easy to find and maintain.
  • the software architecture of the electronic device 100 is only an example, and it can be understood that the software architecture illustrated in the embodiments of the present invention does not constitute a specific limitation to the present application. In other embodiments of the present application, the software architecture of the electronic device 100 may include more or less modules than shown, or some modules may be combined, or some modules may be split, or different architectural arrangements.
  • the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
  • the distributed system may be installed with: a caller APP1 , a caller APP2 , and a callee functional component 3 .
  • APP1, APP2, and functional component 3 may be installed in the same device or in different devices in the distributed system, which is not limited in this embodiment.
  • APPs and/or functional components in the same distributed system can call each other.
  • the called party functional component 3 may be FA or PA.
  • This embodiment does not limit the types of the caller and the callee.
  • the caller is not limited to being an APP, but may also be implemented as other functional components, and the called party may not be limited to being a functional component, but may also be implemented as an APP.
  • APP can call functional components
  • functional components can call other functional components
  • APP can also call other APPs
  • functional components can also call APP.
  • the electronic device creates different sandboxes for different instances of the callee, and different sandboxes have independent operating environments, that is, the virtual system has independent RAM and NVM resources, allowing the instances to run in them, and the sandbox can run on the electronic device. It is created after the received invocation request, or can be created after the invocation relationship of the electronic device is established, which is not limited here. Since the sandbox has an independent running environment, the memory data and application data between different sandboxes are isolated, which ensures the high security and data traceability of the instance running.
  • APP1 and APP2 respectively call functional component 3, and at the same time, functional component 3 itself is also running.
  • the electronic device where functional component 3 is located can create three instances of functional component 3 and three corresponding sandboxes, namely functional component 3 instance 1, functional component 3 instance 2, functional component 3 instance 3, sandbox 1, sandbox 2.
  • the instance 1 of the functional component 3 can provide services for the instance of the caller APP1, the instance 2 of the functional component 3 can provide services for the instance of the caller APP2, and the instance 3 of the functional component 3 can provide services for the functional component 3 itself.
  • Functional component 3 instance 1 runs in sandbox 1
  • functional component 3 instance 2 runs in sandbox 2
  • functional component 3 instance 3 runs in sandbox 3.
  • the instance 1 that provides services for the caller APP1 the instance 2 that provides services for the caller APP2, and the memory data and application data of the functional component 3 can be isolated, effectively reducing the Risks of misuse, confusion and leakage of data of each functional component.
  • each electronic device can record the call event of the caller's call instance and the sandbox in which the instance runs this time into the audit log, and synchronize it to the distributed system to facilitate subsequent traceback calls.
  • Events such as to facilitate finding the cause after an attack is detected, or to find the cause of a possible data security incident or security breach.
  • the invocation event may include information such as the occurrence time of the invocation event, the invocation relationship ID, and the like.
  • FIG. 7 has two calling relationships: APP1 calls functional component 3 , and APP2 calls functional component 3 .
  • the devices where APP1, APP2, and functional component 3 are located can record and maintain the calling relationship respectively, and synchronize them to the distributed system, so that the cause can be easily traced and security risks can be reduced in the event of subsequent problems.
  • This embodiment is described by taking as an example that both the caller and the callee are deployed on the same electronic device 100 .
  • the electronic device 100 may be an independent electronic device (stand-alone), or may be an electronic device in a distributed system.
  • the electronic device 100 may also be referred to as a first device.
  • APPs and functional components may be installed in the electronic device 100 .
  • the examples provided in this embodiment do not constitute any limitation to other embodiments of the present application.
  • FIG. 8 is a flowchart of a method for access control provided by an embodiment of the present application, which specifically includes the following steps:
  • the electronic device 100 initiates a first call request, where the first call request is used by the first caller to request the callee to provide the first service.
  • the first call request may include indication information of the first caller, the callee, and the first service.
  • the first caller may request to access the first resource in the electronic device 100 through the callee.
  • the first resource may include software resources of the electronic device 100 (such as beauty algorithms, positioning functions, and audio and video codec functions), and may also include hardware resources (such as cameras, audio devices, display screens, and other hardware).
  • the type of caller may include but not limited to APP, PA, FA, and the type of callee may include but not limited to APP, PA, FA.
  • the APP can call the functional component PA/FA
  • the functional component PA/FA can also call other functional components PA/FA
  • the APP can also call other APPs
  • the functional component PA/FA can also call the APP.
  • the caller can be a chat APP
  • the called party can be a positioning PA that provides positioning functions.
  • the chat APP needs to obtain location information
  • the positioning PA needs to provide positioning function services.
  • the chat APP can send the positioning PA to the positioning function. Initiate a call request.
  • the electronic device 100 may initiate the first invocation request in response to the received user operation, or may initiate the first invocation request autonomously, which is not limited here.
  • the electronic device 100 can display the user interface of the caller, and the user's touch operation input by the user in the user interface can be detected through an input device such as a touch sensor, and then the electronic device 100 can initiate a user's touch operation in response to the user's touch operation.
  • the callee may be installed in the electronic device 100 in advance. In other embodiments, after the electronic device 100 obtains the first call request, if it is detected that the callee does not exist, the electronic device 100 may download and install the callee from the network, or if the electronic device 100 is in a distributed system If so, the callee may also be acquired, downloaded, and installed from other electronic devices in the distributed system, which is not limited in this embodiment of the present application.
  • the electronic device 100 before the electronic device 100 initiates the first call request, the electronic device 100 needs to confirm that the first caller has the right to access the callee, and that the first caller has the right to access the first service.
  • step S102 the electronic device 100 detects whether there is a first sandbox that can provide services for the first caller, and if it does not exist, executes step S103 , and if so, executes step S104 .
  • the callee may provide different sandboxes for different callers. Therefore, after acquiring the first call request, the electronic device 100 may first detect whether there is a first sandbox that provides services for the first caller.
  • the callers can be clustered through the sandbox. Specifically, the clustering can be performed according to the caller information, and the service instances of the caller with the same caller information run in the same sandbox.
  • the caller information may be included in the first call request in step S101.
  • the caller information may include one or more of the following: the caller's application ID (APP ID), the caller's user ID (user ID, UID), the caller's developer signature, and the account ID of the object device where the caller is located ( account ID), the device ID of the object device (device ID), the ID of the distributed system where it is located (system ID), and so on. in:
  • APP ID which can be used to identify an APP or functional component.
  • the developer signature can be used to identify the developer of the APP or functional component.
  • UID which can be used to identify the user to which the APP or functional component or instance belongs.
  • the electronic device assigns different UIDs to different installed APPs or functional components or instances to distinguish them.
  • the electronic device may assign UIDs to each APP in one data interval (eg, 10000-40000), and assign UIDs to instances of various functional components in another data interval (eg, 40001-50000).
  • the electronic device may assign the same UID to each APP or functional component developed by the same developer. In other embodiments, the electronic device may also assign different UIDs to each APP or functional component developed by the same developer. In one example, when the first APP is installed, the electronic device assigns the UID of the first APP as the third UID, the second APP has the same developer signature as the first APP, and when the second APP is installed, the second APP indicates Using the same UID as the first APP, the electronic device can also assign a third UID to the second APP. The same APP or functional component may have different UIDs in different electronic devices. The embodiments of the present application do not impose any limitations on the manner or rule for assigning UIDs to different APPs or functional components or instances by the electronic device.
  • account ID which can be used to identify the user currently logged in to the electronic device, such as a Huawei account.
  • the device ID which can be used to identify the device.
  • the device ID may be, for example, the name of the device, a serial number, a media access control (media access control, MAC) address, and the like.
  • the system ID can be used to identify the distributed system in which the current electronic device is located.
  • instances can be process isolated based on UID. That is, instances are distinguished by UID, and different instances are assigned different UIDs. Instances of different UIDs serve different callers.
  • the electronic device determines to use the same sandbox according to the developer's signature in the two apps “Huawei Mall” and “Huawei Music”. Provide services for these two apps.
  • the electronic device 100 creates a first sandbox.
  • the sandbox creation module of the electronic device 100 may create a first sandbox dedicated to providing services for the first caller. After the sandbox is created, the electronic device 100 can bind the sandbox with the caller information.
  • the first sandbox is a new independent operating environment. After the electronic device 100 creates the first sandbox, it needs to run the first instance in the first sandbox, and provide the caller with the first instance in the first sandbox. service, see step S104 for the specific instance running process.
  • the sandbox can be executed by existing sandbox software, such as Sandboxie, Oracle VM VirtualBox, VMware, etc., or can be created by the controller of the electronic device by self-isolating RAM and NVM resources, which is not limited herein.
  • existing sandbox software such as Sandboxie, Oracle VM VirtualBox, VMware, etc.
  • the electronic device 100 runs the first instance in the first sandbox.
  • the first instance of the callee is run in the environment of the first sandbox, and the application data generated by the first instance of the callee is saved in the NVM of the first sandbox.
  • the electronic device 100 can create different instances or share the same instance for different callers in the first sandbox through its instance management module, Refer to step S1041-step S1042 for details; at the same time, for the application data generated by the instance running in the sandbox, the electronic device 100, through its sandbox management module, assigns different directory identifiers to callers with the same caller information, through The form of directory identification differentiates the management of application data for different callers.
  • the caller information is used as the directory identifier.
  • the directory identifier of "Huawei Mall” is “Huawei Mall” and the directory identifier of "Huawei Music” is “Huawei Music” .
  • the method further includes:
  • the electronic device 100 detects whether there is a first instance of the callee that can provide services for the first caller, and if it does not exist, executes step S1042 , and if so, executes step S104 .
  • the callee may provide different instances for different callers. Therefore, after acquiring the first call request, the electronic device 100 may first detect whether there is a first instance of the callee that provides services for the first caller.
  • the electronic device 100 may store multiple sets of invocation relationships, and the multiple sets of invocation relationships record invocation events of multiple sets of caller-enabled instances, that is, situations where different instances provide services to different callers. These invocation relationships may be stored in the invocation relationship library in the electronic device 100, so that the electronic device 100 can subsequently query whether there is an instance that provides services for the caller.
  • Each set of invocation relationships may include: caller information, instance information of the callee, invocation relationship identification (identification, ID), and the like.
  • the call relationship may indicate call rights. That is, a set of calling relationships, which can indicate that the caller has permission to call the instance of the callee.
  • the invocation relationship ID may be used to identify different invocation relationships, which is convenient for the electronic device 100 to identify.
  • the call relationship ID of APP1 to call functional component 3 is 1, and the call relationship ID of APP2 to call functional component 3 is 2.
  • each other set of call relationships will be assigned A unique call relationship ID is easy to distinguish and query, and can be shared with other electronic devices or synchronized to a distributed system.
  • the electronic device where the callee is located may record the calling relationship, or when the calling party sends a calling request, the electronic device where the calling party is located may also record the calling relationship.
  • the device where the caller is located and the device where the callee is located may share the same call relationship ID.
  • the calling relationship ID can be allocated by the subject device or by the object device, and shared with the counterpart device.
  • the calling relationship can be synchronized to the distributed system, and other devices in the distributed system can obtain the calling relationship.
  • the caller information may include: the caller's application identification (APP ID).
  • the caller information may also include one or more of the following: the caller's user ID (user ID, UID), the caller's developer signature, the account ID (account ID) of the main device where the caller is located, and the device ID of the main device (device ID), the identifier of the distributed system (system ID), etc.
  • the instance information of the callee may include: the process ID (process ID, PID) of the instance, and the UID of the instance.
  • the PID is the identity identifier of the instance.
  • a unique PID is assigned to the instance, and different instances in the electronic device correspond to different PIDs.
  • the electronic device also assigns a UID to each instance when it is created.
  • the UIDs of different instances of the same callee may be different or the same, which is specifically determined according to the allocation situation of the electronic device.
  • the electronic device 100 may assign the first PID and the first UID to the first instance, and assign the second PID and the second UID to the second instance.
  • the second call request indicates the second UID of the second instance and the first UID of the first instance. If the UIDs are the same, the second UID assigned by the electronic device to the second instance may be the same as the first UID of the first instance.
  • the instance information of the callee may also include one or more of the following: the callee's application ID (APP ID), the callee's user ID (user ID, UID), the callee's developer signature, the callee's The account ID of the object device where the party is located (account ID), the device ID of the object device (device ID), the identification of the distributed system (system ID), etc. in:
  • instances can be process isolated based on PIDs. That is, instances are distinguished by PID, and different instances are assigned different PIDs. Instances of different PIDs serve different callers. For example, in some examples, the first instance and the second instance are different instances of the callee, the first instance and the second instance are assigned the same UID, but the first instance and the second instance are assigned different PIDs, and the first instance and the second instance are assigned different PIDs. The second instance provides services for different callers respectively. Process isolation based on PID can ensure stricter and safer data and/or process isolation than the process isolation solution based on UID.
  • different callers can be distinguished based on one or more of the above-mentioned caller information. That is, different callers are distinguished according to one or more of the following: the caller's application ID (APP ID), the caller's UID, the caller's developer signature, the account ID of the main device where the caller is located (account ID), The device ID of the main device, the identification of the distributed system (system ID), etc. When one or more of the above are not the same, they can be distinguished as different callers.
  • APP ID caller's application ID
  • UID the caller's UID
  • the caller's developer signature the account ID of the main device where the caller is located
  • system ID the identification of the distributed system
  • different callers with the same developer signature may indicate to the callee that they share the same instance. In this way, under the condition of ensuring isolation of data/process, data interaction between applications or functional components of the same developer can also be facilitated, and memory occupation, CPU consumption, etc. can be saved.
  • callers can also share and use the same instance according to other instructions, such as the caller's APP ID, account ID, device ID, system ID, etc., which are not listed here.
  • the caller information and callee information of the call relationship may include multiple items.
  • the first caller and the callee are in a distributed system.
  • the APP ID, and the UID and/or PID of the first instance of the callee can also record information such as the ID of the main device where the first caller is located, and the ID of the object device where the instance of the callee is located, so as to avoid other electronic devices in the distributed system.
  • Applications or functional components on the device that may have the same APP ID incorrectly call or maliciously call the first instance, thereby implementing stricter access control.
  • the first call request of S101 may carry the first caller information, so that the electronic device 100 searches and determines whether there is a first instance of the callee corresponding to the first caller in the call relation library.
  • step S1042 the electronic device 100 creates a first instance, and then executes step S104.
  • the instance creation module of the electronic device 100 can create a first instance dedicated to providing services for the first caller, and perform permission binding.
  • the first instance may be created in the first sandbox, or may be created in the operating system of the electronic device, and then moved to the sandbox to run.
  • the first instance is a specific instance of the callee, and the first instance provides the same functions, services, and data as other instances of the callee, but has different permissions for invocation. For example, if the first instance only grants the first instance Once the caller invokes the permission, other applications or functional components have no permission to invoke the first instance.
  • the electronic device 100 When the electronic device 100 creates the first instance, it can record and save the calling relationship and the calling authority of the first caller calling the first instance. For a specific description, refer to the relevant description in S1041.
  • the electronic device 100 needs to be authenticated for authorization.
  • the electronic device 100 can query the permission information of the first caller and the callee to determine whether the first caller has the permission to call the first instance of the callee, and whether the first caller has the permission to access the first service, It can also be confirmed whether the first instance is the instance that the first caller needs to call, and so on. If it is confirmed that the first caller has the right to call the first instance and/or access the first service, the first instance is run, and if not, the result of no calling right is returned to the first caller.
  • the calling relationship may indicate whether the first caller has permission to call the first instance.
  • the authentication step of confirming whether the first caller has permission to call the first instance and/or access the first service may be performed before running the first instance, or before creating the first instance, or may also be performed during Before initiating the first call request, this embodiment of the present application does not impose any restrictions on the time conditions for the authentication to occur.
  • the authentication step may occur at any point in time before the first instance is run, and even when the first instance is running, you can also query at any time. permissions.
  • the electronic device 100 returns the result of no calling right to the first caller, ends the calling event, and does not continue the subsequent steps.
  • the sandbox can be created first, and the instance can be created in the sandbox; or the instance can be created in the electronic device first, then the sandbox can be created, and then the sandbox can be created in the sandbox. Run the instance.
  • the confirmation of the permission in this step is to prevent an application or functional component that does not have the permission to call the first instance from maliciously calling or erroneously calling the first instance and accessing its resources, thereby reducing security risks.
  • the electronic device 100 responds to the first call request received in S101, and provides the first service for the first caller through the first instance in the first sandbox.
  • the electronic device 100 can run the first instance in the first sandbox , in response to the first call request, allowing the first caller to access the first resource in the first sandbox correspondingly provided by the first instance, and returning the access result to the first caller.
  • the first resources provided by the electronic device 100 may include software resources, hardware resources, etc. allocated to the first sandbox.
  • the electronic device 100 can record the call event of the first caller calling the first instance this time into the audit log, so as to facilitate the subsequent tracing of the call event, for example, to facilitate the attack during the attack. Find reasons after detection, or for possible data security incidents or security breaches.
  • the invocation event may include information such as the occurrence time of the invocation event, the invocation relationship ID, and the like.
  • the electronic device 100 may release the service process of the first instance in the first sandbox, end the first service provided by the first instance to the first caller, and improve the first instance.
  • the resource utilization of a sandbox may be released.
  • the electronic device 100 can recycle the resources of the first sandbox to improve the resource utilization of the electronic device 100.
  • the electronic device 100 initiates a second call request, where the second call request is used by the second caller to request the callee to provide the second service. If the electronic device 100 detects a second sandbox of the callee that can provide services to the second caller, the electronic device 100 runs the second instance in the second sandbox to provide the second service for the second caller while the electronic device 100 runs the second instance in the second sandbox. The device 100 records the calling event of the second caller calling the second instance this time. For the specific process, reference may be made to the description of the first instance invoked by the first caller in the first sandbox in steps S101-S105, which will not be repeated here.
  • the callee can run different corresponding instances in different sandboxes according to different callers, and provide different services.
  • the callee can run the first instance in the first sandbox and run the first instance in the second sandbox. Run the second instance in the sandbox, the first instance in the first sandbox provides the first service for the first caller, and the second instance in the second sandbox provides the second service for the second caller.
  • the box mechanism keeps permissions and data isolated between different instances, and data security is further improved.
  • the electronic device 100 initiates a third calling request, where the third calling request is used by the first calling party to request the called party to provide the third service. If the electronic device 100 detects the first sandbox of the callee that can provide services to the first caller in the first sandbox, the electronic device 100 runs the first instance in the first sandbox, in the first sandbox The third service is provided for the first caller, and at the same time, the electronic device 100 records the calling event of the first caller calling the first instance this time. For the specific process, reference may be made to the description of the first caller calling the first instance in steps S101-S105, which will not be repeated here.
  • two first instances can be run in the first sandbox, and according to different services
  • the application data generated for the two first instances are isolated by directory identifiers.
  • the call request from the second caller is the same as that in step S106, and details are not repeated here.
  • the electronic device 100 may query the permission information to determine whether the first caller has the right to call the callee, if so, execute the above steps, and if not, return no call to the first caller result of permissions.
  • querying the authority information may be performed before any one of steps S101-S107.
  • the electronic device 100 may query the permission information of the first caller and the callee to confirm whether the calling relationship or the calling permission indicates that the first caller has the permission to access the callee, And, the first caller has the right to access the first service, and also confirms whether the first instance is the instance that the first caller needs to call.
  • the electronic device 100 may return a result that the first caller does not have the right to call, and the call fails.
  • the confirmation of the permission in this step is to prevent an application or functional component that does not have the permission to call the first instance from maliciously calling or erroneously calling the first instance and accessing its resources, thereby reducing security risks.
  • the callee when the callee provides services for different callers, it runs different instances in different sandboxes, which can ensure permission isolation between different instances, and is located between instances in different sandboxes.
  • the inability to access data from each other can avoid the problem of the callee's abuse or misuse of the caller's data, and ensure data security.
  • the electronic device 100 may run the same instance in the same sandbox to provide the service.
  • the first caller requests the callee to provide the third service, which is different from the first caller requesting the callee to provide the first service in step S101, but for the same first caller, the callee can The same first instance runs in the first sandbox, and the first instance can provide the first service or the third service for the first caller in response to the first call request or the third call request.
  • the electronic device uses the sandbox management module to differentiate and store the data in the form of a directory.
  • the electronic device 100 When the electronic device 100 runs an instance in the same sandbox, it will generate the memory data corresponding to the instance.
  • the electronic device 100 runs multiple instances in the same sandbox, they correspond to multiple copies of memory data respectively, and between multiple copies of memory data They are isolated from each other and cannot access each other, that is, the instances inside the sandbox are isolated from each other.
  • different devices may be distinguished through sandboxes, that is, different callers on the same device may share the same sandbox.
  • the electronic device 100 initiates a fourth call request, and the fourth call request may carry: the third caller, the callee, and the indication information of the fourth service, wherein the third caller is installed in the electronic device 100, The third caller is the application APP or functional component.
  • the electronic device 100 runs the first instance in the first sandbox, where the first instance is further configured to provide the fourth service for the third caller.
  • both the third caller and the first caller can call the first instance in the first sandbox.
  • the access control method provided in this application can also be implemented between multiple electronic devices in a distributed system, and the caller and the callee who initiate the call request can be deployed on different electronic devices.
  • each device After each device in the distributed system establishes a communication connection, each device will synchronize the functional component information and APP information of other devices in the distributed system. Specifically, each device can synchronize the identification of the functional components and/or APP installed by itself, and its own device information (such as device identification) to the distributed system, which can be seen by other devices, so as to facilitate the subsequent use of various devices in the distributed system. call each other. Which callers can each functional component or APP be called, and which other functional components or APPs can be called, that is, the calling authority and/or the called authority, can be preset and recorded on each electronic device, and synchronized in the distribution in the system.
  • This embodiment is described by taking as an example that the caller and the callee are deployed on different electronic devices in the same distributed system.
  • the caller that initiates the call request is deployed on the electronic device 100
  • the called party is deployed on the electronic device 200
  • the electronic device 100 and the electronic device 200 are in the same distributed system.
  • the type of caller may include but not limited to APP, PA, FA, and the type of callee may include but not limited to APP, PA, FA.
  • the APP can call the functional component PA/FA
  • the functional component PA/FA can also call other functional components PA/FA
  • the APP can also call other APPs
  • the functional component PA/FA can also call the APP.
  • Multiple terminal devices in the same distributed system can synchronize the registration information and permission information of their deployed APPs, PAs, and FAs, as well as information such as the calling relationship between APPs, PAs, and FAs. in,
  • Registration information can be used to identify an application or functional component, and may include the identification (APP ID) of the application or functional component, the identification (device ID) of the electronic device where the application or functional component is located, and the account of the electronic device where the application or functional component is located. Identification (account ID) and other information.
  • the permission information may include information such as the calling/access permission and the calling/accessing permission of the application or functional component.
  • FIG. 9 is a flowchart of a method for access control provided by an embodiment of the present application, which specifically includes the following steps:
  • the electronic device 100 sends a first access request to the electronic device 200, where the first access request is used by the electronic device 100 to request the electronic device 200 for the callee to provide the first service to the first caller.
  • the first caller is deployed on the electronic device 100
  • the callee is deployed on the electronic device 200 .
  • the electronic device 100 may generate a first call request, where the first caller notifies the electronic device 100 that it needs the callee to provide the first service.
  • the first caller of the electronic device 100 requests the callee of the electronic device 200 to provide the first resource.
  • the first resource may include software resources of the electronic device 200 (eg, beauty algorithm, positioning function, audio and video codec function), and may also include hardware resources (eg, camera, audio device, display screen, etc. hardware).
  • the electronic device 100 may acquire the identifier of the electronic device 200 where the callee is located according to the first call request.
  • the first invocation request may include the identification of the electronic device 100, the identification of the first caller, the identification of the electronic device 200, the identification of the called party, and the like.
  • the electronic device 100 may obtain the identifier of the electronic device 200 where the callee to be invoked is located according to the first invocation request.
  • the first call request does not include the identifier of the electronic device 200 where the callee is located, then the electronic device 100 can query the distributed system according to the callee's identifier after acquiring the callee's identifier.
  • the registration information of the callee synchronized in the synchronous system, thereby obtaining the identity of the electronic device 200 .
  • This embodiment does not limit the manner in which the electronic device 100 acquires the identifier of the electronic device 200 .
  • the electronic device 100 may initiate a first access request to the electronic device 200, and the first access request may carry the ID of the electronic device 100, the ID of the electronic device 200, the first call The party ID, the called party ID, the instruction to request the first service, etc.
  • the electronic device 100 may initiate the first access request to the electronic device 200 in response to the received user operation, or may initiate the first access request to the electronic device 200 autonomously, which is not limited here.
  • the electronic device 100 can display the user interface of the first caller, and the user operation input by the user in the user interface can be detected through an input device such as a touch sensor, and then the electronic device 100 can initiate the operation in response to the user's touch operation.
  • a first access request to the electronic device 200 .
  • the callee may be installed in the electronic device 200 in advance.
  • the electronic device 200 may download and install the callee from the network after receiving the first access request sent by the electronic device 100, or may also download and install the callee from the electronic device 100 or other electronic devices in the distributed system obtain, download, and install the callee from anywhere, which is not limited in this embodiment of the present application.
  • the electronic device 100 before the electronic device 100 sends the first access request to the electronic device 200, the electronic device 100 needs to confirm that the first caller has permission to access the callee, and that the first caller has access to the first service permissions.
  • step S202 after acquiring the first access request sent by the electronic device 100, the electronic device 200 detects whether there is a first sandbox of the callee that can provide services for the first caller, and if not, executes step S203, if there is , then step S204 is executed.
  • the callee may provide different instances in different sandboxes for different callers. Therefore, after the electronic device 200 obtains the first access request, it may first detect whether the first sandbox of the callee that provides services for the first caller of the electronic device 100 already exists.
  • the electronic device 200 may determine whether there is a first sandbox according to the caller information in the first access request, and cluster callers with the same caller information.
  • the specific steps are the same as those of step S102, and are not repeated here.
  • the electronic device 200 creates a first sandbox.
  • the instance creation module of the electronic device 200 may create a first sandbox dedicated to providing services to the first caller of the electronic device 100, and communicate with the first sandbox of the electronic device 100.
  • the first caller information is bound.
  • step S103 For the specific sandbox creation process, refer to step S103, which is not repeated here.
  • the electronic device 200 runs the first instance in the first sandbox.
  • the first instance of the callee is run in the environment of the first sandbox, and the application data generated by the first instance of the callee is saved in the NVM of the first sandbox.
  • the electronic device 100 can create different instances or share the same instance for different callers in the first sandbox through its instance management module, Refer to step S1041-step S1043 for details; at the same time, for the application data generated by the instance running in the sandbox, the electronic device 100 assigns different directory identifiers to callers with the same caller information through its sandbox management module.
  • the form of directory identification differentiates the management of application data for different callers.
  • step S204 further includes a process of creating a first instance by the electronic device 200.
  • steps S1041-S1042 For the specific process of creating an instance, refer to steps S1041-S1042, which will not be repeated here.
  • the electronic device 200 responds to the first access request and provides the first service for the first caller in the electronic device 100.
  • step S105 For the specific process of responding to the access request and reclaiming resources after step S205, refer to step S105, which will not be repeated here.
  • the electronic device 300 initiates a second access request to the electronic device 200, where the second access request is used by the electronic device 300 to request the electronic device 200 for the callee to provide the second service to the second caller.
  • the second caller is deployed on the electronic device 300
  • the called party is deployed on the electronic device 200 .
  • the electronic device 200 detects a second sandbox of the callee that can provide services to the second caller, the electronic device 200 runs the second instance in the second sandbox to provide the second caller of the electronic device 300 with the second sandbox. service, and at the same time record the calling event of the second caller of the electronic device 300 calling the second instance of the electronic device 200 this time.
  • the second caller may also be deployed on the electronic device 100 or on the electronic device 200 .
  • the callee can run different corresponding instances in different sandboxes according to different callers, and provide different services.
  • the callee can create a first instance and a second instance, and the first instance is The first caller provides the first service, and the second instance provides the second service for the second caller.
  • the electronic device 100 initiates a third access request to the electronic device 200, where the third access request is used by the electronic device 100 to request the electronic device 200 for the called party to provide the third service to the first caller. If the electronic device 200 detects the first sandbox of the callee that can provide services to the first caller, the electronic device 200 runs the first instance in the first sandbox to provide the first caller of the electronic device 100 with a third service, and at the same time record the invocation event that the first caller of the electronic device 100 invokes the first instance of the electronic device 200 this time. For the specific process, reference may be made to the description of the first caller of the electronic device 100 calling the first sandbox of the electronic device 200 in steps S201-S204, which will not be repeated here.
  • the electronic device 200 runs the same sandbox in the same sandbox. Instances provide services. For example, in step S206, the first caller of the electronic device 100 requests the callee of the electronic device 200 to provide the third service, which is different from the first caller of the electronic device 100 requesting the callee of the electronic device 200 to provide the first service in step S201. service, but the callee will run the same first instance for the same first caller, and the first instance can provide the first service or third call to the first caller in response to the first call request or the third call request Serve.
  • steps S201-S205, S206 and S207 are initiated in no order, and can be initiated in any order or simultaneously.
  • the callees deployed on different electronic devices provide services for different callers, they run different instances in different sandboxes respectively, which can ensure permission isolation between different instances, and the sandbox
  • the inability to mutually access memory data and application data can avoid the problem of being abused or misused by the caller's application data in the unified sandbox, ensuring data security.
  • the electronic device 200 may create multiple first instances for different services in the first sandbox, and isolate the application data generated by the two first instances through directory identifiers according to different services.
  • the electronic device 100 may also be referred to as the first device
  • the electronic device 200 may be referred to as the second device
  • the electronic device 300 may be referred to as the third device
  • the first access request may be referred to as the first request
  • the second access request may be referred to as the second device. It can be referred to as the second request
  • the third access request can also be referred to as the third request.
  • different callers on the same device may share the same sandbox.
  • the first device sends a fourth request to the second device, and the fourth request may carry: a third caller, a callee, and indication information of the fourth service, where the third caller is installed on the first device , the third-party caller is an application APP or a functional component.
  • the second device runs the first instance in the first sandbox, and the first instance is also used to provide the fourth service for the third caller.
  • both the third caller on the first device and the first caller can call the first instance in the first sandbox.
  • the same caller on different devices may share the same instance in the same sandbox.
  • the fourth device initiates a fifth request to the second device, and the fifth request carries: the first caller, the callee, and the indication information of the fifth service, wherein the fourth device is installed with the first caller .
  • the second device runs the first instance in the first sandbox, and the first instance is further configured to provide the fifth service to the first caller of the fourth device.
  • both the first caller on the first device, and the first caller on the fourth device can call the first instance.
  • the same caller on different devices may call different instances in the same sandbox.
  • the first caller and the second caller are the same caller.
  • the first caller of the first device can call the first instance in the first sandbox
  • the first caller of the second device can call the second instance in the first sandbox, the first instance and the The second instance is different.
  • the first sandbox distinguishes the application data of the first instance and the second instance through the directory identifier.
  • different callers on the same device may call different instances in the same sandbox.
  • the first device and the third device are the same device.
  • the first caller of the first device can call the first instance in the first sandbox
  • the second caller of the first device can call the second instance in the first sandbox, the first instance and the The second instance is different.
  • the first sandbox distinguishes the application data of the first instance and the second instance through the directory identifier.
  • the electronic device runs different instances through different sandboxes to provide services for different callers.
  • the data between different sandboxes is isolated, and the data includes memory data and application data, which ensures data security, especially the security of application data.
  • the sandbox mechanism is applied to the isolation of application data in the third embodiment, and a schematic diagram of a specific system structure is shown in FIG. 10 .
  • FIG. 10(A) different instances of the functional component 3 are run in the electronic device, different instances are used to provide services for different callers, and application data generated by different instances is stored and managed through the sandbox. Since the memory data is naturally isolated when the instance is running, the application data is stored in the sandbox, and different directory identifiers are set for different application data through the sandbox management module to manage the application data corresponding to different instances.
  • APP1 may access application data with different directory identifiers in the sandbox through functional component instance 1.
  • run different instances of functional component 3 in the electronic device provide services for different callers through different instances, and then create different sandboxes for different instances to store application data generated by different instances and manage.
  • sandbox 1 and sandbox 3 in Figure 10(B) can be combined, and all caller data can be isolated from application data generated by the operation of functional component 3 itself, as shown in Figure 10(C). Within the caller data, application data generated by different callers is managed through directory identification.
  • a data hosting service module can be added, and when different callers call instances, the data hosting service module can be used to communicate to the caller. The validity of the caller is verified by the operation of the caller. In the case that the caller operates normally, the scheduling sandbox provides storage and reading services of application data for the instance corresponding to the caller. As shown in Figure 10(C), if instance 1 of functional component 3 that provides services for APP1 wants to access the data under the directory identifier of instance 2 of functional component 3, such operations will be intercepted by the data hosting service module to ensure that the Security of application data.
  • the above-mentioned distributed system may be an independent electronic device, or may be one electronic device or multiple electronic devices in the distributed system.
  • Various APPs and functional components may be installed in the electronic device.
  • the examples provided in this embodiment do not constitute any limitation to other embodiments of the present application.
  • the type of caller may include but not limited to APP, PA, FA, and the type of callee may include but not limited to APP, PA, FA.
  • the APP can call the functional component PA/FA
  • the functional component PA/FA can also call other functional components PA/FA
  • the APP can also call other APPs
  • the functional component PA/FA can also call the APP.
  • the caller can be a chat APP
  • the called party can be a positioning PA that provides positioning functions.
  • the chat APP needs to obtain location information
  • the positioning PA needs to provide positioning function services.
  • the chat APP can send the positioning PA to the positioning PA. Initiate a call request.
  • the term “when” may be interpreted to mean “if” or “after” or “in response to determining" or “in response to detecting" depending on the context.
  • the phrases “in determining" or “if detecting (the stated condition or event)” can be interpreted to mean “if determining" or “in response to determining" or “on detecting (the stated condition or event)” or “in response to the detection of (the stated condition or event)”.
  • the above-mentioned embodiments it may be implemented in whole or in part by software, hardware, firmware or any combination thereof.
  • software it can be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated.
  • the computer may be a general purpose computer, special purpose computer, computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server or data center Transmission to another website site, computer, server, or data center by wire (eg, coaxial cable, optical fiber, digital subscriber line) or wireless (eg, infrared, wireless, microwave, etc.).
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes an integration of one or more available media.
  • the usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media (eg, solid state drives), and the like.
  • the process can be completed by instructing the relevant hardware by a computer program, and the program can be stored in a computer-readable storage medium.
  • the program When the program is executed , which may include the processes of the foregoing method embodiments.
  • the aforementioned storage medium includes: ROM or random storage memory RAM, magnetic disk or optical disk and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Automation & Control Theory (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Telephonic Communication Services (AREA)

Abstract

本申请公开了一种访问控制的方法,可以支持被调用方为不同调用方提供服务时,在不同的沙箱中运行不同的实例,不同沙箱之间的数据保持隔离,解决了各调用方的数据被滥用、被误用或被泄露的问题,保障了数据安全。

Description

一种访问控制的方法、电子设备及系统 技术领域
本申请涉及计算机技术领域,尤其涉及一种访问控制的方法、电子设备及系统。
背景技术
终端操作系统(operating system,OS)中的应用程序(application,APP)可以以独立主体的形式向用户申请敏感资源的访问授权,并可以在用户授权通过后为用户提供相应的服务。在一个APP调用另一个APP的服务时,被调用的APP可以为调用方APP提供服务。如果被调用的APP被不同的调用方APP调用,被调用的APP中会存储有不同的调用方产生的数据,被调用的APP可以随意访问不同的多个调用方产生的数据,使得调用方APP的数据安全得不到保障。
发明内容
本申请提供了一种访问控制的方法、相关电子设备及系统,解决了在被调用方中各调用方的数据被滥用、被误用或被泄露的问题,保障了不同调用方数据安全。
上述目标和其他目标将通过独立权利要求中的特征来达成。进一步的实现方式在从属权利要求、说明书和附图中体现。
第一方面,本申请实施例提供了一种访问控制的方法,所述方法应用于通信系统,所述通信系统包括第一设备、第二设备、第三设备,其中,所述第一设备中安装有第一调用方,所述第二设备中安装有被调用方,所述第三设备中安装有第二调用方;所述第一调用方、所述被调用方、所述第二调用方为应用程序或功能组件,所述应用程序为实现多个功能的程序实体,所述功能组件为实现单一功能的程序实体。
所述方法包括:所述第一设备向所述第二设备发送第一请求,所述第一请求携带:所述第一调用方、所述被调用方、第一服务的指示信息;响应于所述第一请求,所述第二设备在第一沙箱中运行第一实例,所述第一实例是所述被调用方的实例,所述第一实例用于为所述第一调用方提供所述第一服务;所述第三设备向所述第二设备发送第二请求,所述第二请求携带:所述第二调用方、所述被调用方、第二服务的指示信息;响应于所述第二请求,所述第二设备在第二沙箱中运行第二实例,所述第二实例是所述被调用方的实例,所述第二实例用于为所述第二调用方提供所述第二服务,所述第二沙箱与所述第一沙箱不同。
实施第一方面的方法,被调用方为不同调用方提供服务时,可以在不同的沙箱中运行不同的实例,如,第二设备上的被调用方可以运行第一沙箱中的第一实例为第一设备上的第一调用方提供第一服务,第二设备上的被调用方可以运行第二沙箱中的第二实例为第三设备上的第二调用方提供第二服务,不同沙箱之间数据保持隔离,可以更为有效的降低各调用方的数据被滥用、被混淆、被误用或被泄露等风险,保障了数据安全。
结合第一方面,在一些实施例中,该方法还可以包括:所述第一设备向所述第二设备发起第三请求,所述第三请求携带:所述第一调用方、所述被调用方、第三服务的指示信息;响应于所述第三请求,所述第二设备在所述第一沙箱中运行所述第一实例,所述第一实例还用于为所述第一调用方提供所述第三服务,或,所述第二设备在上述第一沙箱中运行第三实例,所述第三实例用于为第一调用方提供所述第三服务。
结合第一方面,在一些实施例中,该方法还可以包括:所述第一设备向所述第二设备发起第四请求,所述第四请求携带:所述第三调用方、所述被调用方、第四服务的指示信息,其中,所述第三调用方安装在所述第一设备中,所述第三调用方为应用程序APP或功能组件;响应于所述第四请求,所述第二设备在所述第一沙箱中运行所述第一实例,所述第一实例还用于为所述第三调用方提供所述第四服务,或,所述第二设备在所述第一沙箱中运行第三实例,所述第三实例用于为第三调用方提供所述第四服务。
结合第一方面,在一些实施例中,该方法还可以包括:第四设备向所述第二设备发起第五请求,所述第五请求携带:所述第一调用方、所述被调用方、第五服务的指示信息,其中,所述第四设备中安装有所述第一调用方;响应于所述第五请求,所述第二设备在第一沙箱中运行所述第一实例,所述第一实例还用于为所述第四设备的所述第一调用方提供所述第五服务,或,所述第二设备在第一沙箱中运行第三实例,所述第三实例用于为第三调用方提供所述第四服务。
结合第一方面,在一些实施例中,该方法还可以包括:所述第一调用方和所述第二调用方相同。
结合第一方面,在一些实施例中,该方法还可以包括:所述第一设备和所述第三设备为同一设备。
结合第一方面,在一些实施例中,在所述第二设备运行第一实例之前,所述方法还包括:所述第二设备检测是否存在所述第一沙箱,如果不存在,则所述第二设备创建所述第一沙箱;在所述第二设备运行第二实例之前,所述方法还包括:所述第二设备检测是否存在所述第二沙箱,如果不存在,则所述第二设备创建所述第二沙箱。
结合第一方面,在一些实施例中,所述第二设备在第一沙箱中运行所述第一实例,包括:所述第二设备创建所述第一实例,并在所述第一沙箱中运行所述第一实例;
所述第二设备在第二沙箱中运行所述第二实例,包括:所述第二设备创建所述第二实例,并在所述第二沙箱中运行所述第二实例。
结合第一方面,在一些实施例中,该方法还可以包括:所述第二设备创建所述第一实例后,在所述第二设备存储第一调用关系,所述第一调用关系包括:所述第一调用方的信息,所述第一实例的信息,所述第一调用关系的标识;所述第二设备创建所述第二实例后,在所述第二设备存储第二调用关系,所述第二调用关系包括:所述第二调用方的信息,所述第二实例的信息,所述第二调用关系的标识。
结合第一方面,在一些实施例中,在所述第一设备向所述第二设备发送第一请求之后,所述方法还包括:所述第一设备存储所述第一调用关系;在所述第三设备向所述第二设备发送第二请求之后,所述方法还包括:所述第三设备存储所述第二调用关系。
结合第一方面,在一些实施例中,所述第一调用方的信息包括以下一项或多项:所述第一调用方的应用标识,所述第一调用方的用户标识UID,所述第一调用方的开发者签名,所述第一调用方所在所述第一设备的账户标识,所述第一设备的标识,所述第一调用方所在所述通信系统的标识;所述第一实例的信息包括:所述第一实例的进程标识第一PID,所述第一实例的用户标识第一UID;所述方法还包括:在所述第二设备创建所述第一实例时,所述第二设备为所述第一实例分配所述第一PID,或,所述第一UID。
结合第一方面,在一些实施例中,所述第一实例的信息还包括以下一项或多项:所述被调用方的应用标识,所述被调用方的用户标识UID,所述被调用方的开发者签名,所述被调用方所在所述第二设备的账户标识,所述第二设备的标识,所述第一实例所在 所述通信系统的标识。
结合第一方面,在一些实施例中,该方法还可以包括:所述第一请求还携带所述第一设备的标识、所述第二设备的标识。
结合第一方面,在一些实施例中,所述第二设备运行第一实例之后,所述方法还包括:所述第二设备生成第一结果;所述第二设备将所述第一结果返回给所述第一设备;所述第一设备运行所述第一调用方处理所述第一结果。
结合第一方面,在一些实施例中,在所述第二设备运行第一实例之前,所述方法还包括:所述第二设备确认所述第一调用方具有访问所述第一实例的权限。
结合第一方面,在一些实施例中,在所述第二设备运行第一实例之前,所述方法还包括:所述第二设备确认所述第一调用方具有请求所述被调用方提供所述第一服务的权限。
结合第一方面,在一些实施例中,在所述第一设备向所述第二设备发送第一请求之前,所述方法还包括:所述第一设备确认所述第一调用方具有访问所述被调用方的权限。
结合第一方面,在一些实施例中,所述第一设备、所述第二设备、所述第三设备为同一设备。
结合第一方面,在一些实施例中,所述第二设备中存储有所述第一沙箱与所述第一调用方的映射关系;所述第二设备中存储有所述第二沙箱与所述第二调用方的映射关系。
第二方面,本申请实施例提供了一种访问控制的方法,所述方法应用于第二设备,所述第二设备位于通信系统中,所述通信系统包括第一设备、第二设备、第三设备,其中,所述第一设备中安装有第一调用方,所述第二设备中安装有被调用方,所述第三设备中安装有第二调用方;所述第一调用方、所述被调用方、所述第二调用方为应用程序或功能组件,所述应用程序为实现多个功能的程序实体,所述功能组件为实现单一功能的程序实体。
所述方法包括:所述第二设备接收所述第一设备发送的第一请求,所述第一请求携带:所述第一调用方、所述被调用方、第一服务的指示信息;响应于所述第一请求,所述第二设备在第一沙箱中运行第一实例,所述第一实例是所述被调用方的实例,所述第一实例用于为所述第一调用方提供所述第一服务;所述第二设备接收所述第三设备发送的第二请求,所述第二请求携带:所述第二调用方、所述被调用方、第二服务的指示信息;响应于所述第二请求,所述第二设备在第二沙箱中运行第二实例,所述第二实例是所述被调用方的实例,所述第二实例用于为所述第二调用方提供所述第二服务,所述第二沙箱与所述第一沙箱不同。
实施第二方面的方法,被调用方为不同调用方提供服务时,可以在不同的沙箱中运行不同的实例,如,第二设备上的被调用方可以运行第一沙箱中的第一实例为第一设备上的第一调用方提供第一服务,第二设备上的被调用方可以运行第二沙箱中的第二实例为第三设备上的第二调用方提供第二服务,不同沙箱之间数据保持隔离,可以更为有效的降低各调用方的数据被滥用、被混淆、被误用或被泄露等风险,保障了数据安全。
结合第二方面,在一些实施例中,所述方法还包括:所述第二设备接收所述第一设备发送的第三请求,所述第三请求携带:所述第一调用方、所述被调用方、第三服务的指示信息;响应于所述第三请求,所述第二设备在所述第一沙箱中运行所述第一实例,所述第一实例还用于为所述第一调用方提供所述第三服务,或,所述第二设备在上述第一沙箱中运行第三实例,所述第三实例用于为第一调用方提供所述第三服务。
结合第二方面,在一些实施例中,所述方法还包括:所述第二设备接收到所述第一设备发送的第四请求,所述第四请求携带:所述第三调用方、所述被调用方、第四服务的指示信息,其中,所述第三调用方安装在所述第一设备中,所述第三调用方为应用程序APP或功能组件;响应于所述第四请求,所述第二设备在所述第一沙箱中运行所述第一实例,所述第一实例还用于为所述第三调用方提供所述第四服务,或,所述第二设备在所述第一沙箱中运行第三实例,所述第三实例用于为第三调用方提供所述第四服务。
结合第二方面,在一些实施例中,所述方法还包括:所述第二设备接收所述第四设备发送的第五请求,所述第五请求携带:所述第一调用方、所述被调用方、第五服务的指示信息,其中,所述第四设备中安装有所述第一调用方;响应于所述第五请求,所述第二设备在第一沙箱中运行所述第一实例,所述第一实例还用于为所述第四设备的所述第一调用方提供所述第五服务,或,所述第二设备在第一沙箱中运行第三实例,所述第三实例用于为第三调用方提供所述第四服务。
结合第二方面,在一些实施例中,所述第一调用方和所述第二调用方相同。
结合第二方面,在一些实施例中,所述第一设备和所述第三设备为同一设备。
结合第二方面,在一些实施例中,在所述第二设备运行第一实例之前,所述方法还包括:所述第二设备检测是否存在所述第一沙箱,如果不存在,则所述第二设备创建所述第一沙箱;在所述第二设备运行第二实例之前,所述方法还包括:所述第二设备检测是否存在所述第二沙箱,如果不存在,则所述第二设备创建所述第二沙箱。
结合第二方面,在一些实施例中,所述第二设备在第一沙箱中运行所述第一实例,包括:所述第二设备创建所述第一实例,并在所述第一沙箱中运行所述第一实例;
所述第二设备在第二沙箱中运行所述第二实例,包括:所述第二设备创建所述第二实例,并在所述第二沙箱中运行所述第二实例。
结合第二方面,在一些实施例中,所述第二设备创建所述第一实例后,在所述第二设备存储第一调用关系,所述第一调用关系包括:所述第一调用方的信息,所述第一实例的信息,所述第一调用关系的标识;所述第二设备创建所述第二实例后,在所述第二设备存储第二调用关系,所述第二调用关系包括:所述第二调用方的信息,所述第二实例的信息,所述第二调用关系的标识。
结合第二方面,在一些实施例中,所述第一调用方的信息包括以下一项或多项:所述第一调用方的应用标识,所述第一调用方的用户标识UID,所述第一调用方的开发者签名,所述第一调用方所在所述第一设备的账户标识,所述第一设备的标识,所述第一调用方所在所述通信系统的标识;所述第一实例的信息包括:所述第一实例的进程标识第一PID,所述第一实例的用户标识第一UID;所述方法还包括:在所述第二设备创建所述第一实例时,所述第二设备为所述第一实例分配所述第一PID,或,所述第一UID。
结合第二方面,在一些实施例中,所述第一实例的信息还包括以下一项或多项:所述被调用方的应用标识,所述被调用方的用户标识UID,所述被调用方的开发者签名,所述被调用方所在所述第二设备的账户标识,所述第二设备的标识,所述第一实例所在所述通信系统的标识。
结合第二方面,在一些实施例中,所述第一请求还携带所述第一设备的标识、所述第二设备的标识。
结合第二方面,在一些实施例中,所述第二设备运行第一实例之后,所述方法还包括:所述第二设备生成第一结果;所述第二设备将所述第一结果返回给所述第一设备, 所述第一结果用于所述第一设备运行所述第一调用方处理。
结合第二方面,在一些实施例中,在所述第二设备运行第一实例之前,所述方法还包括:所述第二设备确认所述第一调用方具有访问所述第一实例的权限。
结合第二方面,在一些实施例中,在所述第二设备运行第一实例之前,所述方法还包括:所述第二设备确认所述第一调用方具有请求所述被调用方提供所述第一服务的权限。
结合第二方面,在一些实施例中,所述第一设备、所述第二设备、所述第三设备为同一设备。
结合第二方面,在一些实施例中,所述第二设备中存储有所述第一沙箱与所述第一调用方的映射关系和所述第二沙箱与所述第二调用方的映射关系。
第三方面,本申请实施例提供了一种电子设备,该电子设备可以包括:通信装置、存储器以及耦合于存储器的处理器,多个应用程序,以及一个或多个程序。存储器中存储有计算机可执行指令,处理器执行指令时使得电子设备可以实现如第二方面中第二设备所具有的任一功能。
第四方面,本申请实施例提供了一种通信系统,该通信系统可包括前述各方面中描述的第一设备、第二设备、第三设备等。可理解的,基于同一发明思想,第四方面的通信系统中第一设备、第二设备、第三设备执行的各个步骤可参考第一方面的方法中的第一设备、第二设备、第三设备实现对应功能时所执行的步骤,或,第二设备执行的各个步骤可参考第二方面的方法中的第二设备实现对应功能时所执行的步骤,这里不再赘述。
第五方面,本申请实施例提供了一种计算机存储介质,该存储介质中存储有计算机程序,该计算机程序包括可执行指令,该可执行指令当被处理器执行时使该处理器执行如第二方面所提供的方法对应的操作。
第六方面,本申请实施例提供了一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行如第二方面中任一可能的实现方式。
第七方面,本申请实施例提供了一种芯片系统,该芯片系统可以应用于电子设备,该芯片包括一个或多个处理器,处理器用于调用计算机指令以使得电子设备实现如第二方面中任一可能的实现方式。
实施本申请提供的上述方法,同一个被调用方可以启用多个沙箱,并使用不同的实例来为不同的调用方提供服务。由于沙箱之间的天然隔离属性,不同沙箱无法互相访问数据,这样可以提供系统级的数据安全机制,避免了各调用方的数据被滥用、误用及泄露问题,保证了数据安全。
附图说明
图1为本申请实施例提供的一种通信系统的示意图;
图2为本申请实施例提供的一种应用场景示意图;
图3为本申请实施例提供的电子设备的硬件结构示意图;
图4为本申请实施例提供的一种业务场景示意图;
图5为现有技术方案示意图;
图6为本申请实施例提供的软件架构示意图;
图7为本申请实施例提供的一种访问控制的模型的示意图;
图8为本申请实施例提供的一种访问控制的方法流程图;
图9为本申请实施例提供的另一种访问控制的方法流程图;
图10(A)到10(C)为本申请实施例提供的三种不同的通过沙箱隔离应用数据的示意图。
具体实施方式
下面将结合附图对本申请实施例中的技术方案进行清楚、详尽地描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;文本中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为暗示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征,另外,在本申请实施例的描述中,“多个”是指两个或多于两个。
本申请以下实施例中的术语“用户界面(user interface,UI)”,是应用程序或操作系统与用户之间进行交互和信息交换的介质接口,它实现信息的内部形式与用户可以接受形式之间的转换。用户界面是通过java、可扩展标记语言(extensible markup language,XML)等特定计算机语言编写的源代码,界面源代码在电子设备上经过解析,渲染,最终呈现为用户可以识别的内容。用户界面常用的表现形式是图形用户界面(graphic user interface,GUI),是指采用图形方式显示的与计算机操作相关的用户界面。它可以是在电子设备的显示屏中显示的文本、图标、按钮、菜单、选项卡、文本框、对话框、状态栏、导航栏、Widget等可视的界面元素。
首先,介绍本申请实施例提供的通信系统。
图1示出了本申请实施例提供的一种通信系统10,也可称为 分布式系统10
分布式系统10可以包括多个智能终端设备,这多个终端设备之间建立有通信连接109。例如,如图1中所示,终端设备可以是智能手机101、笔记本电脑102、台式电脑103、平板电脑104、智能音响105、智能手表106、智能手环107、耳机108或者其他类型的电子设备,比如还可以包括桌面型计算机、膝上型计算机、手持计算机、增强现实(augmented reality,AR)设备、虚拟现实(virtual reality,VR)设备、人工智能(artificial intelligence,AI)设备、智慧屏、车机、游戏机、其他智能穿戴设备等,还可以包括物联网(internet of things,IOT)设备或智能家居设备如智能热水器、智能灯具、智能空调等等。本申请对此不作任何限制。在本实施例中,终端设备也可简称为终端,终端设备通常是可以提供用户界面、可以与用户交互、为用户提供业务功能的智能电子设备。
分布式系统10中的多个电子设备均为部署在家庭中的设备时,分布式系统10也可被称为家庭分布式系统。
分布式系统10中的各终端设备上可以搭载
Figure PCTCN2022081882-appb-000001
系统、
Figure PCTCN2022081882-appb-000002
系统、
Figure PCTCN2022081882-appb-000003
Figure PCTCN2022081882-appb-000004
系统、
Figure PCTCN2022081882-appb-000005
系统(HarmonyOS,HOS)或者其他类型的操作系统,分布式系统10中的各个终端设备的操作系统可以相同也可以不同,本申请对此不作限制。在一些实施例中,分布式系统10中的各个终端均搭载有
Figure PCTCN2022081882-appb-000006
系统,那么该分布式系统 10可以称为
Figure PCTCN2022081882-appb-000007
超级虚拟终端(super virtual device),亦可称为
Figure PCTCN2022081882-appb-000008
超级终端,指的是通过分布式技术将多个终端的能力进行整合,存放在一个虚拟的硬件资源池里,根据业务需要统一管理、调度和整合终端能力,来对外提供服务,使得不同终端之间实现快速连接、能力互助、资源共享。
在分布式系统10中,各个终端之间建立有通信连接109,该通信连接109可以为远场通信连接,比如各个终端登录同一个账号从而通过互联网实现连接并通信。分布式系统10中的多个电子设备也可以登录不同账号,但通过绑定的方式进行连接。例如,电子设备100和电子设备200可以登录不同的账号,电子设备100在设备管理应用中,将电子设备200和本身进行绑定,之后通过该设备管理应用来连接。在本申请以下实施例中,电子设备100可以为分布式系统10中的任意一个电子设备,电子设备200也可以为分布式系统10中的任意一个电子设备。例如,电子设备100为智能手机,电子设备200为智慧屏。
在分布式系统10中,该通信连接109也可以为近场通信连接,比如通过有线连接,如通用串行总线(uniersalserialbus,USB)连接,或者无线连接,如蓝牙(bluetooth,BT)连接、无线保真(wireless fidelity,Wi-Fi)连接等,实现各个终端之间在无账号或异账号情况下通信。本申请实施例对通信连接的类型不作限制。终端设备中可以配置有蓝牙(bluetooth,BT)模块和/或无线局域网络(wireless local area networks,WLAN)模块。其中,蓝牙模块可以提供包括经典蓝牙(蓝牙2.1)或蓝牙低功耗(bluetooth low energy,BLE)中一项或多项蓝牙通信的解决方案,WLAN模块可以提供包括无线保真点对点连接(wireless fidelity peer-to-peer,Wi-Fi P2P)、无线保真局域网(wireless fidelity local area networks,Wi-Fi LAN)或无线保真软件接入点(wireless fidelity software access point,Wi-Fi softAP)中一项或多项WLAN通信的解决方案。在一些实施例中,Wi-Fi P2P是指允许无线网络中的设备无需通过无线路由器即可以点对点形式相互连接,在
Figure PCTCN2022081882-appb-000009
系统中又可称为无线保真直连(wireless fidelity direct,Wi-Fi direct)。建立Wi-FiP2P连接的设备之间可以在不连接网络或热点的情况下,直接通过Wi-Fi(必须处于同一频段)进行数据交换,实现点对点的通信,如传输文件、图片、视频等数据。相对于蓝牙,Wi-FiP2P具有搜索速度和传输速度更快、传输距离更远等优点。各个终端之间可通过通信连接109进行数据的传输和交互。
此外,分布式系统10中的多个电子设备也可以结合上述任意几种方式来连接并通信,本申请实施例对此不做限制。
在本申请实施例中,分布式系统10中的各个设备可以安装传统APP,例如传统的相机应用、图库应用、设置应用等等。后续实施例中,传统APP可以简称为APP。
此外,本申请实施例提供的分布式系统10可以安装分布式应用(distributed application)。该分布式应用可以为系统应用,也可以为第三方应用,这里不做限制。
与包含多种能力的传统应用程序不同,分布式应用支持以单一能力为单位进行部署。APP是指可以实现一项或多项功能的计算机程序,可独立运行,通常具有可视的用户界面,可以与用户进行交互。一个分布式应用包括一个或多个功能组件。
功能组件是电子设备中可独立运行的最小能力单元,是对单一能力进行抽象封装的概念。传统APP将多个功能集合在一起,而功能组件将各个功能作为单独的服务化基础能力,独立存在。即,功能组件是实现单一功能的程序实体。
每个功能组件都可以独立下载、安装并运行。组成同一个分布式应用的多个功能组 件,可以部署在分布式系统10中的同一个电子设备中,也可以部署在不同电子设备中。分布式应用可以实现封装远程虚拟化、远程调用、元能力管理、跨平台兼容、安全等功能模块,分布式应用可以调用其他设备有而本设备没有的计算能力,具备将本设备的计算工作拆分到多个设备上协同完成等能力。
分布式系统10可以赋予功能组件更具灵活性的可编排、可迁移等特性,分布式系统10可以通过编排合适的功能组件使其协同完成作业。
可理解的,功能组件只是本实施例中所使用的一个词语,其代表的含义在本实施例中已经记载,其名称并不能对本实施例构成任何限制。另外,在本申请其他一些实施例中,功能组件也可以称为系统组件、系统服务、业务功能、元能力/原子能力(Ability)等其他名词。本申请后续实施例统一以“功能组件”进行描述。
Figure PCTCN2022081882-appb-000010
系统为例,
Figure PCTCN2022081882-appb-000011
系统中的功能组件可以包括以下两种类别:
(1)原子能力(particle ability,PA)。
PA是无UI的功能组件,可被描述为原子化服务或者原子化功能模块/单元,是可实现单一功能的程序实体,是可独立执行的程序片段。PA可以为FA提供支持,例如作为后台服务提供计算能力,或作为数据仓库提供数据访问能力。例如,美颜功能、定位功能、音视频编解码功能等,可以封装为PA。在一些实施例中,particle ability(PA)又可称为atomic ability(AA)。
PA具有多端部署、分布式执行等特性。PA仅对系统服务有依赖关系,和其他PA之间不存在依赖关系。
PA实际上可以将远程虚拟化、远程调用、PA管理、跨平台兼容、安全等实现做封装,对开发者开放跨设备的使能和唤起的服务,以供其他设备调用本设备的计算能力,以及协同其他设备完成计算工作。PA支持Service Ability,Data Ability等。Service Ability用于提供后台运行任务的能力。Data Ability用于对外部提供统一的数据访问抽象。
在本申请实施例中,PA可以被其他APP或FA或PA调用,PA也可以调用其他PA或FA或APP,以实现更多、更复杂的功能。
(2)特征能力(feature ability,FA)。
FA是包含一组或若干组UI的功能组件,可以提供与用户交互的能力。例如,地图应用中的导航界面、即时通讯应用中的视频通话界面等,可以实现为FA。
在一些实施例中,FA可以基于MVVM(model-view-view-model)模式开发,将视图UI和业务逻辑分离。业务逻辑代码和视图UI代码分开部署,视图UI代码则可以集成到其他APP中。视图UI代码在运行过程中,可以和业务逻辑代码通信,获取到UI展示所需要的数据。
FA支持page模板的能力,例如Empty Ability,Login Ability,Setting Ability等。FA可以采用脚本语言(java script,JS)提供声明式开发模式,采用类HTML和层叠样式表(cascading style sheet,CSS)声明式编程语言作为页面布局和页面样式的开发语言,并支持ECMAScript规范的JS语言提供页面业务逻辑。
FA可以具有免安装、独立运行、跨设备UI迁移、跨设备二进制迁移等能力。FA还具有多端部署、分布执行的特性。
在本申请实施例中,FA可以被其他APP或FA或PA调用,FA也可以调用其他PA或FA或APP,以实现更多、更复杂的功能。
同样的,功能组件PA/FA具有多端部署、分布式执行的特点,即一个分布式应用可以包含多个PA/FA,并且多个PA/FA可以部署在相同或不同的终端设备中。分布式系统10中的每个终端设备都可以安装有APP/PA/FA,分布式系统10中的终端设备可以同步其他终端设备的PA/FA信息,便于调用。比如,部署在一个终端设备中的PA/FA,可以被部署在该终端设备中的应用调用,也可以被部署在分布式系统10中其他终端设备中的应用调用。
可以理解的是,“FA”、“PA”只是本实施例中所使用的一个词语,在本申请其他一些实施例中,其还可以被称为其他名词。例如,“PA”、“FA”也可以被称为例如原子能力、原子应用、元能力、原子化功能模块/单元等其他名词。同样的,“PA”在其他一些实施例中还可被称为元服务、原子化服务、原子服务等其他名词,“FA”在其他一些实施例中也可以被称为特性能力、元程序等其他名词。
组成一个分布式应用的多个功能组件可以由同一个开发者来开发或提供,可以由多个开发者分别开发或提供,这里不做限制。不同开发者共同开发功能组件,可以提高分布式应用的开发效率。
在本申请实施例中,功能组件可以对外提供标准化的调用接口,用于被调用方调用。调用方指的是调用请求的发起方,被调用方指的是调用请求的目标对象。一个普通APP可以调用功能组件,被调用的功能组件还可以再次调用其他的功能组件,这种多级调用的情况可以称为链式调用。
在本申请实施例中,在一个调用关系中,发起调用功能的一方,可以称为调用方或调用者,被调用方调用提供资源的一方可以称为被调用方或被调用者。调用方或被调用方可以为APP、FA或PA。整个调用链的初始发起者,可以称为首调者,首调者例如可以为APP或FA。举例来说,调用链为:APP1调用PA1,PA1调用PA2,PA2调用FA1,则APP1为首调者。再举例来说,调用链为:FA1调用PA1,PA1调用PA2,则FA1为首调者。
在本申请一些实施例中,调用方也可以称为主体应用,被调用方还可以称为客体应用。
在调用链中,各个调用方,以及,被调用方,可以部署在同一个电子设备中,也可以部署在不同的电子设备中。
调用方所在设备可以称为主体设备,被调用方所在设备可以为客体设备。
分布式系统10中的各个设备建立通信连接后,各个设备将同步分布式系统中其他设备的功能组件信息以及APP信息等。具体的,各个设备可以将自身安装的功能组件和/或APP的标识、自己的设备信息(例如设备标识)同步到分布式系统10中,对其他设备可见,以方便后续在分布式系统10中各个设备之间互相调用。每个功能组件或APP能够被哪些调用方调用,以及,能够调用哪些其他的功能组件或APP,即调用权限和/或被调用权限,可以预先设置并记录在各个电子设备上,并同步在分布式系统10中。
结合前述描述,为了方便理解,在这里给出一个简单的示例说明。
参考图2,分布式系统10中包括电子设备A和电子设备B,其中,电子设备A中部署有应用程序A、功能组件A和功能组件B,电子设备B中部署有应用程序B、功能组件C和功能组件D。分布式系统10中的每个电子设备可以获知、调用其他电子设备上的功能组件,比如,应用程序A可以通过调用功能组件A、功能组件B以及电子设备B上的功能组件C等实现相应功能,应用程序B可以通过调用功能组件C、功能组件D等实 现相应功能。除了应用程序调用功能组件,功能组件之间也可以互相调用,比如,部署在电子设备A上的功能组件B还可以调用部署在电子设备B上的功能组件D。
需要说明的是,图1、图2所示的场景仅用于辅助描述本申请实施例提供的技术方案,并不对本申请实施例构成限制。在实际业务场景中,分布式系统10可以包括更多或更少的终端设备,各个终端设备中可以部署更多或更少的分布式应用和/或PA/FA,各分布式应用中可以包括更多或更少的PA/FA,对各个APP/PA/FA之间的调用关系也不作任何限定等。
下面对本申请实施例中提供的电子设备的结构进行示例性描述。
本申请实施例提供的电子设备可以为图1所示分布式系统10中所描述的任意一个电子设备,也可以是本申请后续实施例中的电子设备100或电子设备200或其他电子设备,这里不做限制。在这里以电子设备100为示例进行说明。
本申请实施例中,电子设备100可以包括但不限于手机、平板电脑、桌面型计算机、膝上型计算机、手持计算机、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本,以及蜂窝电话、个人数字助理(personal digital assistant,PDA)、增强现实(augmented reality,AR)设备、虚拟现实(virtual reality,VR)设备、人工智能(artificial intelligence,AI)设备、可穿戴式设备、车载设备、智能家居设备和/或智慧城市设备。本申请实施例对电子设备100的具体类型不作任何限制。
图3为本申请实施例提供的电子设备100的硬件结构示意图。
电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
可以理解的是,本发明实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器 110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器110可以包含多组I2C总线。处理器110可以通过不同的I2C总线接口分别耦合触摸传感器180K,充电器,闪光灯,摄像头193等。例如:处理器110可以通过I2C接口耦合触摸传感器180K,使处理器110与触摸传感器180K通过I2C总线接口通信,实现电子设备100的触摸功能。
I2S接口可以用于音频通信。在一些实施例中,处理器110可以包含多组I2S总线。处理器110可以通过I2S总线与音频模块170耦合,实现处理器110与音频模块170之间的通信。在一些实施例中,音频模块170可以通过I2S接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。
PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块170与无线通信模块160可以通过PCM总线接口耦合。在一些实施例中,音频模块170也可以通过PCM接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。所述I2S接口和所述PCM接口都可以用于音频通信。
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器110与无线通信模块160。例如:处理器110通过UART接口与无线通信模块160中的蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块170可以通过UART接口向无线通信模块160传递音频信号,实现通过蓝牙耳机播放音乐的功能。
MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器110和摄像头193通过CSI接口通信,实现电子设备100的拍摄功能。处理器110和显示屏194通过DSI接口通信,实现电子设备100的显示功能。
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器110与摄像头193,显示屏194,无线通信模块160,音频模块170,传感器模块180等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备100充电,也可以用于电子设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。
可以理解的是,本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将 处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(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,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图 像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。
内部存储器121可以包括一个或多个随机存取存储器(random access memory,RAM)和一个或多个非易失性存储器(non-volatile memory,NVM)。
随机存取存储器具有读取/写入速度快,易失性的特性。易失性指的是一旦断电,RAM中所存储的数据将随之消失。通常情况下,随机存取存储器静态功耗极低,运行功耗相对较大。
非易失性存储器具有非易失性、存储数据稳定的特性。非易失性是指断电后,其所存储的数据不会消失,可以长时间断电保存数据。
随机存取存储器可以包括静态随机存储器(static random-access memory,SRAM)、动态随机存储器(dynamic random access memory,DRAM)、同步动态随机存储器(synchronous dynamic random access memory,SDRAM)、双倍资料率同步动态随机存取存储器(double data rate synchronous dynamic random access memory,DDR SDRAM,例如第五代DDR SDRAM一般称为DDR5SDRAM)等。非易失性存储器可以包括磁盘存储器件(magnetic disk storage)、快闪存储器(flash memory)等。
磁盘存储器件是以磁盘为存储介质的存储器,具有存储容量大、数据传输率高、存储数据可长期保存等特点。
快闪存储器按照运作原理划分可以包括NOR FLASH、NAND FLASH、3D NAND FLASH等,按照存储单元电位阶数划分可以包括单阶存储单元(single-level cell,SLC)、多阶存储单元(multi-level cell,MLC)、三阶储存单元(triple-level cell,TLC)、四阶储存单元(quad-level cell,QLC)等,按照存储规范划分可以包括通用闪存存储(英文:universal flash storage,UFS)、嵌入式多媒体存储卡(embedded multi media Card,eMMC)等。
随机存取存储器可以由处理器110直接进行读写,可以用于存储操作系统或其他正在运行中的程序的可执行程序(例如机器指令),还可以用于存储用户及应用程序的数据等。
非易失性存储器也可以存储可执行程序和存储用户及应用程序的数据等,可以提前加载到随机存取存储器中,用于处理器110直接进行读写。
外部存储器接口120可以用于连接外部的非易失性存储器,实现扩展电子设备100的存储能力。外部的非易失性存储器通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部的非易失性存储器中。
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备100可以 通过扬声器170A收听音乐,或收听免提通话。
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备100接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。电子设备100可以设置至少一个麦克风170C。在另一些实施例中,电子设备100可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,电子设备100还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A
的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。电子设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,电子设备100根据压力传感器180A检测所述触摸操作强度。电子设备100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。
陀螺仪传感器180B可以用于确定电子设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定电子设备100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测电子设备100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消电子设备100的抖动,实现防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。
气压传感器180C用于测量气压。在一些实施例中,电子设备100通过气压传感器180C测得的气压值计算海拔高度,辅助定位和导航。
磁传感器180D包括霍尔传感器。电子设备100可以利用磁传感器180D检测翻盖皮套的开合。在一些实施例中,当电子设备100是翻盖机时,电子设备100可以根据磁传感器180D检测翻盖的开合。进而根据检测到的皮套的开合状态或翻盖的开合状态,设置翻盖自动解锁等特性。
加速度传感器180E可检测电子设备100在各个方向上(一般为三轴)加速度的大小。当电子设备100静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用。
距离传感器180F,用于测量距离。电子设备100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,电子设备100可以利用距离传感器180F测距以实现快速对焦。
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。电子设备100通过发光二极管向外发射红外光。电子设备100使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定电子设备100附近有物体。当检测到不充分的反射光时,电子设备100可以确定电子设备100附近没有物体。电子设备100可以利用接近光传感器180G检测用户手持电子设备100贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器180G也可用于皮套模式,口袋模式自动解锁与锁屏。
环境光传感器180L用于感知环境光亮度。电子设备100可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测电子设备100是否在口袋里,以防误触。
指纹传感器180H用于采集指纹。电子设备100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。
温度传感器180J用于检测温度。在一些实施例中,电子设备100利用温度传感器180J检测的温度,执行温度处理策略。例如,当温度传感器180J上报的温度超过阈值,电子设备100执行降低位于温度传感器180J附近的处理器的性能,以便降低功耗实施热保护。在另一些实施例中,当温度低于另一阈值时,电子设备100对电池142加热,以避免低温导致电子设备100异常关机。在其他一些实施例中,当温度低于又一阈值时,电子设备100对电池142的输出电压执行升压,以避免低温导致的异常关机。
触摸传感器180K,也称“触控器件”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。
骨传导传感器180M可以获取振动信号。在一些实施例中,骨传导传感器180M可以获取人体声部振动骨块的振动信号。骨传导传感器180M也可以接触人体脉搏,接收血压跳动信号。在一些实施例中,骨传导传感器180M也可以设置于耳机中,结合成骨传导耳机。音频模块170可以基于所述骨传导传感器180M获取的声部振动骨块的振动信号,解析出语音信号,实现语音功能。应用处理器可以基于所述骨传导传感器180M获取的血压跳动信号解析心率信息,实现心率检测功能。
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏194不同区域的触摸操作,马达191也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备100的接触和分离。电子设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口195可以同时插入多张卡。所述多张卡的类型可以相同,也可以不同。SIM卡接口195也可以兼容不同类型的SIM卡。SIM卡接口195也可以兼容外部存储卡。电子设备100通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,电子设备100采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在电子设备100中,不能和电子设备100分离。
结合上述分布式系统10的说明,参考图4,图4示例性示出了一种可能的分布式的远程教学业务场景。
如图4所示,分布式系统包含智能手机、平板电脑、智慧屏等电子设备。分布式系统中的各个设备两两相互连接。智能手机、平板电脑、智慧屏可以配置不同的软件操作系统(operating system,OS),例如智能手机和平板电脑可以配置
Figure PCTCN2022081882-appb-000012
系统,智慧屏可以配置
Figure PCTCN2022081882-appb-000013
系统。
智能手机中安装有“在线课堂”应用。“在线课堂”是一款安装于电子设备中、为老师和学生提供远程上课所需的各项功能的应用程序,本申请实施例对其名称不做限制。“在线课堂”可以包括以下几个功能组件:黑板功能组件、白板功能组件、音视频编解码功能组件、网络连接功能组件。其中,黑板功能组件、白板功能组件属于FA,音视频编解码功能组件、网络连接功能组件属于PA。黑板功能组件提供远程讲解课程的功能。白板功能组件提供远程回答问题的功能。音视频编解码功能组件提供视频音编解码功能。其中,黑板功能组件和白板功能组件还可以通过调用智能手机中的视频通话功能组件来实现视频通信功能。视频通话功能组件属于PA。
在老师侧,老师在智能手机上使用“在线课堂”时,可以将黑板功能组件迁移或切换到智慧屏上,从而在智慧屏上讲解课程。
在学生侧,学生在智能手机上使用“在线课堂”时,可以将白板功能组件迁移或切换到平板电脑上,从而在平板电脑上回答问题。
将功能组件由一个设备A迁移或切换至另一设备B,可以包括以下两种:1,UI迁移。在FA的视图UI和业务逻辑分离时,设备A可以运行业务逻辑代码时,可以触发设备B运行该视图UI的代码,用户看来就好像是将功能组件从设备A迁移到了设备B中。2,整体迁移。整体迁移是指设备B从设备A处或者从网络中下载并安装该功能组件后,运行该功能组件并提供相应的功能。
在该远程教学业务场景中,“在线课堂”为调用方,平板电脑中的白板功能组件、智慧屏中的黑板功能组件为被调用方。
图4还示出了另一种可能的分布式视频通话业务场景。
如图4所示,智能手机还可以安装有其他分布式应用,例如即时通讯应用。即时通讯应用可以提供视频通话、语音通话及其他通信功能。即时通讯应用可以包括以下功能组件:视频通话功能组件、音视频编解码功能组件、网络连接功能组件。
用户在智能手机上使用即时通讯应用时,可以将该应用的视频通话功能组件迁移或者切换到智慧屏或平板电脑上,从而利用智慧屏或平板电脑的摄像头和显示屏来进行视频通话。
在该视频通话业务场景中,即时通讯应用为调用方,视频通话功能组件为被调用方。
需要说明的是,如图4所示的业务场景仅用于辅助描述本申请实施例的技术方案。在实际业务场景中,图4所示的分布式系统可以包括更多的终端设备,各个设备中可以部署更多或更少的功能组件,各分布式应用可以包括更多或更少的功能组件。
通过图1、图2所示的分布式系统10,以及,图4所示的分布式业务场景,可以整合不同设备的软硬件能力,实现智慧化的全场景体验。
在图1、图2所示的分布式系统10以及图4所示的分布式业务场景中,由于功能组件可以被跨设备调用,为了避免各个调用者的内存数据发生混淆、误用或恶意使用等问题,为了保证各个功能组件可以合理地访问设备资源,以及保障分布式系统中设备间安全共享资源、数据等,本申请实施例提供了一种访问控制的方法,后面将详细介绍解决提供的具体方案。
这里,分布式系统中设备间共享的资源可包括但不限于:软件资源、硬件资源、设备的外设或者配件资源等。
应用程序或功能组件,在其运行过程中生成的数据可以包括以下两种:
1,内存数据。
电子设备启动或发起应用程序或功能组件的实例,即会产生对应的内存数据。
内存数据即为RAM中的数据,可随时被读取,断电即消失。
实例是运行态的应用程序或功能组件。在本申请实施例中,实例可以指进程,也可以指线程。进程是应用程序或功能组件在计算机上的一次执行活动。线程是应用程序或功能组件执行中一个单一的顺序控制流程。一个进程可以包括多个线程。
也就是说,只要一个应用程序或功能组件开始运行,就会生成对应的实例,并产生内存数据。
2,应用数据。
应用数据是指应用程序或功能组件运行过程中写入的内容,例如拍照类应用获取到的照片或视频、文档类应用中用户编辑的文本等等。应用数据也可称为文件数据。
应用数据为NVM中的数据,可以长时间稳定存储在NVM中。
传统单机场景下,电子设备中的APP以独立主体的形式向用户申请敏感资源的访问授权,授权通过后直接为用户提供各项服务。
考虑到单机场景中电子设备中多个APP中的应用数据存储在NVM中,导致APP在得到用户授权后,授权后的APP可以具有NVM中所有的数据的访问权限,在APP被入侵后,会导致NVM中的数据泄露,在此基础上,相关技术提出了沙箱的概念。
沙箱(Sandbox),又称为沙盒,是一个虚拟系统程序,具有独立的运行环境,即该虚拟系统中具有独立的RAM和NVM,允许APP在其中运行。通过沙箱的隔离,使得在沙箱中的APP只可以访问沙箱中的资源,而不能访问设备中其他的资源,保证了设备的安全性和稳定性。
参考图5,图5示例性示出了单机系统中,传统APP被调用时通过沙箱提供服务实现方式。如图5所示,APP1和APP2为调用方,调用APP3对应的服务。各个APP分别有对应的实例,各个实例之间天然隔离。电子设备为被调用的APP3创建沙箱,APP3在沙箱中的RAM资源中运行其实例,为APP1和APP2提供服务,并将运行实例过程中的 产生的应用数据存储在沙箱的数据库中,沙箱的数据库为沙箱中的NVM资源的统称。由于沙箱中数据库是共享的,导致沙箱中的APP3的实例为APP1和APP2提供服务时产生的数据均保存在沙箱的数据库中,APP1和APP2调用APP3产生的数据只能通过APP3做隔离。当沙箱出现漏洞或遭遇恶意行为时,会导致APP1和APP2的数据泄露。另外,由于被调用方APP3无法区分不同调用方APP(APP1和APP2)的身份,因此还存在无法追溯调用关系,难以记录审计日志等问题。
在分布式系统中,权限的授权与否只针对对用户可见的APP,而对用户不可直接感知的功能组件无法进行权限授权。所以调用方APP在调用功能组件时,也同样存在数据安全隐患。
在分布式业务场景中,调用方APP调用功能组件时,如果使用图5中所示的方式,被调用方功能组件以单实例的形式在沙箱中为不同调用方APP提供共享服务,则该功能组件可以产生到来自不同设备、不同调用方的应用数据,可能会因为自身漏洞或者恶意行为,发生滥用或误用各调用者的应用数据的问题。另外,由于被调用方功能组件不会区分不同调用方APP的身份,因此还存在无法追溯调用关系,难以记录审计日志等问题。例如,在图4所示的分布式业务场景中,在智慧屏中为视频通话能力单元创建沙箱,但智慧屏中的视频通话能力单元可以同时获取到智能手机中的“在线课堂”的数据,和,即时通讯应用的应用数据,这两种数据可能会发生泄露。
本申请实施例提供了一种访问控制的方法、电子设备及系统,用于解决在调用事件中,各调用方内存及应用数据数据被滥用、被混淆、被误用或被泄露等问题。该访问控制方法可以应用于包括多个电子设备的通信系统中。
根据本申请提供的方法,同一个被调用方可以启用多个沙箱,并使用不同的沙箱运行实例来为不同的调用方提供服务。由于沙箱之间的天然隔离属性,不同沙箱无法互相访问内存数据和应用数据,这样可以提供系统级的数据安全机制,避免了各调用方的数据被滥用、误用及泄露问题,保证了数据安全。
实施本申请提供的访问控制的方法,可以支持被调用方为不同调用方提供服务时,在不同的沙箱中运行不同的实例,不同实例之间的内存数据保持隔离,更为有效的降低了各调用方的数据被滥用、被混淆、被误用或被泄露等风险,保障了数据安全。
下面示例性介绍本申请实施例提供的一种电子设备100的软件系统架构。
图6是本申请实施例的提供的电子设备100的软件架构框图。电子设备100的软件系统可以采用分层架构、事件驱动架构、微核架构、微服务架构或云架构等。示例性地,电子设备100的软件系统包括但不限于
Figure PCTCN2022081882-appb-000014
或者其它操作系统。
分层架构将软件系统分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口(application programming interface,API)通信。在一些实施例中,如图6所示,电子设备100的软件架构可以包括应用层和内部模块层等。
如图6所示,应用层可以包括一系列APP和功能组件。应用层可以包括系统应用和第三方非系统应用。示例性的,应用程序层可以包括但不限于桌面,相机,图库,通话,导航,WLAN,蓝牙,音乐,多个PA、FA等。
内部模块层可以为应用层的APP及PA/FA提供应用编程接口和功能支持。内部模块 层可以包括一些预先定义的函数和/或功能模块/服务。内部模块层的各个模块可以协作,用于管理应用或功能组件的发现、注册、查询、迁移以及管理应用或功能组件实例的创建、调用等,这些模块可以与电子设备中其他模块协作,实现本申请实施例中提供的访问控制方法。
示例性的,内部模块层可以包括但不限于应用信息管理模块、应用启动管理模块、实例管理模块、应用调度模块、权限管理模块、调用关系管理模块、调用关系库,应用文件管理模块等。
应用信息管理模块,用于管理电子设备100所安装的各个APP或功能组件的信息,方便各个APP/PA/FA的发现、注册、安装、卸载等。例如为各个APP或功能组件分配UID、为各个运行态的实例分配PID等等。再例如管理各个APP或PA/FA的注册信息,如获取、记录、管理各个APP/PA/FA的标识,以及部署该APP/PA/FA的电子设备的标识等,以方便注册信息的查询等功能。
应用启动管理模块,用于管理各个应用程序或功能组件的启动工作。例如,当电子设备100接收到其他设备调用某个应用程序的请求时,应用启动管理模块可以启动该应用程序。
实例管理模块,负责根据调用方的信息,动态启动或创建实例。具体的,当不同设备和/或不同调用方请求调用电子设备100中的应用或功能组件时,实例管理模块将会为不同设备和/或不同调用方分别启用一个该应用或功能组件的实例,各自为不同设备和/或不同调用方提供服务。实例管理模块还用于管理启用的各个实例的生命周期,例如启动、停止、销毁、重启实例等等。
应用调度模块,可以负责管理APP/PA/FA之间的调用等,比如可用于发起调用方对被调用方的调用请求等。比如,一个APP在用户操作的触发下,向应用调度模块发送对某个PA的调用请求,然后应用调度模块可以对该调用请求进行解析处理,获得该APP的标识、被调用方PA的标识以及相应的请求参数。
权限管理模块,可以用于管理各APP/PA/FA的权限信息,负责控制调用方调用被调用方的权限以及各APP/PA/FA对系统资源的访问权限等。权限管理模块还可以用于负责对同一个分布式系统中的多个终端设备中各自部署的APP/PA/FA的权限信息和/或授权信息进行同步。权限管理模块还可用于生成并提供权限相关的提示信息给用户,在一些实施例中,权限管理模块可以在获取到无权限调用某实例的APP发起对该实例的调用请求时,询问用户是否授予权限、更改权限或者删除恶意APP等。
调用关系管理模块,负责维护多组调用方、被调用方的实例组成的调用关系,并将其存储到调用关系库中。
调用关系库,可以用于存储多组调用方、被调用方组成的调用关系。每组调用关系中可以包括调用关系身份标识(identification,ID)、调用方信息、被调用方信息等。其中,调用方信息可以包括调用方名称、所在设备ID、用户标识(user identification,UID)、开发者签名等,被调用方信息可以包括被调用方名称、所在设备ID、实例的UID、实例的进程标识(process identification,PID)等信息。
参考下表1,其示例性示出了两组调用关系。
Figure PCTCN2022081882-appb-000015
Figure PCTCN2022081882-appb-000016
表1
从表1可以看出,这两组调用关系分别是,电子设备100上的APP1、电子设备200上的APP2分别调用了电子设备300中的功能组件3,电子设备300会启用两个功能组件3的实例,分别用于为APP1和APP2提供服务。
表1所示的调用关系不仅可以存储于被调用方所在的电子设备中,还可以存储于调用方所在的电子设备中,这里不做限制。
沙箱管理模块,负责对沙箱中的实例以及实例产生的应用数据进行管理,对沙箱中实例产生的应用数据按照目录的形式进行存储。为了节约资源,同一个沙箱中可以运行不同的实例,或同一个沙箱中的不同的实例可以为多个调用方提供服务,本发明通过目录的形式隔离同一个沙箱中不同服务的实例产生的应用数据。不同的目录对应的标识不同,具体的目录的标识可以是调用方名称、所在设备ID、用户标识(user identification,UID)、开发者签名,被调用方名称、所在设备ID、实例的UID、实例的进程标识(process identification,PID)等,目录的标识可以是上述多个标识的集合,如开发者签名和被调用方标识的集合。沙箱管理模块根据不同的标识,将不同的数据分别存储在不同的目录下,便于查找与维护。
以上对电子设备100的软件架构的介绍仅为示例,可以理解的是,本发明实施例示意的软件架构并不构成对本申请构成具体限定。在本申请另一些实施例中,电子设备100的软件架构可以包括比图示更多或更少的模块,或者组合某些模块,或者拆分某些模块,或者不同的架构布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
下面介绍本申请实施例提供的一种访问控制的模型。
如图7所示的一个实施例中,分布式系统中可以安装有:调用方APP1、调用方APP2、被调用方功能组件3。APP1、APP2、功能组件3可以安装于分布式系统中的相同设备或不同设备中,在本实施例中不作任何限制。处于同一个分布式系统中的APP和/或功能组件之间可以互相调用。其中,被调用方功能组件3可以为FA或PA。本实施例对调用方、被调用方的类型不作限制。比如在其他的一些实施例中,调用方不限于为APP,也可以实施为其他功能组件,被调用方也可以不限于为功能组件,还可以实施为APP。APP可以调用功能组件,功能组件可以调用其他功能组件,APP也可以调用其他APP,功能组件也可以调用APP。
电子设备为被调用方的不同实例创建不同的沙箱,不同的沙箱具有独立的运行环境,即该虚拟系统中具有独立的RAM和NVM资源,允许实例在其中运行,沙箱可以在电子设备接收到的调用请求后创建,也可以在电子设备的调用关系建立后创建,在此不做限定。由于沙箱具有独立的运行环境,不同的沙箱之间的内存数据和应用数据是隔离的,保证了实例运行的高安全性和数据可追溯性。
如图7所示,APP1和APP2分别调用功能组件3,同时,功能组件3自身也在运行。功能组件3所在的电子设备可以创建3个功能组件3的实例和对应的3个沙箱,分别为 功能组件3实例1、功能组件3实例2、功能组件3实例3,沙箱1,沙箱2,沙箱3。其中,功能组件3实例1可以为调用方APP1实例提供服务,功能组件3实例2可以为调用方APP2实例提供服务,功能组件3实例3可以为功能组件3自身提供服务。功能组件3实例1在沙箱1中运行,功能组件3实例2在沙箱2中运行,功能组件3实例3在沙箱3中运行。这样,依靠沙箱之间的隔离属性,可以将为调用方APP1提供服务的实例1、为调用方APP2提供服务的实例2以及功能组件3自身的内存数据和应用数据隔离开来,有效地降低各功能组件数据的滥用、混淆及泄露等风险。
此外,在调用方调用被调用方实例的同时,各个电子设备可以将本次调用方调用实例和实例运行的沙箱的调用事件记录进入审计日志,并同步到分布式系统中,方便后续追溯调用事件,比如方便在攻击检测后查找原因,或者为可能发生的数据安全事故或安全漏洞查找原因。调用事件中可以包括调用事件发生时间、调用关系ID等信息。
图7中的示例存在两个调用关系:APP1调用功能组件3,以及,APP2调用功能组件3。APP1、APP2及功能组件3所在设备都可以分别记录并维护该调用关系,并且同步到分布式系统中,这样可以在后续出现问题时方便回溯原因,降低安全风险。
下面介绍本申请实施例提供的一种访问控制的方法。
实施例一
本实施例以调用方和被调用方均部署在同一电子设备100上为例进行说明。
该电子设备100可以是独立的电子设备(单机),也可以是分布式系统中的一个电子设备。电子设备100又可称为第一设备。
该电子设备100中可以安装有各项APP和功能组件。本实施例提供的示例并不对本申请其他实施例构成任何限制。
图8是本申请实施例提供的访问控制的方法流程图,具体包括步骤如下:
S101,电子设备100发起第一调用请求,该第一调用请求用于第一调用方请求被调用方提供第一服务。
该第一调用请求可以包括第一调用方、被调用方、第一服务的指示信息。
本申请实施例对第一服务的类型、内容等不作任何限制。比如第一调用方可以请求通过被调用方访问电子设备100中的第一资源。该第一资源可以包括电子设备100的软件资源(如美颜算法、定位功能、音视频编解码功能),也可以包括硬件资源(如摄像头、音频设备、显示屏等硬件)。
本实施例对调用方、被调用方的类型不作任何限制。调用方的类型可以包括但不限于APP、PA、FA,被调用方的类型可以包括但不限于APP、PA、FA。比如APP可以调用功能组件PA/FA,功能组件PA/FA也可以调用其他功能组件PA/FA,APP也可以调用其他APP,功能组件PA/FA也可以调用APP。例如,调用方可以是一款聊天APP,被调用方可以是提供定位功能的定位PA,聊天APP在需要获取位置信息的时候,需要定位PA提供定位功能服务,这时,聊天APP可以向定位PA发起调用请求。
电子设备100可以响应于接收到的用户操作发起该第一调用请求,也可以自主地发起该第一调用请求,这里不做限制。在一些实施例中,电子设备100可以显示调用方的用户界面,通过触控传感器等输入设备可以检测到用户在用户界面中输入的用户触摸操作,然后电子设备100可以响应于该用户触摸操作发起调用方对被调用方的第一调用请求。
在一些实施例中,电子设备100中可以提前安装有被调用方。在另一些实施例中,电子设备100可以在获取到第一调用请求之后,如果检测到不存在被调用方,可以从网络中下载并安装被调用方,或者电子设备100如果处于分布式系统中的话,也可以从分布式系统中其他电子设备处获取、下载并安装被调用方,本申请实施例对此不作限制。
在一些实施例中,在电子设备100发起第一调用请求之前,电子设备100需要确认第一调用方具有访问被调用方的权限,以及,第一调用方具有访问第一服务的权限。
S102,电子设备100检测是否存在可为第一调用方提供服务的第一沙箱,如果不存在,则执行步骤S103,如果存在,则执行步骤S104。
在本实施例中,被调用方可以针对不同的调用方,提供不同的沙箱。因此电子设备100在获取到第一调用请求后,可以先检测是否已经存在为第一调用方提供服务的第一沙箱。
由于沙箱所占用的系统的资源较多,运行多个沙箱会占用电子设备100中较多的资源,同时在沙箱内部,电子设备分配给沙箱的资源并不能完全利用。因此可以通过沙箱对调用者进行聚类,具体的,可以根据调用者信息进行聚类,具有相同的调用者信息的调用者的服务的实例在同一个沙箱中运行。调用者信息可以包含在步骤S101的第一调用请求中。
调用者信息可以包括以下一项或多项:调用方的应用标识(APP ID),调用方的用户标识(user ID,UID),调用方的开发者签名,调用方所在客体设备的账户标识(account ID),客体设备的设备标识(device ID),所在分布式系统的标识(system ID)等等。其中:
APP ID,可以用于标识APP或功能组件。
开发者签名,可以用于标识APP或功能组件的开发者。
UID,可以用于标识APP或功能组件或实例所属用户。通常情况下,电子设备会为安装的不同APP或功能组件或实例分配不同的UID,以作区分。例如,电子设备可以在一个数据区间(例如10000-40000)内为各个APP分配UID,而在另一个数据区间(例如40001-50000)内为各个功能组件的实例分配UID。
在一些实施例中,电子设备可能为同一开发者开发的各个APP或功能组件分配相同的UID。在另一些实施例中,电子设备也可以为同一开发者开发的各个APP或功能组件分配不同的UID。在一个示例中,安装第一APP时,电子设备分配该第一APP的UID为第三UID,第二APP与第一APP的开发者签名相同,当安装第二APP时,第二APP指示了与第一APP使用相同的UID,电子设备可以给第二APP也分配第三UID。同一个APP或功能组件在不同电子设备中,可能拥有不同的UID。关于电子设备给不同APP或功能组件或实例分配UID的方式或规则,本申请实施例不作任何限制。
account ID,可以用于标识当前登录到电子设备的用户,例如可以是华为账号。
device ID,可以用于标识设备。device ID例如可以是设备的名称、序列号、媒体访问控制(media access control,MAC)地址等等。
system ID可以用于标识当前电子设备所处的分布式系统。在一种实施方案中,实例可以基于UID进行进程隔离。即以UID区分实例,不同实例分配有不同的UID。不同UID的实例为不同调用方提供服务。
以开发者签名为例,当调用方为“华为商城”和“华为音乐”时,电子设备根据“华 为商城”和“华为音乐”这两个APP中的开发者签名,确定使用同一个沙箱为这两个APP提供服务。
S103,电子设备100创建第一沙箱。
如果没有检测到可供第一调用方调用的被调用方的第一沙箱,电子设备100的沙箱创建模块可以创建一个专属为第一调用方提供服务的第一沙箱。在创建沙箱后,电子设备100可以将沙箱与调用方信息进行绑定。
第一沙箱是一个新的独立的运行环境,在电子设备100创建第一沙箱后,需要在第一沙箱中运行第一实例,通过第一沙箱中的第一实例为调用方提供服务,具体的实例运行过程参见步骤S104。
示例性的,沙箱可以由现有的沙箱软件执行,如Sandboxie,Oracle VM VirtualBox,VMware等,也可以由电子设备的控制器自行隔离RAM和NVM资源创建,在此不做限定。
S104,电子设备100在第一沙箱中运行第一实例。
将被调用方的第一实例在第一沙箱的环境中运行,并将被调用方的第一实例产生的应用数据保存在第一沙箱的NVM中。针对步骤S102中将具有相同调用者信息的调用方共用一个沙箱的情况,电子设备100可以通过其实例管理模块在第一沙箱中针对不同的调用方创建不同的实例或共用同一个实例,具体参见步骤S1041-步骤S1042;同时,针对在沙箱中运行的实例产生的应用数据,电子设备100通过其沙箱管理模块,为具有相同的调用者信息的调用方分配不同的目录标识,通过目录标识的形式有区分的管理不同调用方的应用数据。如开发者签名相同的“华为商城”和“华为音乐”,在第一沙箱中分别启动“华为商城”和“华为音乐”2个实例,并将应用数据存储在第一沙箱的NVM中,通过不同的目录管理NVM中的数据,示例性的,均使用调用方信息作为目录标识,如“华为商城”的目录标识为“华为商城”和“华为音乐”的目录标识为“华为音乐”。
在步骤S104中运行第一实例前,该方法还包括:
S1041,电子设备100检测是否存在可为第一调用方提供服务的被调用方的第一实例,如果不存在,则执行步骤S1042,如果存在,则执行步骤S104。
在本实施例中,被调用方可以针对不同调用方,提供不同的实例。因此电子设备100在获取到第一调用请求后,可以先检测是否已经存在为第一调用方提供服务的被调用方的第一实例。
具体实现中,电子设备100中可以存储有多组调用关系,多组调用关系中记录了多组调用方启用实例的调用事件,即不同实例为不同调用方提供服务的情况。这些调用关系可以存储在电子设备100中的调用关系库中,方便后续电子设备100查询是否已经存在为调用方提供服务的实例。
每组 调用关系可以包括:调用方信息,被调用方的实例信息,调用关系标识(identification,ID)等。
在一些实施例中,调用关系可以指示调用权限。即一组调用关系,可以指示该调用方有权限调用该被调用方的实例。
其中,调用关系ID可以用来标识不同的调用关系,方便电子设备100识别。例如在 前述表1中所示例的两组调用关系,分配APP1调用功能组件3的调用关系ID为1,分配APP2调用功能组件3的调用关系ID为2,同理,其他每组调用关系都会分配一个唯一的调用关系ID,方便区分及查询,并可以共享给其他电子设备或同步到分布式系统中。
在一些实施例中,在创建被调用方的实例时,被调用方所在电子设备可以记录该调用关系,或,在调用方发送调用请求时,调用方所在电子设备也可以记录该调用关系。
在一些实施例中,针对同一个调用关系,调用方所在设备和被调用方所在设备可以共享相同的调用关系ID。该调用关系ID可以由主体设备分配,或客体设备分配,并共享给对方设备。
在一些实施例中,在一个电子设备记录了一个调用关系后,可以将该调用关系同步到分布式系统中,分布式系统中的其他设备可以获取到该调用关系。调用方信息可以包括:调用方的应用标识(APP ID)。
调用方信息还可以包括以下一项或多项:调用方的用户标识(user ID,UID),调用方的开发者签名,调用方所在主体设备的账户标识(account ID),主体设备的设备标识(device ID),所在分布式系统的标识(system ID)等等。
被调用方的实例信息可以包括:实例的进程标识(process ID,PID),实例的UID。PID是实例的身份标识,电子设备运行一个实例即会给该实例分配一个唯一的PID,电子设备中的不同的实例对应不同的PID。在每个实例被创建时,电子设备也会给每个实例分配一个UID。相同被调用方的不同实例的UID可以不同,也可以相同,具体根据电子设备的分配情况确定。
例如电子设备100可以为第一实例分配第一PID和第一UID,为第二实例分配第二PID和第二UID。再比如在另一个示例中,被调用方在响应第二调用方的第二调用请求创建第二实例时,该第二调用请求中指示了第二实例的第二UID与第一实例的第一UID相同,那么电子设备给第二实例分配的第二UID就可以与第一实例的第一UID相同。
被调用方的实例信息还可以包括以下一项或多项:被调用方的应用标识(APP ID),被调用方的用户标识(user ID,UID),被调用方的开发者签名,被调用方所在客体设备的账户标识(account ID),客体设备的设备标识(device ID),所在分布式系统的标识(system ID)等等。其中:
在另一种实施方案中,实例可以基于PID进行进程隔离。即以PID区分实例,不同实例分配不同的PID。不同PID的实例为不同调用方提供服务。比如在一些示例中,第一实例与第二实例为被调用方的不同实例,第一实例与第二实例分配有相同UID,但第一实例与第二实例分配有不同PID,第一实例与第二实例分别为不同调用方提供服务。基于PID进行进程隔离,可以保证比基于UID进行进程隔离方案更加严格、更加安全的数据和/或进程的隔离。
上述实例基于UID进行进程隔离、基于PID进行进程隔离的方案仅为示例,对本申请其他实施例不构成任何限制。
在一些实施例中,可以根据上述调用方信息中的一项或多项区分不同调用方。即依据以下一项或多项来区分不同的调用方:调用方的应用标识(APP ID),调用方的UID,调用方的开发者签名,调用方所在主体设备的账户标识(account ID),主体设备的设备标识(device ID),所在分布式系统的标识(system ID)等。在上述一项或多项不相同时,可以区分为不同的调用方。
在一些实施例中,拥有相同开发者签名的不同调用方,可以向被调用方指示共享使 用同一个实例。这样,在保证了隔离数据/进程的情况下,还可以方便同一开发者的应用或功能组件之间进行数据交互,并且可以节省内存的占用、CPU的消耗等。
除了开发者签名,不同调用方也可以根据其他指示信息共享使用同一个实例,如调用方的APP ID、account ID、device ID、system ID等,这里不再一一列举。
在一些实施例中,为了调用关系更严谨、更准确,调用关系的调用方信息和被调用方信息可以包括多项。例如,在一个示例中,第一调用方与被调用方处于分布式系统中,为了更严谨的核实调用关系,该第一调用方与被调用方的调用关系中除了可以记录第一调用方的APP ID,和被调用方的第一实例的UID和/或PID,还可以记录第一调用方所在主体设备ID、被调用方实例所在客体设备ID等信息,这样可以避免分布式系统中其他电子设备上的可能具有相同APP ID的应用或功能组件错误调用或恶意调用第一实例,从而实现更为严格的访问控制。
在本申请实施例中,S101的第一调用请求中可以携带第一调用方信息,以便电子设备100在调用关系库中查找并判断是否存在第一调用方对应的被调用方的第一实例。
如果S1041判断为否,则执行S1042,如果S1041判断为是,则执行S104。
S1042,电子设备100创建第一实例,然后执行步骤S104。
如果没有检测到可供第一调用方调用的被调用方的第一实例,电子设备100的实例创建模块可以创建一个专属为第一调用方提供服务的第一实例,并且进行权限绑定。
第一实例可以在第一沙箱中创建,也可以在电子设备的操作系统中创建,再移动到沙箱中运行。
该第一实例是被调用方的一个特定实例,该第一实例与被调用方其他实例提供的功能、服务、数据相同,但是可供调用的权限不同,比如如果该第一实例只授予了第一调用方调用权限,那么其他应用或功能组件就没有权限调用第一实例。
电子设备100创建该第一实例的同时,可以记录并保存该第一调用方调用第一实例的调用关系及调用权限。具体说明可以参考S1041中的相关描述。
在一些实施例中,电子设备100需要进行权限的鉴定。电子设备100可以去查询第一调用方、被调用方的权限信息,确定第一调用方是否拥有权限调用被调用方的第一实例,以及,第一调用方是否具有访问第一服务的权限,还可以确认第一实例是否为第一调用方所需要调用的实例等。如果确认第一调用方有权限调用第一实例和/或访问第一服务,则运行第一实例,如果没有权限,则向第一调用方返回没有调用权限的结果。在一些实施例中,调用关系可以指示第一调用方是否具有调用第一实例的权限。
在一些实施例中,确认第一调用方是否具有权限调用第一实例和/或访问第一服务的鉴权步骤,可以在运行第一实例之前,或者在创建第一实例之前,或者还可以在发起第一调用请求之前,本申请实施例对鉴权发生的时间条件不作任何限制,鉴权步骤发生在运行第一实例前任何时间点都可,甚至在运行第一实例时,也可以随时查询权限。
一旦发现第一调用方没有权限调用被调用方的第一实例,电子设备100则向第一调用方返回没有调用权限的结果,结束本次调用事件,不再继续后续步骤。
本步骤中创建实例与步骤S103中创建沙箱没有先后顺序,即可以先创建沙箱,在沙箱中创建实例;也可以先在电子设备中创建实例,然后创建沙箱,并在沙箱中运行实例。
本步骤中权限的确认是为了避免不具有调用该第一实例权限的应用或功能组件恶意调用或错误调用第一实例并访问其资源,降低安全风险。
S105,电子设备100响应S101中接收到的第一调用请求,在第一沙箱中通过第一实例为第一调用方提供第一服务。
具体的,在确认第一调用方有权限调用第一实例,并且确认该第一实例的确是第一调用方所需要的调用的实例之后,电子设备100可以在第一沙箱中运行第一实例,响应第一调用请求,允许第一调用方访问第一实例对应提供的第一沙箱中的第一资源,并将访问结果返回给第一调用方。电子设备100提供的第一资源可包括分配给第一沙箱的软件资源、硬件资源等等。
在第一调用方在第一沙箱调用第一实例的同时,电子设备100可以将本次第一调用方调用第一实例的调用事件记录进入审计日志,方便后续追溯调用事件,比如方便在攻击检测后查找原因,或者为可能发生的数据安全事故或安全漏洞查找原因。调用事件中可以包括调用事件发生时间、调用关系ID等信息。
在获取到第一调用方结束调用被调用方的指令后,电子设备100可以释放第一沙箱中第一实例的服务进程,结束第一实例对第一调用方提供的第一服务,提高第一沙箱的资源利用率。
可选的,可在步骤S105后,在第一调用方不再需要调用电子设备100的资源时,电子设备100可以回收第一沙箱的资源,提高电子设备100的资源利用率。
S106,电子设备100发起第二调用请求,该第二调用请求用于第二调用方请求被调用方提供第二服务。如果电子设备100检测到可为第二调用方提供服务的被调用方的第二沙箱,电子设备100在第二沙箱中运行第二实例,为第二调用方提供第二服务,同时电子设备100记录本次第二调用方调用第二实例的调用事件。具体过程可以参考步骤S101-S105中第一调用方调用在第一沙箱中的第一实例的描述,这里不再赘述。
在本实施例中,被调用方可以根据不同调用方在不同的沙箱中运行不同对应的实例,提供不同的服务,比如被调用方可以在第一沙箱中运行第一实例、在第二沙箱中运行第二实例,第一沙箱中的第一实例为第一调用方提供第一服务,第二沙箱中的第二实例为第二调用方提供第二服务,这样可以通过沙箱机制做到不同实例之间的权限、数据保持隔离,数据安全进一步得到提升。
S107,电子设备100发起第三调用请求,该第三调用请求用于第一调用方请求被调用方提供第三服务。如果电子设备100检测到可为第一调用方在第一沙箱中提供服务的被调用方的第一沙箱,电子设备100在第一沙箱中运行第一实例,在第一沙箱中为第一调用方提供第三服务,同时电子设备100记录本次第一调用方调用第一实例的调用事件。具体过程可以参考步骤S101-S105中第一调用方调用第一实例的描述,这里不再赘述。
可选的,为了使第三服务与第一服务的内存数据在保持隔离,或并行提供第三服务与第一服务,可以在第一沙箱中运行两个第一实例,并根据服务的不同对两个第一实例产生的应用数据通过目录标识进行隔离。
对于来自第二调用者的调用请求,与步骤S106中相同,在此不做赘述。
此外,在上述步骤执行过程中,电子设备100可以查询权限信息,确定第一调用方是否拥有权限调用被调用方,如果有,则执行上述步骤,如果没有,则向第一调用方返回没有调用权限的结果。具体的,查询权限信息可以在步骤S101-S107任意一个步骤之 前。
需要说明的是步骤S101-S105,S106和S107中三个调用请求的发起没有先后顺序,可以按照任意顺序发起,或同时发起。
在步骤S101-S107任意一个步骤之前,电子设备100可以去查询第一调用方、被调用方的权限信息,确认调用关系或调用权限中是否指示了第一调用方具有访问被调用方的权限,以及,第一调用方具有访问第一服务的权限,还确认第一实例是否为第一调用方所需要调用的实例。
如果发现第一调用方并没有权限调用第一实例,那么电子设备100可以向第一调用方返回没有调用权限的结果,调用失败。本步骤中权限的确认是为了避免不具有调用该第一实例权限的应用或功能组件恶意调用或错误调用第一实例并访问其资源,降低安全风险。
实施本实施例一提供的方法,被调用方为不同调用方提供服务时,分别在不同的沙箱中运行不同的实例,可以保证不同实例之间权限隔离,位于不同沙箱中的实例之间无法互相访问数据,可以避免被调用方滥用或误用调用方的数据的问题,保障了数据安全。
在本实施例中,当第一调用方向被调用方发起不同的调用请求,请求被调用方提供另外的服务时,电子设备100可以在同一个沙箱中运行相同的实例提供服务。比如步骤S107中,第一调用方请求被调用方提供第三服务,区别于步骤S101中第一调用方请求被调用方提供第一服务,但是被调用方对于同一个第一调用方,可以在第一沙箱中运行同一个第一实例,第一实例可以响应于第一调用请求或第三调用请求,为第一调用方提供第一服务或第三服务。对于第一服务产生的应用数据和第三服务产生的应用数据,电子设备通过沙箱管理模块,通过目录的形式进行区分存储。
电子设备100在同一个沙箱中运行实例时,即会产生该实例对应的内存数据电子设备100在同一个沙箱中运行多个实例,便分别对应多份内存数据,多份内存数据之间相互隔离,不能互相访问,即沙箱内部的实例之间是相互隔离的。
在一些实施例中,可以为通过沙箱区分不同的设备,即同一设备上的不同调用方,可以共用同沙箱。在一个示例中,电子设备100发起第四调用请求,第四调用请求可以携带:第三调用方、被调用方、第四服务的指示信息,其中,第三调用方安装在电子设备100中,第三调用方为应用程序APP或功能组件。响应于第四调用请求,电子设备100在第一沙箱中运行第一实例,第一实例还用于为第三调用方提供第四服务。在本示例中,第三调用方与第一调用方都可以调用第一沙箱中的第一实例。
实施例二
可以理解的是,本申请提供的访问控制的方法还可以实施在分布式系统中多个电子设备之间,发起调用请求的调用方和被调用方可以部署在不同电子设备上。
分布式系统中的各个设备建立通信连接后,各个设备将同步分布式系统中其他设备的功能组件信息以及APP信息等。具体的,各个设备可以将自身安装的功能组件和/或APP的标识、自己的设备信息(例如设备标识)同步到分布式系统中,对其他设备可见,以方便后续在分布式系统中各个设备之间互相调用。每个功能组件或APP能够被哪些调 用方调用,以及,能够调用哪些其他的功能组件或APP,即调用权限和/或被调用权限,可以预先设置并记录在各个电子设备上,并同步在分布式系统中。
本实施例以调用方和被调用方部署在同一分布式系统中的不同电子设备上为例进行说明。
在本实施例中,发起调用请求的调用方部署在电子设备100上,被调用方部署在电子设备200上,电子设备100和电子设备200处于同一个分布式系统中。
同样的,本实施例对调用方、被调用方的类型不作任何限制。调用方的类型可以包括但不限于APP、PA、FA,被调用方的类型可以包括但不限于APP、PA、FA。比如APP可以调用功能组件PA/FA,功能组件PA/FA也可以调用其他功能组件PA/FA,APP也可以调用其他APP,功能组件PA/FA也可以调用APP。
同一个分布式系统中的多个终端设备可以同步各自部署的APP、PA、FA的注册信息、权限信息,以及APP、PA、FA之间的调用关系等信息。其中,
注册信息可以用于标识应用或功能组件,可以包括该应用或功能组件的标识(APP ID),该应用或功能组件所在电子设备的标识(device ID),该应用或功能组件所在电子设备的账户标识(account ID)等信息。
权限信息可以包括该应用或功能组件的调用/访问权限和被调用/被访问权限等信息。
调用关系的相关描述,可以参考实施例一,这里不再赘述。
本实施例提供的示例并不对本申请其他实施例构成任何限制。
图9是本申请实施例提供的访问控制的方法流程图,具体包括步骤如下:
S201,电子设备100向电子设备200发送第一访问请求,该第一访问请求用于电子设备100向电子设备200请求被调用方给第一调用方提供第一服务。
其中,第一调用方部署在电子设备100上,被调用方部署在电子设备200上。
在电子设备100向电子设备200发送第一访问请求之前,电子设备100可以生成第一调用请求,该第一调用请求是第一调用方通知电子设备100其需要被调用方提供第一服务。
本申请实施例对第一服务的类型、内容等不作任何限制。比如电子设备100的第一调用方请求电子设备200的被调用方提供第一资源。该第一资源可以包括电子设备200的软件资源(如美颜算法、定位功能、音视频编解码功能),也可以包括硬件资源(如摄像头、音频设备、显示屏等硬件)。
电子设备100可以根据第一调用请求获取到被调用方所在的电子设备200的标识。
在一些实施例中,第一调用请求中可以包括电子设备100的标识、第一调用方的标识、电子设备200的标识、被调用方的标识等等。电子设备100可以根据第一调用请求,获取到所需调用的被调用方所在的电子设备200的标识。
在另一些实施例中,第一调用请求中不包括被调用方所在电子设备200的标识,那么电子设备100可以在获取到被调用方的标识后,根据被调用方的标识,查询分布式系统中同步的被调用方的注册信息,从而获取到电子设备200的标识。本实施例对电子设备100获取电子设备200标识的方式不作限制。
在获知被调用方所在电子设备200的标识后,电子设备100可以向电子设备200发起第一访问请求,该第一访问请求中可以携带电子设备100的ID、电子设备200的ID、第一调用方ID、被调用方ID、请求第一服务的指令等。
电子设备100可以响应于接收到的用户操作向电子设备200发起该第一访问请求, 也可以自主地向电子设备200发起该第一访问请求,这里不做限制。在一些实施例中,电子设备100可以显示第一调用方的用户界面,通过触控传感器等输入设备可以检测到用户在用户界面中输入的用户操作,然后电子设备100可以响应于用户触摸操作发起对电子设备200的第一访问请求。
在一些实施例中,电子设备200中可以提前安装有被调用方。在另一些实施例中,电子设备200可以在接收到电子设备100发送的第一访问请求之后,从网络中下载并安装被调用方,或者也可以从电子设备100或分布式系统中其他电子设备处获取、下载并安装被调用方,本申请实施例对此不作限制。
在一些实施例中,在电子设备100向电子设备200发送第一访问请求之前,电子设备100需要确认第一调用方具有访问被调用方的权限,以及,第一调用方具有访问第一服务的权限。
S202,获取到电子设备100发送的第一访问请求后,电子设备200检测是否存在可为第一调用方提供服务的被调用方的第一沙箱,如果不存在,则执行步骤S203,如果存在,则执行步骤S204。
在本实施例中,被调用方可以针对不同调用方,提供在不同沙箱中的不同的实例。因此电子设备200在获取到第一访问请求后,可以先检测是否已经存在为电子设备100的第一调用方提供服务的被调用方的第一沙箱。
具体的,电子设备200可以根据第一访问请求中的调用者信息确定是否存在第一沙箱,并对相同的调用者信息的调用者进行聚类。具体的步骤与步骤S102相同,在此不做赘述。
S203,电子设备200创建第一沙箱。
如果没有检测到可供电子设备100的第一调用方调用的沙箱环境,电子设备200的实例创建模块可以创建一个专属为电子设备100的第一调用方提供服务的第一沙箱,并且与第一调用方信息进行绑定。
具体的沙箱创建过程参见步骤S103,在此不做赘述。
S204,电子设备200在第一沙箱中运行第一实例。
将被调用方的第一实例在第一沙箱的环境中运行,并将被调用方的第一实例产生的应用数据保存在第一沙箱的NVM中。针对步骤S202中将具有相同调用者信息的调用方共用一个沙箱的情况,电子设备100可以通过其实例管理模块在第一沙箱中针对不同的调用方创建不同的实例或共用同一个实例,具体参见步骤S1041-步骤S1043;同时,针对在沙箱中运行的实例产生的应用数据,电子设备100通过其沙箱管理模块,为具有相同的调用者信息的调用方分配不同的目录标识,通过目录标识的形式有区分的管理不同调用方的应用数据。
在运行实例前,步骤S204还包括电子设备200创建第一实例的过程,具体的创建实例的过程参见步骤S1041-S1042,在此不做赘述。
S205,电子设备200响应第一访问请求,为电子设备100中的第一调用方提供第一服务。
具体的响应访问请求与步骤S205后回收资源的过程参见步骤S105,在此不做赘述。
分布式系统中其他电子设备可以向电子发送第二请求,具体请参见如下步骤:
S206,电子设备300向电子设备200发起第二访问请求,该第二访问请求用于电子设备300向电子设备200请求被调用方给第二调用方提供第二服务。其中,第二调用方部署在电子设备300上,被调用方部署在电子设备200上。如果电子设备200检测到可为第二调用方提供服务的被调用方的第二沙箱,电子设备200在第二沙箱中运行第二实例,为电子设备300的第二调用方提供第二服务,同时记录本次电子设备300的第二调用方调用电子设备200的第二实例的调用事件。具体过程可以参考步骤S201-S205中电子设备100的第一调用方调用电子设备200的第一沙箱中的第一实例的描述,这里不再赘述。
在另一些实施例中,第二调用方也可以部署在电子设备100上,或者部署在电子设备200上。
在本实施例中,被调用方可以根据不同调用方在不同的沙箱中运行不同对应的实例,提供不同的服务,比如被调用方可以创建有第一实例、第二实例,第一实例为第一调用方提供第一服务,第二实例为第二调用方提供第二服务,通过沙箱的隔离可以做到不同实例之间的权限、数据保持隔离,数据安全进一步得到提升。
S207,电子设备100向电子设备200发起第三访问请求,该第三访问请求用于电子设备100向电子设备200请求被调用方给第一调用方提供第三服务。如果电子设备200检测到可为第一调用方提供服务的被调用方的第一沙箱,电子设备200在第一沙箱中运行第一实例,为电子设备100的第一调用方提供第三服务,同时记录本次电子设备100的第一调用方调用电子设备200的第一实例的调用事件。具体过程可以参考步骤S201-S204中电子设备100的第一调用方调用电子设备200的第一沙箱的描述,这里不再赘述。
在本实施例中,当电子设备100的第一调用方向电子设备200的被调用方发起不同的调用请求,请求被调用方提供另外的服务时,电子设备200在相同的沙箱中运行相同的实例提供服务。比如步骤S206中,电子设备100的第一调用方请求电子设备200的被调用方提供第三服务,区别于步骤S201中电子设备100的第一调用方请求电子设备200的被调用方提供第一服务,但是被调用方对于同一个第一调用方,会运行同一个第一实例,第一实例可以响应于第一调用请求或第三调用请求,为第一调用方提供第一服务或第三服务。
需要说明的是步骤S201-S205,S206和S207中三个调用请求的发起没有先后顺序,可以按照任意顺序发起,或同时发起。
实施本实施例二提供的方法,部署在不同电子设备上的被调用方为不同调用方提供服务时,分别运行不同的沙箱中的不同的实例,可以保证不同实例之间权限隔离,沙箱之间无法相互访问内存数据和应用数据,可以避免被统一沙箱中的调用方滥用或误用调用方的应用数据的问题,保障了数据安全。
可选的,电子设备200可以在第一沙箱中为针对不同的服务创建多个第一实例,并根据服务的不同对两个第一实例产生的应用数据通过目录标识进行隔离。
电子设备100又可称为第一设备,电子设备200又可称为第二设备,电子设备300又可称为第三设备,第一访问请求又可称为第一请求,第二访问请求又可称为第二请求, 第三访问请求又可称为第三请求。
在一些实施例中,同一设备上的不同调用方,可以共用同一个沙箱。在一个示例中,第一设备向第二设备发送第四请求,第四请求可以携带:第三调用方、被调用方、第四服务的指示信息,其中,第三调用方安装在第一设备中,第三调用方为应用程序APP或功能组件。响应于第四请求,第二设备运行第一沙箱中的第一实例,第一实例还用于为第三调用方提供第四服务。在本示例中,第一设备上的第三调用方与第一调用方都可以调用第一沙箱中的第一实例。
在一些实施例中,不同设备上相同调用方,可以共用同一个沙箱中同一个实例。在一个示例中,第四设备向第二设备发起第五请求,第五请求携带:第一调用方、被调用方、第五服务的指示信息,其中,第四设备中安装有第一调用方。响应于第五请求,第二设备在第一沙箱中运行第一实例,第一实例还用于为第四设备的第一调用方提供第五服务。在本示例中,第一设备上的第一调用方,及,第四设备上的第一调用方都可以调用第一实例。
在一些实施例中,不同设备上相同调用方,可以调用同一沙箱中的不同实例。在一个示例中,第一调用方和第二调用方为同一调用方。在本示例中,第一设备的第一调用方可以调用第一沙箱中的第一实例,而第二设备的第一调用方可以调用第一沙箱中的第二实例,第一实例与第二实例不同。第一沙箱通过目录标识区分第一实例和第二实例的应用数据。
在一些实施例中,相同设备上不同调用方,可以调用同一个沙箱中的不同实例。在一个示例中,第一设备和第三设备为同一设备。在本示例中,第一设备的第一调用方可以调用第一沙箱中的第一实例,而第一设备的第二调用方可以调用第一沙箱中的第二实例,第一实例与第二实例不同。第一沙箱通过目录标识区分第一实例和第二实例的应用数据。
实施例三
上述实施例一和实施例二中的访问控制方法,电子设备通过不同的沙箱运行不同的实例为不同的调用方提供服务。通过沙箱机制的应用,使得不同的沙箱之间数据隔离,数据包括内存数据和应用数据,保障了数据安全,尤其是应用数据的安全。在此基础上,实施例三中将沙箱机制应用于应用数据的隔离,具体的系统结构示意图如图10所示。
在图10(A)中,在电子设备中运行功能组件3不同的实例,通过不同的实例为不同的调用方提供服务,通过沙箱将不同实例产生的应用数据进行存储并管理。由于实例运行时,内存数据天然隔离,在沙箱对应用数据存储,通过沙箱管理模块对不同的应用数据设置不同的目录标识管理不同实例对应的应用数据。
在图10(B)中,考虑到通过目录标识管理同一沙箱中的数据依然会有调用方安全的问题,如APP1可能会通过功能组件实例1去访问沙箱中不同目录标识的应用数据。在10(B)中,在电子设备中运行功能组件3不同的实例,通过不同的实例为不同的调用方提供服务,然后为不同的实例创建不同的沙箱将不同实例产生的应用数据进行存储并管理。
进一步的,考虑到创建沙箱会占用电子设备的资源,过多的沙箱会使电子设备负载过大,并且沙箱中的资源在创建后是固定的,沙箱的资源很多时候不能充分的利用。为了解决上述问题可以将图10(B)中的沙箱1和沙箱3合并,将所有的调用方的数据与功能组件3自身运行产生的应用数据隔离,如图10(C)所示。在调用方数据内部,通过目录标 识管理不同调用方产生的应用数据。
对于上述图10(A)和图10(C)的情况,在图6的内部模块层中,可以增加数据托管服务模块,在不同的调用方调用实例时,可以通过数据托管服务模块对调用者的合法性和调用者的操作进行验证,在调用者合法操作正常的情况下,调度沙箱为调用者对应的实例提供应用数据的存储和读取服务。如图10(C)中,为APP1提供服务的功能组件3实例1如果想访问功能组件3实例2的目录标识下的数据,通过数据托管服务模块会对此类操作进行拦截,保证沙箱中应用数据的安全性。
上述分布式系统可以是独立的电子设备,也可以是分布式系统中的一个电子设备或多个电子设备。电子设备中可以安装有各项APP和功能组件。本实施例提供的示例并不对本申请其他实施例构成任何限制。
本实施例对调用方、被调用方的类型不作任何限制。调用方的类型可以包括但不限于APP、PA、FA,被调用方的类型可以包括但不限于APP、PA、FA。比如APP可以调用功能组件PA/FA,功能组件PA/FA也可以调用其他功能组件PA/FA,APP也可以调用其他APP,功能组件PA/FA也可以调用APP。例如,调用方可以是一款聊天APP,被调用方可以是提供定位功能的定位PA,聊天APP在需要获取位置信息的时候,需要定位PA提供定位功能服务,这时,聊天APP可以向定位PA发起调用请求。
上述实施例所描述的实现方式仅为示例性说明,并不对本申请其他实施例构成任何限制。具体内部实现方式可能根据电子设备类型不同、所搭载的操作系统的不同、所使用的程序、所调用的接口的不同而不同,本申请实施例不作任何限制,可以实现本申请实施例所描述的特征功能即可。
上述实施例中所用,根据上下文,术语“当…时”可以被解释为意思是“如果…”或“在…后”或“响应于确定…”或“响应于检测到…”。类似地,根据上下文,短语“在确定…时”或“如果检测到(所陈述的条件或事件)”可以被解释为意思是“如果确定…”或“响应于确定…”或“在检测到(所陈述的条件或事件)时”或“响应于检测到(所陈述的条件或事件)”。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如DVD)、或者半导体介质(例如固态硬盘)等。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来指令相关的硬件完成,该程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括:ROM或随 机存储记忆体RAM、磁碟或者光盘等各种可存储程序代码的介质。
以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。

Claims (40)

  1. 一种访问控制的方法,其特征在于,所述方法应用于通信系统,所述通信系统包括第一设备、第二设备、第三设备,其中,所述第一设备中安装有第一调用方,所述第二设备中安装有被调用方,所述第三设备中安装有第二调用方;所述第一调用方、所述被调用方、所述第二调用方为应用程序或功能组件,所述应用程序为实现多个功能的程序实体,所述功能组件为实现单一功能的程序实体;
    所述方法包括:
    所述第一设备向所述第二设备发送第一请求,所述第一请求携带:所述第一调用方、所述被调用方、第一服务的指示信息;
    响应于所述第一请求,所述第二设备在第一沙箱中运行第一实例,所述第一实例是所述被调用方的实例,所述第一实例用于为所述第一调用方提供所述第一服务;
    所述第三设备向所述第二设备发送第二请求,所述第二请求携带:所述第二调用方、所述被调用方、第二服务的指示信息;
    响应于所述第二请求,所述第二设备在第二沙箱中运行第二实例,所述第二实例是所述被调用方的实例,所述第二实例用于为所述第二调用方提供所述第二服务,所述第二沙箱与所述第一沙箱不同。
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    所述第一设备向所述第二设备发起第三请求,所述第三请求携带:所述第一调用方、所述被调用方、第三服务的指示信息;
    响应于所述第三请求,所述第二设备在所述第一沙箱中运行所述第一实例,所述第一实例还用于为所述第一调用方提供所述第三服务,或,所述第二设备在上述第一沙箱中运行第三实例,所述第三实例用于为第一调用方提供所述第三服务。
  3. 根据权利要求1或2所述的方法,其特征在于,所述方法还包括:
    所述第一设备向所述第二设备发起第四请求,所述第四请求携带:所述第三调用方、所述被调用方、第四服务的指示信息,其中,所述第三调用方安装在所述第一设备中,所述第三调用方为应用程序APP或功能组件;
    响应于所述第四请求,所述第二设备在所述第一沙箱中运行所述第一实例,所述第一实例还用于为所述第三调用方提供所述第四服务,或,所述第二设备在所述第一沙箱中运行第三实例,所述第三实例用于为第三调用方提供所述第四服务。
  4. 根据权利要求1-3任一项所述的方法,其特征在于,所述方法还包括:
    第四设备向所述第二设备发起第五请求,所述第五请求携带:所述第一调用方、所述被调用方、第五服务的指示信息,其中,所述第四设备中安装有所述第一调用方;
    响应于所述第五请求,所述第二设备在第一沙箱中运行所述第一实例,所述第一实例还用于为所述第四设备的所述第一调用方提供所述第五服务,或,所述第二设备在第一沙箱中运行第三实例,所述第三实例用于为第三调用方提供所述第四服务。
  5. 根据权利要求1-4任一项所述的方法,其特征在于,所述第一调用方和所述第二 调用方相同。
  6. 根据权利要求1-5任一项所述的方法,其特征在于,所述第一设备和所述第三设备为同一设备。
  7. 根据权利要求1-6任一项所述的方法,其特征在于,
    在所述第二设备运行第一实例之前,所述方法还包括:
    所述第二设备检测是否存在所述第一沙箱,如果不存在,则所述第二设备创建所述第一沙箱;
    在所述第二设备运行第二实例之前,所述方法还包括:
    所述第二设备检测是否存在所述第二沙箱,如果不存在,则所述第二设备创建所述第二沙箱。
  8. 根据权利要求7所述的方法,其特征在于,
    所述第二设备在所述第一沙箱中运行所述第一实例,包括:所述第二设备创建所述第一实例,并在所述第一沙箱中运行所述第一实例;
    所述第二设备在所述第二沙箱中运行所述第二实例,包括:所述第二设备创建所述第二实例,并在所述第二沙箱中运行所述第二实例。
  9. 根据权利要求8所述的方法,其特征在于,
    所述第二设备创建所述第一实例后,在所述第二设备存储第一调用关系,所述第一调用关系包括:所述第一调用方的信息,所述第一实例的信息,所述第一调用关系的标识;
    所述第二设备创建所述第二实例后,在所述第二设备存储第二调用关系,所述第二调用关系包括:所述第二调用方的信息,所述第二实例的信息,所述第二调用关系的标识。
  10. 根据权利要求9所述的方法,其特征在于,
    在所述第一设备向所述第二设备发送第一请求之后,所述方法还包括:所述第一设备存储所述第一调用关系;
    在所述第三设备向所述第二设备发送第二请求之后,所述方法还包括:所述第三设备存储所述第二调用关系。
  11. 根据权利要求9-10任意一项所述的方法,其特征在于,
    所述第一调用方的信息包括以下一项或多项:所述第一调用方的应用标识,所述第一调用方的用户标识UID,所述第一调用方的开发者签名,所述第一调用方所在所述第一设备的账户标识,所述第一设备的标识,所述第一调用方所在所述通信系统的标识;
    所述第一实例的信息包括:所述第一实例的进程标识第一PID,所述第一实例的用户标识第一UID;
    所述方法还包括:
    在所述第二设备创建所述第一实例时,所述第二设备为所述第一实例分配所述第一 PID,或,所述第一UID。
  12. 根据权利要求8-11中任一项所述的方法,其特征在于,
    所述第一实例的信息还包括以下一项或多项:所述被调用方的应用标识,所述被调用方的用户标识UID,所述被调用方的开发者签名,所述被调用方所在所述第二设备的账户标识,所述第二设备的标识,所述第一实例所在所述通信系统的标识。
  13. 根据权利要求1-12中任一项所述的方法,其特征在于,所述第一请求还携带所述第一设备的标识、所述第二设备的标识。
  14. 根据权利要求1-13中任一项所述的方法,其特征在于,所述第二设备运行第一实例之后,所述方法还包括:
    所述第二设备生成第一结果;
    所述第二设备将所述第一结果返回给所述第一设备;
    所述第一设备运行所述第一调用方处理所述第一结果。
  15. 根据权利要求1-14中任一项所述的方法,其特征在于,在所述第二设备运行第一实例之前,所述方法还包括:
    所述第二设备确认所述第一调用方具有访问所述第一实例的权限。
  16. 根据权利要求1-15中任一项所述的方法,其特征在于,在所述第二设备运行第一实例之前,所述方法还包括:
    所述第二设备确认所述第一调用方具有请求所述被调用方提供所述第一服务的权限。
  17. 根据权利要求1-16中任一项所述的方法,其特征在于,在所述第一设备向所述第二设备发送第一请求之前,所述方法还包括:
    所述第一设备确认所述第一调用方具有访问所述被调用方的权限。
  18. 根据权利要求1-17中任一项所述的方法,其特征在于,所述第一设备、所述第二设备、所述第三设备为同一设备。
  19. 根据权利要求1-18中任意一项所述的方法,其特征在于,所述第二设备中存储有所述第一沙箱与所述第一调用方的映射关系;所述第二设备中存储有所述第二沙箱与所述第二调用方的映射关系。
  20. 一种访问控制的方法,其特征在于,所述方法应用于第二设备,所述第二设备位于通信系统中,所述通信系统包括第一设备、第二设备、第三设备,其中,所述第一设备中安装有第一调用方,所述第二设备中安装有被调用方,所述第三设备中安装有第二调用方;所述第一调用方、所述被调用方、所述第二调用方为应用程序或功能组件,所述应用程序为实现多个功能的程序实体,所述功能组件为实现单一功能的程序实体;
    所述方法包括:
    所述第二设备接收所述第一设备发送的第一请求,所述第一请求携带:所述第一调用方、所述被调用方、第一服务的指示信息;
    响应于所述第一请求,所述第二设备在第一沙箱中运行第一实例,所述第一实例是所述被调用方的实例,所述第一实例用于为所述第一调用方提供所述第一服务;
    所述第二设备接收所述第三设备发送的第二请求,所述第二请求携带:所述第二调用方、所述被调用方、第二服务的指示信息;
    响应于所述第二请求,所述第二设备在第二沙箱中运行第二实例,所述第二实例是所述被调用方的实例,所述第二实例用于为所述第二调用方提供所述第二服务,所述第二沙箱与所述第一沙箱不同。
  21. 根据权利要求20所述的方法,其特征在于,所述方法还包括:
    所述第二设备接收所述第一设备发送的第三请求,所述第三请求携带:所述第一调用方、所述被调用方、第三服务的指示信息;
    响应于所述第三请求,所述第二设备在所述第一沙箱中运行所述第一实例,所述第一实例还用于为所述第一调用方提供所述第三服务,或,所述第二设备在上述第一沙箱中运行第三实例,所述第三实例用于为第一调用方提供所述第三服务。
  22. 根据权利要求20或21所述的方法,其特征在于,所述方法还包括:
    所述第二设备接收到所述第一设备发送的第四请求,所述第四请求携带:所述第三调用方、所述被调用方、第四服务的指示信息,其中,所述第三调用方安装在所述第一设备中,所述第三调用方为应用程序APP或功能组件;
    响应于所述第四请求,所述第二设备在所述第一沙箱中运行所述第一实例,所述第一实例还用于为所述第三调用方提供所述第四服务,或,所述第二设备在所述第一沙箱中运行第三实例,所述第三实例用于为第三调用方提供所述第四服务。
  23. 根据权利要求20-22任一项所述的方法,其特征在于,所述方法还包括:
    所述第二设备接收所述第四设备发送的第五请求,所述第五请求携带:所述第一调用方、所述被调用方、第五服务的指示信息,其中,所述第四设备中安装有所述第一调用方;
    响应于所述第五请求,所述第二设备在第一沙箱中运行所述第一实例,所述第一实例还用于为所述第四设备的所述第一调用方提供所述第五服务,或,所述第二设备在第一沙箱中运行第三实例,所述第三实例用于为第三调用方提供所述第四服务。
  24. 根据权利要求20-23任一项所述的方法,其特征在于,所述第一调用方和所述第二调用方相同。
  25. 根据权利要求20-24任一项所述的方法,其特征在于,所述第一设备和所述第三设备为同一设备。
  26. 根据权利要求20-25任一项所述的方法,其特征在于,
    在所述第二设备运行第一实例之前,所述方法还包括:
    所述第二设备检测是否存在所述第一沙箱,如果不存在,则所述第二设备创建所述第一沙箱;
    在所述第二设备运行第二实例之前,所述方法还包括:
    所述第二设备检测是否存在所述第二沙箱,如果不存在,则所述第二设备创建所述第二沙箱。
  27. 根据权利要求26所述的方法,其特征在于,
    所述第二设备在第一沙箱中运行所述第一实例,包括:所述第二设备创建所述第一实例,并在所述第一沙箱中运行所述第一实例;
    所述第二设备在第二沙箱中运行所述第二实例,包括:所述第二设备创建所述第二实例,并在所述第二沙箱中运行所述第二实例。
  28. 根据权利要求27所述的方法,其特征在于,
    所述第二设备创建所述第一实例后,在所述第二设备存储第一调用关系,所述第一调用关系包括:所述第一调用方的信息,所述第一实例的信息,所述第一调用关系的标识;
    所述第二设备创建所述第二实例后,在所述第二设备存储第二调用关系,所述第二调用关系包括:所述第二调用方的信息,所述第二实例的信息,所述第二调用关系的标识。
  29. 根据权利要求28所述的方法,其特征在于,
    所述第一调用方的信息包括以下一项或多项:所述第一调用方的应用标识,所述第一调用方的用户标识UID,所述第一调用方的开发者签名,所述第一调用方所在所述第一设备的账户标识,所述第一设备的标识,所述第一调用方所在所述通信系统的标识;
    所述第一实例的信息包括:所述第一实例的进程标识第一PID,所述第一实例的用户标识第一UID;
    所述方法还包括:
    在所述第二设备创建所述第一实例时,所述第二设备为所述第一实例分配所述第一PID,或,所述第一UID。
  30. 根据权利要求28或29所述的方法,其特征在于,
    所述第一实例的信息还包括以下一项或多项:所述被调用方的应用标识,所述被调用方的用户标识UID,所述被调用方的开发者签名,所述被调用方所在所述第二设备的账户标识,所述第二设备的标识,所述第一实例所在所述通信系统的标识。
  31. 根据权利要求20-30中任一项所述的方法,其特征在于,所述第一请求还携带所述第一设备的标识、所述第二设备的标识。
  32. 根据权利要求20-31中任一项所述的方法,其特征在于,所述第二设备运行第一实例之后,所述方法还包括:
    所述第二设备生成第一结果;
    所述第二设备将所述第一结果返回给所述第一设备,所述第一结果用于所述第一设备运行所述第一调用方处理。
  33. 根据权利要求20-32中任一项所述的方法,其特征在于,在所述第二设备运行第一实例之前,所述方法还包括:
    所述第二设备确认所述第一调用方具有访问所述第一实例的权限。
  34. 根据权利要求20-33中任一项所述的方法,其特征在于,在所述第二设备运行第一实例之前,所述方法还包括:
    所述第二设备确认所述第一调用方具有请求所述被调用方提供所述第一服务的权限。
  35. 根据权利要求20-34中任一项所述的方法,其特征在于,所述第一设备、所述第二设备、所述第三设备为同一设备。
  36. 根据权利要求20-35中任意一项所述的方法,其特征在于,所述第二设备中存储有所述第一沙箱与所述第一调用方的映射关系;所述第二设备中存储有所述第二沙箱与所述第二调用方的映射关系。
  37. 一种电子设备,其特征在于,所述电子设备包括:通信装置、存储器以及耦合于所述存储器的处理器,多个应用程序,以及一个或多个程序;所述存储器中存储有计算机可执行指令,所述处理器执行所述指令时使得所述电子设备实现如权利要求20至36中任一项所述的方法。
  38. 一种通信系统,其特征在于,所述通信系统包括:第一设备、第二设备和第三设备,其中,所述第一设备、所述第二设备和所述第三设备配合执行如权利要求1至19中任一项所述的方法。
  39. 一种计算机可读存储介质,包括指令,其特征在于,当所述指令在电子设备上运行时,使得所述电子设备执行如权利要求20至36任一项所述的方法。
  40. 一种包含指令的计算机程序产品,其特征在于,当所述计算机程序产品在电子设备上运行时,使得所述电子设备执行如权利要求20至36任一项所述的方法。
PCT/CN2022/081882 2021-03-23 2022-03-21 一种访问控制的方法、电子设备及系统 WO2022199499A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP22774160.0A EP4280090A1 (en) 2021-03-23 2022-03-21 Access control method, electronic device, and system
US18/551,721 US20240176872A1 (en) 2021-03-23 2022-03-21 Access Control Method, Electronic Device, and System

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN202110307174 2021-03-23
CN202110307174.2 2021-03-23
CN202110774899.2 2021-07-09
CN202110774899.2A CN115114619A (zh) 2021-03-23 2021-07-09 一种访问控制的方法、电子设备及系统

Publications (1)

Publication Number Publication Date
WO2022199499A1 true WO2022199499A1 (zh) 2022-09-29

Family

ID=83324519

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/081882 WO2022199499A1 (zh) 2021-03-23 2022-03-21 一种访问控制的方法、电子设备及系统

Country Status (4)

Country Link
US (1) US20240176872A1 (zh)
EP (1) EP4280090A1 (zh)
CN (1) CN115114619A (zh)
WO (1) WO2022199499A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117252558B (zh) * 2023-11-17 2024-01-19 南京特沃斯清洁设备有限公司 基于人脸识别的清洁设备管理方法及系统

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120297492A1 (en) * 2011-05-16 2012-11-22 Gary Court System and method of integrating modules for execution on a computing device and controlling during runtime an ability of a first module to access a service provided by a second module
CN107102888A (zh) * 2017-04-25 2017-08-29 华中科技大学 一种基于硬件虚拟化技术的共享库隔离保护方法及系统
CN108763921A (zh) * 2018-05-29 2018-11-06 北京迪诺益佳信息科技有限公司 一种应用软件和sdk管控的方法
CN108932427A (zh) * 2018-05-18 2018-12-04 华中科技大学 一种Android应用多开环境中限制访问的控制方法及系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120297492A1 (en) * 2011-05-16 2012-11-22 Gary Court System and method of integrating modules for execution on a computing device and controlling during runtime an ability of a first module to access a service provided by a second module
CN107102888A (zh) * 2017-04-25 2017-08-29 华中科技大学 一种基于硬件虚拟化技术的共享库隔离保护方法及系统
CN108932427A (zh) * 2018-05-18 2018-12-04 华中科技大学 一种Android应用多开环境中限制访问的控制方法及系统
CN108763921A (zh) * 2018-05-29 2018-11-06 北京迪诺益佳信息科技有限公司 一种应用软件和sdk管控的方法

Also Published As

Publication number Publication date
US20240176872A1 (en) 2024-05-30
EP4280090A1 (en) 2023-11-22
CN115114619A (zh) 2022-09-27

Similar Documents

Publication Publication Date Title
WO2022179379A1 (zh) 一种访问控制方法、电子设备及系统
WO2020238728A1 (zh) 智能终端的登录方法及电子设备
WO2022068483A1 (zh) 应用启动方法、装置和电子设备
EP4084486A1 (en) Cross-device content projection method, and electronic device
WO2020150917A1 (zh) 一种应用权限的管理方法及电子设备
WO2021253975A1 (zh) 应用程序的权限管理方法、装置和电子设备
WO2021052204A1 (zh) 基于通讯录的设备发现方法、音视频通信方法及电子设备
WO2022089121A1 (zh) 处理推送消息的方法和装置
WO2022022422A1 (zh) 一种权限管理方法及终端设备
WO2022253158A1 (zh) 一种用户隐私保护方法及装置
WO2022199499A1 (zh) 一种访问控制的方法、电子设备及系统
WO2022199672A1 (zh) 精准撤销权限的访问控制方法、相关装置及系统
WO2022188683A1 (zh) 灵活授权的访问控制方法、相关装置及系统
WO2022247626A1 (zh) 基于应用身份的访问控制方法、相关装置及系统
WO2022111469A1 (zh) 一种文件共享方法、装置及电子设备
WO2023284555A1 (zh) 安全调用服务的方法、安全注册服务的方法及装置
CN115238299A (zh) 基于安全等级的访问控制方法、相关装置及系统
CN115114637A (zh) 基于权限传递的访问控制方法、相关装置及系统
CN115203731A (zh) 基于安全敏感度的访问控制方法、相关装置及系统
CN115203716A (zh) 权限同步方法、相关装置及系统
WO2022194156A1 (zh) 分布式的访问控制方法、相关装置及系统
WO2023179682A1 (zh) 一种设备协同方法
WO2022068578A1 (zh) 文件共享方法和电子设备
WO2023142935A1 (zh) 应用组件管理方法及相关设备
WO2022267656A1 (zh) 组件访问方法和装置、计算机可读存储介质以及芯片

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22774160

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2022774160

Country of ref document: EP

Effective date: 20230818

WWE Wipo information: entry into national phase

Ref document number: 18551721

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE