A method and electronic device for managing virtualization services

CN120256157BActive Publication Date: 2026-10-23HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311808845.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-25
Publication Date
2026-10-23
Estimated Expiration
2043-12-25

AI Technical Summary

Technical Problem

随着安卓版本的发展,以及系统层服务的实现方式及开放要求不同,原来基于安卓架构开放的基础程序框架,无法支持不同版本的虚拟化服务

Benefits of technology

[0041]第五方面,本申请实施例提供了一种芯片系统,该芯片系统应用于电子设备,该芯片系统包括一个或多个处理器,该处理器用于调用计算机指令以使得该电子设备执行如第一方面以及第一方面中任一可能的实现方式描述的方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120256157B_ABST
    Figure CN120256157B_ABST
Patent Text Reader

Abstract

A method and an electronic device for managing virtualization services, applied to the field of calling virtualization services. Optionally, applied to the scenario that a first electronic device establishes a collaborative connection with a second electronic device. The method comprises: in response to the operation of the user confirming the establishment of the collaborative connection with the second electronic device, triggering the enabling of a first virtualization service, the first virtualization service calling a first process service in a system layer; the first electronic device querying a version type supported by the system layer; when the first process service supports an AIDL process, calling an AIDL process service; and when the first process service supports an HIDL process, calling an HIDL process service. The embodiments of the present application can support process services of different version types. Moreover, the embodiments of the present application also support dynamically updating the version type of the process service; in the process of dynamically updating the version, the process service being used is not affected; and the latest updated version service can be used without waiting when the process service is called next time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of terminal technology, and more specifically, to a method and electronic device for managing virtualization services. Background Technology

[0002] With the development of smart terminal technology, some smart terminal services can be implemented by calling virtualization services. Taking multi-screen collaboration as an example, when a user uses a phone with a virtual camera function for video calls but also needs to use a computer for work, they can use multi-screen collaboration between the phone and computer, allowing the computer to control the phone for video calls. However, with the development of Android versions and the different implementation methods and open requirements of system-level services, the original basic program framework based on the Android architecture can no longer support virtualization services from different versions. Summary of the Invention

[0003] In view of this, this application provides a method for managing virtualization services, an electronic device, a computer-readable storage medium, and a computer program product capable of supporting different versions of process services.

[0004] In a first aspect, a method for managing virtualization services is provided, applied to a first electronic device, the method comprising:

[0005] When establishing a collaborative connection with a second electronic device in any of the following ways: receiving a collaborative connection request from the second electronic device, scanning a QR code for establishing a collaborative connection, connecting to the second electronic device via a wired interface, displaying a first interface, the first interface including a first window, the first window including a first control;

[0006] In response to the user clicking the first control, the first virtualization service is enabled, and the first virtualization service calls the first process service in the system layer;

[0007] Obtain the version information corresponding to the first process service, wherein the version information includes the version types supported by the process service;

[0008] When the first process service supports the first system version, the first process service under the first system version is invoked.

[0009] Alternatively, if the first process service supports the second system version, the first process service under the second system version can be called;

[0010] The first process service under the first system version and the first process service under the second system version are different version types of services.

[0011] Optionally, the first process service under the first system version is the HIDL process service, and the first process service under the second system version is the AIDL process service.

[0012] The above method can be executed by a first electronic device or a chip within the first electronic device. Based on the above scheme, when the first electronic device and the second electronic device confirm the establishment of a cooperative connection, a first virtualization service is enabled, and the first virtualization service calls a first process service in the system layer; the first electronic device queries the version types supported by the system layer; if the first process service supports AIDL processes, it calls the AIDL process service; if the first process service supports HIDL processes, it calls the HIDL process service. This application embodiment can support process services of different version types.

[0013] Optionally, the version information can be saved when the first process service is loaded for the first time.

[0014] In some possible implementations, the method further includes:

[0015] Enable the second virtualization service, which calls the same process service in the system layer as the first virtualization service;

[0016] The version information corresponding to the first process service is obtained by querying the mapping table; wherein, the mapping table includes the version information corresponding to the first process service, and the mapping table is saved when the first process service is first loaded.

[0017] Since the version information is saved during the initial load, when other virtualization services that call the first process service (such as the second virtualization service) are enabled subsequently, the saved version information can be directly queried and used without having to check the service repeatedly, thus reducing the number of times the system layer is accessed.

[0018] In some possible implementations, the first virtualization service is a media audio speaker service, and the second virtualization service is a call audio speaker service. Both the media audio speaker service and the call audio speaker service call audio services in the system layer.

[0019] This application's embodiments support calls to the old version of the process service (HIDL process service), or in other words, are compatible with calls to both the old and new versions of the process service. The following description uses the example of the camera virtualization service calling a second process service that supports the old version.

[0020] In some possible implementations, the method further includes:

[0021] When camera-related services are detected, the camera virtualization service is enabled, and the camera virtualization service calls the second process service in the system layer.

[0022] Obtain the version information corresponding to the second process service;

[0023] In response to the version information corresponding to the second process service being the first system version, the second process service under the first system version (e.g., camera HIDL service) is invoked.

[0024] In some possible implementations, before obtaining the version information corresponding to the second process service, the method further includes:

[0025] In response to the system version update operation, the version information corresponding to the second process service is updated, and the updated version information of the second process service is the second system version.

[0026] Optionally, the second process service under the first system version is the HIDL process service, and the second process service under the second system version is the AIDL process service.

[0027] In some possible implementations, the method further includes:

[0028] In response to the notification to exit the camera virtualization service, delete the version information corresponding to the second process service;

[0029] In response to the operation of triggering the camera virtualization service again, the second process service (e.g., camera AIDL service) under the second system version is invoked; wherein, when the camera virtualization service is triggered again, the update process of the version information corresponding to the second process service has been completed.

[0030] Before checking the version information of the second process service, a system version update can be performed to update the second process service from the HIDL process to the AIDL process. Since performing a system version update requires a certain amount of time, it may still be updating when the second process service is currently used; alternatively, the version update process may be completed by the next time the second process service is called. In other words, during the system update process, users do not need to interrupt their current service use and can continue to use the old version of the process service to perform business operations without affecting the user's current business. Furthermore, the latest updated version can be used the next time the second process service is called.

[0031] In some possible implementations, in response to an operation to update the system version, the version information corresponding to the second process service is updated, including:

[0032] In response to the user's click to update the system control, the version information corresponding to the second process service is updated;

[0033] Alternatively, when the conditions for automatic update are met, the system version update is performed automatically, which includes updating the version information corresponding to the second process service.

[0034] In some possible implementations, the first electronic device invokes a virtualization service in the system layer through a first interface. This first interface executes the following process: packaging multiple commands in the main process and then passing the resulting JSON file to the system layer, whereby the system layer parses the JSON file to obtain multiple parsed signaling messages. Dynamic compatibility with system versions can be achieved through this first interface.

[0035] In some possible implementations, the first electronic device includes an application framework layer; a first module in the application framework layer loads a binary file from a system component module via a first calling method based on a unified protocol interface. The first calling method can be understood as a unified calling method. Compared to existing technologies that load two binaries using two JNI calling methods, the first calling method allows the application framework layer to load only one binary file.

[0036] In a second aspect, an electronic device is provided, including a unit for performing any of the methods in the first aspect. The electronic device may be a terminal or a chip within a terminal. The electronic device includes a communication unit, a display unit, and a processing unit.

[0037] When the electronic device is a terminal, the processing unit may be a processor, the communication unit may be a communication interface, and the display unit may be a graphics processing module and a screen; the terminal may also include a memory for storing computer program code, which, when the processor executes the computer program code stored in the memory, causes the terminal to perform any of the methods in the first aspect.

[0038] When the electronic device is a chip within a terminal, the processing unit can be a logic processing unit inside the chip, the communication unit can be a communication interface, pins, or circuits, and the display unit can be a graphics processing unit inside the chip. The chip may also include a memory, which can be memory within the chip (e.g., registers, caches, etc.) or memory located outside the chip (e.g., read-only memory, random access memory, etc.). The memory is used to store computer program code, and when the processor executes the computer program code stored in the memory, it causes the chip to execute any of the methods in the first aspect.

[0039] Thirdly, a computer-readable storage medium is provided that stores computer program code, which, when executed by an electronic device, causes the electronic device to perform any of the methods in the first aspect.

[0040] Fourthly, a computer program product is provided, the computer program product comprising: computer program code, which, when executed by an electronic device, causes the electronic device to perform any of the methods in the first aspect.

[0041] Fifthly, embodiments of this application provide a chip system applied to an electronic device. The chip system includes one or more processors, which are configured to invoke computer instructions to cause the electronic device to perform the methods described in the first aspect and any possible implementation thereof.

[0042] Understandably, the electronic device provided in the second aspect, the computer-readable storage medium provided in the third aspect, the computer program product provided in the fourth aspect, and the chip system provided in the fifth aspect are all used to execute the method provided in this application. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods, and will not be repeated here. Attached Figure Description

[0043] Figure 1 This is an example diagram illustrating an application scenario of an embodiment of this application;

[0044] Figure 2 This is a software architecture diagram provided in the embodiments of this application;

[0045] Figure 3 This is a schematic block diagram of the relay layer module in the system according to an embodiment of this application;

[0046] Figure 4 This is a schematic block diagram of the scheduling scheme provided in the embodiments of this application;

[0047] Figure 5A This is a timing example diagram of enabling virtualization services provided in an embodiment of this application;

[0048] Figure 5B This is an example diagram of a user confirmation interface for collaborative connections according to an embodiment of this application;

[0049] Figure 5C This is another example diagram of a user-confirmed collaborative connection interface in an embodiment of this application;

[0050] Figure 6A This is another timing example diagram of a virtualization service provided in the embodiments of this application;

[0051] Figure 6BThis is a sample screenshot of the interface for a system update;

[0052] Figure 6C This is an example screenshot of a system update notification received when a mobile phone and a laptop are connected together.

[0053] Figure 6D This is an example screenshot of an interface where users set conditions for automatic system updates;

[0054] Figure 7 This is an example diagram of a new interface process provided in an embodiment of this application;

[0055] Figure 8 This is an example diagram illustrating a calling method provided in an embodiment of this application;

[0056] Figure 9 This is a flowchart illustrating a method for managing virtualization services provided in an embodiment of this application.

[0057] Figure 10 This is a schematic diagram of the structure of an electronic device applicable to this application. Detailed Implementation

[0058] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.

[0059] In the embodiments of this application, unless otherwise stated, "multiple" can mean two or more.

[0060] This application applies to electronic devices, including mobile phones, smart screens, tablets, wearable electronic devices, in-vehicle electronic devices, augmented reality (AR) devices, virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), projectors, artificial intelligence (AI) devices, wearable devices, in-vehicle devices, smart home devices, and / or smart city devices, etc. This application does not impose any special limitations on the specific type of electronic device.

