Application installation method and device, electronic equipment and readable storage medium

By using installation files that support multi-VM development language development in a dual-system environment, the problem of high cost of installing applications on dual-systems is solved, and the co-compilation and deployment on both operating systems is realized, reducing development and installation costs.

CN119512575APending Publication Date: 2025-02-25GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411585191.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2021-02-24
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

The cost of installing applications in a dual-system environment is high, mainly because of the need to develop and install application versions under different systems separately.

Method used

By obtaining the installation file of the application to be installed on the first operating system, the development language of the file supports the first virtual machine and the second virtual machine, and then installing the application on the first operating system and the second operating system.

Benefits of technology

It realizes that the same application is compiled and deployed on two operating systems, reducing the cost of installing applications on dual systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119512575A_ABST
    Figure CN119512575A_ABST
Patent Text Reader

Abstract

The invention relates to an application program installation method and device, electronic equipment and a computer readable storage medium, the application program installation method and device are applied to the electronic equipment, a first operating system and a second operating system can run on the electronic equipment, a first virtual machine can run on the first operating system, and a second virtual machine can run on the second operating system. The method comprises the steps that an installation file of an application program to be installed is obtained through a first operating system, and the application program is installed on the first operating system and a second operating system. The development language of the installation file of the application program is the development language supported by both the first virtual machine and the second virtual machine, the first virtual machine can run on the first operating system, and the second virtual machine can run on the second operating system, so that the application program can be installed on the first operating system and the second operating system. Therefore, the same application program is compiled and deployed on the two operating systems together, and the cost of installing the application program on the dual systems is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This invention patent application is a divisional application of the Chinese invention patent application with application date of February 24, 2021, application number 2021102055634, and name “Application installation method and device, electronic device, and readable storage medium”. Technical Field

[0002] The present application relates to the field of computer technology, and in particular to a method and device for installing an application, an electronic device, and a readable storage medium. Background Art

[0003] As electronic devices become more and more powerful, a single operating system sometimes cannot meet people's demands for the functions of electronic devices. Therefore, some electronic devices begin to be equipped with dual systems to provide users with a better user experience.

[0004] Generally, a dual system includes a main system and a secondary system, and the software architecture and source language used by the applications on the main system are more advanced than those on the secondary system. Therefore, the cost of installing applications on the dual system is high. Summary of the invention

[0005] The embodiments of the present application provide a method and device for installing an application, an electronic device, and a readable storage medium, which can reduce the cost of installing the application on a dual system.

[0006] A method for installing an application is applied to an electronic device, wherein the electronic device can run a first operating system and a second operating system, a first virtual machine can be run on the first operating system, and a second virtual machine can be run on the second operating system, the method comprising:

[0007] Obtaining, through the first operating system, an installation file of an application to be installed; wherein a development language of the installation file of the application is a development language supported by both the first virtual machine and the second virtual machine;

[0008] The application is installed on the first operating system and the second operating system.

[0009] An application is installed on an electronic device, the electronic device can run a first operating system and a second operating system; a first virtual machine can be run on the first operating system, and a second virtual machine can be run on the second operating system;

[0010] The development language of the installation file of the application is a development language supported by both the first virtual machine and the second virtual machine, and the application can be installed on the first operating system and the second operating system.

[0011] An application installation device is applied to an electronic device, on which a second operating system and a first operating system can be run, a second virtual machine can be run on the second operating system, and a first virtual machine can be run on the first operating system, the device comprising:

[0012] an installation file acquisition module, used to acquire, through the first operating system, an installation file of an application to be installed; wherein the development language of the installation file of the application is a development language supported by both the first virtual machine and the second virtual machine;

[0013] An application installation module is used to install the application on the first operating system and the second operating system.

[0014] An electronic device includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above-mentioned application installation method.

[0015] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the method for installing an application as described above.

[0016] The above-mentioned application installation method and device, electronic device, and computer-readable storage medium are applied to an electronic device, on which a first operating system and a second operating system can be run, a first virtual machine can be run on the first operating system, and a second virtual machine can be run on the second operating system. The method includes: obtaining the installation file of the application to be installed through the first operating system, and installing the application on the first operating system and the second operating system. The development language of the application installation file is a development language supported by both the first virtual machine and the second virtual machine.

[0017] Because the development language of the installation file of the application is a development language supported by both the first virtual machine and the second virtual machine, and the first virtual machine can be run on the first operating system and the second virtual machine can be run on the second operating system, the application can be installed on the first operating system and the second operating system. Thus, the same application can be compiled and deployed on both operating systems, reducing the cost of installing the application on the dual systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0019] Figure 1 An application environment diagram of a method for installing an application program in an embodiment;

[0020] Figure 2 is a flowchart of a method for installing an application in an embodiment;

[0021] Figure 3 for Figure 2 A flowchart of a method for installing an application on a first operating system and a second operating system;

