Method for running application program, related device and medium

By identifying and migrating the application's portable processes to run on suitable hardware devices, the problems of high energy consumption and insufficient resources in existing technologies are solved, resulting in smoother application operation and a better user experience.

CN113535252BActive Publication Date: 2025-11-28HUAWEI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010290606.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-04-14
Publication Date
2025-11-28
Estimated Expiration
2040-04-14

AI Technical Summary

Technical Problem

In the existing technology, the way applications allocate processes leads to excessive power consumption when electronic devices are running, and processes cannot be executed or are inefficient when there is a lack of necessary hardware resources, resulting in problems such as crashes and freezes.

Method used

By identifying migrateable processes within an application and migrating them to suitable hardware resources in surrounding electronic devices based on their capability requirements, distributed resource utilization ensures that processes run on appropriate devices, resulting in smoother operation.

Benefits of technology

It effectively reduces the operating load on electronic devices, ensures the reliability and smoothness of processes, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113535252B_ABST
    Figure CN113535252B_ABST
Patent Text Reader

Abstract

The application provides a running method of an application program, related equipment and a medium. The method comprises the following steps: identifying a migratable process in the application program in advance, determining the capability requirement of running the migratable process based on the API called in the migratable process, and when starting the application program, searching for a second electronic device with the capability requirement corresponding to the migratable process from surrounding equipment, so as to migrate the migratable process to the second electronic device for running. The suitable process is allocated to the suitable hardware resource for running, the distributed resource utilization is realized, the hardware capability of the surrounding electronic device is fully utilized, the process of the application program is still available after migration, the reliability is ensured, the process running is further smoother, the presentation effect is better, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, and in particular, to a running method of an application program, a related device and a medium. BACKGROUND

[0002] With the wide use of electronic devices, various application programs carried on the electronic devices are also welcomed by users. In order to bring better experience to users, application program developers continuously optimize and increase the functions of the application programs, so that the operation of the application programs is more and more cool, the content is more and more rich, and the function is more and more powerful. In this way, the size of the application program becomes larger and larger, the storage space occupied becomes more and more, and the processing capacity requirement of the electronic device becomes higher and higher. Therefore, when the electronic device runs the application program, the energy consumption is prone to be too high, which leads to the application program crashing, the electronic device freezing and the like.

[0003] In the prior art, the application program is divided into multiple processes and distributed to multiple electronic devices for processing, and the general operation capacity of the multiple electronic devices, i.e. the operation capacity of the central processing unit (CPU) is utilized to realize parallel processing of the multiple processes. In this way, the multiple electronic devices utilize the respective CPUs to jointly complete the processing of the multiple processes of the application program, thereby reducing the energy consumption generated when a single electronic device processes the application program.

[0004] However, some processes not only need to utilize the CPU, but also need to utilize other resources (for example, a gravity sensor), and if some electronic devices do not have these resources, such a distribution manner may lead to the failure of execution of some processes. Some processes can utilize the CPU to be completed, but the implementation effect and processing efficiency are not very good, for example, when a game is run, the picture resolution may be low and the fluency may be poor. SUMMARY

[0005] The present application provides a running method of an application program, a related device and a medium. The method can be implemented by a first electronic device such as a smart terminal, and the method can pre-identify a migratable process in the application program and determine the capability requirement for running the migratable process based on the API called therein, so as to find a second electronic device in the surrounding devices which has the capability requirement for running the migratable process, so as to migrate the migratable process to the second electronic device for running. The method can realize the distribution of the suitable processes to the suitable hardware resources in the surrounding for running, realize the distributed resource utilization, fully utilize the hardware capability of the surrounding electronic devices, make the processes of the application program still available after migration, ensure the reliability, further make the processes run more smoothly and present better effect, and improve the user experience.

[0006] The following describes the present application from multiple aspects. It is easily understood that the implementation of the following multiple aspects can refer to each other.

[0007] In a first aspect, the present application provides a running method of an application. After receiving an application starting instruction under a timing or a user trigger, a first electronic device can start the application. Before starting the application, the first electronic device has obtained each migratable process corresponding to the application and the capability requirement of running the migratable process. The above information can be determined by the first electronic device after automatically analyzing and classifying the migratable process according to the code or other files of the application, or can be directly obtained from other electronic devices. In addition, the first electronic device also obtains the hardware information of a surrounding second electronic device. This obtaining process can be periodic or after starting the application. The hardware information of the second electronic device is used to represent the name, model, identification, parameters, etc. of the hardware possessed by the second electronic device. Based on this, when starting the application, the first electronic device can check whether there is a corresponding migratable process in the database. If there is, the hardware of the surrounding second electronic device is further determined whether it has the capability of running the migratable process according to the hardware information of the second electronic device. If the hardware of the second electronic device has the capability of running the migratable process, the first electronic device migrates the migratable process to the second electronic device when running the application, that is, when the application runs to the migratable process. If there are multiple second electronic devices that meet the capability requirement, the first electronic device can determine a target second electronic device for migration. The target second electronic device can be the one with the highest capability among all the second electronic devices, or the one with the most functions, or other possible cases. At least one process in the application communicates through an inter-process communication (IPC) mode, that is, the data or result after the execution of a process can be called and shared by other processes.

[0008] In this technical solution, since the processes of the application are identified and classified in advance, and the capability requirement of running the migratable process is determined, at least one process in the application that is migratable can be found a suitable second electronic device and migrated to run according to the above method. Thus, the advantage hardware resources of the surrounding electronic devices can be mobilized, the running load of the first electronic device is reduced, the processes of the application are still available after migration, the reliability is ensured, and the running of the application is smoother and better, achieving multiple purposes at once.

[0009] In a possible implementation manner of the first aspect, the first electronic device can analyze the application program by itself, specifically including identifying processes in the application program, determining the migratable processes, and then determining application program interfaces (APIs) called by the migratable processes. Since the APIs actually need to call many underlying functions, the functions need to be executed by corresponding entities, and therefore, the corresponding capability requirements of running the migratable processes can be determined according to the function categories of the APIs called by the migratable processes. If the hardware corresponding to the hardware information of the second electronic device meets the capability requirements of running the migratable processes, it indicates that the hardware corresponding to the hardware information of the second electronic device has the capability of running the migratable processes.

[0010] In the technical solution, the first electronic device identifies the migratable processes of the application program, can determine which processes are migratable, and simultaneously determines the capability requirements of running the migratable processes according to the function categories of the APIs called by the migratable processes, thereby laying a foundation for subsequently finding the most suitable second electronic device.

[0011] In a possible implementation manner of the first aspect, the first electronic device can determine the process name of the application program according to an extensible markup language (XML) file of the application program, and identify the processes in the application program based on the process name.

[0012] In the technical solution, the processes are directly determined through the XML file, and there is no need to analyze the code of the application program in more details, so that the identification speed is high.

[0013] In a possible implementation manner of the first aspect, the first electronic device determines the classes in the code of the application program, and identifies the classes with the inter-process communication (IPC) function as the processes of the application program.

[0014] In the technical solution, according to the characteristic that the independent processes have the IPC mechanism to implement inter-process communication, the processes in the application program can also be quickly determined through the identification of the IPC function.

[0015] In a possible implementation manner of the first aspect, the first electronic device obtains functions called in the migratable processes, and determines the APIs therein, thereby determining the APIs called by the migratable processes.

[0016] In one possible implementation of the first aspect, when the API called by the portable process corresponds to multiple functional categories, the first electronic device can determine the target functional category with the highest priority among the multiple functional categories corresponding to the called API based on the priority of the functional categories, and use the capability requirements corresponding to the target functional category as the capability requirements for running the portable process. Specifically, the priority can be determined based on the importance or impact of the functional category on the current application, or it can be determined based on the hardware capabilities of the first electronic device.