[0061] This application applies to electronic devices that support virtualization functions or invoke virtualization capabilities. Virtualization functions perform upper and lower layer scheduling at the level of virtualization services. In some embodiments, the electronic device supports multiple virtualization services. Optionally, virtualization services include audio virtualization services (or virtual audio services), video virtualization services (or virtual video services), and so on. For example, audio virtualization services include virtual microphone services, virtual speaker services, etc. Similarly, video virtualization services include virtual camera services, etc.

[0062] This application does not specifically limit the services that schedule or trigger virtualization services. For example, when a user uses multi-screen collaboration services, super notification services, super call services, or office services, the electronic device triggers virtualization services.

[0063] In some application scenarios, taking multi-screen collaboration as an example, the first electronic device acts as the master device and can establish a communication connection with one or more second electronic devices, where one or more second electronic devices act as slave devices.

[0064] This application does not specifically limit the communication connection method between the first electronic device and the second electronic device. The communication connection between the first electronic device and the second electronic device can be a wired connection (e.g., a connection via a USB cable) or a wireless connection. A wired connection refers to a connection established through a wired interface. Wired interfaces include, but are not limited to: Universal Serial Bus (USB) interface, Ethernet interface, High Definition Multimedia Interface (HDMI) interface, Video Graphics Array (VGA) interface, Digital Visual Interface (DVI) interface, serial interface, etc. A wireless connection refers to a connection established through a wireless communication interface. Wireless connections include, but are not limited to: Wireless Fidelity (Wi-Fi) connection, Bluetooth connection, infrared connection, NFC connection, ZigBee connection, and other short-range connections, as well as long-range connections (long-range connections include, but are not limited to, mobile networks supporting 2G, 3G, 4G, 5G, 6G, and subsequent standard protocols). For example, the master device and the slave device can log in to the same user account (e.g., the user's Honor account) and then connect remotely through a server (e.g., a multi-device collaboration server provided by Honor).

[0065] The following combination Figure 1 The application scenarios will be explained. For example... Figure 1As shown, when user A is making a video call with user B (using mobile phone 103) using mobile phone 102, they also need to handle some work using laptop 101 simultaneously. For ease of operation, user A can enable multi-screen collaboration between mobile phone 102 (corresponding to the first electronic device) and laptop 101 (corresponding to the second electronic device). After establishing a collaborative connection between mobile phone 102 and laptop 101, the audio and video from mobile phone 102 can be switched to laptop 101. At this time, user A can control mobile phone 102 to make video calls through laptop 101.

[0066] After the mobile phone 102 establishes a collaborative connection with the laptop 101, the audio and video from the mobile phone 102 will switch to the laptop 101. Optionally, an option may pop up on the mobile phone 102 for the user to decide whether to switch the audio and video to the laptop 101. If the user confirms the switch, then the microphone audio will be captured from the laptop 101. If user B (who is having a video call with user A) makes a sound, then user B's sound will also be played from the laptop 101's speaker. At the same time, the camera view from the mobile phone 102 will also switch to the camera view from the laptop 101.

[0067] like Figure 1 As shown, interface 11 displayed on mobile phone 102 is the interface after mobile phone 102 and mobile phone 103 establish a video call connection. After mobile phone 102 collaborates with laptop 101, the interface displayed on laptop 101 includes interface 10. Interface 10 is the same as, or synchronized with, interface 11 displayed on mobile phone 102.

[0068] exist Figure 1 In the multi-screen collaboration scenario shown, mobile phone 102 achieves collaboration with laptop computer 101 by calling virtualized audio and video services (including virtualized audio services and virtualized video services).

[0069] It should be noted that, Figure 1 The description only uses multi-screen collaboration as an example, and the embodiments in this application are not limited thereto.

[0070] It should also be noted that the virtualization services called by the mobile phone may be the same or different for different types of services, and this application embodiment does not limit this.

[0071] It should be understood that Figure 1 The application scenarios shown are only examples of mobile phones and laptops, and the embodiments of this application are not limited to these. For example, mobile phones and tablets, mobile phones and smart screens, and mobile phones and mobile phones are also applicable to the embodiments of this application.

[0072] This application provides a method for managing virtualization services. By adding modules (at least including a system relay layer) to the application framework layer of the software architecture and modifying the scheduling process of virtualization services, it supports the normal operation of different service versions within the same system. The following will combine... Figure 2 The software architecture shown in the figure describes the relevant modules involved in the embodiments of this application.

[0073] Figure 2 This is an architecture diagram of the software system provided in the embodiments of this application. The software system can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. The embodiments of this application use a layered architecture as an example to exemplarily describe the software system of an electronic device.

[0074] like Figure 2 As shown, a layered software system is divided into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the software system can be divided into five layers, from top to bottom: application layer, application framework layer, system layer, extension layer, and kernel layer (Linux kernel).

[0075] The application layer may include multiple applications, or a series of application packages (APKs). In this embodiment, as... Figure 2 As shown, the application layer includes instant messaging software and multi-screen collaboration applications. Instant messaging software can be a system application or a third-party application, such as social applications like WeChat and QQ. In some embodiments, the multi-screen collaboration application is a system application.

[0076] For example, such as Figure 2 As shown, the application layer can also include gallery, map, Wi-Fi, Bluetooth, SMS, music, calls, navigation, video, and camera.

[0077] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer may include some predefined functions.

[0078] In this embodiment of the application, the application framework layer provides functional modules for managing virtualization services. For example... Figure 2As shown, the application framework layer includes an interconnection service module. The interconnection service module includes an interface layer module, a connection layer module, and a system relay layer. Optionally, the application framework layer includes a distributed mobile sensing development platform (DMSDP) framework layer; the DMSDP framework layer includes the interconnection service module.

[0079] The interface layer module in the interconnect service provides interfaces to enable communication between the interconnect service module and the upper layer (application layer). For example, the interface layer module receives requests from the application layer. Or, the interface layer module sends signaling or data to the application layer. For instance, the interface layer module is the DMSDP software development kit (SDK) interface layer module.

[0080] The connection layer module is an intermediate conversion layer used to connect the interface layer module and the system relay layer. The connection layer module can also be called a DMSDP (Wrapper) connection layer. When the system relay layer is loaded for the first time, it obtains the service versions supported by the system layer and converts the corresponding service versions. For example, it converts the Android interface definition language (AIDL) service to V2 and the Hardware abstraction layer interface definition language (HIDL) service to V1.

[0081] AIDL is a description language for Android's internal inter-process communication interfaces. It defines communication interfaces between processes, enabling inter-process communication. AIDL is a solution in the Android architecture for implementing remote procedure calls (RPC).

[0082] The system relay layer is used to perform appropriate processing when application-layer services call back virtualization services. For example, the system relay layer is the DMSDP system relay layer.

[0083] In some embodiments, the system relay layer is used to update the version controller (e.g., based on the AIDL and HIDL service configurations in the system layer) according to the system layer's configuration. Figure 3 (The version control module shown in the image).

[0084] Optionally, when the relay layer checks the services of the system layer, it may prioritize reading according to the AIDL version; if no AIDL service is configured, it will read the HIDL service.

[0085] For example, when the relay layer checks the services of the system layer, it checks whether the AIDL configuration file exists; if it exists, it continues to perform AIDL service checks. For resident AIDL services, it is considered that AIDL services are supported. For non-resident AIDL services, it attempts to obtain a service handle; if a service handle is obtained, it is considered that AIDL services are supported. Here, resident AIDL services can be understood as services that are started or launched after system boot.

[0086] Optionally, the AIDL configuration file may include a version number, device identifier, or product information, etc. For example, the AIDL configuration file may take the form of an AIDL manifest.

[0087] For example, for camera virtualization services (also known as camera services or camera-related services), both camera registration services and camera streaming services need to be checked simultaneously. If both camera registration services and camera streaming services pass the check (passing the check can be understood as: the AIDL configuration file corresponding to the camera AIDL service exists), then the system layer is considered to support the camera AIDL service.

[0088] For example, for audio virtualization services (also known as audio services or audio-related services), both microphone and speaker services need to be checked. If both microphone and speaker services pass the check (which can be understood as the existence of an AIDL configuration file corresponding to the audio AIDL service), then the system layer is considered to support the audio AIDL service. Otherwise, it is assumed that the system layer only supports the HIDL service.

[0089] The specific functions and roles of the interface layer module, the connection layer module, and the system relay layer will be discussed later. Figure 5A or Figure 6A The timing sequence shown is described in detail.

[0090] Optionally, the interconnection service module also includes a data processing module, a transmission channel, and a capability acquisition module. The data processing module is used to process business data related to the interconnection service, including but not limited to data acquisition, data parsing, data packaging, data conversion, data querying, and data storage. The transmission channel is used to transmit data related to the interconnection service (or virtualization service). The capability acquisition module is used to collect relevant virtualization capabilities supported by the local device and the peer device (e.g., a device performing multi-screen collaboration with the local device). For example, the capability acquisition module is used to collect camera resolution information, the number of cameras, and the usage status of audio or video.

[0091] It is understandable that the application framework layer also includes modules related to other virtualization services. For example, optionally, Figure 2The diagram illustrates the Device Discovery Service, Device Transfer Service, Device Connection Service, and Collaboration Assistant Service. Specifically, the Device Discovery Service provides a framework interface for virtual services related to device discovery; the Device Transfer Service provides a framework interface for virtual services related to device transfer functionality; the Device Connection Service provides a framework interface for virtual services related to device connection functionality; and the Collaboration Assistant Service provides a framework interface for virtual services related to device collaboration functionality.

[0092] The system layer may include multiple functional modules. In this embodiment, the system layer provides an adaptation layer functional module for virtualization services. For example... Figure 2 As shown, the system layer includes a camera virtualization adaptation layer and an audio virtualization adaptation layer. The audio virtualization adaptation layer provides audio-related virtualization services. Optionally, the audio virtualization adaptation layer includes audio AIDL services and audio HIDL services.

[0093] In some embodiments, the audio virtualization adaptation layer includes virtualization services for different audio types, which can be integrated into the same service module. For example, the audio AIDL service includes media audio speaker service, call audio modem speaker service, media audio microphone service, and call audio modem microphone service.

[0094] Media audio includes, but is not limited to: alarm sounds, message notification sounds, or notification sounds, etc.; call audio can be understood as sounds related to people, including but not limited to: telephone call sounds, call recordings, etc.

[0095] The camera virtualization adaptation layer is used to provide camera-related virtualization services. Optionally, the camera virtualization adaptation layer includes camera AIDL services and camera HIDL services.

[0096] In some embodiments, the camera virtualization adaptation layer includes camera virtualization services of different modes, which can be integrated into the same service module. For example, the camera AIDL service includes camera registration service and camera streaming service.

[0097] It is understandable that the system layer may also include other modules. Optionally, such as Figure 2 As shown, the system layer also includes a multimedia platform, audio framework, codec modules, etc. For explanations of the functions of the other modules, please refer to relevant technical documentation.

[0098] It's also understandable that the virtualization adaptation layer in the system layer can be differentiated based on the system layer configuration. Figure 2The descriptions provided are merely illustrative. For example, access and communication with the camera HIDL service and the audio HIDL service can be maintained. Optionally, as technology evolves or Android versions develop, Figure 2 It may include related AIDL services (such as camera AIDL services and audio AIDL services), but not related HIDL services (such as camera HIDL services and audio HIDL services); or it may include some AIDL services and some HIDL services, such as camera AIDL services and audio HIDL services, etc.

[0099] Optionally, such as Figure 2 As shown, the system layer also includes a multimedia platform, audio framework, encoding / decoding modules, etc.

[0100] An extension layer refers to an extension layer of the hardware abstraction layer (HAL). For example... Figure 2 As shown, the extension layer includes an audio module, a modem module, a sensor module, a camera module, and a virtual camera module. The extension layer can be understood as a layer repackaged according to the usage of the system layer, used to solve the adaptation problem for different drivers.

[0101] Understandable. Figure 2 The extended layer shown may also include other modules, and the embodiments of this application are not limited thereto.

[0102] The kernel layer is used to drive hardware resources. The kernel layer can include multiple driver modules. For example... Figure 2 As shown, the kernel layer includes display driver, camera driver, USB driver, CPU driver, audio driver, network driver, storage driver, and print driver, etc.

[0103] Figure 2 In the software architecture shown, the application layer and the system service layer can communicate across processes. Communication can be achieved using inter-process communication mechanisms (Binder) or by relying on a Binder driver.

[0104] It should be understood that Figure 2 The layered structure shown does not constitute a specific limitation on the software system of the electronic device. In other embodiments of this application, the software system of the electronic device may include more than Figure 2 The layered architecture shown may have more or fewer layers, or each layer of the software system of an electronic device may include more than [a certain number of layers]. Figure 2 The embodiments shown may have more or fewer constituent structures, and the present application is not limited to these.

[0105] Taking a multi-screen collaboration application as an example, the mobile phone, in response to the user's confirmation of multi-screen collaboration with the peer device, triggers a request to enable the audio virtualization service. It should be understood that this description uses the triggering of the audio virtualization service as an example, and the embodiments of this application are not limited to this. After the first electronic device and the second electronic device establish multi-screen collaboration, the audio virtualization service is usually started by default. The request to enable the audio virtualization service is passed to the application framework layer through the application layer. The system relay layer in the interconnect service within the application framework layer performs cross-process access to check the service version type supported by the lower layer (system layer). Specifically, the system relay layer checks the audio virtualization adaptation layer in the system layer to determine whether the audio virtualization service supports audio AIDL or HIDL services. The system layer returns the result to the system relay layer in the interconnect service. The system relay layer continues to return the result to the connection layer module in the interconnect service. The connection layer module in the interconnect service converts the result into the corresponding version number (V2 or V1) for recording and returns the version number to the interface layer in the interconnect service. The interface layer in the interconnect service returns the successful enable result to the application layer.

[0106] Figure 3 An example diagram of the relay layer in the system according to an embodiment of this application is shown. For example... Figure 3 As shown, the relay layer of the system includes a V2 interface module, a V1 interface module, a version control module, a management module, a HIDL scheduling module, and an AIDL scheduling module. The V2 and V1 interface modules connect to the upper-layer interconnect service interface. The upper-layer interconnect service interface can be a DMSDPWrapper interface. The V2 interface module needs to read the version control module to determine the supported version number of the lower layer. If the upper-layer interconnect service calls the V1 interface module, it can call according to the historical scheme; if the upper-layer interconnect service calls the V2 interface module, it may be an older version (V1 version) or a newer version (V2 version), so dynamic selection needs to be implemented according to the version control module. The wrapper management module connects to both the V2 and V1 interface modules. The wrapper management module also connects to the HIDL and AIDL scheduling modules to connect to the virtualization adaptation layer (including the virtualization adaptation layer HIDL service and the virtualization adaptation layer AIDL service) in the system layer when calling the corresponding service.

[0107] Figure 4 This is a schematic diagram illustrating the historical solutions for virtualization services and the decoupling solution proposed in this application. For example... Figure 4As shown in this embodiment, during the loading of virtualization services, the service version type or chip service type in the system layer is first checked to determine whether it is an AIDL service or a HIDL service. The system layer then returns the check result to the system dependency library. The connection layer in the system dependency library converts the service type into a version number, i.e., V1 or V2. If V2 is supported, the V2 callback scheme is executed; if V1 is supported, the V1 callback scheme is executed. The solution provided in this embodiment is compatible with historical versions.

[0108] Furthermore, this application embodiment supports dynamic updates of service versions. That is, after the service version in the system layer corresponding to the virtualization service is updated from HIDL service to AIDL service, the AIDL service can be invoked the next time the service is called.

[0109] Taking virtualization service 2 as an example, service 2 corresponds to callback V1; callback 1, after being processed by the system dependency library, calls the HIDL service, which in turn calls the HIDL callback in HIDL chip service 2 to run virtualization service 2. After the HIDL update in HIDL chip service 2 is completed, the next time service 2 is enabled, it will call back to the latest updated AIDL service.

[0110] The above scheme includes callback schemes for the new version (V2) and the old version (V1). After the application layer triggers the business logic, a version check is first performed, that is, the version type of the virtualization service being called is detected. In other words, it determines whether the corresponding version type is V1 or V2, and returns the check result to the system dependency library. After intermediate processing, the system dependency library can return the version information to the application layer. The version information can be either the new version (V2) or the old version (V1). When the virtualization service triggered at the application layer is the old version (V1), a callback scheme can be used... Figure 4 The callback scheme for the older version (V1) shown is executed and scheduled. When the virtualization service triggered at the application layer is the newer version (V2), it can be achieved through... Figure 4 The callback scheme execution scheduling of the new version (V2) is shown in the figure.

[0111] In some embodiments, the solution provided in this application ensures availability after an update of the Android system version of an electronic device, with both the new Android system version and the old chip version, as well as between the new version and the new chip version. In other words, the solution provided in this application is compatible with both high-version Android and old-version chips.

[0112] refer to Figure 5A , Figure 5A This is a timing example diagram of enabling virtualization services according to an embodiment of this application.

[0113] In some embodiments, Figure 5AThe timing flow shown can be applied to Figure 2 The software architecture is shown. Optionally, Figure 5A The first business shown is Figure 2 It is triggered by an application in the application layer, such as a multi-screen collaboration application or an instant messaging application. Figure 5A The interface layer module shown (e.g., the DMSDP SDK interface layer) is Figure 2 The interface layer module shown; Figure 5A The connection layer module shown (e.g., the DMSDP wrapper connection layer) is Figure 2 The connection layer module shown; Figure 5A The relay layer module shown in the figure can be Figure 2 The system relay layer shown in the application framework layer; Figure 5A The AIDL process audio service shown in the image can be... Figure 2 The audio AIDL service in the audio virtualization service shown in the middle system layer; Figure 5A The AIDL process video service shown in the image can be... Figure 2 The camera AIDL service is shown in the camera virtualization service at the system layer.

[0114] like Figure 5A The enabling process 1 shown, taking the first service as an example, includes the following steps to enable the virtualization service:

[0115] Step 101: Enable the first virtualization service for the first business function in the application layer.

[0116] This application does not specifically limit the business and / or application that triggers virtualization services. The term "first business" is used broadly to refer to any business that requires triggering virtualization services. For example, the first business could be office work, multi-screen collaboration, etc.

[0117] This application does not specifically limit the application that initiates the first service. For example, the application can be a multi-screen collaboration application, an office application, a video call application, etc.

[0118] The embodiments of this application do not specifically limit the number and / or types of virtualization services enabled, which may depend on the triggering of services and / or application implementation.

[0119] Generally speaking, for multi-screen collaboration services, audio services are enabled first. For example, in the case of multi-screen collaboration services, the virtualization services enabled include: enabling audio speaker services and / or audio microphone services.

[0120] The following describes the timing for enabling virtualization services from a UX interaction perspective.

[0121] Generally speaking, for multi-screen collaboration services, audio services are enabled first. For example, in the case of multi-screen collaboration services, the virtualization services enabled include: enabling media audio speaker services and / or media audio microphone services.

[0122] The following describes the timing for enabling virtualization services from a UX interaction perspective.

[0123] In some scenarios, for multi-screen collaboration services, virtualization services are enabled when multi-screen collaboration is enabled, or when device collaboration is confirmed. This application's embodiments do not specifically limit the operation for confirming the execution of multi-screen collaboration.

[0124] In some embodiments, the first electronic device establishes a collaborative connection with the second electronic device via Bluetooth. For example, a user enables the "Multi-screen Collaboration" switch on a PC and turns on Bluetooth on their mobile phone. A connection interface is displayed on the phone, including a "Connect" control. The phone initiates a collaborative connection in response to the user clicking the "Connect" control. After a successful connection, the PC synchronously displays the phone's interface. When the phone detects the user clicking the "Connect" control, it enables virtualization services, such as audio virtualization services.

[0125] Figure 5B An example interface for collaborative connectivity is shown. For example... Figure 5B As shown, assuming laptop 101 has multi-screen collaboration enabled and mobile phone 102 has Bluetooth enabled, a connection window 210 will pop up on mobile phone 102. Window 210 includes connection and cancellation controls. Window 210 is used to prompt the user that a connection can be established to achieve data sharing between devices. In response to the user clicking the connection control, mobile phone 102 begins to establish a connection with laptop 101. After laptop 101 and mobile phone 102 successfully establish a connection, the interface of mobile phone 102 will be synchronously displayed on laptop 101.

[0126] In some embodiments, a first electronic device achieves collaborative connection with a second electronic device through a "tap-to-connect" or "one-tap-to-link" function. For example, by touching the NFC area on the back of a mobile phone to the Magic-Link tag on an Honor laptop, interconnection between the phone and the laptop can be achieved. It is understood that this connection method requires both the phone and the laptop to support NFC functionality.

[0127] In some embodiments, the first electronic device achieves collaborative connection with the second electronic device through a QR code scanning function. For example, as... Figure 5CAs shown, mobile phone 102 establishes a connection with PC by scanning the QR code displayed on laptop 101. After scanning the QR code, a connection interface is displayed on mobile phone 102, including window 210 with a "Connect" control. Mobile phone 102 initiates a collaborative connection in response to the user clicking the "Connect" control. After a successful connection is established between laptop 101 and mobile phone 102, the interface of mobile phone 102 is simultaneously displayed on laptop 101.

[0128] In some embodiments, in response to a user's operation on a mobile phone, the first electronic device determines to establish a collaborative connection with the second electronic device. The user's operation on the mobile phone includes, but is not limited to, clicking to confirm the connection in a pop-up window on the screen, or clicking a shortcut key to initiate the collaborative connection.

[0129] In some embodiments, a collaborative connection is established after the first electronic device is connected to the second electronic device (e.g., a PC) via a data cable (e.g., a USB interface). For example, after a mobile phone is connected to a PC via a data cable, a connection interface pops up on the phone, including a "Connect" control; the phone initiates a collaborative connection in response to the user clicking the "Connect" control.

[0130] In other scenarios, there are other services (such as Super Call and Shared Call) that enable virtualization services.

[0131] In some embodiments, the first electronic device (e.g., a mobile phone) and the second electronic device (e.g., a PC) do not establish a collaborative connection, but both belong to the same trust ring. In a shared call scenario, if the first electronic device receives an incoming call, it will trigger the virtualization service to be enabled.

[0132] For example, the mobile phone enters the "HyperTerminal" interface, which includes multiple smart devices; the mobile phone responds to the user's operation of clicking on the PC in the interface and establishes a collaborative connection with the PC.

[0133] Step 102-1: The interface layer attempts to obtain service information from the connection layer.

[0134] Optionally, after step 101, or in other words, after the interface layer receives the instruction to enable the first virtualization service, it may attempt to obtain the corresponding service information from the connection layer.

[0135] Since other business operations may also trigger the enabling of the first virtualization service, the interface layer can perform a service query after receiving the instruction to enable the first virtualization service. Optionally, in step 102-2, the interface layer performs device and service logic processing.

[0136] The purpose of introducing step 102-2 is to perform service checks or determine service usage. For example, the interface layer can check whether other services are using the audio virtualization service, or whether the audio virtualization service is repeatedly enabled, or whether the audio permissions of the current device (e.g., a device that performs multi-screen collaboration with electronic devices) are enabled.

[0137] This application does not limit the specific implementation method of the service check performed at the interface layer. For example, the interface layer can determine whether the currently enabled first virtualization service is being used by checking mapping table A. The service usage status can be obtained by querying the mapping table. If the first virtualization service is not being used by other services, then subsequent steps can continue; if other services are using the first virtualization service, then an error is reported or the current process ends.

[0138] Step 102-2 may occur after step 101. Optionally, this embodiment of the application does not specifically limit the execution order between step 102-2 and step 102-1. For example, step 102-2 may come first, followed by step 102-1. Or, for example, step 102-2 may come second, followed by step 102-1.

[0139] Step 103: The connection layer loads the relay layer of the system for the first time.

[0140] When the system relay layer module is loaded for the first time, the connection layer can obtain the service versions that the system layer can support, or the supported version status, from the relay layer.

[0141] Optionally, in this embodiment, the connection layer converts (or defines) the AIDL services supported by the system layer to version V2; and converts (or defines) the HIDL services to version V1.

[0142] Step 104: The relay layer in the system checks the process services in the system layer.

[0143] In other words, the relay layer in the system determines which version of the service is supported by the process module of the lower layer (system layer) through cross-process access.

[0144] Taking the virtualization service enabled in step 101 as an example, if the virtualization service is an audio service, then step 104 will query the version types supported by the audio service at the system layer. For example, ... Figure 5A As shown, audio services support AIDL process services.

[0145] Step 105: The system layer returns the query results to the system relay layer.

[0146] For example, the audio service in the system layer returns query results to the system relay layer.

[0147] In some embodiments, the query result is used to indicate whether the audio service in the system layer supports the AIDL process service, or in other words, whether the version of the service that the first virtualization service needs to call in the system layer is V2.

[0148] For example, for the first virtualization service, by checking the service support information, the AIDL process returns the result "supported", that is, the audio service supports AIDL service.

[0149] Step 106: The relay layer in the system returns the result to the connection layer.

[0150] After receiving the "support" result from the system layer, the relay layer in the system returns the result to the connection layer.

[0151] Step 107-1: The connection layer records version information.

[0152] After receiving the result from the relay layer in the system, the connection layer can perform version information recording, that is, save the version information supported by the virtualization service. Version information indicates whether the virtualization service supports AIDL or HIDL services. Optionally, the connection layer can use different version numbers to name the versions supporting AIDL and those supporting HIDL services respectively. For example, if the virtualization adaptation layer in the system layer supports AIDL services, it is recorded as V2; if the virtualization adaptation layer in the system layer supports HIDL services, it is recorded as V1.

[0153] For example, after receiving a "supported" result from the relay layer in the system, the connection layer performs version information recording, that is, saves the version information supported by the audio service. If the audio service supports AIDL process services, the connection layer records the audio service version information as V2. Of course, if the relay layer returns "not supported," meaning it does not support AIDL process services or only supports HIDL process services, then the connection layer can record the version information as V1.

[0154] It is understood that this description takes the audio service in the system layer supporting the AIDL process service as an example, and the embodiments of this application are not limited to this.

[0155] This application does not specifically limit the method by which the connection layer saves information. For example, the connection layer can save version information supported by different types of services in the form of a mapping table or mapping relationship.

[0156] In some embodiments, the connection layer records version information separately for different types of services. For example, it records the version information for audio services and the version information for camera services.

[0157] Step 107-2: The connection layer returns the result to the interface layer.

[0158] After recording the version information, the connection layer returns a result to the interface layer. This result may include the version number supported by the virtualization service. For example, if the result is "V2", it means that the audio service supports version V2.

[0159] Step 107-3: The interface layer returns the result to the first service.

[0160] For the interface layer, when returning results to the application layer, it will directly return a "successfully enabled" result, without needing to return a version number. It can be understood that for the application layer, there is no need to return version information; if the system layer supports AIDL services, it can directly notify the corresponding virtualization service in the application layer that its enabling was successful.

[0161] Through the above enabling process 1, after triggering the first virtualization service, the process of accessing the AIDL service can be realized by checking the version status supported by the system layer.

[0162] The enabling process described in section 1 above outlines the process of enabling the first virtualization service. The following sections will further elaborate on this process. Figure 5A The process of enabling the second virtualization service (which may be referred to as "Enabling Process 2"). Optionally, in Figure 5A In this context, enabling process 2 occurs after enabling process 1. The similarity between enabling process 2 and enabling process 1 is that both invoke the same type of virtualization service. For example, ... Figure 5A As shown, the first virtualization service is an audio speaker service, which calls the audio service module in the system layer; the second virtualization service is a modem service, which also calls the audio service module in the system layer. In other words, the first and second virtualization services are services that call the same virtualization service module in the system layer.

[0163] In some embodiments, the first virtualization service and the second virtualization service correspond to the same type of service, or in other words, the first virtualization service and the second virtualization service call the same process service module (or virtualization service module) in the system layer. This means that if the first virtualization service is enabled first, and the service version type supported by the system layer has already been queried during the process of enabling the first virtualization service, then when enabling the second virtualization service, the connection layer module can determine the version type of the audio virtualization service module corresponding to the second virtualization service by checking historical information. Since cross-process access is slow and takes time, querying historical information avoids repeatedly executing the process of the relay layer accessing the system layer across processes to query the supported version status, thus saving time.

[0164] Understandable. Figure 5A The specific content of the first virtualization service and / or the second virtualization service shown is merely an example description, and the embodiments of this application are not limited thereto.

[0165] For example, the first virtualization service is a media audio speaker service, and the second virtualization service is a call audio speaker service; when the first virtualization service or the second virtualization service is enabled, the audio virtualization service module in the system layer is invoked.

[0166] For example, the first virtualization service is a media audio microphone service, and the second virtualization service is a call audio microphone service; when the first virtualization service or the second virtualization service is enabled, the audio virtualization service module in the system layer is invoked.

[0167] For example, the first virtualization service is a media audio microphone service, and the second virtualization service is a call audio speaker service; when the first virtualization service or the second virtualization service is enabled, the audio virtualization service module in the system layer is invoked.

[0168] like Figure 5A As shown, the process of enabling the second virtualization service includes:

[0169] Step 201: Enable the second virtualization service in the application layer.

[0170] Optionally, for multi-screen collaboration services, when an electronic device receives an incoming call, a call tone (modem) service will also be triggered.

[0171] Of course, the above description only uses multi-screen collaboration as an example, and the embodiments of this application are not limited to this. In fact, which virtualization services are enabled depends on the triggering of the service and / or the application implementation.

[0172] It should be noted that the aforementioned virtualization services enabling multi-screen collaboration are illustrative examples, and the embodiments of this application are not limited thereto. For instance, if a user receives a video call during multi-screen collaboration using an electronic device, then camera registration service also needs to be enabled. The process of enabling the photo album registration service will be described in detail later.

[0173] For example, taking the second service, which is also a multi-screen collaboration service, the virtualization services enabled by the multi-screen collaboration service may also include: enabling call audio microphone (modem mic) service; enabling call audio speaker (modem speaker) service, etc.

[0174] Step 202: The interface layer obtains service information from the connection layer.

[0175] The process of step 202 is similar to that of step 102. For the sake of brevity, the relevant descriptions can be found in the previous text. They will not be repeated here.

[0176] Step 203: The connection layer checks historical information.

[0177] It should be noted that historical information refers to version information recorded in the connection layer history. In some embodiments, the recording process of historical information may occur in step 107-1 of the aforementioned enabling process 1. Since the service version types supported by the system layer have already been queried in the aforementioned enabling process 1, in enabling process 2, the connection layer module can directly check the historical information to determine the version type of the audio virtualization service module corresponding to the second virtualization service, without having to perform the cross-process access process again, thus saving time.

[0178] Step 204-1: The connection layer returns the result to the interface layer.

[0179] Optionally, the result returned by the connection layer to the interface layer includes "V2". A description of step 204-1 can be found in step 107-2; for brevity, it will not be repeated here.

[0180] Step 204-2: The interface layer returns the result to the second service.

[0181] Step 204-2 is similar to step 107-3 above, and the relevant description can be found in the previous text. For the sake of brevity, it will not be repeated here.

[0182] Regarding the process of accessing the same type of virtualization service in the system layer, the above description is only based on two typical scenarios: enabling process 1 and enabling process 2. That is, enabling process 1 is the process of loading audio services for the first time, and enabling process 2 is the process of loading audio services for the second time. The embodiments of this application are not limited to this.

[0183] It should be understood that enabled virtualization services can include a greater number and / or variety. Figure 5A The steps shown are merely illustrative descriptions.

[0184] It should also be understood that the embodiments of this application do not specifically limit the order in which virtualization services are enabled. However, for a virtualization service that is being called for the first time, its version information can be saved according to the process in enabling process 1, so that it can be directly queried and used when loading the same type of virtualization service later. For example, in enabling process 2, the mapping table saved by the connection layer in enabling process 1 can be queried to obtain the corresponding version information.

[0185] Combined with the preceding text Figure 5A This describes the scenario where AIDL processes are supported when enabling virtualization services. However, in some scenarios, certain virtualization services may not support AIDL processes but support HIDL processes. These services that support HIDL processes but not AIDL processes may be older versions of the virtualization service, or virtualization services that have not yet been upgraded or updated. This application also provides solutions for these scenarios to achieve dynamic compatibility with older versions of virtualization services. The following will combine... Figure 6A The timing diagram is used to describe this.

[0186] It should be noted that, Figure 6A The process in the process can be executed independently or in conjunction with... Figure 5A This application does not specifically limit the combination of implementations.

[0187] Optionally, in Figure 6A and Figure 5A When implemented in combination, Figure 6A and Figure 5A The process can be carried out simultaneously, or it can be executed first. Figure 5A The process in the middle, then execute Figure 6A The process in.

[0188] For those that execute first Figure 5A Execute again Figure 6A In the case of multi-screen collaboration, for example, electronic devices first enable audio virtualization service by default; during multi-screen collaboration, if the electronic device receives a video call, it will also enable camera virtualization service.

[0189] about Figure 6A The various modules shown in the image are related to... Figure 5A The difference is: Figure 6A The system layer includes camera services that support the HIDL process. Other modules and... Figure 5A Similar examples are shown in the text and will not be repeated here. Figure 6A As shown, it includes:

[0190] Step 301: Enable third virtualization services in the application layer.

[0191] Optionally, the third virtualization service is a camera-related service, such as a camera registration service.

[0192] For example, when a camera-related application is opened (using video calling), a camera service is enabled. Alternatively, the third service is a video calling service. Optionally, the video calling service is a video call using a third-party application.

[0193] It is understood that the above description uses the camera registration service as an example of a third virtualization service, and the embodiments of this application are not limited thereto.

[0194] It should be noted that different business operations or applications may call different services. That is, which type of service is enabled (or which service is changed) depends on business requirements and / or application triggers. This application embodiment does not make specific limitations on this.

[0195] For example, when connecting an electronic device to a smart study lamp, or when using the MeeTime phone service, a registration type service (e.g., camera registration service) can be invoked; when using a third-party video call service, a switching type service (e.g., camera stream switching service) can be invoked.

[0196] Step 302-1: The interface layer attempts to obtain service information from the connection layer.

[0197] Optionally, in step 3 (step 103), the connection layer loads the relay layer in the system for the first time.

[0198] Step 302-2: The interface layer executes device and service logic processing.

[0199] The relevant description of step 302-2 can be found in the description of step 102-2 above. For the sake of brevity, it will not be repeated here.

[0200] For example, the interface layer checks the usage of the camera registration service.

[0201] Step 303: The connection layer loads the relay layer of the system for the first time.

[0202] Step 304: The relay layer in the system executes the process check service in the system layer.

[0203] Step 305: The system layer returns the query results to the system relay layer.

[0204] exist Figure 6AIn the query returned by the HIDL process to the system relay layer, the result is "not supported". In other words, the system layer does not support the AIDL process for third-party virtualization services enabled by the application layer.

[0205] Step 306: The relay layer in the system returns the result to the connection layer.

[0206] After receiving the "not supported" result from the system layer, the relay layer in the system returns the result to the connection layer.

[0207] Step 307-1: The connection layer records version information.

[0208] Accordingly, the version information for camera-related services recorded by the connection layer is "V1".

[0209] Step 307-2: The connection layer returns the result to the interface layer.

[0210] After recording the version information, the connection layer returns a result to the interface layer. This result may include the version number supported by the virtualization service. For example, if the result is "V1", it means that the camera service supports version V1.

[0211] Step 307-3: The interface layer returns the result to the third service.

[0212] For the interface layer, when returning results to the application layer, it will directly return a "successfully enabled" result, without needing to return a version number. In other words, for services that support HIDL processes, the application layer can directly notify the corresponding virtualization service that its enabling has been successful.

[0213] Similarly, the third and fourth virtualization services can also correspond to the same type of service. For example, the third virtualization service is a camera registration service, and the fourth virtualization service is a camera streaming service; both belong to the camera category. Regarding the relationship between the third and fourth virtualization services, please refer to the descriptions of the first and second virtualization services mentioned above, which will not be repeated here. The following combines... Figure 6A The enabling process described in section 4 outlines the process of enabling the fourth virtualization service. It should be understood that some descriptions of the steps involved in enabling the fourth virtualization service can be found in the preceding text. Figure 5A The description of enabling process 2 in the text.

[0214] like Figure 6A As shown, the process of enabling the fourth virtualization service includes:

[0215] Step 401: Enable the fourth virtualization service in the third service of the application layer.

[0216] Step 402: The interface layer obtains service information from the connection layer.

[0217] Step 403: The connection layer checks historical information.

[0218] Similarly, since step 307-1 recorded the version information of the camera service as "V1", the version information of the camera service queried here is also "V1".

[0219] Step 404-1: The connection layer returns the result to the interface layer.

[0220] Optionally, the result returned by the connection layer to the interface layer includes "V1".

[0221] Step 404-2: The interface layer returns the result to the third service.

[0222] For a description of step 404-2, please refer to step 307-3 above. For the sake of brevity, it will not be repeated here.

[0223] Understandable. Figure 6A The example described uses the initial loading of the HIDL process camera service in the system layer when enabling the camera registration service as an example, but this application's embodiments are not limited to this. For instance, the initial loading of the HIDL process camera service in the system layer could also occur when enabling the camera switching service. Of course, in the system relay layer, cross-process access only needs to be performed when the HIDL process camera service in the system layer is loaded for the first time. For non-initial loading cases, the connection layer can determine the corresponding version number by checking historical version information.

[0224] Figure 6A Enable processes 3 and 4 illustrate camera services that do not support AIDL processes. In some scenarios, with system version upgrades or dynamic updates, some virtualization services that do not support AIDL processes will be updated to support AIDL processes through updates or upgrades. This application provides an embodiment of dynamically updating virtualization services. By performing dynamic updates during the enabling (or using) of a virtualization service, the latest version can be used the next time the virtualization service is enabled. Compared to related upgrade service processes that require interrupting the current service use during upgrades, the method of this application embodiment can achieve dynamic updates without interrupting the currently used virtualization service (or interrupting the current business); and the latest updated service can be used directly without waiting the next time the virtualization service is enabled. The following is combined with... Figure 6A The update process shown in Figure 5 is described below.

[0225] Figure 6AThe update process 5 shown includes: the system update module updates the HIDL process camera service in the system layer. After a period of time, the HIDL process camera service in the system layer has been updated to the AIDL process camera service.

[0226] exist Figure 6A In this process, update process 5 occurs before notification exit process 6. This ensures that the updated camera service is used when the camera service is re-enabled subsequently.

[0227] It should be understood that Figure 6A The description only uses updating the version of the camera service in the system layer as an example, and the embodiments of this application are not limited thereto.

[0228] Optionally, after the version update of the virtualization service at the system level is completed, the electronic device can resume its functions by restarting. Alternatively, for some virtualization services, the electronic device can be used without restarting after the update is completed.

[0229] This application does not limit the specific timing of the virtualization service version update process in its embodiments. In some embodiments, the virtualization service version update process may occur while the virtualization service is in use, or in other words, after the relay layer module checks the service in the system and before the virtualization service is triggered again.

[0230] This application does not limit how users perform version updates. For example, as shown in the embodiments... Figure 6B As shown in Figure (1), the phone responds to the user's click on the settings application 1201 and displays... Figure 6B The interface shown in (2). Figure 6B As shown in (2), the settings page includes a "System and Updates" control 1202. The phone responds to the user's click on the "System and Updates" control 1202 by displaying the "System and Updates" settings interface. For example, the "System and Updates" settings interface is as follows: Figure 6B As shown in (3), the interface includes a software update option 1203. In response to the user clicking the software update option 1203, the phone displays an interface to check the system version, for example... Figure 6B The interface shown in (4) is as follows. The phone responds to the user's click on the "Check for Updates" control 1203 by performing a version check. After the version check is complete, if a new version is found, the user can click on the new version to download the system file. The phone automatically updates in the background after the download is complete. Of course, Figure 6B The scenario shown can occur when the first electronic device and the second electronic device have already established a multi-screen collaboration connection. That is, during the collaboration process, the phone responds to the user's initiative to initiate a system update and executes the system update.

[0231] Alternatively, in some embodiments, the electronic device performs the update in the background in response to the user clicking the "Confirm System Update" control in the pop-up window.

[0232] Alternatively, in some embodiments, when the first electronic device and the second electronic device are engaged in multi-screen collaboration, the first electronic device responds to the user's click on the "Confirm System Update" control on the collaborating device, and performs the update in the background. For example, Figure 6C As shown, with a multi-screen collaboration connection established between mobile phone 102 and laptop 101, a system update window pops up on the interface of mobile phone 102. The phone responds to the user clicking the "Download and Install" option in the system update window and begins downloading system files. Of course, the phone can download system files in the background; during the download process, the collaboration between mobile phone 102 and laptop 101 can continue normally. In other words, during the collaboration process, the phone responds to the user's confirmation of the update notification and executes the system update.

[0233] Alternatively, in some embodiments, if the user sets the electronic device to automatically download updates under certain specific conditions, then the electronic device can automatically download updates after the corresponding conditions are met.

[0234] For example, such as Figure 6D As shown in Figure (1), the mobile phone responds to the user's click on control 1301 and displays... Figure 6D The interface shown in (2). Figure 6D As shown in (2), the interface includes window 1302. Window 1302 includes device settings options and help options. The phone displays [the following text is incomplete and requires further context: "In response to the user clicking the device settings option, the phone displays..."] Figure 6D The interface shown in (3). Figure 6D As shown in (3), the interface includes a switch for automatic download under WLAN and a switch for nighttime installation. Figure 6D In the interface shown in (3), both the automatic download under WLAN and the nighttime installation options are enabled. That is, if the phone detects that it is in a WLAN environment, it will automatically download the system files and automatically complete the installation at night. In other words, during the collaboration process, the phone will automatically perform a system update after the update conditions are met.

[0235] It is understood that the above examples illustrate various ways of updating the system, and the embodiments of this application are not limited thereto.

[0236] In the historical approach to the update process, the application framework layer could not be updated while a virtualization service was in use. In related technologies, it was necessary to wait until the current virtualization service usage was complete before updating both the application framework layer and the system layer, allowing for reuse. However, in this embodiment, the system layer can be updated during the use of a virtualization service, enabling the use of the latest service the next time the virtualization service is triggered. From the user's perspective, there is no need to interrupt current business operations or wait for updates; the latest service can be used directly. Furthermore, by providing different version control for various services, mutual compatibility is achieved within the same system version.

[0237] In some embodiments, during the execution of a service, a notification may be sent to exit the corresponding virtualization service.

[0238] It should be noted that in some embodiments, enabling or disabling virtualization services is essentially triggered by business logic and can be considered a user-initiated action. Disabling a virtualization service will not affect the operation of other virtualization services.

[0239] In some embodiments, a termination notification is triggered by a system-level anomaly or by an automatic mechanism, causing the process to exit. Termination notifications are essentially related to service process modules within the system layer. If a service process module is terminated, all services associated with that module will also exit. For example, if the AIDL process audio service is terminated, enabled media audio virtualization services or call audio speaker services will also exit. Another example is when certain services are found to be consuming excessive power in the background, causing their processes to terminate.

[0240] The following combination Figure 6A The notification exit process 6 shown in the figure is described.

[0241] For example, such as Figure 6A The notification exit process 6 shown includes the following steps:

[0242] Step 501: The third business notification in the application layer exits.

[0243] For example, in response to the user hanging up the video call, the camera service is exited.

[0244] This application does not specifically limit the event that triggers the exit notification. The exit notification can be triggered by an upper layer (such as the application layer) or by a lower layer.

[0245] In some application scenarios, underlying events may trigger the shutdown of virtualization services or notify the exit of currently running virtualization services. Taking camera virtualization services as an example, when the camera is actively shut down by the user, or when an electronic device responds to a user opening another application, causing that other application to preempt the currently running camera virtualization service, the underlying layer will pass a shutdown notification to the system layer (e.g., the hardware layer or kernel layer passes the shutdown event to the upper layer). The system layer then passes the shutdown notification to the system relay layer, so that the system relay layer can decide whether to delete the callback of the currently running virtualization service based on its processing logic. Of course, after the underlying module triggers the shutdown notification, the notification is passed to the corresponding service module in the system layer; which service module it is passed to depends on the service type corresponding to the event.

[0246] For example, when the event triggered at the underlying level is the first time the smart desk lamp connects to the camera, the notification to turn off is passed to the relay layer of the system through the camera registration service.

[0247] For example, when the event triggered at the underlying level is the switching between the front and rear cameras, the notification to turn off is passed to the relay layer of the system through the camera switching service.

[0248] This application does not specifically limit the triggering conditions for notifying users to exit virtualization services. The foregoing examples are merely illustrative descriptions of some scenarios, and this application is not limited to them. For instance, in the event of an underlying failure, there may also be a situation where users are notified to exit virtualization services.

[0249] Step 502: The interface layer notifies the connection layer to clear the status. In other words, upon receiving a notification to exit, the interface layer notifies the connection layer to delete the service's status. The connection layer can then delete the corresponding service's usage status (or, in other words, delete the version information corresponding to the process service).

[0250] In some embodiments, the connection layer can delete the saved version information, for example, deleting the saved version type V1 of the camera service in the system layer.

[0251] It is understood that when the connection layer is in a cleared state, it may also perform other operations, including but not limited to: closing unnecessary threads or processes, releasing memory space, disconnecting from remote devices, etc. This application embodiment does not specifically limit this.

[0252] Step 503: The connection layer unloads the module of the relay layer in the system.

[0253] In some embodiments, unloading a module of the relay layer in a system can be understood as unloading a binary file. A binary file can be understood as a code segment used to implement a corresponding service. "Unloading" can be understood as an operation of deleting from memory space. By unloading binary files, memory space can be avoided.

[0254] It is understandable that the initial loading mentioned in the above process is essentially loading a binary file stored in memory. When exiting the business, this binary file can be unloaded to avoid it occupying memory space.

[0255] Step 504-1: The connection layer returns the deletion result to the interface layer.

[0256] After deleting a service from its usage state, the connection layer can notify the interface layer of the deletion result. For example, the deletion result could indicate that the deletion was successful.

[0257] Step 504-2: The interface layer returns the deletion result to the application layer.

[0258] After receiving a successful deletion result from the connection layer, the interface layer returns or passes the successful deletion result to the application layer to notify the upper layer that the relevant service information has been deleted.

[0259] In some embodiments, after a service update at the system layer is completed, if the virtualization service triggered by the current service is exited and then re-enabled, the latest updated virtualization service can be used. For example, as shown... Figure 6A The enabling process 7 shown includes the following steps:

[0260] Step 701: Enable the fourth virtualization service in the third service of the application layer.

[0261] The difference between step 701 and step 401 is that step 701 occurs after update process 5 and notification exit process 6. By the time step 701 is executed, the camera service update process has already been completed.

[0262] Step 702: The interface layer obtains service information from the connection layer.

[0263] Step 703: The connection layer loads the relay layer of the system for the first time.

[0264] Step 704: The relay layer in the system checks the process service in the system layer.

[0265] At this point, since the camera service in the HIDL process of the system layer has been updated to the AIDL service, the result obtained when the relay layer accesses the system layer inspection service across processes is "supported" for the AIDL service.

[0266] Step 705: The system layer returns the query results to the system relay layer.

[0267] exist Figure 6AIn this context, the AIDL process returns "Supported" as the query result to the system relay layer. This means that the system layer supports the AIDL process for the fourth virtualization service that is enabled again by the application layer.

[0268] As can be seen, in the aforementioned enabling process 4, when enabling the fourth virtualization service, the system layer returned the result of "not supported" for the AIDL process, but after the update process 5, the returned query result has been updated to "supported".

[0269] Step 706: The relay layer in the system returns the result to the connection layer.

[0270] After receiving the "support" result from the system layer, the relay layer in the system returns the result to the connection layer.

[0271] Step 707-1: The connection layer records version information.

[0272] Accordingly, the version information for camera-related services recorded by the connection layer is "V2".

[0273] Step 707-2: The connection layer returns the result to the interface layer.

[0274] After recording the version information, the connection layer returns a result to the interface layer. This result may include the supported version number. For example, if the result is "V2", it means that the camera service supports version V2, or the camera AIDL service.

[0275] Step 707-3: The interface layer returns the result to the third service.

[0276] For the interface layer, when returning results to the application layer, it will directly return a "successfully enabled" result, without needing to return a version number. In other words, for services that have been updated to support AIDL processes, the application layer can simply notify the corresponding virtualization service that its enabling has been successful.

[0277] In this embodiment, when the system layer service is updated from HIDL service to AIDL service, the DMSDP loading of the system relay layer is accessed through the de-enable interface of the business call, and the version control module of the system relay layer is re-initialized in the next business call, replacing the historical version with the updated version, thereby realizing dynamic service update.

[0278] To achieve dynamic compatibility, this application also provides an extensible, general-purpose interface. By using the more universal JSON protocol, the interface process is simplified to address the issue of high complexity in historical version interface changes. The following, in conjunction with... Figure 7 The examples in the text are described below.

[0279] like Figure 7As shown, the AIDL interface process provided in this application embodiment involves at least... Figure 7 The diagram shows the DMSDP main process, system components, and chip component services. The DMSDP main process and system component wrapper reside at the application framework layer; the chip component services reside at the system layer, for example... Figure 2 The audio virtualization service shown is either the audio AIDL service or the audio HIDL service.

[0280] When an application framework layer accesses a service within the chip component service across processes, the DMSDP main process can package or merge multiple commands, for example, by packaging them into a JSON file or a struct. The specific types of these commands are not limited here. For example, multiple commands might include: unregistration callback, notification command 1, notification command 2, ..., notification command n, control command 1, etc. The registration callback command is independent and does not need to be packaged. The system component (specifically, the protocol relay module within the system component) forwards the packaged JSON file to the chip component service through the command forwarding interface. Upon receiving the packaged JSON file, the chip component service parses it to obtain the aforementioned commands. Similarly, when the chip component service sends multiple commands to the DMSDP main process, packaging can be performed first; the system component then forwards the packaged commands to the DMSDP main process, which can then parse them to obtain the commands sent by the chip component service.

[0281] In the existing interface flow, the DMSDP main process, system components, and chip component services are strongly dependent on each other, or in other words, the relationship between multiple commands and the interfaces of system components is many-to-many (or one-to-one). For example, if there are 6 commands in the DMSDP main process, each command corresponding to an interface in a system component, the chip component service will parse and obtain the corresponding 6 commands. That is, for the 6 commands, the corresponding connection relationship can be represented as 6:6:6. In the existing interface flow, if a new service is added to the DMSDP main process, the system will crash and the new service will be unusable because the corresponding interface does not exist in the system component; or, for each new service, the system component will add a corresponding interface, which is highly complex due to the changes in interfaces.

[0282] And from Figure 7As shown in the interface flow diagram, the system component only needs to forward commands in the AIDL interface flow. For example, if the DMSDP main process has 6 commands, and these 6 commands correspond to the same interface in the system component, the chip component service obtains the corresponding 6 commands through parsing. That is, for the 6 commands, the corresponding connection relationship can be illustrated as 6:1:6. It can be seen that in the modified interface flow, the dependency relationship between the DMSDP main process, the system component, and the chip component service is transformed into a dependency relationship between the DMSDP main process and the chip component service. The advantage of this approach is that when adding a new chip component service to the chip component service, since the relationship between multiple commands and the system component interfaces is many-to-one, updates can be performed within the chip component service or the DMSDP main process (e.g., uploading the corresponding APK), without requiring modifications to the interfaces within the system components. Similarly, when there are updated business processes, new business requirements, or new commands in the DMSDP main process, the many-to-one relationship between multiple commands and the system component interfaces allows for updates within the DMSDP main process or the chip component service, without requiring modifications to the interfaces within the system components. This solves the problem of high complexity in historical interface changes. This allows for dynamic support of system-level and chip ROM upgrades after system updates, and these changes are reflected in the business logic. Figure 7 The packaging and parsing processes shown are all completed in the relay layer module.

[0283] Understandable, for Figure 7 The AIDL interface process shown can be applied to Figure 5A or Figure 6A The timing diagram shown.

[0284] In some embodiments, Figure 7 The V2 interface shown is applied to Figure 6A In the timing diagram, execution Figure 6A The update process in step 5. Figure 7 During the process of updating the HIDL camera service to the AIDL camera service using the chip component service, no changes to system components are required, such as... Figure 6A The interface layer or connection layer in the code does not need to be modified.

[0285] This application also provides a calling method that unifies the protocol entry point to the interface layer, ensuring logical consistency and protocol scalability. The following will combine... Figure 8 The examples in the text are described below. For example... Figure 8 As shown, Figure 8 The upper part of the diagram shows the historical calling methods, while the lower part shows the calling methods of this application.

[0286] In the historical call method, the business logic completes cross-module calls to the system's relay layer through two Java Native Interface (JNI) interfaces. For example... Figure 8 As shown in the diagram above, the application framework layer loads binary files through two interfaces. Taking the camera service as an example, DMSDP (APK) needs to load two binary files from the DMSDP system component: libvircamerawrapper.so and libcamera_jni.so. See [link to DMSDP system component diagram]. Figure 8 Example of a frame diagram of the upper right corner area in the image above. Figure 8 The calling process shown in the upper diagram includes two calling methods. For example, Figure 8 The first invocation method shown in the upper diagram includes the following steps: Step 1, the office business accesses or enables the service through DMSDP (APK); Step 2, DMSDP (APK) obtains the service from the DMSDP system component through the JNI interface; Step 3, after receiving the request from the DMSDP system component, the HIDL service in the chip component returns relevant information, such as the queried information, starts the corresponding service, or returns the service status; Step 4, the DMSDP system component passes the information returned by the HIDL service in the chip component to DMSDP (APK).

[0287] For example, Figure 8 The second calling method shown in the upper middle figure includes the following steps: Step 5, DMSDP(APK) performs switching and other operations through the JNI interface; Step 6, DMSDP(libmsdpmedia) passes instructions to the DMSDP system component through the wrapper interface; Step 7, the DMSDP system component communicates with the HIDL service in the chip component through the HIDL interface.

[0288] for Figure 8 As shown in the diagram above, the framework layer needs to load two binary files, which require a certain amount of memory space; furthermore, implementing the two calling methods through two JNI implementations involves some complexity.

[0289] Figure 8 The following diagram illustrates the calling method in this application. For example... Figure 8 As shown in the diagram below, the application framework layer loads binary files through a unified interface. The calling method in this application unifies the protocol entry point to the wrapper interface layer. Taking the camera service as an example, DMSDP (APK) can load a binary file (e.g., libvircamerawrapper.so) from the DMSDP system component; see [link to relevant documentation]. Figure 8 The following is an example of a frame diagram of the upper right area in the image below. Figure 8The calling method shown in the diagram below includes the following steps: Step 1, office operations access or enable services through DMSDP (APK); Step 2, DMSDP (APK) obtains services from DMSDP (libmsdpmedia) through a new JNI interface (e.g., cameracontrol interface); Step 3, DMSDP (libmsdpmedia) passes instructions to the DMSDP system component through the wrapper interface; Step 4A, the DMSDP system component accesses the HIDL or AIDL services in the chip component, including but not limited to: querying service information, starting services, querying service usage status, etc.; Step 4B, the HIDL or AIDL services in the chip component sequentially pass relevant information about the HIDL or AIDL to DMSDP through the interface. Additionally, Figure 8 The diagram below also includes: Step 5, DMSDP (APK) performs switching operations through the JNI interface; Step 6, DMSDP (libmsdpmedia) transmits instructions to the DMSDP system component through the wrapper interface; Step 7, the DMSDP system component communicates with the HIDL service in the chip component through the HIDL interface.

[0290] As you can see, Figure 8 The calling method shown in the image below only requires loading a single binary file, compared to... Figure 8 The above diagram requires loading two binary files. This application provides a highly scalable upper and lower layer decoupling solution, which can reduce memory space usage, or in other words, reduce disk usage. Furthermore, it unifies the calling interface to the wrapper interface layer, making the calling method simpler and ensuring logical consistency.

[0291] In the invocation method of this application, a unified protocol interface is used to reach the wrapper interface layer, meaning that only one interface is needed to complete the invocation.

[0292] The above text combined Figures 5A to 8 The examples described herein illustrate timing diagrams or implementation logic for managing virtualization services according to embodiments of this application. The following, in conjunction with... Figure 9 This application describes a method flow for managing virtualization services as illustrated in an embodiment. Figure 9 The method shown can be applied to a first electronic device. For example... Figure 9 As shown, it includes:

[0293] Step 910: When establishing a collaborative connection with the second electronic device in any of the following ways: receiving a collaborative connection request from the second electronic device, scanning a QR code for establishing a collaborative connection, connecting to the second electronic device via a wired interface, and displaying a first interface, the first interface including a first window, the first window including a first control.

[0294] Step 920: In response to the user's click on the first control, enable the first virtualization service, and the first virtualization service calls the first process service in the system layer.

[0295] Step 930: Obtain the version information corresponding to the first process service, wherein the version information includes the version types supported by the process service.

[0296] Step 940: When the first process service supports the first system version, the first process service under the first system version is invoked; or, when the first process service supports the second system version, the first process service under the second system version is invoked; wherein the first process service under the first system version and the first process service under the second system version are services of different version types.

[0297] In this embodiment, when the first electronic device and the second electronic device confirm the establishment of a cooperative connection, the first virtualization service is enabled, and the first virtualization service calls the first process service in the system layer; the first electronic device queries the version types supported by the system layer; if the first process service supports AIDL processes, it calls the AIDL process service; if the first process service supports HIDL processes, it calls the HIDL process service. This embodiment can support process services of different version types.

[0298] In some embodiments, the method further includes: enabling a second virtualization service, wherein the second virtualization service and the first virtualization service call the same process service in the system layer; obtaining version information corresponding to the first process service by querying the mapping table; wherein the mapping table includes version information corresponding to the first process service, and the mapping table is saved when the first process service is first loaded.

[0299] In other words, the version information of the first process service can be saved when it is first loaded. This way, when other virtualization services that call the first process service are enabled subsequently, the saved version information can be directly queried and used, without having to check the service repeatedly, thus reducing the number of times the system layer is accessed.

[0300] In some embodiments, the first process service under the first system version is the HIDL process service, and the first process service under the second system version is the AIDL process service.

[0301] In some embodiments, the first virtualization service is a media audio speaker service, and the second virtualization service is a call audio speaker service. Both the media audio speaker service and the call audio speaker service call audio services in the system layer.

[0302] Of course, this application embodiment supports the invocation of older version process services. In some embodiments, the method further includes:

[0303] When camera-related services are detected, the camera virtualization service is enabled, and the camera virtualization service calls the second process service in the system layer.

[0304] Obtain (or check) the version information corresponding to the second process service;

[0305] In response to the version information corresponding to the second process service being the first system version, the second process service under the first system version is invoked.

[0306] For example, the second process service invoked when enabling the camera virtualization service is the HIDL version service.

[0307] In some embodiments, before obtaining the version information corresponding to the second process service, the method further includes:

[0308] In response to the system version update operation, the version information corresponding to the second process service is updated, and the updated version information of the second process service is the second system version.

[0309] In other words, before checking the version information of the second process service, a system version update can be performed to update the second process service from the HIDL process to the AIDL process. Since performing a system version update requires a certain process, it may still be updating when the second process service is currently used; alternatively, the version update process of the second process service may be completed by the next time it is called. In this way, the latest updated version can be used the next time the second process service is called.

[0310] Optionally, the second process service under the first system version is the HIDL process service, and the second process service under the second system version is the AIDL process service.

[0311] After the system version update is completed, the latest updated version can be used the next time the camera virtualization service is enabled. In some embodiments, the method further includes: deleting the version information corresponding to the second process service in response to an operation to exit the camera virtualization service; and calling the second process service under the second system version in response to an operation to trigger the camera virtualization service again; wherein, when the camera virtualization service is triggered again, the update process of the version information corresponding to the second process service has been completed.

[0312] This application embodiment does not specifically limit the timing or method of triggering a system update. Optionally, in response to the operation of updating the system version, updating the version information corresponding to the second process service includes:

[0313] In response to the user's click to update the system control, the version information corresponding to the second process service is updated;

[0314] Alternatively, when the conditions for automatic update are met, the system version update is performed automatically, and the system version update includes updating the version information corresponding to the second process service.

[0315] For example, refer to the foregoing Figures 6B to 6C The interface shown indicates that a system version update will be performed.

[0316] Optionally, the first electronic device calls the virtualization service in the system layer through the first interface; the first interface is used to execute the following interface process: package multiple commands in the main process and pass the JSON file obtained after packaging to the system layer so that the system layer can parse the JSON file and obtain multiple parsed signaling.

[0317] The first interface can be called the V2 interface. Dynamic system version compatibility can be achieved through the first interface. For example, the specific process of the first interface can be referred to the aforementioned... Figure 7 For the sake of brevity, the description in the text will not be repeated here.

[0318] Optionally, the first electronic device includes an application framework layer; a first module in the application framework layer loads a binary file from a system component module based on a unified protocol interface using a first calling method. The first calling method can be understood as a unified calling method. Compared to the existing technology that loads two binaries using two JNI calling methods, the first calling method allows the application framework layer to load only one binary file. For a detailed description, please refer to the foregoing. Figure 8 For the sake of brevity, the description in the text will not be repeated here.

[0319] The above text combined Figures 1 to 9 This application describes in detail the method for managing virtualization services provided in its embodiments. The following will combine... Figure 10 This application describes an apparatus embodiment. It should be understood that the apparatus for managing virtualization services in this application embodiment can execute the method for managing virtualization services described in the foregoing embodiments of this application. That is, the specific working processes of the various products described below can be referred to the corresponding processes in the foregoing method embodiments.

[0320] Figure 10 A schematic diagram of the structure of an electronic device 1000 applicable to this application is shown.

[0321] Electronic device 1000 may include processor 110, external memory interface 120, internal memory 121, universal serial bus (USB) interface 130, charging management module 140, power management module 141, battery 142, antenna 1, 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, button 190, motor 191, indicator 192, camera 193, display screen 194, and subscriber identification module (SIM) card interface 195, etc.

[0322] The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0323] It should be noted that, Figure 10 The structure shown does not constitute a specific limitation on the electronic device 1000. In other embodiments of this application, the electronic device 1000 may include... Figure 10 The components shown may include more or fewer components, or the electronic device 1000 may include... Figure 10 The components shown may be a combination of certain components, or the electronic device 1000 may include... Figure 10 Sub-components of some of the components shown. Figure 10 The components shown can be implemented in hardware, software, or a combination of software and hardware.

