Grafting method and system applying ecological environment, terminal and storage medium

By building the target container in the OpenHarmony system and calling the Android application functions, the problem of restricted application development is solved, the application ecological environment is improved, and direct call to Android applications is realized, reducing development complexity.

CN119025085APending Publication Date: 2024-11-26深圳开鸿数字产业发展有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411057153.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-02
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

Due to the few applications of the OpenHarmony system, application development is restricted, and the dependence on function implementation between applications leads to thresholds and lacks an effective application ecological environment.

Method used

By building a target container in the target device of the OpenHarmony system, running the Android system independently, and receiving signals calling the target function, judging that the target application is an Android application, it calls its function in the target container, and uses the startActivity command or SDK loading compatibility scheme to call it .

Benefits of technology

It solves the problem of restricted application development of OpenHarmony system, allows direct call to Android application functions, improves the application ecological environment, lowers the development threshold, and improves development efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119025085A_ABST
    Figure CN119025085A_ABST
Patent Text Reader

Abstract

The invention discloses a grafting method and system applying an ecological environment, a terminal and a storage medium. The method comprises the following steps: constructing a target container in target equipment for developing an OpenHarmony system, wherein the target container is used for independently running a set of Android system; receiving a target signal, wherein the target signal is a signal for calling a target function; and judging a target application corresponding to the target function, and if the target application is an Android application, calling the target function of the target application in the target container based on the target signal. According to the method and the device, the problem that application development is limited due to few applications in the OpenHarmony system in the prior art can be solved, and convenience is brought to users developing the OpenHarmony system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of Hongmeng application development, and in particular to an application ecological environment grafting method, system, terminal and storage medium. Background Art

[0002] At present, the number of devices and users of the OpenHarmony system is relatively small, and application development is also relatively lacking. Limited by the entire ecological environment, the lack of applications will hinder the development of new applications. It can be seen that the application development environment itself is also a sub-ecosystem. The implementation of application functions often needs to rely on the functions of other applications. For example, travel apps rely on the functions of navigation apps, and navigation apps sometimes call taxi ticketing apps, which rely on mobile payment apps, and so on. An interactive ecosystem is formed between applications, which achieves synergy while also forming a threshold barrier for the entry of other operating systems.

[0003] Therefore, the application ecological environment of the OpenHarmony system is not good, and the problem of limited application development caused by few applications needs to be solved urgently.

[0004] Therefore, the prior art still needs to be improved and enhanced. Summary of the invention

[0005] The main purpose of the present invention is to provide an application ecological environment grafting method, system, terminal and storage medium, aiming to solve the problem of limited application development due to the small number of applications in the OpenHarmony system in the prior art.

[0006] In order to achieve the above object, the present invention provides a first aspect of an application ecological environment grafting method, wherein the application ecological environment grafting method comprises:

[0007] Building a target container in a target device for developing an OpenHarmony system, wherein the target container is used to independently run an Android system;

[0008] receiving a target signal, wherein the target signal is a signal for calling a target function;

[0009] A target application corresponding to the target function is determined, and if the target application is an Android application, the target function of the target application is called in the target container based on the target signal.

[0010] In one implementation, the step of constructing a target container in a target device for developing an OpenHarmony system includes:

[0011] Obtain a target usage scenario of the target device, and based on the target usage scenario, obtain a list of Android applications corresponding to the target usage scenario;

[0012] The Android system is isolated and installed in the target device based on the Anbox tool, and the application corresponding to the Android application list is installed in the Android system to obtain the target container.

[0013] In one implementation, calling the target function of the target application in the target container based on the target signal includes:

[0014] Determine whether the target function can be directly called through the startActivity command in the Android system;

[0015] If the target function can be directly called through the startActivity command, the target function is called using the first calling method;

[0016] If the target function cannot be directly called through the startActivity command, the target function is called using the second calling method.

[0017] In one implementation, the first calling method includes:

[0018] forwarding the target signal to the first target interactive process;

[0019] The first target interaction process parses the target signal to obtain a first target parameter, wherein the first target interaction process is a process of the Openharmony system and exists in the host machine;