[0017] This technical solution is generally applicable when the second electronic device is an electronic device with relatively complete hardware functions (such as a computer, smartphone, smart TV, etc.). Therefore, when determining the migration device later, the second electronic device with the most suitable high-priority functions can be selected for migration.

[0018] In one possible implementation of the first aspect, if the API called by the portable process includes multiple functional categories, the first electronic device determines the capability requirements corresponding to all multiple functional categories as the capability requirements for running the portable process based on the multiple functional categories corresponding to the called API.

[0019] In this technical solution, all functional categories corresponding to the API are included in the capability requirements of the portable process, which can ensure that the portable process can run reliably after being migrated to the second electronic device.

[0020] In one possible implementation of the first aspect, the capability requirement corresponding to running the portable process can be the hardware information of a certain type of hardware capable of running the portable process. Then, if the first electronic device determines that the hardware information of the second electronic device matches the hardware information corresponding to the portable process, it means that the hardware corresponding to the hardware information of the second electronic device satisfies the capability requirement corresponding to running the portable process.

[0021] In this technical solution, the capability requirements corresponding to the running of the migrated process have been pre-set as specific hardware information. Therefore, the first electronic device does not need to perform too many capability queries and comparisons, but can directly match the information. In particular, when the hardware information corresponding to the migrated process and the hardware information of the second electronic device both include the same type of information, information matching can be achieved quickly.

[0022] In one possible implementation of the first aspect, if the hardware information of the second electronic device meets the capability requirements for running the transferable process, the first electronic device still needs to further determine that the hardware capability of the second electronic device is higher than that of the first electronic device itself before migrating the transferable process to the second electronic device.

[0023] In the technical solution, if the hardware capability of the second electronic device is not as good as that of the first electronic device, even if the second electronic device can run the migratable process, the migratable process does not need to be migrated, and meaningless migration of the migratable process can be avoided.

[0024] In a possible implementation manner of the first aspect, if multiple second electronic devices meet the capability requirement for running the migratable process, the first electronic device can determine a target second electronic device from the multiple second electronic devices, and migrate the migratable process to the target second electronic device. The hardware capability of the target second electronic device is the highest, or the hardware resource is the most, or the hardware type is the most comprehensive, among the hardware capabilities of the multiple second electronic devices, so that a more optimal and reliable running effect is achieved.

[0025] In a possible implementation manner of the first aspect, if multiple second electronic devices meet the capability requirement for running the migratable process, the first electronic device can display the hardware information of the multiple second electronic devices, and a user can select one of the multiple second electronic devices as a target second electronic device for migration, so as to meet the user requirement.

[0026] In the second aspect, the present application provides a first electronic device. The first electronic device can include a starting module, a monitoring module, and a migration module. In some implementation manners, the first electronic device can further include a process identification module, an API identification module, and a capability identification module. The first electronic device implements part or all of the methods provided in any implementation manner of the first aspect through the above modules.

[0027] In the third aspect, the present application provides a first electronic device including a memory and a processor. The memory is configured to store computer readable instructions (or computer programs), and the processor is configured to read the computer readable instructions to implement the methods provided in any implementation manner of the first aspect.

[0028] In the fourth aspect, the present application provides a computer storage medium, which can be nonvolatile. The computer storage medium stores computer readable instructions. When the computer readable instructions are executed by a processor, the methods provided in any implementation manner of the first aspect are implemented.

[0029] In the fifth aspect, the present application provides a computer program product. The computer program product includes computer readable instructions. When the computer readable instructions are executed by a processor, the methods provided in any implementation manner of the first aspect are implemented. BRIEF DESCRIPTION OF DRAWINGS

[0030] Figure 1 An application scenario schematic diagram of a running method of an application program provided by an embodiment of the present application;

[0031] Figure 2 A structural schematic diagram of a first electronic device or a second electronic device provided for an embodiment of the present application;

[0032] Figure 3 A software architecture schematic diagram of a first electronic device or a second electronic device provided for an embodiment of the present application;

[0033] Figure 4 An example diagram of a class diagram provided for an embodiment of the present application;

[0034] Figure 5 An example diagram of a call relationship diagram provided for an embodiment of the present application;

[0035] Figure 6 A flow schematic diagram of a running method of an application program provided for an embodiment of the present application;

[0036] Figure 7 An XML file example diagram of an Android-based application program provided for an embodiment of the present application;

[0037] Figure 8 Another structural schematic diagram of a first electronic device provided for an embodiment of the present application. DETAILED DESCRIPTION

[0038] In order to facilitate the understanding of the technical solutions of the embodiments of the present application, first, the application scenarios applicable to the related technologies of the present application are introduced.

[0039] In life, people often run various application programs (such as games, social software, work software, etc.) on electronic devices to meet the daily needs of work, entertainment, etc. However, with the increasing size of application programs, more and more hardware resources are occupied, often leading to problems such as black screen and death of electronic devices. On the other hand, with the improvement of living standards, users mostly have many electronic devices, such as desktop computers, smart televisions, smart phones, tablet devices, VR (Virtual Reality) headsets, etc. Different electronic devices have different configurations and each has its own advantages, for example, a smart television has a large screen and can provide better visual experience; a desktop computer has a very powerful CPU and can run more complex programs; a smart phone has better and more cameras and various types of sensors; a VR headset has a virtual reality environment graphics processing unit (GPU) and display device, as well as cameras and infrared devices that capture user eye, hand, body, etc. information.

[0040] Therefore, the application running method provided in this application aims to automatically classify and identify each process in the application, and allocate the appropriate process to the surrounding suitable hardware resources to run. This can achieve distributed resource utilization, alleviate the energy consumption of running all processes of the application on only one electronic device, make full use of the hardware capabilities of the surrounding electronic devices, ensure the reliability of the application process after migration, and further make the process run more smoothly or present a better effect, thereby improving the user experience.

[0041] like Figure 1 The diagram illustrates an application scenario for the running method of the application provided in this embodiment. One or more second electronic devices 102 exist around the first electronic device 101 (three second electronic devices 102A, 102B, and 102C are shown in the diagram). Each second electronic device 102 is configured with corresponding hardware. Various applications are installed on the first electronic device 101, and each application can include at least one process during runtime. By analyzing the application's code and / or related documentation, the first electronic device 101 can determine how many processes are in the application, the process code of each process, and whether the process is portable. Based on the process code analysis, the application programming interface (API) that each process in the application will call during runtime can be determined. Different APIs can be categorized into different functional types, such as user interface (UI) APIs, GPU APIs, neural network processing unit (NPU) APIs, etc. Based on the functional type of the APIs called by the process, the capability requirements for running the process can be determined. When the first electronic device 101 starts an application, it can determine which second electronic device 102 has the hardware capability to run one or more transferable processes in the application based on the hardware information of the surrounding second electronic devices 102 and the capability requirements corresponding to the running process obtained from the above analysis. Then, it transfers these transferable processes to the second electronic device 102 with the running capability. For example, if the second electronic device 102B has a GPU chip, and process A in the application started by the first electronic device 101 calls a GPU-class API, then during the application's execution, specifically when the application reaches process A, the first electronic device 101 can transfer process A to the second electronic device 102B, where the second electronic device 102B will run process A.

[0042] It should be noted that a process is an independent function of a program about a certain data set, and is the smallest unit of resource allocation of a computer system, which can apply for and own system resources. A program refers to the description of instructions, data and their organization form, and a process is an entity of a program. The technical solution of the present application can determine which code will run as an independent process during application running through static code analysis. Therefore, although the application has not generated a corresponding entity to run during the analysis process, it can also be considered as identification and migration of the process in the application.