[0324] Processor 110 may include one or more processing units. For example, processor 110 may include at least one of the following processing units: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, video codec, digital signal processor (DSP), baseband processor, and neural network processing unit (NPU). These different processing units may be independent devices or integrated devices.

[0325] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.

[0326] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0327] In some embodiments, processor 110 may include one or more interfaces. For example, processor 110 may include at least one of the following interfaces: an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM interface, and a USB interface.

[0328] Figure 10The connection relationships between the modules shown are merely illustrative and do not constitute a limitation on the connection relationships between the modules of the electronic device 1000. Optionally, the modules of the electronic device 1000 may also adopt a combination of various connection methods described in the above embodiments.

[0329] The charging management module 140 receives power from a charger, which can be either a wireless or wired charger. In some wired charging embodiments, the charging management module 140 receives current from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 receives electromagnetic waves (current path shown as dashed lines) via the wireless charging coil of the electronic device 1000. While charging the battery 142, the charging management module 140 can also supply power to the electronic device 1000 via the power management module 141.

[0330] The power management module 141 connects the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, providing power to the processor 110, internal memory 121, display screen 194, camera 193, and wireless communication module 160, etc. The power management module 141 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (e.g., leakage current, impedance). Optionally, the power management module 141 can be located within the processor 110, or the power management module 141 and the charging management module 140 can be located in the same device.