[0022] Figure 4 A schematic diagram of a distributed architecture of a method for installing an application based on dual virtual machines in an embodiment;

[0023] Figure 5 A flowchart of a method for installing a second installation file in a second operating system in one embodiment;

[0024] Figure 6 is a flowchart of a method for installing an application in another embodiment;

[0025] Figure 7 is a flowchart of a method for installing an application in a specific embodiment;

[0026] Figure 8 is a structural block diagram of an installation device for an application in one embodiment;

[0027] Fig. 9 for Figure 8 The structural diagram of the application installation module in the figure;

[0028] Fig.10 FIG. 1 is a schematic diagram of the internal structure of an electronic device in an embodiment. DETAILED DESCRIPTION

[0029] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0030] Figure 1 FIG. 1 is an application scenario diagram of a method for installing an application program in an embodiment. Figure 1As shown, the application environment includes an electronic device 120 and a server 140, and the electronic device 120 and the server 140 are connected via a network. The first operating system and the second operating system can be run on the electronic device, and the first virtual machine can be run on the first operating system, and the second virtual machine can be run on the second operating system. The electronic device 120 obtains the installation file of the application to be installed through the first operating system through the application installation method in the present application; and installs the application on the first operating system and the second operating system. Among them, the development language of the installation file of the application is a development language supported by both the first virtual machine and the second virtual machine. Here, the electronic device can be any terminal device such as a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a wearable device, a smart home device, etc., and this application does not limit this.

[0031] In the traditional method, an electronic device equipped with a dual system generally includes a main system and a secondary system, and the software architecture and source language used by the application on the main system are more advanced than those of the application on the secondary system. For example, the application on the main system is developed using JAVA voice, while the application on the secondary system is developed using the lower-level C voice. Of course, this application is not limited to this. Therefore, for the same application, it is necessary to use different source languages ​​and software architectures for development, so that the two different versions of the application developed separately can be installed and run on the main system and the secondary system. For the same application, two applications of the same version are developed, and then installed based on the installation files of the application. Obviously, the development and installation costs of the application are too high.

[0032] Therefore, the present application proposes a method for installing an application. First, it is no longer necessary to develop two different versions of an application using different source languages ​​and software architectures for dual systems; second, it is no longer necessary to install the application based on the installation files of the application under different systems. Specifically, a first operating system and a second operating system can be run on an electronic device, and a first virtual machine can be run on the first operating system, and a second virtual machine can be run on the second operating system. Among them, the first virtual machine and the second virtual machine both support the same development language, so the installation file of the application can be developed using the same development language, so that the installation file of the application can be installed under two operating systems at the same time. Thereby, the development and installation costs of the application are reduced.

[0033] Figure 2 FIG. 1 is a flowchart of a method for installing an application in an embodiment. The method for installing an application in this embodiment is to run on Figure 1The electronic device 120 in the example is used for description. The first operating system and the second operating system can be run on the electronic device, and the first operating system can be run on the first virtual machine, and the second operating system can be run on the second virtual machine. During the application installation phase, the first virtual machine does not need to be run on the first operating system, and the second virtual machine does not need to be run on the second operating system. When running an application on the first operating system, it is necessary to run the first virtual machine on the first operating system; similarly, when running an application on the second operating system, it is necessary to run the first virtual machine on the second operating system to create an operating environment for the application.

[0034] Specifically, if the first operating system is the main system, such as the Android system, the Android system generally runs on the main processor CPU of the wearable device, and the software on the CPU is often written in a high-level architecture and language, such as JAVA. If the second operating system is the secondary system, such as the RTOS system, the RTOS system generally runs on the coprocessor MCU of the wearable device, and the software on the MCU is often written in C language. In this way, because the RTOS system and the Android system are written in different languages, they cannot be compiled and deployed together, and the distributed architecture cannot be realized.

[0035] Therefore, a DVM (Dalvik Virtual Machine) virtual machine is run in the first operating system (such as an Android system), and a lightweight JVM virtual machine (Java Virtual Machine, Java virtual machine) is run on the second operating system (such as an RTOS system). The first virtual machine and the second virtual machine can run the same type of applications, wherein the same type of applications can be applications developed based on the JAVA source language. That is, through the first virtual machine and the second virtual machine, it is possible to install and run applications in the same development language (such as JAVA) on both the first operating system and the second operating system. Furthermore, it is possible to jointly compile and deploy applications in the same development language in the first operating system and the second operating system, thereby improving the efficiency of compilation and deployment.