[0043] It should also be noted that the multiple processes in the application in the embodiments of the present application can communicate through an inter-process communication (IPC) mode. Generally, each process has its own part of independent system resources and is isolated from each other. In order to enable different processes to access resources and work in coordination, inter-process communication is needed. These processes can run on the same computer or different computers connected by a network, and thus the application in the case of multiple processes can obtain the result after process running through the IPC mode, so as to facilitate the calling or outputting of a process to the running result of another process and the like. In a possible implementation manner, the inter-process communication can be implemented by using a remote procedure call (RPC) mode. RPC is a way of inter-process communication, which can allow a process to call a procedure or function in another address space. In the implementation scenario of the embodiments of the present application, since the processes in the application in the first electronic device 101 are migrated to the second electronic device 102 for running, it can be understood that the first electronic device 101 and the second electronic device 102 should both have the inter-process communication function, so as to ensure that the processes in the application can still communicate when the processes are distributed in different electronic devices for running. Specifically, the first electronic device 101 and the second electronic device 102 can install the same operating system with the inter-process communication function. For example, in an Android operating system, the Android binder mechanism can be modified by modifying the Android operating system OS layer, so that the Android binder can support cross-device IPC communication (RPC calling); thus, the application code in the application layer can directly communicate between processes without any modification.

[0044] The technical solution of the present application is applicable to various application scenarios in which application programs capable of inter-process communication run in the first electronic device, and the running methods of each application program are consistent. Similarly, each application program includes at least one process, and the migration method and running method of each migratable process are also the same when the migratable condition is met. Therefore, the running method of the application program is described below mainly by taking any migratable process in an application program as an example.

[0045] The first electronic device 101 and the second electronic device 102 in the embodiments of the present application can be specifically a smart electronic device such as a mobile phone, a tablet computer, a smart television, a notebook computer, a vehicle-mounted device, a wearable device, and the like. In one implementation scenario, the first electronic device 101 and the second electronic device 102 can have an association relationship, which can be specifically that the operating systems of the first electronic device 101 and the second electronic device 102 are logged in the same account (for example, a mobile phone, a computer, and a tablet computer logged in the same Android account), or the first electronic device 101 and the second electronic device 102 have been bound or paired. In another implementation scenario, the second electronic device 102 only needs to be around the first electronic device 101, that is, the first electronic device 101 can search for and communicate with the second electronic device 102, for example, the first electronic device 101 can search for the second electronic device 102 through Bluetooth, or the first electronic device 101 detects that the second electronic device 102 belongs to the same local area network.

[0046] It should be understood that the application scenarios described in the embodiments of the present application are for more clearly illustrating the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. It can be known by those skilled in the art that the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems as new application scenarios appear.

[0047] The electronic device provided by the embodiments of the present application is first introduced below.

[0048] Figure 2 A structural schematic diagram of a first electronic device or a second electronic device according to an embodiment of the present application is shown, which is hereinafter collectively referred to as an electronic device 100.

[0049] It should be understood that the electronic device 100 can have more or fewer components than those shown in the figure, can combine two or more components, or can have a different component configuration. The various components shown in the figure can be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and / or application specific integrated circuits.

[0050] The electronic device 100 can include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headset interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 can include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

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

[0052] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to instruction operation codes and timing signals, and complete the control of fetching instructions and executing instructions.

[0053] The memory in the processor 110 can also be provided for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can save instructions or data that the processor 110 has just used or repeatedly uses. If the processor 110 needs to use the instructions or data again, it can be directly called from the memory. This avoids repeated access and reduces the waiting time of the processor 110, thus improving the efficiency of the system.

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

[0055] It can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is only illustrative and does not constitute a structural limitation of the electronic device 100. In some other embodiments of the present application, the electronic device 100 can also use different interface connection methods or a combination of multiple interface connection methods in the above embodiments.

[0056] The charging management module 140 is configured to receive a charging input from a charger. The charger can be a wireless charger or a wired charger.

[0057] The power management module 141 is configured to connect the battery 142 and the charging management module 140 to the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160, etc.

[0058] The wireless communication function of the electronic device 100 can be realized through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor, etc.

[0059] The electronic device 100 realizes the display function through the GPU, the display screen 194, and the application processor, etc. The GPU is a microprocessor for image processing, which is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs, which execute program instructions to generate or change display information.

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

[0061] The electronic device 100 can implement a photographing function through an ISP, the camera 193, a video codec, a GPU, the display screen 194, and an application processor, and the like.

[0062] The ISP is configured to process data fed back by the camera 193. For example, when taking a photo, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing to convert it into an image visible to the naked eye. The ISP can also optimize algorithms for noise, brightness, and skin color of the image. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be disposed in the camera 193.

[0063] The camera 193 is used to capture still images or videos. An object projects an optical image through a lens to a photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transmitted to an ISP to be converted 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 image signal in RGB, YUV, or the like. In embodiments of the present application, the camera 193 includes a camera for capturing images required for face recognition, such as an infrared camera or other camera. The camera for capturing images required for face recognition is generally located on the front of the electronic device, for example, above the touch screen, or can be located at other positions, which is not limited in embodiments of the present application. In some embodiments, the electronic device 100 can include other cameras. The electronic device can also include a dot matrix emitter (not shown in the figure) for emitting light. The camera captures the light reflected by the face to obtain a face image, and the processor processes and analyzes the face image by comparing it with the stored face image information to verify.

[0064] The digital signal processor is used to process digital signals, in addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, etc.

[0065] The video codec is used to compress or decompress digital videos. The electronic device 100 can support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as: moving picture experts group (MPEG) 1, MPEG 2, MPEG 3, MPEG 4, etc.

[0066] The NPU is a neural-network (NN) computing processor, which can quickly process input information by referring to the structure of a biological neural network, for example, by referring to the transmission mode between human brain neurons, and can also continuously self-learn. Through the NPU, the electronic device 100 can realize intelligent cognition and other applications, such as: image recognition, face recognition, voice recognition, text understanding, etc.

[0067] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to extend the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos are stored in the external memory card.

[0068] The internal memory 121 can be used to store computer executable program code including instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 can include a program storage area and a data storage area. The program storage area can store an operating system, at least one application required for a function (such as a face recognition function, a fingerprint recognition function, a mobile payment function, etc.), and the like. The data storage area can store data created during use of the electronic device 100 (such as face information template data, fingerprint information template, etc.), and the like. In addition, the internal memory 121 can include a high-speed random access memory, and can also include a non-volatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like.

[0069] The electronic device 100 can implement an audio function through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, the application processor, and the like. For example, music playback, recording, and the like.

[0070] The audio module 170 is used to convert digital audio information into an analog audio signal output, and is also used to convert an analog audio input into a digital audio signal.

[0071] The speaker 170A, also known as a "loudspeaker", is used to convert an audio electrical signal into a sound signal.

[0072] The receiver 170B, also known as a "earpiece", is used to convert an audio electrical signal into a sound signal.

[0073] The microphone 170C, also known as a "microphone", "sound transducer", is used to convert a sound signal into an electrical signal.

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

[0075] The pressure sensor 180A is configured to sense a pressure signal and convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be disposed on the display screen 194. The pressure sensor 180A can be of various types, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, etc.

[0076] The gyroscope sensor 180B can be configured to determine a motion attitude of the electronic device 100. In some embodiments, the gyroscope sensor 180B can be configured to determine an angular velocity of the electronic device 100 about three axes (i.e., x, y, and z axes).

[0077] The proximity light sensor 180G can include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode can be an infrared light emitting diode.