[0331] The wireless communication function of electronic device 1000 can be realized through devices such as antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor.

[0332] Electronic device 1000 can implement display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0333] Display screen 194 can be used to display images or videos. 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 (AMOLED), a flexible light-emitting diode (FLED), a mini light-emitting diode (Mini LED), a micro light-emitting diode (Micro LED), a micro OLED, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 1000 may include one or N displays screens 194, where N is a positive integer greater than 1.

[0334] Electronic device 1000 can achieve shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0335] The ISP (Image Signal Processor) is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can perform algorithmic optimization of image noise, brightness, and color. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.

[0336] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into a standard red-green-blue (RGB), YUV, or other image signal format. In some embodiments, the electronic device 1000 may include one or N cameras 193, where N is a positive integer greater than 1.

[0337] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when electronic device 1000 is selecting a frequency, the DSP is used to perform Fourier transforms on the frequency energy.

[0338] Video codecs are used to compress or decompress digital video. Electronic device 1000 may support one or more video codecs. Thus, electronic device 1000 can play or record video in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG 2, MPEG 3, and MPEG 4.

[0339] Electronic device 1000 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.

[0340] The ambient light sensor 180L is used to sense the ambient light intensity. The electronic device 1000 can adaptively adjust the brightness of the display screen 194 based on the sensed ambient light intensity. The ambient light sensor 180L can also automatically adjust the white balance when managing virtualization services.