[0036] Among them, JVM is a fictional computer that is realized by simulating various computer functions on an actual computer. A very important feature of the Java language is its independence from the platform, and the use of the Java virtual machine is the key to achieving this feature. If a general high-level language is to run on different platforms, it must at least be compiled into different target codes. After the introduction of the Java virtual machine, the Java language does not need to be recompiled when running on different platforms. The Java language uses the Java virtual machine to shield information related to the specific platform, so that the Java language compiler only needs to generate target code (bytecode) that runs on the Java virtual machine, and it can run on multiple platforms without modification. When the Java virtual machine executes the bytecode, it interprets the bytecode into machine instructions on the specific platform for execution. This is why Java can be "compiled once and run everywhere."

[0037] All Java programs in the Android system run on the DVM. Each program in the Android system has its own thread, and the DVM only executes the .dex Dalvik executable file. Each Android application has an independent DVM instance at the bottom layer and executes under its interpretation.

[0038] like Figure 2 As shown, a method for installing an application is provided, including steps 220 to 240. Among them,

[0039] Step 220: obtaining, through the first operating system, an installation file of the application to be installed; wherein the development language of the installation file of the application is a development language supported by both the first virtual machine and the second virtual machine.

[0040] In the traditional method, the electronic device can run a first operating system and a second operating system, and the first operating system can run a first virtual machine, while the second operating system does not run a virtual machine. Among them, because the first operating system has the first virtual machine, it can support more advanced software architectures and source languages ​​with the help of the first virtual machine. However, because the second operating system does not have a virtual machine, it cannot support more advanced software architectures and source languages.

[0041] Therefore, the second virtual machine is installed and run on the second operating system of the electronic device. Wherein, the first virtual machine and the second virtual machine both support the same development language. Therefore, the installation file of the application can be developed using the same development language, so that the installation file of the application can be installed in two operating systems at the same time.

[0042] When installing an application on an electronic device, the electronic device currently runs under a first operating system, and obtains the installation file of the application to be installed from a server through the first operating system. Specifically, the electronic device may download the installation file of the application to be installed from the server. The installation file of the application is the installation package of the application.

[0043] Step 240: Install the application program on the first operating system and the second operating system.

[0044] After the electronic device downloads the installation file of the application to be installed from the server, the application can be installed on the first operating system and the second operating system. Specifically, the installation file of the application can be parsed to obtain two parts of the installation file, one of which can be installed in the first operating system and the other can be installed in the second operating system.

[0045] When the electronic device runs on the first operating system, the installation files installed on the first operating system can support some functions of the application on the first operating system. Correspondingly, when the electronic device runs on the second operating system, the installation files installed on the second operating system can support some functions of the application on the second operating system.

[0046] In the embodiment of the present application, because the development language of the installation file of the application is a development language supported by both the first virtual machine and the second virtual machine, and the first virtual machine can be run on the first operating system, and the second virtual machine can be run on the second operating system, the application can be installed on the first operating system and the second operating system. Thus, the same application is compiled and deployed on the two operating systems, and the distributed architecture of the same application under the two operating systems is realized, which reduces the cost of installing the application on the dual systems.

[0047] In one embodiment, Figure 3 As shown, step 240, installing the application on the first operating system and the second operating system, includes:

[0048] Step 242, parse the installation file of the application to obtain a first installation file and a second installation file, wherein the data volume of the first installation file is greater than the data volume of the second installation file.

[0049] The electronic device currently runs under the first operating system, and obtains the installation file of the application to be installed from the server through the first operating system. And under the first operating system, the installation file of a complete application that can be installed in the dual system is parsed to obtain the first installation file and the second installation file. Among them, the first installation file can be installed under the first operating system, and the second installation file can be installed under the second operating system. Here, parsing the installation file of the application can be understood as decompressing the installation file of the application. That is, the installation file (APK installation package) of an application is decompressed to obtain the first installation file (main APK installation package) and the second installation file (mini-APK installation package).

[0050] The first operating system is the main system and the second operating system is the secondary system, so the functions implemented by installing the first installation file under the first operating system are generally more complex than the functions implemented by installing the second installation file under the second operating system. In order to achieve more complex functions, the data volume of the first installation file is correspondingly larger than the data volume of the second installation file. In addition, when the electronic device runs under the first operating system, the functions of the application can be provided only by the first installation file installed under the first operating system. When the electronic device runs under the second operating system, the functions of the application can be provided only by the second installation file installed under the second operating system.

[0051] Step 244: Send the second installation file to the second operating system to install the second installation file in the memory space corresponding to the second operating system.

[0052] Step 246: Install the first installation file in the memory space corresponding to the first operating system.

[0053] The electronic device parses the installation file of the application under the first operating system, obtains the first installation file and the second installation file, and then needs to send the second installation file to the second operating system to install the second installation file in the memory space corresponding to the second operating system. Then, the first installation file is installed in the memory space corresponding to the first operating system.

[0054] Specifically, the electronic device sends the second installation file (mini-APK installation package) to the second operating system under the first operating system to install the mini-APK installation package in the memory space corresponding to the second operating system. Then, the first installation file (main APK installation package) is installed in the memory space corresponding to the first operating system.