[0020] Sending the first target parameter to a second target interaction process, where the second target interaction process is an Android system process and exists in the target container;

[0021] The second target interaction parses the first target parameters to obtain the target startActivity command

[0022] A target function of the target application is called based on the target startActivity command.

[0023] In one implementation, after the target function is called in the first calling mode, the method further includes:

[0024] When the target application feeds back the first information, based on the second target interactive program, the first information is converted into a second target parameter and sent to the first target interactive program;

[0025] The first target interaction program parses the second target parameter to obtain first target information;

[0026] The target signal is fed back based on the first target information.

[0027] In one implementation, the second calling method includes:

[0028] Based on the container calling interface, the target service interface name, target interface parameters and target SDK path carried by the target signal are transferred to the target container;

[0029] The target application in the target container dynamically loads the target SDK based on the target service interface name, the target interface parameters and the target SDK path to obtain a target execution result;

[0030] The target execution result is fed back to the Openharmony system based on the container calling interface.

[0031] In one implementation, before calling the target function in the second calling mode, the method further includes:

[0032] The caller application corresponding to the target application in the Openharmony system registers with the interface platform of the target application during the development phase and downloads the target SDK of the target application;

[0033] Place the target SDK into the resource file corresponding to the target application.

[0034] The second aspect of the present invention is an application ecological environment grafting device, comprising:

[0035] A construction module is used to build a target container in a target device for developing an OpenHarmony system, wherein the target container is used to independently run an Android system;

[0036] A signal receiving module, used to receive a target signal, wherein the target signal is a signal for calling a target function;

[0037] The determination module is used to determine the target application corresponding to the target function, and if the target application is an Android application, the target function of the target application is called in the target container based on the target signal.

[0038] According to a third aspect of the present invention, a terminal is provided, wherein the terminal comprises: a memory, a processor, and an application ecological environment grafting program stored in the memory and executable on the processor, wherein the application ecological environment grafting program implements the steps of the application ecological environment grafting method as described above when executed by the processor.

[0039] A fourth aspect of the present invention provides a computer-readable storage medium, wherein the computer storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the application ecological environment grafting method described in any one of the above items.

[0040] Beneficial effects: Compared with the prior art, the present invention provides an application ecological environment grafting method, system, terminal and storage medium. In the application ecological environment grafting method provided by the present invention, when developing the OpenHarmony system, by constructing a target container in the target device for developing the OpenHarmony system, the target container is used to independently run a set of Android systems, and then receiving a target signal for calling a target function, and judging the target application corresponding to the target function, if the target application is an Android application, the target function in the corresponding Android application can be called in the target container based on the target signal to feedback the target signal. The present invention provides a user with an application ecological environment grafting method, which solves the problem of limited application development caused by poor application ecological environment and few applications of the OpenHarmony system in the prior art. In the present invention, by constructing a target container in the target device for developing the OpenHarmony system, when the developed application needs to call the functions of other Android applications, it can be called directly based on the target container without redeveloping a corresponding OpenHarmony application, thereby improving the application ecological environment of the OpenHarmony system and bringing convenience to users who develop the OpenHarmony system. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 A flow chart of an embodiment of the method for applying ecological environment grafting provided by the present invention;

[0042] Figure 2 A triggering business flow chart of an embodiment of the application ecological environment grafting method provided by the present invention;

[0043] Figure 3 A flow chart of a startactivity calling compatible solution of an embodiment of the application ecological environment grafting method provided by the present invention;

[0044] Figure 4A flowchart of a SDK loading compatibility solution for an embodiment of the application ecological environment grafting method provided by the present invention;

[0045] Figure 5 A structural principle diagram of an embodiment of an application ecological environment grafting device provided by the present invention;

[0046] Figure 6 A schematic diagram of an operating environment of an embodiment of a terminal provided by the present invention. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0048] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.

[0049] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as generally understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as herein.

[0050] The application ecological environment grafting method provided by the present invention can be applied to a terminal with computing capability, and the terminal can execute the application ecological environment grafting method provided by the present invention to call more application functions.