[0341] In some embodiments, the ambient light sensor 180L can acquire the ambient illuminance of the current shooting environment. When the ambient illuminance is greater than or equal to a first illuminance threshold, the current shooting environment can be considered relatively bright, and can be considered a high-brightness shooting environment.

[0342] Touch sensor 180K, also known as a touch device, can be disposed on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a touch display. Touch sensor 180K is used to detect touch operations applied to or near it. Touch sensor 180K can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K may also be disposed on the surface of electronic device 1000, and in a different location from display screen 194.

[0343] Button 190 includes a power button and volume buttons. Button 190 can be a mechanical button or a touch button. Electronic device 1000 can receive button input signals and implement functions related to the button input signals.

[0344] Motor 191 can generate vibrations. Motor 191 can be used for incoming call notifications or for haptic feedback. Motor 191 can produce different vibration feedback effects for touch operations applied to different applications. Motor 191 can also produce different vibration feedback effects for touch operations applied to different areas of the display screen 194. Different application scenarios (e.g., time reminders, receiving messages, alarm clocks, and games) can correspond to different vibration feedback effects. The touch vibration feedback effect can also be customized.

[0345] In some embodiments, the processor 110 is configured to, when establishing a collaborative connection with a second electronic device in any of the following ways: receive a collaborative connection request from the second electronic device, scan a QR code for establishing a collaborative connection, connect to the second electronic device via a wired interface, and display a first interface on a display screen 194, the first interface including a first window, the first window including a first control; in response to a user clicking the first control, enable a first virtualization service, the first virtualization service calling a first process service in the system layer; obtain version information corresponding to the first process service, the version information including the version type supported by the process service; when the first process service supports a first system version, call the first process service under the first system version; or, when the first process service supports a second system version, call the first process service under the second system version; wherein the first process service under the first system version and the first process service under the second system version are services of different version types.