[0055] In an embodiment of the present application, the installation file of an application developed using the same development language is directly parsed to obtain a first installation file and a second installation file. Then, the first installation file and the second installation file are installed under two different operating systems, respectively. By parsing the installation file of the application into two parts, the effect of installing the application under two different operating systems is achieved. It is no longer necessary to develop two different versions of the application using different source languages ​​and software architectures for the dual systems; secondly, it is also not necessary to install the installation files of the application under different systems, respectively. Thus, the development and installation costs of the application are reduced.

[0056] In one embodiment, sending the second installation file to the second operating system to install the second installation file in the memory space corresponding to the second operating system includes:

[0057] Sending the second installation file from the first operating system to the second operating system through the dual-system communication interface;

[0058] The second installation file is received through the second operating system, and the second installation file is installed in the memory space corresponding to the second operating system.

[0059] like Figure 4 FIG. 1 is a schematic diagram of a distributed architecture of an application installation method based on dual virtual machines in an embodiment. The AP (Application Processor) 420 can run a first operating system, such as an Android system, and the MCU (Microcontroller Unit) 440 can run a second operating system, such as an RTOS system.

[0060] The installation file (APK installation package) of an application is parsed on the first operating system to obtain a first installation file (main APK installation package) and a second installation file (mini-APK installation package). The service Service in the first operating system can communicate with the DVM, and the DVM can communicate with the underlying dual-core communication module (Dual-core communication) through JNI (Java Native Interface). Among them, the dual-core communication module is written based on C language. Correspondingly, the service Service in the second operating system can communicate with the Embeded JVM through Virtual Dual-core Communication, and the Embeded JVM can communicate with the underlying dual-core communication module (Dual-core communication) through JNI. A dual-system communication interface 460 is configured between the dual-core communication module on the second operating system and the dual-core communication module on the first operating system, and dual-system communication can be achieved through the dual-system communication interface 460. Among them, the dual-system communication interface 460 can be an SPI interface (Serial Peripheral Interface), of course, this application does not limit this.

[0061] Among them, there is a virtual interface (VirtualAPI) between the Virtual Dual-core Communication on the second operating system and the Virtual Dual-core Communication on the first operating system, but in fact, direct communication is impossible through the VirtualAPI, and it must be transferred through the underlying dual-core communication interface (API, Application Programming Interface). The specific reasons are not repeated here.

[0062] Therefore, if the electronic device currently runs the first operating system, the second installation file can be sent from the first operating system to the second operating system through the dual-system communication interface API under the first operating system, and the second installation file is received in the second operating system, and the second installation file is installed in the memory space corresponding to the second operating system.

[0063] In the embodiment of the present application, based on the above-mentioned distributed architecture, the first operating system can be controlled to send the second installation file to the second operating system through the dual-system communication interface from top to bottom. The second installation file is installed in the memory space corresponding to the second operating system. Then, the second installation file can be run in the Embeded JVM. Thus, the installation file based on the same application is parsed and installed separately under two different operating systems.

[0064] In one embodiment, Figure 5 As shown, installing the second installation file in the memory space corresponding to the second operating system includes:

[0065] Step 510, verify the second installation file to obtain a verification result; wherein the second installation file includes a second resource file and a second code file; if the verification passes, proceed to step 530; if the verification fails, proceed to step 590 and end the installation process.

[0066] Among them, the second installation file is an installation file installed in the second virtual machine under the second operating system. After the second operating system receives the second installation file, first, the second installation file is decompressed by a decompression tool to obtain multiple directories or files. If the second installation file is an installation package written based on JAVA, the multiple directories or files obtained after decompression include a second resource file, a second code file and other files. Among them, the second resource file includes assert files, lib library files, res files, resources.arsc files, etc., which can be called sub-resource files. The second code file includes a classes.dex file. The specific directories or files are shown in Table 1-1 below:

[0067] Table 1-1

[0068]

[0069] The file verification results in META-INF can be used to verify the correctness, integrity and legality of the files in the installation package. This ensures the security of the installation process and prevents users from installing applications that have been infected by viruses or maliciously tampered with. If the verification is successful, the second resource file is parsed to obtain at least one sub-resource file, and the sub-resource file is stored in the second resource area. If the verification fails, the installation process ends.

[0070] Step 530: If the verification is successful, the second resource file is parsed to obtain at least one sub-resource file, and the sub-resource file is stored in the second resource area.

[0071] Because the second resource file includes assert file, lib library file, res file, resources.arsc file, etc., these files can be called sub-resource files. So if the verification is passed, the second resource file is parsed to obtain at least one sub-resource file, and the sub-resource file is stored in the second resource area. The second resource area here is a storage space divided for the second operating system, which is specially used to store sub-resource files.

[0072] Step 550: parse the second code file to obtain bytecodes that can be executed in the second virtual machine, and import the bytecodes into the second code area.