[0051] Embodiment 1

[0052] At present, from the perspective of equipment manufacturers, the OpenHarmony system's ecological environment includes Huawei and various embedded equipment manufacturers; from the perspective of users, the OpenHarmony system has huge advantages due to factors such as government support, the superiority of the system's distributed functions and international business security considerations, and the patriotic tendencies of ordinary users. However, the application development part is still relatively lacking.

[0053] Moreover, the current number of devices and users is relatively small. Limited by the entire ecological environment, the lack of applications will hinder the development of new applications. Specifically, the application development environment itself is also a sub-ecosystem. Since the functions of most applications often need to rely on the functions of other applications, for example, travel apps rely on the functions of navigation apps, and navigation apps sometimes need to call the functions of taxi-hailing and ticket-buying apps, and taxi-hailing and ticket-buying apps rely on mobile payment apps, and so on. An interactive ecosystem is formed between applications, which achieves synergy while also forming a threshold barrier for the entry of other operating systems.

[0054] Based on this, in this embodiment, a set of application ecological environment grafting methods is provided, aiming to solve the problem of limited application development due to the small number of applications when developing the OpenHarmony system in the prior art.

[0055] like Figure 1 As shown, the application ecological environment grafting method provided in this embodiment includes the steps of:

[0056] S100, constructing a target container in a target device for developing an OpenHarmony system, wherein the target container is used to independently run an Android system.

[0057] Specifically, in this embodiment, the implementation scheme of anbox is used for reference, improved and adapted, and a containerized solution for loading an Android on a device running Openharmony is proposed.

[0058] Specifically, Anbox is a free, open-source compatible tool that can be used to independently run an Android system on a Linux environment through lxc containerization technology. It is based on container technology and can directly share hardware resources with Linux. The emergence of this technology not only brings more application choices to Linux users, but also promotes the interoperability between operating systems and the integration of application ecosystems to a certain extent.

[0059] Specifically, in terms of technical implementation, Anbox uses LXC container technology to run the Android system in a container, which means that Android applications can run in the GNU / Linux system without any modification. This method effectively solves the problem of application compatibility between different operating systems and provides users with a smoother application experience. LXC is based on the Linux namespace mechanism, which is a virtualization technology that isolates processes through virtual memory. Through process isolation and Linux cgroup process grouping technology to achieve containerization, two operating systems can be run on a single device at the same time. One system is the main system of the system, also called the host machine, and the other operating system depends on the main system. After the container is started, it runs in the container, also called a virtual machine.

[0060] When installing Anbox, users only need to follow the instructions provided to complete the installation and start using it. This simple installation method lowers the user's usage threshold and allows more users to easily experience the convenience brought by Anbox.

[0061] Moreover, Anbox supports multiple Linux distributions, including Ubuntu 16.04 and 18.04, etc. This provides users with a wide range of choices. Whether they are individual users or corporate users, they can choose the appropriate Linux distribution to use Anbox according to their own needs and preferences.

[0062] Since Anbox shares hardware resources directly with Linux, it can provide application running performance close to that of native systems. This efficient running mechanism ensures smooth running of Android applications in Linux systems, bringing users a good user experience.

[0063] Furthermore, the Anbox project is an open platform that encourages developers and users to participate in the improvement and contribution of the project. Therefore, as a technology for running Android applications on Linux systems, Anbox provides users with a brand new application experience with its unique implementation method, simple installation steps, wide application scenarios and good performance advantages.

[0064] LXC is a lightweight virtualization technology based on the Linux kernel that allows running multiple isolated Linux containers on the same host.

[0065] Specifically, LXC uses the cgroups and namespace functions provided by the Linux kernel to achieve isolation between containers. Each container has its own independent file system, network configuration, process space, and resource limits, thus achieving both safe and efficient environmental isolation. It can start quickly, takes up few resources, and supports high-density deployment. LXC also provides developers with an independent development environment to avoid conflicts between applications.

[0066] It can be seen that LXC, as a mature container virtualization technology, plays an important role in many fields with its lightweight, efficient and easy-to-manage characteristics. It not only provides users with a flexible application deployment method, but also promotes the development and application of virtualization technology.