[0346] It is understood that the method for managing virtualization services in this application embodiment can be applied to... Figure 10 The specific implementation steps of the electronic device shown can be referred to the description of the method embodiments above, and will not be repeated here.

[0347] The processor can be implemented via a processing unit. The term "unit" here can be implemented in software and / or hardware, and this application embodiment does not specifically limit this.

[0348] For example, a "unit" can be a software program, a hardware circuit, or a combination of both that implements the above functions. The hardware circuit may include an application-specific integrated circuit (ASIC), electronic circuits, a processor (e.g., a shared processor, a proprietary processor, or a group processor) and memory that executes one or more software or firmware programs, integrated logic circuits, and / or other suitable devices that can provide the above functions.

[0349] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0350] This application also provides a computer program product that, when executed by a processor, implements the methods described in any of the method embodiments of this application.

[0351] The computer program product can be stored in memory and, after processes such as preprocessing, compilation, assembly, and linking, is finally converted into an executable object file that can be executed by a processor.

[0352] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a computer, implements the methods described in any of the method embodiments of this application. The computer program may be a high-level language program or an executable object program.

[0353] The computer-readable storage medium can be volatile memory or non-volatile memory, or it can include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as 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), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).

[0354] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process and technical effects of the above-described apparatus and equipment can be referred to the corresponding processes and technical effects in the foregoing method embodiments, and will not be repeated here.