[0078] The ambient light sensor 180L is configured to sense an ambient light intensity. The electronic device 100 can adaptively adjust the display screen 194 brightness according to the sensed ambient light intensity. The ambient light sensor 180L can also be used to automatically adjust white balance when taking a picture.

[0079] The fingerprint sensor 180H is configured to acquire a fingerprint. The electronic device 100 can use the acquired fingerprint characteristics to implement fingerprint unlocking, access application lock, fingerprint picture taking, fingerprint call answering, etc. In some embodiments, the fingerprint sensor 180H can be disposed under the touch screen. The electronic device 100 can receive a touch operation of a user on a region of the touch screen corresponding to the fingerprint sensor, and in response to the touch operation, acquire fingerprint information of a user’s finger, and implement fingerprint recognition to open a hidden album, open a hidden application, log in an account, complete payment, etc.

[0080] The temperature sensor 180J is configured to detect a temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to implement a temperature processing strategy.

[0081] The touch sensor 180K, also referred to as a “touch panel”. The touch sensor 180K can be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 together form a touch screen, also referred to as a “touch screen”. The touch sensor 180K is configured to detect a touch operation acting on or near the touch sensor 180K. The touch sensor 180K can transmit the detected touch operation to the application processor to determine a touch event type. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on a surface of the electronic device 100, which is different from the position of the display screen 194.

[0082] The keys 190 include a power on key, a volume key, and the like. The keys 190 can be mechanical keys. They can also be touch keys. The electronic device 100 can receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.

[0083] The indicator 192 can be an indicator light and can be used to indicate a charging state, a power change, a message, a missed call, a notification, and the like.

[0084] The SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to achieve contact and separation with the electronic device 100. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0085] The software system of the electronic device 100 can use a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.

[0086] In a possible implementation manner of the embodiments of the present application, the first electronic device and the second electronic device can use an iOS operating system, an Android operating system, or other operating systems to implement the running scheme of the application program of the present application. The following takes an Android system with a layered architecture as an example to exemplarily illustrate the software structure of the first electronic device and the second electronic device.

[0087] Figure 3 is a software structure block diagram of the first electronic device or the second electronic device of the embodiments of the present application.

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

[0089] The application layer can include a series of application packages.

[0090] As shown in Figure 3 , the application package can include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, and the like applications (which can also be referred to as applications).

[0091] The application framework layer provides an application programming interface (API) and programming framework for applications of the application layer. The application framework layer includes some pre-defined functions.

[0092] As shown in Figure 3 the application framework layer can include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc.

[0093] The window manager is used to manage window programs. The window manager can acquire the size of the display screen, determine whether there is a status bar, lock the screen, and intercept the screen, etc.

[0094] The content provider is used to store and acquire data, and make the data accessible to the application. The data can include videos, images, audios, dialed and received calls, browsing history and bookmarks, phone books, etc.

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

[0096] The phone manager is used to provide communication functions of the first electronic device or the second electronic device. For example, management of call states (including call connection, call hang-up, etc.).

[0097] The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, etc.

[0098] The notification manager enables the application to display notification information in the status bar, which can be used to convey a type of message that can automatically disappear after a short stay without user interaction. For example, the notification manager is used to inform the completion of downloading, message reminders, etc. The notification manager can also be a notification in the form of a chart or a scroll bar text appearing in the top status bar of the system, such as a notification of an application running in the background, or a notification in the form of a dialog interface appearing on the screen. For example, prompting text information in the status bar, issuing a prompt sound, vibrating the electronic device, flashing the indicator light, etc.

[0099] The Android runtime includes a core library and a virtual machine. The Android runtime is responsible for scheduling and managing the Android system.

[0100] The core library includes two parts: one part is the function function required by the java language to call, and the other part is the core library of Android.

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

[0102] The system library can include a plurality of functional modules. For example, a surface manager, media libraries, a three-dimensional graphics processing library (e.g., OpenGL ES), a 2D graphics engine (e.g., SGL), etc.

[0103] The surface manager is used to manage the display subsystem and provides fusion of 2D and 3D layers for a plurality of applications.

[0104] The media libraries support playback and recording of a plurality of commonly used audio, video formats, and static image files, etc. The media libraries can support a plurality of audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0105] The three-dimensional graphics processing library is used to implement three-dimensional graphics drawing, image rendering, composition, and layer processing, etc.

[0106] The 2D graphics engine is a drawing engine for 2D drawing.

[0107] The kernel layer is a layer between hardware and software. The kernel layer includes at least display drivers, camera drivers, audio drivers, and sensor drivers.

[0108] For ease of understanding, before the specific embodiments are described, a brief introduction is given to the code structure of an application program and code analysis techniques.

[0109] The code of an application program can be composed of a plurality of classes, where each class can define variables and attributes of the variables and methods executed by the class, where the methods can be implemented by defined or called functions. Further, the classes can have inheritance relationships, i.e., one class can inherit the functions of another class and also add new functions of its own. Generally, the class being inherited is referred to as a parent class or a base class, and the class inheriting the base class is referred to as a child class or a derived class. The inheritance can be simply understood as a relationship between the base class and the derived class, where the derived class has all the features of the base class, but the base class does not necessarily have all the features of the derived class. An example is given to illustrate the inheritance relationship between classes. The base class is fruit, and the derived classes are strawberry and watermelon. The fruit can define a plurality of variables and functions such as sugar content, water content, vitamin content, etc. The strawberry and the watermelon can inherit the variables and functions defined in the fruit and also add other variables and functions of their own. Figure 4As shown is an example diagram of a class diagram, which is used to show the relationship between six classes A, B, C, D, E and F, wherein A and D are base classes, B and C are derived classes of A and can inherit all functions in A; E and F are derived classes of D and can inherit all functions in D.

[0110] Further, based on the relationship between the classes, the function call relationship of each class can also be constructed. Continuing to use the example of Figure 4 , suppose that class C defines functions 1 and 2, and function 1 calls the base class A, and suppose that the functions called in the base class A include functions 3 and 4, then the function call relationship in class C can be represented as Figure 5 , that is, class C calls functions 1 and 2, and function 1 calls all the functions (functions 3 and 4) defined in the base class A.

[0111] The application program of the Android system is composed of a series of components, and the four components of Android development are: Activity, which is used to present functions; Service, which is a background running service and does not provide interface presentation; Broadcast Receiver, which is used to receive broadcasts; and Content Provider, which supports storage and reading of data in multiple applications, and is equivalent to a database. Each component has some functions defined in advance, and these pre-defined functions include various callable APIs. By calling these APIs, the application program can obtain system services. For example Figure 3 As shown in the software structure block diagram, the application program in the application program layer obtains various system functions in the system library by calling the APIs in the application program architecture layer. Therefore, in the Android system, the four components can be considered as base classes that have been defined in advance, and the derived classes that inherit the base classes can call the functions of the base classes, so as to call the various APIs defined therein to implement the functions corresponding to the derived classes.

[0112] Further, when the code of the application program is analyzed, a static program analysis technique can be used. Static program analysis is a traditional technique in the field of compilation, which mainly obtains string information by scanning source code (for example, C language source code, Java bytecode, etc.), and performs lexical analysis, syntax analysis, semantic analysis and other steps on the string information to analyze the semantics and program structure of the statements in the program, so as to achieve the purposes of compiling, transforming and understanding the program. For example, intermediate code / representation analysis in the compiler, static bug detection of programming languages (bug analyzer), code editor (eclipse, sourceInsight), etc. all depend on static program analysis techniques. The embodiments of the present application can specifically use a static program analysis tool to implement the above functions, for example, the analysis tool Soot. Soot can read in bytecode (read in by characters), remove redundant spaces, comments and other characters, and form individual words (these words can be variable names or function names); then search the entire code according to keywords (such as class, for, while, break, etc.), identify the classes in the code, the inheritance relationship between the classes or / and the functions called by each class, and construct a class diagram (for example Figure 4 ) and a function call relationship diagram (for example Figure 5 ) corresponding to a piece of code based on this.