[0067] In this embodiment, the step of constructing a target container in a target device for developing an OpenHarmony system includes:

[0068] Obtain a target usage scenario of the target device, and based on the target usage scenario, obtain a list of Android applications corresponding to the target usage scenario;

[0069] The Android system is isolated and installed in the target device based on the Anbox tool, and the application corresponding to the Android application list is installed in the Android system to obtain the target container.

[0070] Specifically, when the user develops the OpenHarmony system in the target device, more Android application functions are obtained by building the target container.

[0071] First, according to the target usage scenario of the target device, a list of commonly used applications in the target usage scenario is listed through market research. At the same time, active applications for some applications can also be obtained, so that some commonly used Android application functions on the market can be installed in the device through Android containerization based on the Android application list to obtain the target container.

[0072] In this embodiment, the target container also exposes a unified interface to an external OpenHarmony application. When the OpenHarmony application needs to use a corresponding function, the system framework calls the function of the corresponding Android application in the target container by calling the unified interface, thereby further optimizing the development path of the OpenHarmony application and improving the development efficiency of the OpenHarmony application.

[0073] S200: Receive a target signal, where the target signal is a signal for calling a target function.

[0074] In this embodiment, the target signal is a signal sent by a user when using an OpenHarmony application in an OpenHarmony system in a host machine.

[0075] S300: Determine a target application corresponding to the target function, and if the target application is an Android application, call the target function of the target application in the target container based on the target signal.

[0076] Specifically, when developing the OpenHarmony system, since the implementation of application functions often depends on the functions of other applications, it is usually necessary to call the corresponding functions of applications that have not been developed in this system. At this time, it is necessary to use the target container to implement the development and use of the OpenHarmony application.

[0077] Reference Figure 2 , when the target signal for calling the target function is received, it will first determine whether the target application corresponding to the target function is a locally installed OpenHarmony application or a locally undeveloped Android application. Specifically, the AbilityManagerService in the OpenHarmony system will first query the BundleManagerService for the application information to be started. If it can be found, it is considered that the called party is an openharmony native application process and the normal startability process is followed; if the corresponding application cannot be found, it will match the applications stored in the Android application list configuration information. If the corresponding application can be found, the container interface call process is triggered.

[0078] Specifically, the BundleManagerService is a system service responsible for managing installation packages, which handles operations including package installation, update, uninstallation, and package information query. The BundleManagerService not only ensures the smooth installation and uninstallation of applications, but also provides comprehensive management of installed packages, and is an indispensable component of the operating system.

[0079] When it is found that the target application is an Android application, the target function of the target application is called in the target container based on the target signal.

[0080] In this embodiment, calling the target function of the target application in the target container based on the target signal includes:

[0081] Determine whether the target function can be directly called through the startActivity command in the Android system;

[0082] If the target function can be directly called through the startActivity command, the target function is called using the first calling method;

[0083] If the target function cannot be directly called through the startActivity command, the target function is called using the second calling method.

[0084] Specifically, in this embodiment, two native interaction technologies of Android are respectively designed with compatible solutions of openharmony.

[0085] In Android, there are two native interaction technologies. The first is to directly call the service application through the startActivity instruction, passing the parameters through intent. This method will directly open the process of the service application and execute the corresponding logical functions. Specifically, startActivity() is a method in Android development that is used to start a new Activity. This method is usually used in the current Activity to jump to another Activity.

[0086] The second way is to call the corresponding function through the interface provided by the software development kit SDK. This interactive technology requires registering and downloading the function SDK on the service application interface platform during the development stage, adding the SDK to the application, and then calling the corresponding function through the interface provided by the SDK at runtime. The second way is actually to make the application itself have service functions.

[0087] Therefore, after receiving the target signal, it is first determined whether the function corresponding to the target signal can be directly called through the startActivity command in the Android system. If so, the first calling method can be used to try to call the target function. If not, the second calling method is used to call it.

[0088] Specifically, the first calling method includes:

[0089] forwarding the target signal to the first target interactive process;

[0090] The first target interaction process parses the target signal to obtain a first target parameter, wherein the first target interaction process is a process of the Openharmony system and exists in the host machine;

[0091] Sending the first target parameter to a second target interaction process, where the second target interaction process is an Android system process and exists in the target container;

[0092] The second target interaction parses the first target parameters to obtain the target startActivity command

[0093] A target function of the target application is called based on the target startActivity command.

[0094] Specifically, refer to Figure 3 , when the user uses an Openharmony app in the Openharmony system, the target signal is triggered by a function button or option in the Openharmony app, and the target signal is forwarded to a connectservice_oh process dedicated to container interaction through AbilityManagerService. In this embodiment, the connectservice_oh process is the first target interaction process, which exists in the host machine and serves the Openharmony system. AbilityManagerService is a very important system service in HarmonyOS. It is responsible for managing the operation of applications and the display of the user interface, which is crucial to ensuring the normal operation of the system and user experience; the connectservice_oh process also plays an important role in HarmonyOS. It is responsible for handling connections and communications between devices and is one of the key components for realizing the distributed characteristics of HarmonyOS.

[0095] The first target interaction process connectservice_oh and the second target interaction process connectservice_an exist in the host and container respectively. The two are servers to each other and realize two-way interaction through socket. When the user uses the target device, the Openharmony system in the host is mainly used. When the user sends the target signal through the app in the Openharmony system to realize the target function, and the target function can only be realized based on the Android application, the first target interaction process connectservice_oh in the Openharmony system will send messages as a client, and the second target interaction process connectservice_an will receive them. When Android needs to actively send a message to the host, the second target interaction process connectservice_an can also actively trigger the message as a client. For example, when the navigation positioning service is started in the target container, the message content can be actively passed to the application in the host.

[0096] After receiving the target signal, the first target interaction process connectservice_oh parses the target signal, serializes the passed parameters and context information into string parameters, obtains the first target parameters, and then passes them to the connectservice_an process inside the target container through the startability interface. In this embodiment, the connectservice_an process is the second target interaction process.

[0097] The second target interactive process connectservice_an obtains messages through socket monitoring, interprets the obtained first target parameters, and converts them into the corresponding target startactivity command, and then passes the message to activitymanagerservice to trigger the application startup process of Android itself to call the target function of the target application.

[0098] In this embodiment, after the target function is called in the first calling mode, the method further includes:

[0099] When the target application feeds back the first information, based on the second target interactive program, the first information is converted into a second target parameter and sent to the first target interactive program;

[0100] The first target interaction program parses the second target parameter to obtain first target information;

[0101] The target signal is fed back based on the first target information.

[0102] Specifically, when the corresponding Android application in the target container, that is, the target application, executes the target function, it will feedback certain information, which is recorded as the first information in this embodiment. Figure 3 , the first information will be transmitted back to the Openharmony app through the opposite path of the target information. Specifically, in the target container, based on the second target interaction program, the first information is converted into a second target parameter and sent to the first target interaction program in the host machine, and then the first target interaction program receives the second target parameter and parses the second target parameter to obtain the first target information, and finally the target signal is fed back based on the first target information.

[0103] Specifically, when the function corresponding to the target signal cannot be directly called through the startActivity command in the Android system, the second calling method needs to be used for calling. Since the second calling method is to load the compatible solution through SDK, the caller oh application needs to register with the interface platform of the called service in advance during the development stage, download the function SDK, and put the SDK in the resource file of the application. This step is the same as Android application development.

[0104] If the target function cannot be directly called through the startActivity command, the target function is called using the second calling method. Therefore, before calling the target function using the second calling method, the method further includes:

[0105] The caller application corresponding to the target application in the Openharmony system registers with the interface platform of the target application during the development phase and downloads the target SDK of the target application;

[0106] Place the target SDK into the resource file corresponding to the target application.

[0107] Specifically, the caller application corresponding to the target application in the Openharmony system, that is, the Openharmony app that triggers the target signal is the caller oh application. During the development stage, it is necessary to register in advance on the interface platform of the called service, download the corresponding function SDK of the target application, the target SDK, and put the target SDK into the resource file of the application.