[0355] In the several embodiments provided in this application, the systems, apparatuses, and methods disclosed can be implemented in other ways. For example, some features of the method embodiments described above can be ignored or not performed. The apparatus embodiments described above are merely illustrative; the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Multiple units or components can be combined or integrated into another system. Furthermore, the coupling between units or components can be direct coupling or indirect coupling, including electrical, mechanical, or other forms of connection.

[0356] It should be understood that in the various embodiments of this application, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0357] Furthermore, the terms "system" and "network" are often used interchangeably in this paper. The term "and / or" in this paper merely describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. Additionally, the character " / " in this paper generally indicates that the preceding and following related objects have an "or" relationship.

[0358] The terms (or numbers) "first," "second," etc., appearing in the embodiments of this application are for descriptive purposes only, that is, only to distinguish different objects, such as different "virtualization services," and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined with "first," "second," etc., may explicitly or implicitly include one or more features. In the description of the embodiments of this application, "at least one (item)" refers to one or more. "Multiple" means two or more. "At least one (item) below" or similar expressions refer to any combination of these items, including any combination of a single item or a plurality of items.

[0359] For example, expressions like "the item includes at least one of the following: A, B, and C" appearing in the embodiments of this application generally mean, unless otherwise specified, that the item can be any one of the following: A; B; C; A and B; A and C; B and C; A, B and C; A and A; A, A and A; A, A and B; A, A and C, A, B and B; A, C and C; B and B, B, B and B, B, B and C, C and C; C, C and C, and other combinations of A, B, and C. The above uses three elements, A, B, and C, as examples to illustrate the possible entries for the item. When expressed as "the item includes at least one of the following: A, B, ..., and X," that is, when the expression contains more elements, then the applicable entries for the item can also be obtained according to the aforementioned rules.

