Cross-system application program running method and electronic equipment
By displaying desktop icons applied in the second software system in the first software system and realizing communication between the two, the problem of poor compatibility between different software systems is solved, and the application on another software system is used without distinction on one software system, which improves the user experience.
Patent Information
- Application Number
- CN202411721205.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-09
- Publication Date
- 2025-04-25
AI Technical Summary
In electronic devices, the compatibility between different software systems is poor, making it difficult for users to use applications on another software system without distinction.
By displaying desktop icons applied in the second software system in the first software system and realizing communication between the first software system and the second software system, the user can operate the application program in the second software system indiscriminately on the first software system.
This enables the indiscriminate use of applications on another software system on one software system, improves the user experience and simplifies the process of cross-system operation.
Smart Images

Figure CN119883362A_ABST
Abstract
Description
[0001] This application is a divisional application. The application number of the original application is 202210230654.8, and the original application date is March 9, 2022. The entire contents of the original application are incorporated into this application by reference. Technical Field
[0002] The present application relates to the field of terminal technology, and in particular to a method, device and electronic device for running an application across systems. Background Art
[0003] With the continuous development of electronic devices, different software systems can be installed in the same electronic device, and different software systems can install different applications to adapt to different scenarios. For example, an electronic device can be equipped with an Android system and a Linux system, or an Android system and a Windows system, and so on.
[0004] When an electronic device is equipped with different software systems, it can use one of the software systems as the main system and the other systems as auxiliary systems, and the auxiliary systems can be installed or run in a virtual machine or container. For example, taking an electronic device equipped with an Android system and a Linux system as an example, the electronic device can use the Android system as its main system and the Linux system as its auxiliary system, wherein the Linux system can be installed in a virtual machine. When an electronic device is equipped with different software systems, due to the poor compatibility between different software systems, it is difficult for users to use other software systems indiscriminately on one of the software systems. For example, it is difficult to operate an application on another software system in the same way as an application on one software system. Summary of the invention
[0005] The present application provides a method for running an application across systems, an electronic device, a computer-readable storage medium, a computer program product, and a chip system, which can realize the indiscriminate use of other software systems on one software system.
[0006] In a first aspect, the present application provides a method for running an application across systems. The method can be applied to an electronic device. The electronic device can be equipped with a first software system and a second software system. The second software system runs based on the first software system. The method may include: in response to the acquired first operation, obtaining application information of at least one target application in the second software system through the first software system, the target application is an application installed in the second software system, and the application information includes one or more of the icon, identifier and executable path of the target application; and displaying a desktop icon of the target application in the first software system.
[0007] In this way, by displaying the desktop icon of the application in the second software system in the first software system, the user can quickly start the application in the second software system by clicking the desktop icon of the application in the second software system displayed in the first software system, so that the method of starting the application in the second software system is the same as the method of starting the application in the first software system, and thus the user can operate the application in the second software system on the first software system without distinction, thereby improving the user experience.
[0008] In a possible implementation, the first software system is an Android system, and the second software system is a Linux system.
[0009] In a possible implementation, obtaining application information of at least one target application in the second software system through the first software system specifically includes: starting the first main activity in the proxy Android application package APK in the first software system according to the first operation; sending a first message to the second software system through the first main activity, the first message is used to obtain application information of at least one target application in the second software system; obtaining a second message fed back by the second software system through the first mainactivity, the second message includes application information of at least one target application. Thus, the first software system and the second software system communicate with each other. Exemplarily, the first operation can be an operation of starting the proxy APK.
[0010] In a possible implementation, displaying a desktop icon of a target application in a first software system specifically includes: registering application information of the target application in a desktop launcher of the first software system through a first main activity, so as to display the desktop icon of the target application in the first software system.
[0011] In a possible implementation, after the desktop icon of the target application is displayed in the first software system, the method further includes: controlling the first main activity to end running. Thus, after the desktop icon of the target application is displayed in the first software system, the life cycle of the first main activity is controlled to be received, thereby achieving the purpose of displaying the application in the second software system in the first software system by using the activity life cycle management solution.
[0012] In a possible implementation, before sending the first message to the second software system through the first main activity, the method further includes: judging through the first main activity whether the first software system meets the operating environment of the second software system; if so, sending the first message to the second software system through the first main activity; if not, automatically installing the second software system, or displaying a prompt message on the display interface of the first software system, the prompt message is used to prompt the installation of the second software system. In this way, the operating environment of the second software system is detected, so that the method can ensure that it is executed under the operating environment that meets the second software system, thereby improving the stability of the system.
[0013] In a possible implementation, after the desktop icon of the target application is displayed in the first software system, the method further includes: in response to the acquired second operation, starting the second main activity main activity in the proxy Android application package APK in the first software system, the second operation being the operation of starting the target application; notifying the second software system to start the target application through the second main activity, and notifying the proxy APK to establish a first application activity app activity 1 associated with the target application; obtaining the application interface of the target application sent by the second software system through app activity 1; and displaying the application interface of the target application in the first software system. In this way, the user can start and run the application in the second software system in the first software system without distinction, thereby improving the user experience.
[0014] In a possible implementation, after notifying the second software system to start the target application through the second main activity and notifying the proxy APK to establish a first application activity app activity 1 associated with the target application, the method further includes: controlling the second main activity to end execution.
[0015] In a possible implementation, after the application interface of the target application is displayed in the first software system, the method further includes: obtaining a third operation through app activity 1, the third operation being an operation of starting a sub-interface in the application interface; notifying the second software system through app activity 1 to start the sub-interface in the application interface; obtaining the sub-interface in the application interface sent by the second software system through the proxy APK, and establishing a second application activity appactivity2 associated with the sub-interface; and displaying the sub-interface in the application interface in the first software system. In this way, an app activity is created for each different interface in a target application, so that the app activity corresponding to a certain interface can accurately identify the user's operation on the interface, thus avoiding the situation where a target application corresponds to only one app activity, which makes it difficult for the app activity to accurately identify the user's operation, thereby being able to respond to the user's operation immediately and improving the user experience.
[0016] In a possible implementation, after the sub-interface in the application interface is displayed in the first software system, the method further includes: controlling app activity 1 to pause running.
[0017] In one possible implementation, after the sub-interface in the application interface is displayed in the first software system, the method further includes: in response to an operation of closing the sub-interface obtained by app activity 2, controlling app activity 2 to end running, and / or controlling app activity 1 to switch from a paused running state to a resumed running state.
[0018] In one possible implementation, after the application interface of the target application is displayed in the first software system, the method further includes: in response to an operation of closing the application interface obtained by app activity 1, controlling app activity 1 to terminate operation; wherein, when the proxy APK establishes app activity 2 associated with a sub-interface of the application interface, app activity 2 associated with the sub-interface of the application interface is simultaneously controlled to terminate operation.
[0019] In a second aspect, the present application provides a device for running an application across systems, the device being included in an electronic device, and the device having the function of implementing the method described in the first aspect or any possible implementation manner of the first aspect.
[0020] In a third aspect, the present application provides an electronic device, characterized in that it includes: a processor, the processor is used to run a computer program stored in a memory, so that the electronic device implements the method described in the first aspect or any possible implementation of the first aspect.
[0021] In a fourth aspect, the present application provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect or any possible implementation of the first aspect is implemented.
[0022] In a fifth aspect, the present application provides a computer program product, characterized in that when the computer program product runs on an electronic device, the electronic device implements the method described in the first aspect or any possible implementation manner of the first aspect.
[0023] In a sixth aspect, the present application provides a chip system, characterized in that the chip system includes a memory and a processor, and the processor executes a computer program stored in the memory to implement the method described in the first aspect or any possible implementation of the first aspect.
[0024] It can be understood that the beneficial effects of the second to sixth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 This is a schematic diagram of running an application in a Linux system on an Android system desktop provided by an embodiment of the present application;
[0026] Figure 2 is a system architecture diagram of a software system carried by an electronic device provided in an embodiment of the present application;
[0027] Figure 3 This is a schematic diagram of displaying an application icon of a Linux system on an Android system desktop provided by an embodiment of the present application;
[0028] Figure 4 It is a flowchart of a method for running an application across systems provided by an embodiment of the present application;
[0029] Figure 5 This is a schematic diagram of a process of prompting a user of an Android Linux system provided by an embodiment of the present application;
[0030] Figure 6 This is a schematic diagram of switching the display interface of an application in a Linux system on an Android system desktop provided by an embodiment of the present application;
[0031] Figure 7This is a schematic diagram of switching the display interface of an application in a Linux system on an Android system desktop provided by an embodiment of the present application;
[0032] Figure 8 This is a schematic diagram of switching the display interface of an application in a Linux system on an Android system desktop provided by an embodiment of the present application;
[0033] Fig. 9 This is a schematic diagram of a process of operating an application in a Linux system across the Android system provided by an embodiment of the present application;
[0034] Fig.10 This is a management process of an activity life cycle in an Android system provided by an embodiment of the present application;
[0035] Fig.11 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;
[0036] Fig.12 A schematic diagram of the structure of a chip provided in an embodiment of the present application. DETAILED DESCRIPTION
[0037] The term "and / or" in this article is a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The symbol " / " in this article indicates that the associated objects are in an or relationship, for example, A / B means A or B.
[0038] The terms "first" and "second" in the specification and claims herein are used to distinguish different objects rather than to describe a specific order of the objects. For example, a first response message and a second response message are used to distinguish different response messages rather than to describe a specific order of the response messages.
[0039] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0040] In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more than two. For example, multiple processing units refer to two or more processing units, etc.; multiple elements refer to two or more elements, etc.
[0041] Generally, taking an electronic device equipped with an Android system and a Linux system, and the main system of the electronic device is an Android system, when the Linux system is needed, it is often necessary to run the Linux system in a virtual machine or container, and the desktop of the Linux system is displayed as a window on the desktop of the Android system. When a user operates an application in the Linux system, the operation can only be performed in the window where the Linux system desktop is located, and no matter how many applications in the Linux system are running, the activity range of these applications can only be within the window where the Linux system desktop is located, and they cannot be moved or scaled individually, resulting in a poor user experience. For example, Figure 1 As shown, if the user runs three applications on the Android system, two independent windows; the three applications are Android app, Linux app1, and Linux app2, among which the Android app is displayed on the Android desktop (i.e., the desktop of the Android system) in the form of an independent window, and the two applications Linux app1 and Linux app2 are displayed on the Linux desktop (i.e., the desktop of the Linux system), and the entire Linux desktop is displayed on the Android desktop as a window of the Android system.
[0042] Therefore, the present application proposes a method for operating an application across systems. On the basis of running a first software system, the electronic device can run a second software system through a virtual machine or a container, and run the application through the second software system. The electronic device can also display the application that has been installed and / or running in the second software system in the interface of the first software system, so that the user can use the operation method in the first software system to operate the application in the second software system under the first software system, thereby allowing the user to use the second software system without distinction under the first software system, realizing cross-system operation of the application, and improving the user experience.
[0043] The following describes the software system architecture of the electronic device by taking an electronic device equipped with an Android system and running a Linux system through a container as an example.
[0044] For example, Figure 2 The system architecture of a software system installed in an electronic device is shown, wherein the first software system of the electronic device is an Android system and the second software system is a Linux system. Figure 2As shown, both the Android system and the Linux system use the Linux kernel. In addition, the Android system may also include: an application framework layer (Application Framework) and an application layer; the Linux system includes: a window service (weston) and multiple application programs.
[0045] The application framework layer of the Android system may include: input manager service (IMS), activity manager service (AMS), window manager service (WMS) and system service (surface flinger). Among them, IMS is mainly used to manage input operations detected by electronic devices, AMS is mainly used to manage the activities of various applications, WMS is mainly used to manage the windows of various applications, and system service (surface flinger) is mainly responsible for the service process of synthesizing all display layers of the Android system.
[0046] The application layer of the Android system may include: a desktop launcher and an agent Android application package (APK). The desktop launcher is mainly used to display and manage other applications (applications, Apps) on electronic devices. The agent APK is mainly used to interact with the Linux system, display the applications installed in the Linux system, run the applications in the Linux system, etc.
[0047] It should be noted that the Android system of the electronic device may also include Figure 2 The hardware abstraction layer and system runtime library not shown in the figure, the system runtime library may include: Android runtime library, the Android runtime library may include a core library and a virtual machine, the system runtime library may also include: C library or C++ library, which will not be repeated here.
[0048] The multiple applications of the Linux system may include: multiple X11 applications (X11 APPs) and multiple wayland applications (wayland apps), wherein the X11 applications are applications matching the old version of the X11 protocol, and the wayland applications are applications matching the new version of the wayland protocol.
[0049] In addition, the window service (weston) of the Linux system may include: a system interface manager (desktop-shell), a compatible application protocol (xwayland), a compositor (compositor) and a backend compositor (compositorbackend). Among them, the system interface manager is used to manage the global interface of the Linux system; the compatible application protocol is used to be compatible with various X11 applications on the basis of matching various wayland applications; the compositor is used to combine various layers of the application to obtain a synthesized interface; the backend compositor is used to process the synthesized interface.
[0050] In the embodiment of the present application, the proxy APK of the application layer can be opened in the Android system of the electronic device. The Android system can interact with the Linux system through the proxy APK, display the icons of the applications installed in the Linux system on the desktop of the Android system, and run the applications in the Linux system.
[0051] Further, see Figure 2 , Figure 2 The software architecture of the proxy APK is also shown in Figure 2 As shown, the proxy APK software architecture may include: a communication layer (native), a management layer (myservice) and an activity layer (activity).
[0052] Native acts as a communication channel between the proxy APK and the Linux system, and is used to transmit information to the Linux system and receive information from the Linux system. For example, native can send control instructions for starting applications located in the Linux system to the Linux system, send detected input events to the Linux system, and receive window display information (such as refreshing the displayed interface) or window management information (such as adjusting the size or position of the display) from the Linux system.
[0053] Myservice is mainly used to manage app activities, for example, to create or destroy an app activity, so as to manage the life cycle of app activities. For example, myservice can also be used to connect to the container of the Linux system through a channel and initialize the windows, sessions, inputs, etc. of the Linux application running on the Android system.
[0054] Activity can include: main activity (mainactivity) and application activity (appactivity). Mainactivity is the main program of the proxy APK, which is mainly used to interact with the Linux system to obtain the icon information, application identifier and executable path of the application installed in the Linux system, and register this information in the desktop launcher (launcher), so that the icons of the applications installed in the Linux system can be generated and displayed in the desktop of the Android system, and the application icons in the Linux system can be operated in the desktop of the Android system to run the applications in the Linux system in the desktop of the Android system. For example, Figure 3 As shown in (A), multiple application icons are displayed on the Android desktop, such as an icon of Android App1, an icon of Android App2, an icon of the proxy APK, etc. Figure 3 (A), after the user clicks the proxy APK icon in the Android desktop, the main activity in the proxy APK can interact with Linux and register the information related to the applications installed in the Linux system into the Android system, so that the application icons in the Linux system can be displayed in the Android system, that is, the display is as follows Figure 3 In some embodiments, the icon information of the application may be information of the icon of the application displayed on the desktop of the Linux system, the application identifier may be the name, identity (identification, ID) or other information used to uniquely indicate the application, and the executable path of the application may be the storage location of the application in the Linux system.
[0055] The app activity can be an activity in the Android system that corresponds to an application running in the Linux system, or an activity that corresponds to a submenu in an application in the Linux system running in the Android system. For example, after a user operates an application icon in the Linux system on the Android system's desktop, the Android system can create an app activity that corresponds to the application selected by the user. In addition, when a window in which an application in the Linux system is running is displayed on the Android system's desktop, when a user selects a submenu in the application under the window, an activity corresponding to the submenu can also be created in the Android system. Exemplarily, the activity corresponding to the application can be understood as the activity corresponding to the main interface of the application, and the submenu of the application can be understood as the sub-interface under the main interface of the application.
[0056] Among them, each app activity can collect triggered input events, send the collected input events to the Linux system through native, and receive information feedback from the Linux system based on the input events through native. Then, according to the information feedback from the Linux system, the current displayed interface of the app activity is refreshed (such as displaying a floating box, icon flashing and color changes, etc.), or the window displayed by the app activity is adjusted (such as adjusting the size or position of the window), etc.
[0057] Next, based on the above description, a method for operating an application across systems provided by an embodiment of the present application is introduced.
[0058] For example, Figure 4 A method for operating an application across systems is shown. Figure 4 In this article, for the sake of convenience, it is assumed that the electronic device can be equipped with the Android system and the Linux system, and the Android system can be the main system of the electronic device; of course, the electronic device can also be equipped with other systems, and the main system of the electronic device can also be other systems, which is not limited here. Figure 4 As shown, the cross-system application operation method may include the following steps:
[0059] In S401, after the electronic device detects that a user triggers an opening operation on a proxy APK installed in the Android system, the main activity (main activity 1) of the proxy APK may be started.
[0060] In S402, main activity 1 determines whether the Android system meets the operating environment of the Linux system. When the Android system meets the operating environment of the Linux system, S404 is executed; otherwise, S403 is executed.
[0061] main activity 1 When judging whether the Android system meets the operating environment of the Linux system, you can first determine whether the installation directory of the container required to run the Linux system in the Android system is available from the installation directory in the Android system. When there is an installation directory for the container required to run the Linux system in the Android system, since the container generally has a Linux system pre-installed, it can be determined that the Android system meets the operating environment of the Linux system. When there is no installation directory for the container required to run the Linux system in the Android system, it can be determined whether there is a mirror package related to the Linux system in the Android system. When there is a mirror package related to the Linux system, the mirror package can be automatically installed so that the Linux system is installed in the Android system. When there is no mirror package related to the Linux system, it indicates that the Android system does not meet the operating environment of the Linux system at this time, so the user can be prompted to install the Linux system by themselves. For example, Figure 5 As shown in (A), after the user clicks "Proxy APK", when main activity 1 determines that the Android system does not meet the operating environment of the Linux system, a prompt box 51 can be popped up on the desktop of the Android system, in which the user can be informed that the Linux system needs to be installed by himself, that is, Figure 5 The interface shown in (B).
[0062] In S403, the user is prompted to install the Linux system. After the user successfully installs the Linux system, S404 can be entered automatically or manually by the user.
[0063] In S404, main activity 1 interacts with the Linux system to obtain application information such as application icons, application identifiers, and application executable paths of applications installed in the Linux system.
[0064] When the Linux system is not running, main activity 1 can send a startup instruction to the Linux system to start the Linux system. After the Linux system is started, main activity 1 can send a first message to the Linux system, and the first message can be used to obtain application information such as application icons, application identifiers, and executable paths of applications installed in the Linux system. After the Linux system obtains the first message, it can send a second message to main activity 1, and the second message can include application information such as application icons, application identifiers, and executable paths of applications installed on the Linux system. Among them, main activity 1 can communicate with the Linux system through the native in the proxy APK, and the communication protocol between the two can be but is not limited to the free remote desktop protocol (FreeRDP).
[0065] In S405, main activity 1 registers the application information such as the application icon, application identifier and executable path of the application installed in the Linux system into the desktop launcher of the Android system to generate a desktop icon of the application in the Linux system on the desktop of the Android system.
[0066] In some embodiments, after the main activity 1 completes generating a desktop icon of the application in the Linux system on the desktop of the Android system, it may automatically terminate its operation.
[0067] At this point, the desktop icons of the Linux system application can be displayed on the Android system desktop. For example, the screen displayed on the Android system desktop can be as follows: Figure 3 As shown in (B).
[0068] In some embodiments, the above S401 to S405 are not necessary steps of the method, that is, during the execution of the method, S401 to S405 do not need to be executed every time.
[0069] After generating the desktop icon of the Linux application in the Android system desktop, the user can select the desktop icon of the Linux application in the Android system desktop to start the Linux application in the Android system. See the following description for details.
[0070] In S406, the electronic device detects a triggering event of the user on the icon of the target application in the desktop icon of the Linux system generated in the Android desktop, and can create a main activity (main activity 2) in the proxy APK.
[0071] When the user needs to start the target application in the Linux system, the user can operate the desktop icon of the target application in the Linux system on the desktop of the Android system of the electronic device (such as clicking), and the electronic device can detect the trigger event through the desktop launcher in the Android system, and the activity management service AMS in the Android system creates a main activity 2 in the proxy APK.
[0072] In S407, main activity 2 notifies the Linux system to start the target application in the Linux system, and notifies the proxy APK to establish an app activity (app activity 1) associated with the target application.
[0073] Main activity 2 can send a third message to the Linux system, and the third message can include information such as the application identifier of the target application and the executable path of the target application. After receiving the third message, the Linux system can learn the target application and the corresponding startup path (i.e., executable path) that the user needs to start, and start the target application.
[0074] In addition, main activity 2 can also notify the proxy APK to establish an appactivity 1 associated with the target application. After main activity 2 completes the above work, it can automatically end its operation.
[0075] In addition, the proxy APK can also register the app activity 1 it creates with the myservice of the proxy APK so that myservice can manage the app activity 1.
[0076] In S408, app activity 1 interacts with the Linux system to display the application interface of the target application in the Android system.
[0077] After the Linux system runs the target application, the target application can automatically draw the application interface of the target application according to the resources of the target application, and send the application interface of the target application to Weston of the Linux system. Weston can forward the application interface of the target application to app activity 1 related to the target application in the proxy APK in the Android system. After the appactivity 1 obtains the application interface of the target application, it can display the application interface of the target application. In addition, when the application interface of the target application in the Linux system is refreshed, the Linux system can also send the refresh information to app activity 1 related to the target application in the proxy APK, so that appactivity 1 related to the target application in the proxy APK refreshes the application interface of the target application displayed in the Android system, so that the application interface of the target application displayed on the desktop of the Android system is synchronized with the application interface of the target application displayed on the desktop of the Linux system.
[0078] When the target application draws the interface, the target application can first request a window from Weston, and Weston can allocate a window to the target application according to the configured data. After that, the target application can draw the application interface of the target application in the allocated window according to the resources of the target application.
[0079] The window allocated by Weston may correspond to information such as window identification, window size and window position. The window identification is used to uniquely indicate the window, the window size is used to indicate the size of the window, and the window position is used to indicate the position where the window is displayed.
[0080] In addition, when forwarding the application interface of the target application, Weston may also carry the window information of the window allocated by Weston to the target application. The window information may include the window identifier, window size, window position, etc.
[0081] It should be noted that, in actual applications, the interface drawn by the application may include one or more layers. When multiple layers are included, the Weston synthesizer can combine the layers according to the stacking relationship and transparency between the layers to obtain a synthesized application interface. For the sake of simplicity, the embodiment of the present application takes the interface of the target application including one layer as an example for explanation, and the embodiment of the present application does not limit the number of layers included in the interface of the target application.
[0082] After the application interface of the target application is displayed in the Android system, the user can browse the content of the application interface of the target application in the desktop of the Android system and perform corresponding operations. It can be understood that when the application interface of the target application is displayed in the desktop of the Android system, the Linux system is also running and is running in the background of the Android system.
[0083] At this point, the target application in the Linux system is started and displayed on the Android system desktop. Afterwards, the user can operate the target application in the application interface of the target application displayed on the Android system desktop. See the following description for details.
[0084] In S409, the app activity 1 corresponding to the target application detects the user's start event of the sub-interface in the application interface of the target application, and the app activity 1 sends the start event to the Linux system. The app activity 1 corresponding to the target application can monitor the user's operation events on the application interface of the target application in real time, such as: monitoring window display, movement, maximization, minimization, full screen, dragging, closing and other events. In one example, the sub-interface in the application interface of the target application can be a new interface opened under the application interface. For example, Figure 6 As shown, Figure 6 The interface 61 shown in (A) may be an application interface of the target application; Figure 6 In (B), the user can click on the "file" control 62 in the application interface 61; after the user clicks on the "file" control 62, the interface 61 can be switched to Figure 6 Interface 63 is shown in (C), wherein interface 63 can be called a sub-interface of interface 61.
[0085] In S410, the Linux system draws a sub-interface related to the startup event based on the acquired startup event, and sends the sub-interface to the proxy APK, so that the proxy APK creates an app activity corresponding to the sub-interface. After the Linux system acquires the startup event, it can draw the sub-interface related to the startup event in the manner of drawing the application interface of the target application as described above.
[0086] In S411, after the proxy APK obtains the sub-interface sent by the Linux system, it can create an app activity (app activity 2) corresponding to the sub-interface. The proxy APK can obtain the sub-interface sent by Linux through the myservice inside it, and send the demand for creating app activity 2 to the activity management service AMS in the Android system through myservice. After the activity management service AMS learns the demand of myservice, it can create an app activity 2 in the proxy APK. In this way, the sub-interface of the target application required by the user can be displayed on the desktop of the Android system, and the user can perform corresponding operations in the sub-interface.
[0087] It can be understood that by creating an app activity for different interfaces in a target application, the app activity corresponding to a certain interface can accurately identify the user's operations on the interface. This avoids the situation where a target application only corresponds to one app activity, which makes it difficult for the app activity to accurately identify user operations. This allows for immediate response to user operations, improving user experience.
[0088] In some embodiments, when the app activity corresponding to a sub-interface in an application receives a close event input by the user to close the sub-interface, the app activity can feedback the close event to the Linux system. After the Linux system receives the close event, it can close the sub-interface corresponding to the app activity, and feedback the information of closing the interface to the myservice in the proxy APK. After the myservice in the proxy APK receives the information fed back by the Linux system, it can end the life cycle of the app activity. In this way, the sub-interface that the user needs to close can be closed on the Android system desktop. For example, see Figure 7 ,exist Figure 7 In (A), a sub-interface 71 of a certain application is currently displayed; Figure 7 In (B), after the user chooses to return to the main interface (ie, clicks the return key 72), the currently displayed interface can be switched from the sub-interface 71 to the main interface 73. Figure 7 In the operation process shown, the life cycle of the app activity corresponding to the sub-interface 71 is switched from the running stage to the destroying stage, and the life cycle of the app activity ends in the destroying stage.
[0089] In addition, when the user closes an application, the app activity corresponding to the main interface of the application (that is, the app activity created when the user first opens the application) can collect the event and feedback the event to the Linux system. When the Linux system learns of the event, it can close the application corresponding to the app activity and feedback the closing event to myservice in the proxy APK. After myservice in the proxy APK obtains the information fed back by the Linux system, it can end the life cycle of each app activity related to the application. In this way, you can close the application in the Linux system in the Android system on the Android system desktop. For example, see Figure 8 ,exist Figure 8 In (A), the electronic device displays a main interface 81 of an application; Figure 8 In (B), the display interface of the application is switched from the main interface 81 to the sub-interface 82; Figure 8 In (C), the user chooses to close the application. After closing, the electronic device can display Figure 8 The interface shown in (D) is shown in Figure 8 In (A), the proxy APK in the electronic device can create an appactivity1 corresponding to the main interface 81; Figure 8 In (B), the proxy APK in the electronic device can create an appactivity2 corresponding to the sub-interface 82. At this time, there are two app activities related to the application in the proxy APK; Figure 8 In (D), the proxy APK can simultaneously or sequentially end the life cycle of app activity1 corresponding to the main interface 81 and app activity2 corresponding to the sub-interface, so that the application in the Linux system can be closed in the Android system on the Android system desktop.
[0090] Therefore, by using the activity lifecycle management solution in the Android system, the opening process of the application in the Linux system is embedded in the Android system, so that the user can quickly start the application in the Linux system by clicking the desktop icon of the application in the Linux system displayed on the desktop of the Android system, so that the way to start the Linux application is the same as the way to start the Android application, and then the user can operate the Linux application on the Android system without distinction, thereby improving the user experience. In addition, the application in the Linux system will not be controlled in an emulator window on the desktop of the Android system, so that the user can arbitrarily operate the application interface of the application in the Linux system on the desktop of the Android system, such as dragging and dropping.
[0091] To facilitate understanding, the following example is used to illustrate.
[0092] For example, Fig. 9 FIG. 1 shows a process of running a Linux application on an Android system. Fig. 9 As shown, the electronic device 90 is equipped with an Android system and a Linux system, and the main system of the electronic device 90 is the Android system. Fig. 9 In (A), the electronic device displays the desktop of the Android system, and three applications are installed in the Android system, namely Android App1, Android App2 and proxy APK.
[0093] exist Fig. 9 In (A), the user can click the icon of the "Proxy APK" application. Then, the proxy APK in the Android system can interact with the Linux system and generate a desktop icon of the application installed in the Linux system on the Android system desktop, showing Fig. 9 The interface shown in (B). Fig. 9 In (B), a desktop icon of an application installed in the Linux system is generated on the Android system desktop as Linux App 91. Then, the user can start the application in the Linux system on the Android desktop. Fig. 9 In (C), the user can click on the desktop icon LinuxApp91 of the Linux application on the desktop of the Android system. After the user clicks on the desktop icon Linux App91, the Android system can display the application interface of the application corresponding to the desktop icon Linux App91, that is, display the following Fig. 9 The interface shown in (D). Fig. 9 In (D), the interface 92 may be an application interface of an application corresponding to the desktop icon Linux App 91. Fig. 9 In (D), the user can operate the interface 92 as needed. Fig. 9 In (E), the user can choose to maximize the interface 92. After the user selects, the electronic device 90 can display Fig. 9 The interface shown in (F) at this time, the interface 92 covers the entire display screen of the electronic device 90, that is, covers the entire desktop of the Android system on the electronic device 90.
[0094] For example, Fig.10The figure shows a management process of the activity life cycle in the Android system. When the user switches between interfaces, the activity will also switch between multiple states, such as visible or invisible state, foreground or background state. When the activity switches between different states, different life cycle methods will be called back. Among them, the Activity class can provide many callbacks, which will let the activity know that a state has changed, such as: the system is creating, stopping or resuming an activity, or destroying the process where the activity is located, etc. In order to navigate between the various stages of the activity life cycle, the Activity class provides six core callbacks: onCreate(), onStart(), onResume(), onPause(), onStop(), and onDestroy(). When the activity enters a new state, the system will call one or more of these callbacks.
[0095] For example, in the onCreate() phase, when the activity is clicked (Activity Launched), the system calls onCreate() of activity 1. In this phase, activity 1 can be initialized, such as using setContentView to load the layout, initializing some controls and variables, etc. At this time, activity 1 is in the background and is not visible.
[0096] After the onCreate() phase is completed, the life cycle of activity 1 enters the onStart() phase. Activity 1 is currently visible, but has not yet appeared in the foreground and cannot interact with the user. In this phase, the animation in activity 1 can be initialized.
[0097] After the onStart() phase is completed, the life cycle of activity 1 enters the onResume() phase. In the onResume() phase, the current state of activity 1 is running, and activity 1 can interact with the user.
[0098] When another activity (such as activity 2) covers activity 1 to enter the foreground interface, the life cycle of activity 1 will enter the onPouse() phase, in which activity 1 is visible but cannot interact with the user.
[0099] After the onPouse() phase is completed, the life cycle of activity 1 can enter the onStop() phase. At this time, activity 1 is invisible to the user and may be recycled by the system if the system memory is tight.
[0100] After the onStop() phase is completed, the life cycle of activity 1 enters the onDestory() phase, in which activity 1 can be destroyed. After the onDestory() phase is completed, activity 1 is shut down, and the life cycle of activity 1 ends.
[0101] In addition, after the onPouse() phase is completed, if the user brings activity 1 back to the foreground interface, activity 1 can cover activity 2. At this time, the life cycle of activity 1 can re-enter the onResume() phase.
[0102] After the onStop() phase is completed, when you switch back to activity 1 from activity 2, or when you return to activity 1 from the desktop, that is, when you return to activity 1, the life cycle of activity 1 can enter onRestart(). No operation can be performed in the onRestart() phase, and the life cycle of activity 1 can enter the onStart() phase through this phase.
[0103] In addition, when the system is low on memory, when a higher priority application needs memory, the process of the lower priority activity1 can be killed to reclaim memory. When the user switches back to activity1, the life cycle of activity1 can re-enter the onCreate() phase.
[0104] Combine the following Fig.10 ,right Figure 4 Describes the life cycle of the activities involved in the method of running applications across systems described in .
[0105] 1) The process of displaying the application icon of Linux system application on the Android system desktop
[0106] like Fig.10 As shown, after the user clicks the icon of the proxy APK, the mainactivity corresponding to the proxy APK can be started (i.e. Figure 4Step S401 in the above example), at this time, the main activity starts running and enters the "created" state, i.e. Fig.10 The activity launched phase. Fig.10 Creating activity1 in the example can be understood as creating the main activity.
[0107] Next, enter the onCreate() phase. In the onCreate() phase, activity 1 can determine whether the container environment that the Linux application depends on has been installed. If not, it prompts the user to install it and completes the installation in the current thread. If the container environment that the Linux application depends on has been installed, a separate thread will be started in the background to pull up the basic environment for the Linux system to run (i.e. Figure 4 The steps described in S402 and S403, and the step of starting the Linux system described in S404).
[0108] Next, enter the onStart() phase. In the onStart() phase, activity 1 can use the applist function to monitor the / usr / share / applications / *.desktop and icon directories in the Linux system to obtain application information of the installed Linux system applications, such as: application name, executable file path, and application icon, etc. (i.e. Figure 4 After activity 1 obtains the application information of the application in the Linux system, it can dynamically register this information to the desktop of the Android system. After that, the desktop icons of these obtained Linux applications (i.e., Figure 4 In addition, after the application in the Linux system is uninstalled, the background service in the Android system can still scan the aforementioned directories in the Linux system to achieve dynamic removal of the Linux application shortcut icon on the Android system desktop.
[0109] Next, enter the onResume() phase. In the onResume() phase, activity 1 can start the myservices service by sending a message through the handler, so as to establish a channel connection with the launched Linux container through myservice, so that subsequent input, window, session, etc. initialization can be performed through myservice.
[0110] Then, it can enter the onDestory() phase through the activity is running phase, the onPause() phase, and the onStop() phase. In the onDestory() phase, activity 1 can automatically end its operation. At this point, the life cycle of activity 1 ends. For example, activity 1 does not need to perform any operations in the activity running phase, the onPause() phase, and the onStop() phase, but only needs to follow the process.
[0111] 2) The process of launching Linux applications through desktop icons on Android
[0112] like Fig.10 As shown, after the user clicks the application icon of the Linux application (hereinafter referred to as the "target application") on the desktop of the Android system, a new main activity 2 (i.e. Figure 4 The main activity 2 can send information including the application identifier of the target application and the executable path of the target application to the Linux system through myservice during the onCreate() phase, so as to start the target application in the Linux system (i.e. Figure 4 The main activity 2 can fork the application process of the target application, and then notify the proxy APK to pull up a new app activity through the JNI interface callback, and establish a mapping relationship with the target application on the Linux side clicked by the user (i.e. Figure 4 (part of the steps described in S407).
[0113] After that, the main activity 2 can enter the onDestory() phase through the onStart() phase, onResume() phase, activity isrunning phase, onPause() phase and onStop() phase. In the onDestory() phase, the main activity 2 can automatically end its operation. At this point, the life cycle of the main activity 2 ends. Exemplarily, the main activity does not need to perform any operations in the onStart() phase, onResume() phase, activity is running phase, onPause() phase and onStop() phase, and only needs to follow the process.
[0114] The life cycle of the app activity launched by the proxy APK can also be Fig.10 The life cycle of the activity is shown in . At each stage of the app activity life cycle, the app activity will monitor the window display, movement, maximization, minimization, full screen, dragging, closing, etc. of the target application associated with it, and transmit these events to the Linux system through a protocol (such as FreeRDP). In addition, the Linux system can also transmit the results of the response event back to the app activity through the protocol, and then the app activity will perform corresponding processing, such as adjusting the window size, etc. When the app activity monitors the event of closing the target application, the app activity can enter the onDestory() stage and remove the window from the Android system desktop, thereby achieving the same closing experience as ordinary Android.
[0115] In addition, when the app activity monitors the user opening a sub-interface in the main interface of the target application, the proxy APK can pull up an app activity corresponding to the sub-interface, thereby monitoring the user's operation on the sub-interface through the app activity corresponding to the sub-interface (i.e. Figure 4 The life cycle of the app activity corresponding to the sub-interface may also be Fig.10 In addition, when the proxy APK launches an app activity corresponding to the sub-interface, the app activity corresponding to the main interface of the target application (i.e., the app activity launched by the proxy APK notified by the main activity above) can enter the onPause() phase, or enter the onStop() phase.
[0116] It is understandable that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0117] Corresponding to the method for running applications across systems described in the above embodiment, an embodiment of the present application also provides a device for running applications across systems. The device has the function of implementing the method for running applications across systems described above, which will not be repeated here.
[0118] It is understandable that the electronic devices involved in the embodiments of the present application may be mobile phones, tablet computers, desktop computers, laptop computers, handheld computers, notebook computers, ultra-mobile personal computers (UMPC), netbooks, as well as cellular phones, personal digital assistants (PDA), augmented reality (AR) devices, virtual reality (VR) devices, artificial intelligence (AI) devices, wearable devices, vehicle-mounted devices, smart home devices and / or smart city devices, etc. Exemplary embodiments of electronic devices include but are not limited to electronic devices equipped with iOS, Android, Windows, Harmony OS or other operating systems, wherein the specific type of the electronic device is not particularly limited in the embodiments of the present application.
[0119] The electronic device involved in the embodiment of the present application is introduced below. Fig.11 , Fig.11 1 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may be, but is not limited to, equipped with at least two software systems, such as an Android system and a Linux system.
[0120] like Fig.11 As shown, the electronic device 1100 may include a processor 1110 , a memory 1120 , and a display screen 1130 .
[0121] The processor 1110 may be a general-purpose processor or a dedicated processor. For example, the processor 1110 may include a central processing unit (CPU) and / or a baseband processor. The baseband processor may be used to process communication data, and the CPU may be used to implement corresponding control and processing functions, execute software programs, and process data of software programs.
[0122] Exemplarily, the processor 1110 may include one or more processing units. The processor 1110 may include one or more of an application processor (AP), a modem, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). Different processors may be independent devices or integrated into one or more processors.
[0123] The memory 1120 may store a program, which may be executed by the processor 1110 so that the processor 1110 executes the method described in the embodiment of the present application. The memory 1120 may also store data. The processor 1110 may read the data stored in the memory 1120. The memory 1120 and the processor 1110 may be provided separately. Alternatively, the memory 1120 may also be integrated in the processor 1110.
[0124] The display screen 1130 is used to display images, videos, etc. The display screen 1130 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. Exemplarily, the display screen 1130 can be, but is not limited to, a folding screen, that is, a display screen that can be folded. Exemplarily, the display screen 1130 can be used to display icons of Android applications and / or icons of Linux applications, etc.
[0125] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 1100. In other embodiments of the present application, the electronic device 1100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0126] Based on the method described in the above embodiment, the present application embodiment also provides a chip. Fig.12 , Fig.12 This is a schematic diagram of the structure of a chip provided in an embodiment of the present application. Fig.12 As shown, the chip 1200 includes one or more processors 1201 and an interface circuit 1202. Optionally, the chip 1200 may also include a bus 1203. Among them:
[0127] The processor 1201 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 1201 or an instruction in the form of software. The above-mentioned processor 1201 can be a general-purpose processor, a neural network processor (Neural Network Processing Unit, NPU), a digital communicator (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods and steps in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.
[0128] The interface circuit 1202 can be used to send or receive data, instructions or information. The processor 1201 can use the data, instructions or other information received by the interface circuit 1202 to process, and can send the processing completion information through the interface circuit 1202.
[0129] Optionally, the chip 1200 also includes a memory, which may include a read-only memory and a random access memory, and provides operation instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory (NVRAM). The memory may be coupled to the processor 1201.
[0130] Optionally, the memory stores executable software modules or data structures, and the processor 1201 can perform corresponding operations by calling operation instructions stored in the memory (the operation instructions can be stored in the operating system).
[0131] Optionally, the interface circuit 1202 may be used to output the execution result of the processor 1201 .
[0132] It should be noted that the corresponding functions of the processor 1201 and the interface circuit 1202 can be implemented through hardware design, software design, or a combination of hardware and software, and there is no limitation here.
[0133] It should be understood that each step of the above method embodiment can be completed by a hardware-based logic circuit or a software-based instruction in a processor.
[0134] It is understood that the processor in the embodiments of the present application may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. The general-purpose processor may be a microprocessor or any conventional processor.
[0135] The method steps in the embodiments of the present application can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC.
[0136] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.
[0137] It should be understood that the various numerical numbers involved in the embodiments of the present application are only used for the convenience of description and are not used to limit the scope of the embodiments of the present application.
Claims
1. A method for running an application across systems, characterized in that: Applied to an electronic device, the electronic device is equipped with a first software system and a second software system, the second software system runs based on the first software system; The method comprises: In response to the acquired first operation, acquiring, through the first software system, application information of at least one target application in the second software system, the target application being an application installed in the second software system, the application information including one or more of an icon, an identifier, and an executable path of the target application; Displaying a desktop icon of the target application in the first software system.
2. The method according to claim 1, characterized in that The first software system is an Android system, and the second software system is a Linux system.
3. The method according to claim 1 or 2, wherein: The application programs of the Linux system include: one or more of an X11 application program (X11 APP) and a wayland application program (wayland app).
4. The method according to any one of claims 1 to 3, characterized in that The acquiring, through the first software system, application information of at least one target application in the second software system specifically includes: According to the first operation, starting a first main activity in the proxy Android application package APK in the first software system; Sending a first message to the second software system through the first main activity, where the first message is used to obtain application information of at least one target application in the second software system; A second message fed back by the second software system is obtained through the first main activity, where the second message includes application information of the at least one target application.
5. The method according to claim 4, characterized in that The first main activity communicates with the Linux system through the native in the proxy APK, and the communication protocol between the two is the free remote desktop protocol.
6. The method according to claim 4 or 5, characterized in that: The first main activity communicates with the Linux system through the native in the proxy APK.
7. The method according to any one of claims 4 to 6, characterized in that The communication protocol between the first main activity and the Linux system is the Free Remote Desktop Protocol.
8. The method according to any one of claims 4 to 7, characterized in that Displaying the desktop icon of the target application in the first software system specifically includes: The application information of the target application is registered in the desktop launcher of the first software system through the first main activity, so as to display the desktop icon of the target application in the first software system.
9. The method according to any one of claims 4 to 8, characterized in that After displaying the desktop icon of the target application in the first software system, the method further includes: Control the first main activity to end running.
10. The method according to any one of claims 4 to 9, characterized in that: Before sending the first message to the second software system through the first main activity, the method further includes: Determining, by means of the first main activity, whether the first software system satisfies the operating environment of the second software system; If the conditions are met, sending a first message to the second software system through the first main activity; If not, the second software system is automatically installed, or a prompt message is displayed on the display interface of the first software system, the prompt message being used to prompt the installation of the second software system.
11. The method according to any one of claims 1 to 10, characterized in that: After displaying the desktop icon of the target application in the first software system, the method further includes: In response to the acquired second operation, starting a second main activity in the proxy Android application package APK in the first software system, wherein the second operation is an operation of starting the target application; Notifying the second software system to start the target application through the second main activity, and notifying the proxy APK to establish a first application activity app activity 1 associated with the target application; Acquiring, through the first application activity, an application interface of the target application sent by the second software system; An application interface of the target application is displayed in the first software system.
12. The method according to claim 11, characterized in that After notifying the second software system to start the target application through the second main activity and notifying the proxy APK to establish a first application activity associated with the target application, the method further includes: Control the second main activity to end running.
13. The method according to claim 11 or 12, characterized in that: After displaying the application interface of the target application in the first software system, the method further includes: Acquire a third operation through the app activity 1, where the third operation is an operation of starting a sub-interface in the application interface; Notifying the second software system to start a sub-interface in the application interface through the app activity 1; Acquire a sub-interface in the application interface sent by the second software system through the proxy APK, and establish a second application activity app activity 2 associated with the sub-interface; The sub-interface in the application interface is displayed in the first software system.
14. The method according to claim 13, characterized in that After displaying the sub-interface in the application interface in the first software system, the method further includes: Control the app activity 1 to pause running.
15. The method according to claim 11 or 12, characterized in that: After displaying the sub-interface in the application interface in the first software system, the method further includes: In response to the operation of closing the sub-interface acquired by the app activity 2, the app activity 2 is controlled to end its operation, and / or the app activity 1 is controlled to switch from a paused operation state to a resumed operation state.
16. The method according to any one of claims 11 to 15, characterized in that: After displaying the application interface of the target application in the first software system, the method further includes: In response to the operation of closing the application interface acquired by the app activity 1, controlling the app activity 1 to end running; Among them, when the proxy APK establishes app activity 2 associated with the sub-interface of the application interface, the app activity 2 associated with the sub-interface of the application interface is controlled to end running at the same time.
17. An electronic device, characterized in that: include: A processor, wherein the processor is used to run a computer program stored in a memory so that the electronic device implements the method according to any one of claims 1 to 16.
18. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 16 is implemented.
19. A computer program product, characterized in that When the computer program product runs on an electronic device, the electronic device is enabled to implement the method according to any one of claims 1 to 16.
20. A chip, characterized in that: comprising at least one processor and an interface; The at least one processor obtains program instructions or data through the interface; The at least one processor is used to execute the program line instructions to implement the method according to any one of claims 1-16.