[0113] Based on the classes, class diagrams and function call relationship diagrams obtained by static program analysis, the first electronic device can perform relevant analysis.

[0114] Please refer to Figure 6 , Figure 6is a flowchart of a method for running an application provided in the present application. It should be noted that S1011-S1013 and S1014 are two optional ways for the first electronic device to obtain the migratable process in the application and the capability requirement corresponding to the running of the migratable process. Among them, S1011-S1013 is the identification of the migratable process in the application and the determination of the capability requirement corresponding to the running of the migratable process by the first electronic device itself, which can be performed when the first electronic device installs the application for the first time, or when the first electronic device starts the application for the first time, or after the first electronic device detects that the user triggers a specified instruction (for example, marks the application as a migratable application). It can be understood that after the first electronic device determines the migratable process in the application and the capability requirement corresponding thereto, if it detects that the application is started again, it does not need to analyze the application again, but directly calls the migratable process and the corresponding capability requirement of the application from the database. Similarly, S1014 is determined by other devices to send to the first electronic device, and the first electronic device can directly call it from the database. That is, steps S1011-S1013 or S1014 in the present embodiment are not executed again after being executed once, and the method corresponding to steps S101-S103 is directly executed.

[0115] S1011, the first electronic device identifies the process in the application and determines the migratable process.

[0116] The first electronic device identifies the process in the application and has the following two possible implementation manners.

[0117] In the first possible implementation manner, the first electronic device can determine the process name of the application according to the extensible markup language (XML) file of the application, and then identify the process in the application based on the process name of the application.

[0118] XML is a markup language used to mark electronic files to have structure. The first electronic device will obtain the XML file of the application when installing the application, and the XML file will record whether each class is a process. Specifically, whether each class in the XML file is a process can be determined by scanning whether there is a keyword in the class indicating that the class is a process. For example, if the class is marked as Figure 7An example of an XML file of an Android-based application is shown, Android:name=com.zhong.ActivityA indicates that there is a class named ActivityA in the Android apk package com.zhong. Whether this class ActivityA is a process depends on whether the XML records the keyword Android:process after the class name. If the keyword is present, it means that the class is an independent process, otherwise, it means that the class is not an independent process. It can be seen that, for the example of Figure 7 ActivityA is not a process, while ActivityB and ActivityC are independent processes.

[0119] Therefore, by identifying the class name in the XML file of the application and whether the specified keyword exists after the class name, the process name of the application can be determined. Then based on the process name, the class name consistent with the process name in the code of the application can be statically analyzed, and the class corresponding to the class name is identified as a process. For example Figure 7 ActivityB and ActivityC in the example are two process names, and in the code of the application, two classes corresponding to ActivityB and ActivityC are identified, and the two classes are determined as two processes in the application.

[0120] In the first possible implementation, the process is directly identified through the XML file, and there is no need to analyze the code of the application in more detail, so the identification speed is fast.

[0121] In the second possible implementation, the first electronic device can determine the process in the code by scanning the code of the application. Specifically, the classes in the code of the application can be identified, and the classes with IPC functions are determined as the processes of the application.

[0122] In this implementation, the first electronic device can determine the classes included in the application program through static program analysis, and the standard for measuring whether each class is a process mainly lies in whether the class has information transmission with other classes. The information transmission here is the inter-process communication (IPC) mentioned above, that is, if a class needs to have inter-process communication with other classes, it means that the class is an independent process. If a class does not need to have inter-process communication with other classes, it means that the class is only part of a process and is not a truly independent process. Therefore, in this implementation, the first electronic device can further identify whether each class has an IPC function, and if so, it means that the class is a process. Specifically, to determine whether a class has an IPC function, the first electronic device can identify whether the class has the names of various classes and functions for implementing the IPC function, for example, in the Android system, messager and binder are two classes for implementing the IPC function, so messager and binder can be used as two keywords for identifying the IPC function. The first electronic device can determine whether the class is a process by identifying whether the class has any of the two keywords messager and binder, and as long as it has any keyword, it means that the class is a process. Of course, the IPC function of some classes can be implemented through other means (such as file sharing), in which case it may not be possible to determine whether the class is a process through static program analysis. However, such unidentified processes will not be migrated and will still run in the first electronic device, and will not hinder the implementation of the scheme of the present application.

[0123] In a second possible implementation, in view of the characteristics that independent processes will have an IPC mechanism to realize inter-process communication, the processes in the application program can also be quickly determined through the identification of the IPC function.

[0124] Further, in the above two possible implementation manners, the first electronic device can take all the identified processes as migratable processes, or filter a part of the processes as migratable processes. In some possible implementation cases, a part of the processes can be specified by a user or a preset number of processes can be specified as migratable processes. In another possible implementation scenario, processes of a specified type can be taken as migratable processes. Specifically, it is mentioned above that there are four components of Android, and the Activity component is a component for presenting functions, and therefore the API of this type of component generally involves a UI interface. Therefore, a process inheriting the Activity component will also involve the interaction of some UI interface classes. In this case, if such a process is migrated to the second electronic device for running, it may cause inconvenience to the user, and therefore the first electronic device can determine the class diagram of the application program through static program analysis, determine the process inheriting the Activity component as a non-migratable process, and determine other processes as migratable processes. Of course, the first electronic device can also directly determine, based on the class diagram, the process not inheriting the Activity component, and take these processes as migratable processes.

[0125] In S1012, the first electronic device determines an application program interface API called by the migratable process.

[0126] Based on the above description, the first electronic device obtains the inheritance relationship between classes in the application program through static program analysis, thereby constructing a class diagram corresponding to the application program, and determining a function call graph of each class based on the class diagram. Based on the function call graph, the first electronic device can determine the functions called in the migratable process. The API is a pre-defined function, and therefore based on the functions called in the migratable process, the first electronic device can determine the API called in the migratable process. Still taking the example of Figure 5 and Figure 6 If the C class is determined as a migratable process, and the function 3 and the function 4 are actually the API 1 and the API 2, the first electronic device can determine that the API called by the migratable process C is the API 1 and the API 2.

[0127] In S1013, the first electronic device determines the capability requirement for running the migratable process according to the function category corresponding to the called API.

[0128] According to the hardware functions actually operated by the API, the different APIs can be pre-divided into function categories. Specifically, each API can correspond to one or more function categories. For example, API1 can call the function of a sensor, and API1 can be divided into a sensor category; API2 can call the functions of a UI interface and a GPU, and API1 can be divided into a GPU category and a UI interface category. According to the function categories corresponding to each API used by the migratable process, the capability requirement corresponding to running the migratable process can be determined. Specifically, the capability requirement is information used to represent the capability or device or hardware required to run the migratable process. The capability requirement can specifically be the hardware information of a certain type of hardware capable of running the migratable process, and can also be a series of specification parameters of the hardware or device capable of running the migratable process, for example, the capability requirement corresponding to running a GPU category migratable process can include a shader model parameter, whether a display management software is provided, a maximum power of a graphics card, a full-screen anti-aliasing, a maximum digital display resolution, a total amount of cache frames, and the like. For another example, the function categories corresponding to API1 and API2 called in the migratable process are a sensor category, a GPU category, and a UI interface category. The capability requirement corresponding to running the migratable process can be the hardware information of various types of sensor elements, GPU chips, and display devices with UI display and interaction functions. The hardware information can be a hardware name, a hardware identifier, or / and a hardware model. The hardware information corresponding to running the migratable process can exemplarily be "sensor, GPU, display". Further, when the capability required to run the migratable process is the capability of a CPU, the capability requirement can further include the remaining computing capability of the CPU in addition to the hardware information or specification parameters described above. Specifically, the CPU is different from the GPU, and the GPU can only be occupied by one process. Therefore, if the migratable process is subsequently migrated to a second electronic device to run, the migratable process will not be occupied by other processes, and the resources of the GPU can be fully utilized. The CPU can handle many processes in parallel. Therefore, if the resources of the CPU in the second electronic device are already occupied by a part, the computing capability of the CPU will be reduced, and the migratable process can not be well run. Therefore, when the hardware is a CPU, the hardware information can further include the remaining computing capability of the CPU.