[0360] In summary, the above description is merely a preferred embodiment of the technical solution of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A method for managing virtualization services, characterized in that, Applied to a first electronic device, the method includes: When establishing a collaborative connection with a second electronic device through any of the following methods, a first interface is displayed, the first interface including a first window, the first window including a first control; any of the following methods include: receiving a collaborative connection request from the second electronic device; scanning a QR code for establishing a collaborative connection; and connecting to the second electronic device via a wired interface; In response to the user's click on the first control, the first virtualization service is enabled, and the first virtualization service calls the first process service in the system layer; Cross-process access is performed through the system relay layer in the application framework layer. The virtualization adaptation layer in the system layer is checked to determine the version type supported by the first virtualization service, so as to obtain the version information corresponding to the first process service. The version information includes the version type supported by the process service. When the first process service supports the first system version, the first process service under the first system version is invoked. Alternatively, when the first process service supports the second system version, the first process service under the second system version is called; the first process service under the first system version is the HIDL process service, and the first process service under the second system version is the AIDL process service. The first process service under the first system version and the first process service under the second system version are different version types of services.

2. The method according to claim 1, characterized in that, The method further includes: Enable the second virtualization service, which calls the same process service in the system layer as the first virtualization service; The version information corresponding to the first process service is obtained by querying the mapping table; wherein, the mapping table includes the version information corresponding to the first process service, and the mapping table is saved when the first process service is loaded for the first time.

3. The method according to claim 2, characterized in that, The first virtualization service is a media audio speaker service, and the second virtualization service is a call audio speaker service. Both the media audio speaker service and the call audio speaker service call audio services in the system layer.

4. The method according to claim 1 or 2, characterized in that, The method further includes: When camera-related services are detected, the camera virtualization service is enabled, and the camera virtualization service calls the second process service in the system layer. Obtain the version information corresponding to the second process service; In response to the version information corresponding to the second process service being the first system version, the second process service under the first system version is invoked.

5. The method according to claim 4, characterized in that, Before obtaining the version information corresponding to the second process service, the method further includes: In response to the system version update operation, the version information corresponding to the second process service is updated, and the updated version information of the second process service is the second system version.

6. The method according to claim 5, characterized in that, The second process service under the first system version is the HIDL process service, and the second process service under the second system version is the AIDL process service.

7. The method according to claim 5 or 6, characterized in that, The method further includes: In response to the notification to exit the camera virtualization service, delete the version information corresponding to the second process service; In response to the operation of triggering the camera virtualization service again, the second process service under the second system version is invoked; wherein, when the camera virtualization service is triggered again, the update process of the version information corresponding to the second process service has been completed.

8. The method according to claim 5, characterized in that, The operation of updating the system version, which involves updating the version information corresponding to the second process service, includes: In response to the user's click to update the system control, the version information corresponding to the second process service is updated; Alternatively, when the conditions for automatic update are met, the system version update is performed automatically, which includes updating the version information corresponding to the second process service.

9. The method according to claim 1 or 2, characterized in that, The first electronic device calls the virtualization service in the system layer through the first interface; the first interface is used to execute the following interface process: package multiple commands in the main process and pass the JSON file obtained after packaging to the system layer so that the system layer can parse the JSON file and obtain multiple parsed signaling.

10. The method according to claim 1 or 2, characterized in that, The first electronic device includes an application framework layer; the first module in the application framework layer loads binary files from system component modules through a first calling method based on a unified protocol interface.

11. An electronic device, characterized in that, The device includes a processor and a memory coupled together, the memory being used to store a computer program that, when executed by the processor, causes the electronic device to perform the method of any one of claims 1 to 10.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, causes the electronic device to perform the method of any one of claims 1 to 10.

13. A chip system, characterized in that, The chip system is applied to an electronic device, the chip system including one or more processors, the processors being configured to invoke computer instructions to cause the electronic device to perform the method as described in any one of claims 1 to 10.

Citation Information

Patent Citations

  • Camera API adaptation method and device based on Android system, equipment and medium

    CN113360179A

  • Method for acquiring video frame, electronic equipment and readable storage medium

    CN115022570A