[0073] The second code file includes a classes.dex file. The classes.dex file is a JAVA bytecode file generated after the JAVA source code is compiled. Therefore, the second code file is parsed to obtain bytecode that can be run in the second virtual machine, and the bytecode is imported into the second code area. The second code area here is also a storage space divided for the second operating system, which is specifically used to store the bytecode that can be run in the second virtual machine obtained by parsing the second code file.

[0074] Step 570: Load the sub-resource file of the second resource area through the bytecode of the second code area to install the second installation file in the memory space corresponding to the second operating system.

[0075] During the installation phase of the application, the sub-resource file of the second resource area is loaded through the bytecode of the second code area, that is, the sub-resource file of the second resource area is called through the bytecode of the second code area to install the second installation file in the memory space corresponding to the second operating system. The loading here is the preloading process during the application installation process.

[0076] In the embodiment of the present application, during the installation phase of the application, firstly, verification is performed to ensure the security of the installation process and to prevent the user from installing an application that has been infected by a virus or maliciously tampered with. Secondly, the second installation file is parsed and loaded to install the second installation file in the memory space corresponding to the second operating system. Thus, the application (e.g., JAVA application) developed using the development language on the first operating system is installed on the second operating system. Furthermore, the application is compiled and deployed together in the first operating system and the second operating system using the same development language, thereby improving the efficiency of compilation and deployment.

[0077] In one embodiment, the sub-resource file includes at least one of an image material of the application, an interface layout file, an animation effect file, and a color file.

[0078] Among them, the folders starting with anim in the sub-resource file usually store the animation effect files of the application. The folders starting with color usually store the various color values ​​of the application, that is, color files. The folders starting with drawable usually store the image materials of the application, and the image materials include pictures or graphic materials. The folders starting with layout usually store the interface layout files of the application. Of course, based on different applications, other files can also be included in the sub-resource file, and this application does not limit this.

[0079] In the embodiment of the present application, the sub-resource file includes at least one of the image material, interface layout file, animation effect file, and color file of the application. The sub-resource file is parsed and loaded to install the second installation file in the memory space corresponding to the second operating system. Thus, the second installation file is installed in the second operating system quickly and efficiently.

[0080] In one embodiment, installing a first installation file in a memory space corresponding to a first operating system includes:

[0081] Verifying the first installation file to obtain a verification result; wherein the first installation file includes a first resource file and a first code file;

[0082] If the verification is successful, the first resource file is parsed to obtain at least one sub-resource file, and the sub-resource file is stored in the first resource area;

[0083] Parsing the first code file to obtain bytecodes that can be executed in the first virtual machine, and importing the bytecodes into the first code area;

[0084] The sub-resource file of the first resource area is loaded through the bytecode of the first code area to install the first installation file in the memory space corresponding to the first operating system.

[0085] Among them, the first installation file is an installation file installed in the first operating system. After the first operating system receives the first installation file, first, the first installation file is decompressed by a decompression tool to obtain multiple directories or files. If the first installation file is an installation package written based on JAVA, the multiple directories or files obtained after decompression include a first resource file and a first code file and other files. Among them, the first resource file includes assert files, lib library files, res files, resources.arsc files, etc., which can be called sub-resource files. The first code file includes a classes.dex file. The specific directories or files are shown in Table 1-1 above and will not be repeated in the embodiments of the present application.

[0086] The file verification results in META-INF can be used to verify the correctness, integrity and legality of the files in the installation package. This ensures the security of the installation process and prevents users from installing applications that have been infected by viruses or maliciously tampered with. If the verification is successful, the first resource file is parsed to obtain at least one sub-resource file, and the sub-resource file is stored in the first resource area. If the verification fails, the installation process ends.

[0087] Because the first resource file includes assert files, lib library files, res files, resources.arsc files, etc., these files can be called sub-resource files. So if the verification is passed, the first resource file is parsed to obtain at least one sub-resource file, and the sub-resource file is stored in the first resource area. The first resource area here is a storage space divided for the first operating system, which is specially used to store sub-resource files.

[0088] The first code file includes a classes.dex file. The classes.dex file is a JAVA bytecode file generated after the JAVA source code is compiled. Therefore, the first code file is parsed to obtain bytecode that can be run in the first virtual machine, and the bytecode is imported into the first code area. The first code area here is also a storage space divided for the first operating system, which is specifically used to store the bytecode that can be run in the first virtual machine obtained by parsing the first code file.

[0089] During the installation phase of the application, the sub-resource file of the first resource area is loaded through the bytecode of the first code area, that is, the sub-resource file of the first resource area is called through the bytecode of the first code area to install the first installation file in the memory space corresponding to the first operating system. The loading here is the preloading process during the installation process of the application.