[0129] In the embodiments of the present application, when the API corresponding to the migratable program call has multiple function categories, two processing strategies can be used. In the first processing strategy, the first electronic device can determine the target function category with the highest priority from the multiple function categories corresponding to the called API according to the priority of the function categories, and then determine the capability requirement corresponding to the target function category as the capability requirement corresponding to running the migratable process. Specifically, the priority of the function categories corresponding to various APIs can be pre-divided, and specifically, the priority can be determined according to the importance or influence degree of the function categories to the current application, or the priority can be determined according to the hardware capability of the first electronic device. For example, for some applications, the sensitivity of the sensor is important, and then the function category of the sensor can be taken as the target function category. For another example, the GPU chip in the first electronic device has general capability or no GPU chip, and then the function category of the GPU can be taken as the target function category. In the second possible implementation, the first electronic device can determine the capability requirement corresponding to all function categories as the capability requirement corresponding to running the migratable process according to the multiple function categories corresponding to the called API.

[0130] For example, it is assumed that the current application is a game, and for the game, the GPU affects the smoothness of the picture, and the CPU affects the running rate. In the first processing strategy, the priority of the function categories can be set as GPU > CPU > sensor. If the function category corresponding to a migratable process in the application includes the sensor, the GPU, and the CPU, the first electronic device can determine the GPU as the target function category according to the priority of the function categories, and the hardware information corresponding to the migratable process is the GPU. In the second processing strategy, the hardware information corresponding to the migratable process is the GPU, the CPU, and the sensor.

[0131] The two different processing strategies can be used for different implementation scenarios. If the second electronic device is an electronic device with complete hardware functions (for example, a computer, a smart phone, a smart television, etc.), the first processing strategy can be used, so that the second electronic device with the most suitable high-priority function can be selected for migration in subsequent determination of the migration device. Otherwise, the second processing strategy can be used to ensure that the migratable process can be reliably run after being migrated to the second electronic device.

[0132] In S1014, the first electronic device receives the migratable process in the application and the capability requirement corresponding to running the migratable process.

[0133] In the implementation of S1014, the migratable process and the capability requirement corresponding to running the migratable process can be provided by the application provider, and can be obtained when the application is installed.

[0134] After S1011-S1013 or S1014 is executed, the first electronic device will store each portable program corresponding to the application and the capability requirements corresponding to running each portable process in the database. When the first electronic device executes S101-S103, it can directly call from the database.

[0135] S101, the first electronic device starts the application.

[0136] The application in this application embodiment may be launched by the user, launched on a scheduled time, or launched after being called by other application interfaces, etc. This application does not make specific limitations in this regard.

[0137] S102, the first electronic device obtains the hardware information of the second electronic device.

[0138] Based on the above... Figure 1 As described in the scenario, the second electronic device is distributed around the first electronic device. The first electronic device can periodically acquire the hardware information of the second electronic device, or it can begin acquiring the hardware information of the second electronic device after detecting that an application has started. That is, S102 can be executed before S101, after S102, or S102 can be triggered simultaneously with S103 to update the hardware information of the second electronic device, thus ensuring that the hardware information of the second electronic device is more real-time. Therefore, this embodiment does not limit the execution order of S102.

[0139] The hardware information of the second electronic device refers to the hardware information inherent in the second electronic device itself. For example, if the second electronic device contains a CPU, a camera, and sensors, then one or more of the following information—hardware name, hardware identifier, hardware model, and hardware specification parameters—constitutes the hardware information of the second electronic device. Furthermore, as described in S1013, when the hardware is a CPU, the hardware information of the second electronic device may further include the CPU's remaining computing power.

[0140] S103, if there is a transferable process in the application, and the hardware corresponding to the hardware information of the second electronic device has the ability to run the transferable process, during the running of the application, the first electronic device transfers the transferable process to the second electronic device, and the second electronic device is used to run the transferable process.

[0141] After the first electronic device starts the application program, it can determine whether there is a migratable process in the currently started application program from the database. If the database records the migratable process, the first electronic device can determine whether the hardware corresponding to the hardware information of the second electronic device has the ability to run the migratable process while running the application program, specifically when executing the entry of the migratable process. If the hardware corresponding to the hardware information of the second electronic device has the ability to run the migratable process, the first electronic device can migrate the migratable process to the second electronic device.

[0142] Correspondingly, the second electronic device runs the migratable process and feeds back the result data of the migratable process to the first electronic device or other second electronic devices running the migratable process through the RPC mode. In the Android system, the code of the application program is stored in the virtual machine, and when migrating, the context of the virtual machine where the migratable process is located can be migrated to the second electronic device. The second electronic device starts the virtual machine and loads the migrated context, and then executes the migratable process.

[0143] Further, before the first electronic device migrates the migratable process, the user can be prompted to confirm whether to perform the migration operation, and the device information of the second electronic device can also be displayed in the prompt. After receiving the confirmation instruction of the user, the migration operation is performed. Alternatively, the first electronic device can also send an authorization request to the second electronic device, and the first electronic device migrates the migratable process to the second electronic device only after the second electronic device authorizes the request.

[0144] Specifically, the first electronic device can determine whether the hardware corresponding to the hardware information of the second electronic device has the ability to run the migratable process by matching the hardware information of the second electronic device with the ability requirement corresponding to the running of the migratable process. If the hardware corresponding to the hardware information of the second electronic device meets the ability requirement corresponding to the running of the migratable process, the migration is performed. The specific matching method can be as follows.

[0145] In the first matching manner, the capability requirement corresponding to the migratable process running can be hardware information of a certain type of hardware capable of running the migratable process. If the hardware information corresponding to the migratable process is completely consistent with the hardware information in the hardware information of the second electronic device, it is determined that the second electronic device has the hardware required when the migratable process runs, and it is determined that the hardware of the second electronic device has the capability of running the migratable process. In this implementation manner, as long as the hardware information corresponding to the migratable process can be found in the hardware information of the second electronic device, the hardware information is the hardware name, the hardware model or other information. For example, the hardware information of the second electronic device includes a GPU, and the hardware information corresponding to the migratable process is a GPU, and the GPU of the second electronic device has the capability of running the migratable process.

[0146] In the second matching manner, the capability requirement corresponding to the migratable process running can be a specification parameter. At this time, the first electronic device needs to further determine whether the capability of the hardware corresponding to the hardware information of the second electronic device can meet the capability requirement corresponding to the migratable process running. The specific determination method can determine whether the GPU specification of the second electronic device reaches or is higher than the specification required by the migratable process according to the specification parameter corresponding table of the model / name. For example, the hardware information in the second electronic device can include a model GPU123. The first electronic device can call the specification parameter corresponding table of the model / name, determine the specification parameter corresponding to the GPU123, compare the specification parameter of the GPU123 with the specification parameter corresponding to the migratable process, and if the specification parameters are matched, it is considered that the GPU123 of the second electronic device has the capability of running the migratable process.