[0108] Specifically, containerization technology allows Android applications to run in Hongmeng. The interfaces and libraries provided by the SDK handle the communication between Hongmeng and Android processes. For example, by calling methods in the SDK, you can start an Android process in Hongmeng, pass data and receive responses.

[0109] Developers need to register on Openharmony's service platform, which usually involves creating a developer account and obtaining corresponding certification to obtain access to the service. After obtaining registration permissions, download a specific function SDK. In this embodiment, the function SDK of the feature is the target SDK. The function SDK corresponding to each application provides the libraries and interfaces required to interact with the service application. Integrate the downloaded SDK in the caller's oh project. It is usually necessary to add dependencies in the build.gradle file and import related classes and methods in the code. You can use the interface provided by the target SDK to communicate with the service application.

[0110] Specifically, refer to Figure 4 , Figure 4 This is a compatible solution when the target function needs to be loaded through SDK. In this embodiment, the second calling method includes:

[0111] Based on the container calling interface, the target service interface name, target interface parameters and target SDK path carried by the target signal are transferred to the target container;

[0112] The target application in the target container dynamically loads the target SDK based on the target service interface name, the target interface parameters and the target SDK path to obtain a target execution result;

[0113] The target execution result is fed back to the Openharmony system based on the container calling interface.

[0114] Specifically, the caller oh application calls callContainerService to trigger the loading compatibility process of the target SDK.

[0115] Specifically, it includes: based on the napi adapter interface callContainerService specially provided by the Openharmony system framework, function calls are implemented by passing in parameters such as service interface name, interface parameters, SDK path, etc.

[0116] Specifically, after the callContainerService passes the target message to the abilitymanagerservice, the abilitymanagerservice also passes the target service interface name, target interface parameters and target SDK path carried by the target signal to the target container through the first target interaction process connectservice_oh.

[0117] The shell application in the target container, that is, the target application, dynamically loads the target SDK, executes the corresponding business logic through the Android runtime, and feeds back the target execution result to the Openharmony system based on the container call interface.

[0118] In this way, the loading compatibility solution based on the target SDK is completed.

[0119] It can be seen that this embodiment is based on the use scenarios of devices equipped with the Openharmony system. Through market research, a list of commonly used applications (and active applications for applications) is listed to install some commonly used Android application functions on the market into the device through Android containerization, and a unified interface is exposed for external OpenHarmony applications to use. When the OpenHarmony application needs to use the corresponding function, it calls the unified interface, and the system framework will call the function of the corresponding Android application in the container. In this way, by referring to the implementation solution of anbox, improved adaptation is made, and a set of containerization solutions for running Android on Openharmony is provided. Based on two Android native interaction technologies, an openharmony-compatible solution is designed, the startactivity call compatible solution and the sdk loading compatible solution. In this way, the current problems of the OpenHarmony system, such as poor application ecological environment, few applications, and limited application development, can be improved.

[0120] In summary, this embodiment provides an application ecological environment grafting method. When developing an OpenHarmony system, a target container is constructed in a target device for developing an OpenHarmony system. The target container is used to independently run an Android system, and then a target signal for calling a target function is received, and the target application corresponding to the target function is determined. If the target application is an Android application, the target function in the corresponding Android application can be called in the target container based on the target signal to provide feedback on the target signal. This embodiment provides a method for grafting an application ecological environment for users, which solves the problem of limited application development caused by poor application ecological environment and few applications of the OpenHarmony system in the prior art. In this embodiment, by constructing a target container in a target device for developing an OpenHarmony system, when the developed application needs to call the functions of other Android applications, it can be directly called based on the target container without redeveloping a corresponding OpenHarmony application, thereby improving the application ecological environment of the OpenHarmony system and bringing convenience to users who develop the OpenHarmony system.

[0121] It should be understood that, although the various steps in the flowcharts given in the accompanying drawings of the present invention are displayed in sequence according to the indications of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear description in this article, the execution of the steps in the present invention is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps of the present invention may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0122] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by signaling related hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0123] Embodiment 2