[0090] In the embodiment of the present application, during the installation phase of the application, firstly, verification is performed to ensure the security of the installation process and prevent the user from installing an application that has been infected by a virus or maliciously tampered with. Secondly, parsing and loading are performed to install the first installation file in the memory space corresponding to the first operating system. Thus, it is possible to install an application (such as a JAVA application) developed in the same development language as that on the second operating system on the first operating system. Furthermore, it is possible to jointly compile and deploy the application in the second operating system and the first operating system using the same development language, thereby improving the efficiency of compilation and deployment.

[0091] In one embodiment, the power consumption when the first operating system is running on the electronic device is greater than the power consumption when the second operating system is running on the electronic device.

[0092] In the embodiment of the present application, the dual system on the electronic device includes a first operating system and a second operating system. If the first operating system is the main system, such as the Andriod system, the Andriod system generally runs on the main processor CPU of the wearable device. If the second operating system is the secondary system, such as the RTOS system, the RTOS system generally runs on the coprocessor MCU of the wearable device. And the functions implemented under the first operating system are generally more complex than the functions implemented under the second operating system, so the power consumption when the first operating system is run on the electronic device is greater than the power consumption when the second operating system is run on the electronic device.

[0093] In one embodiment, the first virtual machine is a DVM virtual machine, the second virtual machine is a JVM virtual machine, the first installation file runs on the DVM virtual machine, and the second installation file runs on the JVM virtual machine.

[0094] In the embodiment of the present application, the first operating system and the second operating system can be run on the electronic device, and the first virtual machine can be run on the first operating system, and the second virtual machine can be run on the second operating system. When the first installation file is installed under the first operating system, it is installed and run in the memory space corresponding to the first operating system. When the second installation file is installed under the second operating system, it is installed and run in the memory space corresponding to the second operating system. Thus, the same application is compiled and deployed on two operating systems through virtual machines under different operating systems, reducing the cost of installing applications on dual systems.

[0095] In one embodiment, Figure 6 As shown, a method for installing an application is provided, further comprising:

[0096] Step 620, using the same development language to write the first installation file and the second installation file;

[0097] Step 640, compile and package the first installation file and the second installation file into an installation file of the application;

[0098] Step 660, obtaining the installation file of the application to be installed through the first operating system;

[0099] Step 680: Install the application program on the first operating system and the second operating system.

[0100] In the embodiment of the present application, the first operating system and the second operating system can be run on the electronic device, and the first virtual machine can be run on the first operating system, and the second virtual machine can be run on the second operating system. Wherein, both the first virtual machine and the second virtual machine support the development language, so the installation file of the application can be developed using the development language, so that the installation file of the application can be installed in two operating systems at the same time.

[0101] Specifically, during the development phase of the application, the developer uses the same development language to write the first installation file and the second installation file, and compiles and packages the first installation file and the second installation file into the installation file of the application. Here, the same development language is not limited to writing, and in addition to the JAVA language in the above embodiment, it can also be java, c, c++, C#, pascal, python, lisp, prolog, FoxPro, VC, Easy Language, Chinese version of C language and other source languages.

[0102] Then, the installation file of the application to be installed can be obtained through the first operating system, and the application can be installed on the first operating system and the second operating system, thereby reducing the development and installation costs of the application.

[0103] In a specific embodiment, Figure 7 As shown, a method for installing an application is provided, which is applied to an electronic device, the electronic device can run a first operating system (Android system) and a second operating system (RTOS system), a first virtual machine (DVM) can be run on the first operating system, and a second virtual machine (JVM) can be run on the second operating system, the method comprising:

[0104] Step 702, using the same development language to write the first installation file and the second installation file; the development language is a source language supported by both the first virtual machine and the second virtual machine;

[0105] Step 704, compile and package the first installation file and the second installation file into an installation file of the application;

[0106] Step 706, obtaining the installation file of the application to be installed through the first operating system;

[0107] Step 708, parsing the installation file of the application to obtain a first installation file and a second installation file, wherein the data volume of the first installation file is greater than the data volume of the second installation file;

[0108] Step 710, sending the second installation file from the first operating system to the second operating system through the dual-system communication interface;

[0109] Step 712, receiving the second installation file through the second operating system, verifying the second installation file, and obtaining a verification result; wherein the second installation file includes a second resource file and a second code file; if the verification passes, proceed to step 714; if the verification fails, proceed to step 722 and end the installation process.

[0110] Step 714, parsing the second resource file to obtain at least one sub-resource file, and storing the sub-resource file in the second resource area;

[0111] Step 716, parsing the second code file to obtain bytecodes that can be executed in the second virtual machine, and importing the bytecodes into the second code area;

[0112] Step 718, loading the sub-resource file of the second resource area through the bytecode of the second code area, so as to install the second installation file in the memory space corresponding to the second operating system;

[0113] Step 720: Install the first installation file in the memory space corresponding to the first operating system using the same method as that for installing the second installation file in the second operating system.