[0147] In the first matching manner, the capability requirement corresponding to the migratable process running has been pre-set to the hardware information of some specific hardware. Therefore, the first electronic device does not need to perform a process of excessive capability query and comparison, and direct information matching can be performed. Especially when the hardware information corresponding to the migratable process and the hardware information of the second electronic device both include the same type of information (for example, both are names or both are models), information matching can be quickly realized. In the second matching manner, the hardware information corresponding to the migratable process is not limited. Thus, some hardware models that are newly emerged or not included in the database but meet the capability can also be used to run the migratable process. Meanwhile, some hardware or chips that integrate multiple capabilities or functions can also be used to run the migratable process, which is more flexible. These specific matching manners can be applicable to specific scenarios, and it should also be understood that the embodiments of the present application are not limited to the two matching manners. The matching of various types of representation information of the capability requirement can also be used as the matching manner of the embodiments of the present application.

[0148] In the embodiments of the present application, when there is only one second electronic device, it is only necessary to determine whether the hardware of the second electronic device meets the capability requirement of running the migratable process. When there are multiple second electronic devices, there are two possible implementation manners.

[0149] In the first possible implementation manner, the first electronic device can poll the hardware information of the multiple second electronic devices, and determine whether the hardware corresponding to the polled hardware information of the second electronic devices has the capability of running the migratable process, for example, first determine whether the hardware corresponding to the hardware information of the first second electronic device meets the capability requirement of running the migratable process. If yes, the migratable process is migrated to the first second electronic device. If no, the next second electronic device is polled until a second electronic device meeting the above condition is found and the migration operation is performed. In this implementation manner, the first electronic device only needs to find a second electronic device having the capability of running the migratable process in the multiple second electronic devices, and then migrate the migratable process, without the need to determine the hardware information of all second electronic devices.

[0150] In the first implementation manner, as long as there is a second electronic device capable of running the migratable process, the migratable process can be migrated to the second electronic device, which can save the time of confirming the second electronic device by the first electronic device, and realize fast migration while ensuring running of the migratable process.

[0151] In the second possible implementation manner, the first electronic device can first determine the hardware information of all second electronic devices, determine at least one candidate second electronic device having the capability of running the migratable process, and then determine a target second electronic device in the candidate second electronic devices, and migrate the migratable process to the target second electronic device. In specific implementation, the first electronic device can determine the second electronic device having the highest hardware capability in the at least one candidate second electronic device as the target second electronic device. The first electronic device can also determine the second electronic device having the most hardware functions or hardware resources or the most comprehensive hardware types in the at least one candidate second electronic device as the target second electronic device. The first electronic device can further display the hardware information of the at least one candidate second electronic device, and determine the target second electronic device according to the selection instruction of a user. When receiving the selection instruction of the user on any one candidate second electronic device, the first electronic device determines the selected candidate second electronic device as the target second electronic device, and migrates the migratable process to the target second electronic device.

[0152] In the second implementation, the first implementation can allow the migratable process to run in the second electronic device with the highest hardware capability or the most hardware resources or the most comprehensive hardware types, so as to achieve a more optimal and reliable running effect. This implementation is suitable for migrating the migratable process to a device with better performance, rather than only for sharing the running load of the first electronic device. The second implementation can be selected by the user independently, and meet the user's needs.

[0153] Further, after determining that the hardware information of the second electronic device matches the capability requirement of running the migratable process, the first electronic device can further determine whether the hardware capability of the second electronic device is higher than the hardware capability of the first electronic device itself. The specific determination method is similar to the above method, and can also be determined by the model / name specification parameter corresponding table or the hardware capability information (such as the evaluation score). Only when the hardware capability of the second electronic device is higher than the hardware capability of the first electronic device itself, the migratable process is migrated to the second electronic device. It can be understood that this implementation is to avoid meaningless migration of the migratable process, that is, if the hardware capability of the second electronic device is not as good as that of the first electronic device, even if the second electronic device can run the migratable process, the migratable process does not need to be migrated.

[0154] Based on the above description, it can be understood that if the application program includes multiple migratable processes, when each migratable process is run, if the migratable process has a corresponding second electronic device, the second electronic device runs the migratable process, and if the migratable process does not have a corresponding second electronic device, the first electronic device runs the migratable process. Meanwhile, the second electronic devices running different migratable processes and the first electronic device maintain RPC communication. For example, when executing a game application program, the mobile phone as the first electronic device executes a sensor process, and the computer as the second electronic device executes a GPU process. Then, various gravity, acceleration and other sensor data of the user operating the mobile phone can be transmitted to the computer through the RPC mode, and the GPU of the computer displays the corresponding picture according to the sensor data.

[0155] In an implementation scenario, the application program has only one process, and the process is a migratable process. It can be understood that the application program will be migrated to the second electronic device as a whole after being started. This implementation scenario can be suitable for the second electronic device not having a certain application program, but being able to start the application program through the first electronic device and use the application program in the second electronic device. The advantage of this is that the second electronic device does not need to permanently install the application program, but only needs to migrate the process in the first electronic device to run temporarily, and the space will be released after running, so as not to occupy the storage space of the second electronic device.

[0156] Based on the technical solution, it can be seen that the automatic classification and identification of each process in the application program in advance can determine whether each process in the application program can be migrated and the corresponding capability requirement, and the migratable process in the application program is migrated to the electronic device with running capability through matching with the hardware information of the surrounding electronic device. The hardware capability of the surrounding electronic device and the capability requirement of the migratable process are fully considered, the process migration after execution is avoided, the reliability is ensured, the running load of the first electronic device is reduced, and the running of the application program is smoother and better.

[0157] Figure 8 For another structure schematic diagram of the first electronic device 200 of the embodiment of the application, the first electronic device 200 can include:

[0158] The starting module 210 is configured to start the application program.

[0159] The monitoring module 220 is configured to acquire the hardware information of the second electronic device.

[0160] The migration module 230 is configured to, if there is a migratable process in the application program and the hardware corresponding to the hardware information of the second electronic device has the capability of running the migratable process, migrate the migratable process to the second electronic device in the process of running the application program; and at least one process in the application program communicates through an inter-process communication (IPC) mode.

[0161] In a possible implementation scenario, the first electronic device 200 further includes:

[0162] The process identification module 240 is configured to identify the processes in the application program and determine the migratable process.

[0163] The API identification module 250 is configured to determine the application program interface (API) called by the migratable process.

[0164] The capability identification module 260 is configured to determine the capability requirement corresponding to the running of the migratable process according to the function category corresponding to the called API.

[0165] The hardware corresponding to the hardware information of the second electronic device has the capability of running the migratable process includes that the hardware corresponding to the hardware information of the second electronic device meets the capability requirement corresponding to the running of the migratable process.

[0166] In a possible implementation scenario, the process identification module 240 is specifically configured to:

[0167] Determine the process name of the application program according to an extensible markup language (XML) file of the application program.

[0168] based on the process name of the application program, identifying a process in the application program, determining the migratable process.

[0169] In a possible implementation scenario, the process identifying module 240 is specifically configured to:

[0170] determining a class in the code of the application program, identifying a class with an IPC function as a process of the application program, and determining the migratable process.

[0171] In a possible implementation scenario, the API identifying module 240 is specifically configured to:

[0172] obtaining a called function in the migratable process;

[0173] based on the called function in the migratable process, determining an API called by the migratable process.

[0174] In a possible implementation scenario, the function categories corresponding to the called API include a plurality of function categories; the capability identifying module 260 is specifically configured to:

[0175] determining, according to a priority of the function categories, a target function category with a highest priority from the plurality of function categories corresponding to the called API;

[0176] determining that a capability requirement corresponding to the target function category is a capability requirement corresponding to running the migratable process.