[0124] Based on the above embodiments, the present invention also provides an application ecological environment grafting device, and its functional module schematic diagram is as follows: Figure 5 As shown, the application ecological environment grafting device includes:

[0125] A construction module, used to construct a target container in a target device for developing an OpenHarmony system, wherein the target container is used to independently run an Android system, as described in the first embodiment;

[0126] A signal receiving module, used to receive a target signal, where the target signal is a signal for calling a target function, as described in the first embodiment;

[0127] The determination module is used to determine the target application corresponding to the target function. If the target application is an Android application, the target function of the target application is called in the target container based on the target signal, as described in the first embodiment.

[0128] Embodiment 3

[0129] like Figure 6 As shown, based on the above-mentioned application ecological environment grafting method, the present invention also provides a terminal accordingly, and the terminal includes a processor 10, a memory 20 and a display 30. Figure 6 Only some components of the terminal are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.

[0130] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a hard disk or memory of the terminal. In other embodiments, the memory 20 may also be an external storage device of the terminal, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the terminal. Furthermore, the memory 20 may also include both an internal storage unit of the terminal and an external storage device. The memory 20 is used to store application software and various types of data installed on the terminal, such as the program code of the installation terminal. The memory 20 can also be used to temporarily store data that has been output or is to be output. In one embodiment, an application ecological environment grafting program 40 is stored on the memory 20, and the application ecological environment grafting program 40 can be executed by the processor 10, thereby realizing the application ecological environment grafting method in the present application.

[0131] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run the program code or process data stored in the memory 20, such as executing the application ecosystem grafting method.

[0132] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 30 is used to display information on the terminal and to display a visual user interface. The components 10-30 of the terminal communicate with each other via a system bus.

[0133] In one embodiment, when the processor 10 executes the application ecological environment grafting program 40 in the memory 20, the following steps are implemented:

[0134] Building a target container in a target device for developing an OpenHarmony system, wherein the target container is used to independently run an Android system;

[0135] receiving a target signal, wherein the target signal is a signal for calling a target function;

[0136] A target application corresponding to the target function is determined, and if the target application is an Android application, the target function of the target application is called in the target container based on the target signal.

[0137] The step of constructing a target container in a target device for developing an OpenHarmony system includes:

[0138] Obtain a target usage scenario of the target device, and based on the target usage scenario, obtain a list of Android applications corresponding to the target usage scenario;

[0139] The Android system is isolated and installed in the target device based on the Anbox tool, and the application corresponding to the Android application list is installed in the Android system to obtain the target container.

[0140] The calling the target function of the target application in the target container based on the target signal includes:

[0141] Determine whether the target function can be directly called through the startActivity command in the Android system;

[0142] If the target function can be directly called through the startActivity command, the target function is called using the first calling method;

[0143] If the target function cannot be directly called through the startActivity command, the target function is called using the second calling method.

[0144] The first calling method includes:

[0145] forwarding the target signal to the first target interactive process;

[0146] The first target interaction process parses the target signal to obtain a first target parameter, wherein the first target interaction process is a process of the Openharmony system and exists in the host machine;

[0147] Sending the first target parameter to a second target interaction process, where the second target interaction process is an Android system process and exists in the target container;

[0148] The second target interaction parses the first target parameters to obtain the target startActivity command

[0149] A target function of the target application is called based on the target startActivity command.

[0150] Wherein, after the target function is called by the first calling method, the method further includes:

[0151] When the target application feeds back the first information, based on the second target interactive program, the first information is converted into a second target parameter and sent to the first target interactive program;

[0152] The first target interaction program parses the second target parameter to obtain first target information;

[0153] The target signal is fed back based on the first target information.

[0154] The second calling method includes:

[0155] Based on the container calling interface, the target service interface name, target interface parameters and target SDK path carried by the target signal are transferred to the target container;

[0156] The target application in the target container dynamically loads the target SDK based on the target service interface name, the target interface parameters and the target SDK path to obtain a target execution result;