[0114] In the embodiment of the present application, because the development language of the installation file of the application is a development language supported by both the first virtual machine and the second virtual machine, and the first virtual machine can be run on the first operating system, and the second virtual machine can be run on the second operating system, the application can be installed on the first operating system and the second operating system. Thus, the same application is compiled and deployed on the two operating systems, and the distributed architecture of the same application under the two operating systems is realized, which reduces the cost of installing the application on the dual systems.

[0115] In one embodiment, an application is installed on an electronic device, and the electronic device can run a first operating system and a second operating system; a first virtual machine can be run on the first operating system, and a second virtual machine can be run on the second operating system;

[0116] The development language of the installation file of the application is a development language supported by both the first virtual machine and the second virtual machine, and the application can be installed on the first operating system and the second operating system.

[0117] In the embodiment of the present application, the application is a similar application that can be run by the first virtual machine and the second virtual machine, wherein the similar application can be an application developed based on a development language. And the installation file of the application can be parsed to obtain a first installation file and a second installation file. The electronic device sends the second installation file from the first operating system to the second operating system to install the second installation file in the memory space corresponding to the second operating system, and installs the first installation file in the memory space corresponding to the first operating system.

[0118] Therefore, it is no longer necessary to develop two different versions of applications using different development languages ​​and software architectures for the two systems; secondly, it is no longer necessary to install the application installation files based on different systems, thereby reducing the development and installation costs of the application.

[0119] In one embodiment, Figure 8 As shown, an application installation device 800 is provided, which is applied to an electronic device, on which a second operating system and a first operating system can be run, a second virtual machine can be run on the second operating system, and a first virtual machine can be run on the first operating system. The device includes:

[0120] An installation file acquisition module 820 is used to acquire the installation file of the application to be installed through the first operating system; wherein the development language of the installation file of the application is a development language supported by both the first virtual machine and the second virtual machine;

[0121] The application installation module 840 is used to install the application on the first operating system and the second operating system.

[0122] In one embodiment, Fig. 9 As shown, the application installation module 840 includes:

[0123] An installation file parsing unit 842 is used to parse the installation file of the application to obtain a first installation file and a second installation file, wherein the data volume of the first installation file is greater than the data volume of the second installation file;

[0124] A second installation file installation unit 844, configured to send the second installation file to the second operating system so as to install the second installation file in a memory space corresponding to the second operating system;

[0125] The first installation file installation unit 846 is used to install the first installation file in the memory space corresponding to the first operating system.

[0126] In one embodiment, the second installation file installation unit is further used to send the second installation file from the first operating system to the second operating system through the dual-system communication interface; receive the second installation file through the second operating system, and install the second installation file in the memory space corresponding to the second operating system.

[0127] In one embodiment, the second installation file installation unit is also used to verify the second installation file to obtain a verification result; wherein the second installation file includes a second resource file and a second code file; if the verification is passed, the second resource file is parsed to obtain at least one sub-resource file, and the sub-resource file is stored in the second resource area; the second code file is parsed to obtain bytecode that can be executed in the second virtual machine, and the bytecode is imported into the second code area; the sub-resource file in the second resource area is loaded through the bytecode in the second code area to install the second installation file in the memory space corresponding to the second operating system.

[0128] In one embodiment, the sub-resource file includes at least one of an image material of the application, an interface layout file, an animation effect file, and a color file.

[0129] In one embodiment, the first installation file installation unit is also used to verify the first installation file to obtain a verification result; wherein the first installation file includes a first resource file and a first code file; if the verification is passed, the first resource file is parsed to obtain at least one sub-resource file, and the sub-resource file is stored in the first resource area; the first code file is parsed to obtain bytecode that can be executed in the first virtual machine, and the bytecode is imported into the first code area; the sub-resource file in the first resource area is loaded through the bytecode in the first code area to install the first installation file in the memory space corresponding to the first operating system.

[0130] In one embodiment, the power consumption when the first operating system is running on the electronic device is greater than the power consumption when the second operating system is running on the electronic device.

[0131] In one embodiment, the first operating system is an Android system, and the second operating system is an RTOS system.

[0132] In one embodiment, the first virtual machine is a DVM virtual machine, the second virtual machine is a JVM virtual machine, the first installation file runs on the DVM virtual machine, and the second installation file runs on the JVM virtual machine.

[0133] In one embodiment, an application installation device 800 is provided, further comprising:

[0134] An installation file writing module, used to write the first installation file and the second installation file using the same development language;

[0135] The compiling and packaging module is used to compile and package the first installation file and the second installation file into an installation file of the application.

[0136] It should be understood that, although the various steps in the flowcharts in the above-mentioned figures are displayed in sequence according to the indications of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the above-mentioned figures may include a plurality of sub-steps or a plurality of 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 portion of the sub-steps or stages of other steps.