[0177] In a possible implementation scenario, the function categories corresponding to the called API include a plurality of function categories; the capability identifying module 260 is specifically configured to:

[0178] determining, according to the plurality of function categories corresponding to the called API, capability requirements corresponding to the plurality of function categories as the capability requirement corresponding to running the migratable process.

[0179] In a possible implementation scenario, the second electronic device includes a plurality of second electronic devices; the migration module 230 is specifically configured to:

[0180] if there is a migratable process in the application program, and at least one hardware of the second electronic device has a capability of running the migratable process, determining a target second electronic device from the at least one second electronic device;

[0181] migrating the migratable process to the target second electronic device in a process of running the application program.

[0182] In a possible implementation scenario, the first electronic device 200 further includes:

[0183] The display module 270 is configured to display the hardware information of at least one of the second electronic devices.

[0184] The migration module 230 is specifically configured to:

[0185] When the selection instruction of any one of the second electronic devices is received, the selected second electronic device is determined as the target second electronic device.

[0186] Those skilled in the art can understand that, in various embodiments of the present application, the size of the serial number of each process does not mean the order of execution, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0187] The various embodiments of the present application can be combined in any way to achieve different technical effects.

[0188] In the above embodiments, all or part of the embodiments can be realized by software, hardware, firmware or any combination thereof. When realized by software, all or part of the embodiments can be realized in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable devices. The computer instructions can be stored in a computer readable storage medium or transferred from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be transferred from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode. The computer readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The available media can be magnetic media (such as floppy disk, hard disk, magnetic tape), optical media (such as DVD), or semiconductor media (such as solid state disk (SSD)) and the like.

[0189] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing relevant hardware. The program can be stored in a computer readable storage medium, and when the program is executed, the processes of the above-mentioned embodiment methods can be included. The storage medium can be a magnetic disc, an optical disc, a read-only memory (ROM), a random access memory (RAM), or the like.

[0190] The above disclosure is only the preferred embodiments of the present application, and of course cannot limit the scope of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope of the present application.

Claims

1. A method of running an application program, the application program comprising at least one process, characterized in that, The method comprises: A first electronic device starts an application program; The first electronic device identifies processes in the application program and determines a migratable process; The first electronic device determines an application program interface (API) called by the migratable process, and determines, according to a function category corresponding to the called API, a capability requirement corresponding to running the migratable process; The first electronic device obtains hardware information of a second electronic device in a plurality of second electronic devices; If the application program has the migratable process and at least one hardware corresponding to the hardware information of the second electronic device has the capability of running the migratable process, the first electronic device determines a target second electronic device in at least one second electronic device, and migrates the migratable process to the target second electronic device in the process of running the application program; At least two processes in the application program communicate through an inter-process communication (IPC) mode; The hardware corresponding to the hardware information of the second electronic device has the capability of running the migratable process, including that the hardware corresponding to the hardware information of the second electronic device meets the capability requirement corresponding to running the migratable process.

2. The method of claim 1, wherein, The first electronic device identifies processes in the application program, including: The first electronic device determines a process name of the application program according to an extensible markup language (XML) file of the application program; The first electronic device identifies processes in the application program based on the process name of the application program.

3. The method of claim 1, wherein, The first electronic device identifies processes in the application program, including: The first electronic device determines a class in the code of the application program, and identifies a class with an IPC function as a process of the application program.

4. The method according to any one of claims 1-3, characterized in that, The first electronic device determines an application program interface (API) called by the migratable process, including: The first electronic device obtains a function called in the migratable process; The first electronic device determines an API called by the migratable process based on the function called in the migratable process.

5. The method according to any one of claims 1-3, characterized in that, The function category corresponding to the called API includes multiple function categories; the first electronic device determines, according to the function category corresponding to the called API, a capability requirement corresponding to running the migratable process, including: The first electronic device determines, according to a priority of a function category, a target function category with the highest priority in the multiple function categories corresponding to the called API; The first electronic device determines that the capability requirement corresponding to the target function category is the capability requirement corresponding to running the migratable process.

6. The method according to any one of claims 1-3, characterized in that, The function category corresponding to the called API includes multiple function categories; the first electronic device determines, according to the function category corresponding to the called API, a capability requirement corresponding to running the migratable process, including: The first electronic device determines, according to the multiple function categories corresponding to the called API, that the capability requirements corresponding to the multiple function categories are the capability requirement corresponding to running the migratable process.

7. The method according to any one of claims 1-3, characterized in that, The target second electronic device is at least one of the second electronic devices that has the highest hardware capability, the most hardware resources, the most hardware functions, or the most complete hardware types.

8. The method of claim 7, wherein, The first electronic device determines a target second electronic device from the second electronic devices. The first electronic device displays hardware information of the second electronic devices. When a selection instruction for any one of the second electronic devices is received, the first electronic device determines the selected second electronic device as the target second electronic device.

9. A first electronic device, characterized by The application program includes: A starting module that starts the application program; A monitoring module that obtains hardware information of the second electronic devices; A process identification module that identifies processes in the application program and determines a migratable process; An API identification module that determines an application program interface (API) called by the migratable process; A capability identification module that determines a capability requirement corresponding to running the migratable process according to a function category corresponding to the called API; A migration module that, if there is a migratable process in the application program and at least one of the second electronic devices has hardware that has the capability to run the migratable process, determines a target second electronic device from the second electronic devices and migrates the migratable process to the target second electronic device during running of the application program. At least one process in the application program communicates through an inter-process communication (IPC) mode. The hardware corresponding to the hardware information of the second electronic device has the capability to run the migratable process includes that the hardware corresponding to the hardware information of the second electronic device meets the capability requirement corresponding to running the migratable process.

10. The first electronic device of claim 9, wherein, The process identification module is specifically configured to: Determine a process name of the application program according to an extensible markup language (XML) file of the application program; Identify processes in the application program based on the process name of the application program and determine the migratable process.

11. The first electronic device of claim 9, wherein, The process identification module is specifically configured to: Determine a class in a code of the application program, identify a class having an IPC function as a process of the application program, and determine the migratable process.

12. The first electronic device according to any one of claims 9-11, wherein, The API identification module is specifically configured to: Obtain a function called in the migratable process; Determine an API called by the migratable process based on the function called in the migratable process.

13. The first electronic device according to any one of claims 9-11, wherein, The function category corresponding to the called API includes multiple function categories; the capability identification module is specifically configured to: Determine a target function category having the highest priority from the multiple function categories corresponding to the called API according to a priority of the function category; Determine the capability requirement corresponding to the target function category as the capability requirement corresponding to running the migratable process.

14. The first electronic device of any one of claims 9-11, wherein, The function category corresponding to the called API includes multiple function categories; the capability identification module is specifically configured to: Determine the capability requirements corresponding to the multiple function categories as the capability requirement corresponding to running the migratable process according to the multiple function categories corresponding to the called API.

15. The first electronic device of any one of claims 9-11, wherein, The target second electronic device is at least one of the second electronic devices that has the highest hardware capability, the most hardware resources, the most hardware functions, or the most complete hardware types.

16. The first electronic device of claim 15, wherein, Further comprising: a display module configured to display hardware information of the at least one second electronic device; The migration module is specifically configured to: when receiving a selection instruction for any one of the second electronic devices, determine the selected second electronic device as the target second electronic device.

17. A first electronic device, comprising: comprising a memory and a processor, wherein, The memory is configured to store computer readable instructions; and the processor is configured to read the computer readable instructions and implement the method according to any one of claims 1-8.

18. A computer storage medium, characterized in that, The computer readable instructions are stored, and when executed by a processor, implement the method according to any one of claims 1-8.

Citation Information

Patent Citations

  • Method, system and device of running process

    CN102546920A