[0157] The target execution result is fed back to the Openharmony system based on the container calling interface.

[0158] Before calling the target function in the second calling mode, the method further includes:

[0159] The caller application corresponding to the target application in the Openharmony system registers with the interface platform of the target application during the development phase and downloads the target SDK of the target application;

[0160] Place the target SDK into the resource file corresponding to the target application.

[0161] Embodiment 4

[0162] The present invention also provides a computer-readable storage medium on which one or more programs are stored. The one or more programs can be executed by one or more processors to implement the steps of the application ecological environment grafting method described in the above embodiment.

[0163] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for applying ecological environment grafting, characterized in that: The application ecological environment grafting method comprises: Building a target container in a target device for developing an OpenHarmony system, wherein the target container is used to independently run an Android system; receiving a target signal, wherein the target signal is a signal for calling a target function; A target application corresponding to the target function is determined, and if the target application is an Android application, the target function of the target application is called in the target container based on the target signal.

2. The method for applying ecological environment grafting according to claim 1, characterized in that: The step of constructing a target container in a target device for developing an OpenHarmony system includes: Obtain a target usage scenario of the target device, and based on the target usage scenario, obtain a list of Android applications corresponding to the target usage scenario; The Android system is isolated and installed in the target device based on the Anbox tool, and the application corresponding to the Android application list is installed in the Android system to obtain the target container.

3. The method for applying ecological environment grafting according to claim 1, characterized in that: The calling the target function of the target application in the target container based on the target signal includes: Determine whether the target function can be directly called through the startActivity command in the Android system; If the target function can be directly called through the startActivity command, the target function is called using the first calling method; If the target function cannot be directly called through the startActivity command, the target function is called using the second calling method.

4. The method for applying ecological environment grafting according to claim 3, characterized in that: The first calling method includes: forwarding the target signal to the first target interactive process; The first target interaction process parses the target signal to obtain a first target parameter, wherein the first target interaction process is a process of the Openharmony system and exists in the host machine; Sending the first target parameter to a second target interaction process, where the second target interaction process is an Android system process and exists in the target container; The second target interaction parses the first target parameters to obtain the target startActivity command A target function of the target application is called based on the target startActivity command.

5. The method for applying ecological environment grafting according to claim 4, characterized in that: After the target function is called in the first calling mode, the method further includes: When the target application feeds back the first information, based on the second target interactive program, the first information is converted into a second target parameter and sent to the first target interactive program; The first target interaction program parses the second target parameter to obtain first target information; The target signal is fed back based on the first target information.

6. The method for applying ecological environment grafting according to claim 3, characterized in that: The second calling method includes: Based on the container calling interface, the target service interface name, target interface parameters and target SDK path carried by the target signal are transferred to the target container; The target application in the target container dynamically loads the target SDK based on the target service interface name, the target interface parameters and the target SDK path to obtain a target execution result; The target execution result is fed back to the Openharmony system based on the container calling interface.

7. The method for applying ecological environment grafting according to claim 3, characterized in that: Before calling the target function in the second calling mode, the method further includes: The caller application corresponding to the target application in the Openharmony system registers with the interface platform of the target application during the development phase and downloads the target SDK of the target application; Place the target SDK into the resource file corresponding to the target application.

8. An application ecological environment grafting device, characterized in that: The system comprises: A construction module is used to build a target container in a target device for developing an OpenHarmony system, wherein the target container is used to independently run an Android system; A signal receiving module, used to receive a target signal, wherein the target signal is a signal for calling a target function; The determination module is used to determine the target application corresponding to the target function, and if the target application is an Android application, the target function of the target application is called in the target container based on the target signal.

9. An intelligent terminal, characterized in that: The smart terminal includes a memory, a processor, and an application ecological environment grafting program stored in the memory and executable on the processor. When the application ecological environment grafting program is executed by the processor, the steps of the application ecological environment grafting method as described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores an application ecological environment grafting program, and when the application ecological environment grafting program is executed by a processor, the steps of the application ecological environment grafting method according to any one of claims 1 to 7 are implemented.