[0137] The division of the various modules in the installation device of the above application is only for illustration. In other embodiments, the installation device of the application can be divided into different modules as needed to complete all or part of the functions of the installation device of the above application.

[0138] For the specific definition of the installation device of the application, please refer to the definition of the installation method of the application above, which will not be repeated here. Each module in the above-mentioned installation device of the application can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0139] In one embodiment, an electronic device is also provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of a method for installing an application provided in the above embodiments.

[0140] Fig.10 FIG. 1 is a schematic diagram of the internal structure of an electronic device in one embodiment. Fig.10 As shown, the electronic device includes a processor and a memory connected via a system bus. The processor is used to provide computing and control capabilities to support the operation of the entire electronic device. The memory may include a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The computer program can be executed by the processor to implement a method for installing an application provided in each of the above embodiments. The internal memory provides a cached operating environment for the operating system computer program in the non-volatile storage medium. The electronic device can be any terminal device such as a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), a vehicle-mounted computer, a wearable device, etc.

[0141] The implementation of each module in the installation device of the application provided in the embodiment of the present application can be in the form of a computer program. The computer program can be run on an electronic device or an electronic device. The program module constituted by the computer program can be stored in the memory of the electronic device or the electronic device. When the computer program is executed by the processor, the steps of the method described in the embodiment of the present application are implemented.

[0142] The embodiment of the present application also provides a computer-readable storage medium, one or more non-volatile computer-readable storage media containing computer-executable instructions, which, when executed by one or more processors, enable the processors to execute the steps of the application installation method.

[0143] A computer program product comprising instructions, when the computer program product is run on a computer, causes the computer to execute a method for installing an application.

[0144] Any reference to memory, storage, database or other media used in the embodiments of the present application may include non-volatile and / or volatile memory. Suitable non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM), which is used as an external cache memory. As an illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), 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).

[0145] The above application installation examples only express several implementation methods of the present application, and the descriptions are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present application, which all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the attached claims.

Claims

1. A method for installing an application, characterized in that: Applied to an electronic device, the electronic device can run a first operating system and a second operating system, a first virtual machine can be run on the first operating system, and a second virtual machine can be run on the second operating system, the method includes: Obtaining, through the first operating system, an installation file of an application to be installed; wherein a development language of the installation file of the application is a development language supported by both the first virtual machine and the second virtual machine; The application is installed on the first operating system and the second operating system.

2. The method according to claim 1, characterized in that The step of installing the application on the first operating system and the second operating system includes: The installation file of the application is installed on both the first operating system and the second operating system.

3. The method according to claim 1 or 2, characterized in that: The installation file of the application includes a first installation file and a second installation file. The step of installing the application on the first operating system and the second operating system includes: Installing the first installation file in the memory space corresponding to the first operating system; The second installation file is installed in the memory space corresponding to the second operating system.

4. The method according to claim 3, characterized in that The method further comprises: The installation file of the application is sent to the second operating system through the first operating system, so as to install the second installation file in the memory space corresponding to the second operating system.

5. The method according to claim 1, characterized in that: The method further comprises: When the installation file of the application is installed on the first operating system and the second operating system, neither the first virtual machine nor the second virtual machine is running.

6. The method according to claim 1, characterized in that The method further comprises: The first installation file and the second installation file are written in the same development language; The first installation file and the second installation file are compiled and packaged into an installation file of the application.

7. The method according to claim 1 or 2, characterized in that: The electronic device includes any one of a mobile phone, a tablet computer, a personal digital assistant (PDA), a wearable device or a smart home device; Before installing the application on the first operating system and the second operating system, the method further includes: Parsing is performed based on the installation file of the same application.

8. The method according to claim 3, characterized in that The electronic device includes any one of a mobile phone, a tablet computer, a personal digital assistant (PDA), a wearable device or a smart home device; the method also includes: parsing the installation file of the application to obtain the first installation file and the second installation file.

9. An application program, characterized in that Installed on an electronic device, the electronic device can run a first operating system and a second operating system; a first virtual machine can be run on the first operating system, and a second virtual machine can be run on the second operating system; The development language of the installation file of the application is a development language supported by both the first virtual machine and the second virtual machine, and the application can be installed on the first operating system and the second operating system.

10. An application installation device, characterized in that: Applied to an electronic device, the electronic device can run a second operating system and a first operating system, the second operating system can run a second virtual machine, and the first operating system can run a first virtual machine, the device includes: an installation file acquisition module, used to acquire, through the first operating system, an installation file of an application to be installed; wherein the development language of the installation file of the application is a development language supported by both the first virtual machine and the second virtual machine; An application installation module is used to install the application on the first operating system and the second operating system.

11. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the computer program is executed by the processor, the processor is caused to execute the steps of the method for installing the application program according to any one of claims 1 to 8.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for installing the application program according to any one of claims 1 to 8 are implemented.