WO2022179338A1 - 应用程序的安装方法和装置、电子设备、可读存储介质 - Google Patents

应用程序的安装方法和装置、电子设备、可读存储介质 Download PDF

Info

Publication number
WO2022179338A1
WO2022179338A1 PCT/CN2022/072434 CN2022072434W WO2022179338A1 WO 2022179338 A1 WO2022179338 A1 WO 2022179338A1 CN 2022072434 W CN2022072434 W CN 2022072434W WO 2022179338 A1 WO2022179338 A1 WO 2022179338A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
operating system
installation
installation file
virtual machine
Prior art date
Application number
PCT/CN2022/072434
Other languages
English (en)
French (fr)
Inventor
曹庆峰
林春德
马海龙
曹智强
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2022179338A1 publication Critical patent/WO2022179338A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances

Definitions

  • the present application relates to the field of computer technology, and in particular, to a method and apparatus for installing an application program, an electronic device, and a readable storage medium.
  • a dual system includes a main system and a secondary system, and the software architecture and source language used by the applications on the primary system are more advanced than those on the secondary system. Therefore, the cost of installing applications on dual systems is higher.
  • the embodiments of the present application provide an application installation method and device, an electronic device, and a readable storage medium, which can reduce the cost of installing application programs on dual systems.
  • a method for installing an application program, which is applied to an electronic device the electronic device can run a first operating system and a second operating system, a first virtual machine can run on the first operating system, and a second operating system can run on the second operating system.
  • a second virtual machine can be run, and the method includes:
  • 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;
  • the application is installed on the first operating system and the second operating system.
  • An application program installed on an electronic device wherein the electronic device can run a first operating system and a second operating system; a first virtual machine can run on the first operating system, and a first virtual machine can run on the second operating system.
  • the development language of the installation file of the application program is a development language supported by both the first virtual machine and the second virtual machine, and the first operating system and the second operating system can be installed on the application.
  • a first virtual machine can be run on the device, and the device includes:
  • an installation file obtaining module configured to obtain 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 the first virtual machine and the second virtual machine All supported development languages;
  • An application installation module configured to install the application on the first operating system and the second operating system.
  • An electronic device includes 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 operations of the above-mentioned application program installation method.
  • a computer-readable storage medium having stored thereon a computer program that, when executed by a processor, implements the operations of the above-described application program installation method.
  • FIG 1 is an application environment diagram of an application installation method in one embodiment
  • FIG. 3 is a flowchart of a method for installing an application program on the first operating system and the second operating system in FIG. 2;
  • FIG. 4 is a schematic diagram of a distributed architecture of an application installation method based on dual virtual machines in one embodiment
  • FIG. 5 is a flowchart of a method for installing a second installation file in a second operating system in one embodiment
  • FIG. 6 is a flowchart of a method for installing an application in another embodiment
  • FIG. 7 is a flowchart of a method for installing an application in a specific embodiment
  • Fig. 8 is a structural block diagram of an application installation device in one embodiment
  • Fig. 9 is the structural block diagram of the application program installation module in Fig. 8.
  • FIG. 10 is a schematic diagram of the internal structure of an electronic device in one embodiment.
  • FIG. 1 is an application scenario diagram of an application installation method in one embodiment.
  • the application environment includes an electronic device 120 and a server 140 , and the electronic device 120 and the server 140 are connected through a network.
  • the first operating system and the second operating system can run on the electronic device, the first virtual machine can run on the first operating system, and the second virtual machine can 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 this application; and installs the application on the first operating system and 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.
  • the electronic device may be any terminal device such as a mobile phone, a tablet computer, a PDA (Personal Digital Assistant, personal digital assistant), a wearable device, and a smart home device, which is not limited in this application.
  • electronic equipment equipped with dual systems generally includes a main system and a sub system, and the software architecture and source language used by the application programs on the main system are more efficient than those on the sub system.
  • advanced the application program on the main system is developed using JAVA voice, and the application program on the secondary system is developed using the lower-level C voice, of course, this application does not limit this. Therefore, for the same application program, it is necessary to use different source languages and software architectures for development, so that the two different versions of the application program developed respectively can be installed and run on the main system and the auxiliary system.
  • two applications of the same version are developed and installed based on the installation files of the application. Obviously, the development and installation costs of the application are too high.
  • the present application proposes a method for installing an application program.
  • the installation file of the application under the system is installed.
  • the first operating system and the second operating system can run on the electronic device, the first virtual machine can run on the first operating system, and the second virtual machine can run on the second operating system.
  • the first virtual machine and the second virtual machine both support the same development language, so the same development language can be used to develop the installation file of the application, so that the installation file of the application can be installed in two under the operating system.
  • the development and installation costs of the application are reduced.
  • FIG. 2 is a flowchart of an application installation method in one embodiment.
  • the application installation method in this embodiment is described by taking the electronic device 120 in FIG. 1 as an example for description.
  • the electronic device can run the first operating system and the second operating system, and the first operating system can run on the first operating system.
  • the second virtual machine can run on the second operating system.
  • the first virtual machine does not need to be run on the first operating system, nor does the second virtual machine need to run on the second operating system.
  • the application program is run on the first operating system, the first virtual machine needs to be run on the first operating system; similarly, when the application program is run on the second operating system, the first virtual machine needs to be run on the second operating system.
  • 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
  • the software on the CPU is often written in high-level architectures and languages, such as JAVA language.
  • the second operating system is a sub-system, such as an RTOS system
  • the RTOS system generally runs on the coprocessor MCU of the wearable device, and the software on the MCU is usually written in C language. In this way, because the RTOS system and the Andriod system are written in different languages, it is impossible to achieve joint compilation and deployment, and it is impossible to achieve a distributed architecture.
  • the DVM (Dalvik Virtual Machine) virtual machine is run in the first operating system (such as the Andriod system), and the lightweight JVM virtual machine (Java Virtual Machine, Java virtual machine) is run on the second operating system (such as the RTOS system).
  • the first virtual machine and the second virtual machine can run the same type of application program, wherein the same type of application program may be an application program developed based on the JAVA source language. That is, through the first virtual machine and the second virtual machine, an application program in the same development language (eg, JAVA) can be installed and run on both the first operating system and the second operating system.
  • the same development language is used to jointly compile and deploy the applications in the first operating system and the second operating system, which improves the efficiency of compilation and deployment.
  • the JVM is a fictional computer, which 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 realizing this feature. If a general high-level language is to run on different platforms, at least it needs to be compiled into different object 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 the information related to the specific platform, so that the Java language compiler only needs to generate the object code (bytecode) running on the Java virtual machine, and it can run on various platforms without modification. .
  • the Java virtual machine executes the bytecode, it interprets the bytecode into machine instructions for execution on a specific platform. This is why Java is able to "compile once, run anywhere”.
  • All Java programs in the Android system run on the DVM.
  • Each program on the Android system has its own thread, and the DVM only executes the Dalvik executable file of .dex.
  • Each Android application corresponds to an independent DVM instance at the bottom and executes under its interpretation.
  • an application installation method is provided, including operations 220 to 240 . in,
  • an installation file of the application to be installed is obtained through the first operating system; wherein, the development language of the application installation file is a development language supported by both the first virtual machine and the second virtual machine.
  • the first operating system and the second operating system can run on the electronic device, and the first virtual machine can run on the first operating system, but the virtual machine does not run on the second operating system.
  • the first operating system has a first virtual machine, a higher-level software architecture and source language can be supported by means of the first virtual machine.
  • the second operating system does not have a virtual machine, it cannot support higher-level software architectures and source languages.
  • the second virtual machine is installed and run on the second operating system of the electronic device.
  • the first virtual machine and the second virtual machine both support the same development language. Therefore, the installation file of the application program can be developed by using the same development language, so that the installation file of the application program can be installed in two operating systems at the same time.
  • the electronic device When the application is installed on the electronic device, the electronic device is currently running under the first operating system, and the installation file of the application to be installed is obtained from the 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.
  • the application is installed on the first operating system and the second operating system.
  • the application 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 program can be parsed to obtain two parts of the installation file, one of which can be installed under the first operating system, and the other part of the installation file can be installed under the second operating system.
  • the part of the installation files installed under the first operating system can support part of the functions of the application program under the first operating system.
  • the part of the installation files installed under the second operating system can support part of the functions of the application program under 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
  • the first virtual machine can run on the first operating system
  • the second operating system can run the first virtual machine.
  • the second virtual machine is run so that applications can be installed on the first operating system and the second operating system. Therefore, the same application program is jointly compiled and deployed on the two operating systems, the distributed architecture of the same application program under the two operating systems is realized, and the cost of installing the application program on the dual systems is reduced.
  • operation 240 installing the application program on the first operating system and the second operating system, includes:
  • the installation file of the application is parsed 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.
  • 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, an installation file of a complete application program that can be installed in the dual systems is analyzed to obtain a first installation file and a second installation file.
  • the first installation file may be installed under the first operating system
  • the second installation file may be installed under the second operating system.
  • 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 a first installation file (main APK installation package) and a second installation file (mini-APK installation package).
  • the first operating system is the main system
  • the second operating system is the auxiliary system
  • the functions realized by installing the first installation file under the first operating system are generally better than those realized by installing the second installation file under the second operating system.
  • the function is more complex.
  • the data volume of the first installation file is larger than the data volume of the second installation file.
  • the functions of the application may only be provided by the first installation file installed under the first operating system. If the electronic device runs under the second operating system, the functions of the application may only be provided by the second installation file installed under the second operating system.
  • the second installation file is sent to the second operating system, so as to install the second installation file in the memory space corresponding to the second operating system.
  • the first installation file is installed in the memory space corresponding to the first operating system.
  • the electronic device parses the installation file of the application, and after obtaining the first installation file and the second installation file, the second installation file needs to be sent to the second operating system, so as to correspond to the second operating system. Install the second installation file in the memory space. Then, the first installation file is installed in the memory space corresponding to the first operating system.
  • the electronic device sends the second installation file (mini-APK installation package) to the second operating system under the first operating system, so as to install the mini-APK installation package in the memory space corresponding to the second operating system.
  • the first installation file main APK installation package
  • the installation files of the application programs developed by using the same development language are directly parsed to obtain the first installation file and the second installation file. Then, the first installation file and the second installation file are respectively installed under two different operating systems.
  • the installation file of the application By parsing the installation file of the application into two parts, the effect of installing the application under two different operating systems is realized. It is no longer necessary to develop two different versions of application programs using different source languages and software architectures for dual systems; secondly, it is also not necessary to install applications based on installation files of different systems. Thus, the development and installation costs of the application are reduced.
  • 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:
  • 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.
  • FIG. 4 it is a schematic diagram of a distributed architecture of an application installation method based on dual virtual machines in one embodiment.
  • the AP Application Processor, application processor
  • the AP can run a first operating system, such as an Android system.
  • MCU Microcontroller Unit, Micro Control Unit
  • a second operating system such as an RTOS system, can run.
  • An 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 DVM can communicate with the DVM through the service Service in the first operating system, and the DVM can communicate with the underlying dual-core communication module (Dual-core communication) through JNI (Java Native Interface).
  • the dual-core communication module is written based on C language.
  • the service in the second operating system can communicate with the embedded JVM (Embeded JVM) through the virtual dual-core communication module (Virtual Dual-core Communication), and the embedded JVM can communicate with the underlying dual-core communication module (Dual-core JVM) through JNI communication) to communicate.
  • 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 the dual-system communication can be realized through the dual-system communication interface 460 .
  • the dual-system communication interface 460 may be an SPI interface (Serial Peripheral Interface, serial peripheral interface), which, of course, is not limited in this application.
  • 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.
  • 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.
  • 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. Install the second installation file in the memory space corresponding to the second operating system. Then, the second installation file can be run on the Embeded JVM. Therefore, it is realized that the installation files based on the same application are parsed and then installed respectively under two different operating systems.
  • installing the second installation file in the memory space corresponding to the second operating system includes:
  • operation 510 verify the second installation file, and obtain a verification result; wherein, the second installation file includes a second resource file and a second code file; if the verification is passed, proceed to operation 530; if the verification fails, proceed to operation 590, End the installation process.
  • 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 a plurality of directories or files. If the second installation file is an installation package written based on JAVA, the multiple directories or files obtained through decompression include the second resource file, the second code file and other files.
  • the second resource file includes an assert file, a lib library file, a res file, a resources.arsc file, etc., and these files may be referred to as sub-resource files.
  • the second code file includes the classes.dex file. The specific directories or files are shown in Table 1-1 below:
  • the file verification result in META-INF can be used to verify the correctness, integrity and legality of the files in the installation package. To ensure the security of the installation process and prevent users from installing applications that have been infected by viruses or maliciously tampered with. 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. If the verification fails, the installation process ends.
  • 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 file includes an assert file, a lib library file, a res file, a resources.arsc file, etc.
  • these files may be called sub-resource files. Therefore, 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 for storing sub-resource files.
  • the second code file is parsed to obtain bytecodes that can be run in the second virtual machine, and the bytecodes are imported into the second code area.
  • the second code file includes the classes.dex file.
  • the classes.dex file is the JAVA bytecode file generated after compiling the JAVA source code. Therefore, the second code file is parsed to obtain bytecodes that can be run in the second virtual machine, and the bytecodes are imported into the second code area.
  • the second code area here is also a storage space divided by the second operating system, and is specially used to store bytecodes that can be run in the second virtual machine by parsing the second code file.
  • the sub-resource file of the second resource area is loaded 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.
  • 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.
  • the security of the installation process is first ensured by verification, and the user is prevented from installing the application program that has been infected by a virus or maliciously tampered with.
  • parsing and loading are performed to install the second installation file in the memory space corresponding to the second operating system.
  • the application program eg, JAVA application program
  • the same development language is used to jointly compile and deploy the applications in the first operating system and the second operating system, which improves the efficiency of compilation and deployment.
  • 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.
  • the folder starting with anim in the sub-resource file usually stores the animation effect file of the application.
  • Folders starting with color usually store various color values of the application, that is, color files.
  • Folders starting with drawable usually store the image materials of the application, and the image materials include pictures or graphic materials.
  • Folders starting with layout usually store the interface layout files of the application.
  • the sub-resource file may also include other files, which are not limited in this application.
  • the sub-resource file includes at least one of an image material of an application, an interface layout file, an animation effect file, and a color file.
  • the second installation file is installed in the memory space corresponding to the second operating system by parsing and loading the sub-resource file.
  • the second installation file can be quickly and efficiently installed in the second operating system.
  • installing the first installation file in the memory space corresponding to the first operating system includes:
  • 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;
  • 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 sub-resource file of the first resource area is loaded through the bytecode of the first code area, so as to install the first installation file in the memory space corresponding to the first operating system.
  • 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 a plurality of directories or files. If the first installation file is an installation package written based on JAVA, the multiple directories or files obtained through decompression include the first resource file, the first code file and other files.
  • the first resource file includes an assert file, a lib library file, a res file, a resources.arsc file, and the like, and these files may be referred to as sub-resource files.
  • the first code file includes the classes.dex file. The specific directory or file is shown in Table 1-1 above, which is not repeated in this embodiment of the present application.
  • the file verification result in META-INF can be used to verify the correctness, integrity and legality of the files in the installation package. To ensure the security of the installation process and prevent users from installing applications that have been infected by viruses or maliciously tampered with. 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. If the verification fails, the installation process ends.
  • the first resource file includes an assert file, a lib library file, a res file, a resources.arsc file, etc.
  • these files may be called sub-resource files. Therefore, 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 for storing sub-resource files.
  • the first code file includes the classes.dex file.
  • the classes.dex file is the JAVA bytecode file generated after compiling the JAVA source code. Therefore, the first code file is parsed to obtain bytecodes that can be run in the first virtual machine, and the bytecodes are imported into the first code area.
  • the first code area here is also a storage space divided by the first operating system, and is specially used to store bytecodes that can be run in the first virtual machine obtained by parsing the first code file.
  • 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 application installation process.
  • the security of the installation process is first ensured by verification, and the user is prevented from installing the application program that has been infected by a virus or maliciously tampered with.
  • parsing and loading are performed to install the first installation file in the memory space corresponding to the first operating system.
  • the application program eg JAVA application program
  • the same development language is used to jointly compile and deploy the applications in the second operating system and the first operating system, which improves the efficiency of compilation and deployment.
  • the power consumption when running the first operating system on the electronic device is greater than the power consumption when running the second operating system on the electronic device.
  • the dual systems on the electronic device include a first operating system and a second operating system.
  • 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.
  • the second operating system is a secondary system, such as an RTOS system
  • the RTOS system generally runs on the coprocessor MCU of the wearable device.
  • the functions realized under the first operating system are generally more complex than those realized under the second operating system, so the power consumption when running the first operating system on the electronic device is greater than that when running the second operating system on the electronic device. power consumption when.
  • 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
  • the second installation file runs on the JVM virtual machine.
  • the first operating system and the second operating system can run on the electronic device, the first virtual machine can run on the first operating system, and the second virtual machine can run on the second operating system. If 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. If 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. Therefore, co-compiling and deploying the same application program on the two operating systems is realized through virtual machines under different operating systems, and the cost of installing the application program on the dual systems is reduced.
  • a method for installing an application further comprising:
  • Operation 620 using the same development language to write the first installation file and the second installation file;
  • Operation 640 compiling and packaging the first installation file and the second installation file into an installation file of the application
  • Operation 660 obtaining the installation file of the application to be installed through the first operating system
  • the application is installed on the first operating system and the second operating system.
  • the first operating system and the second operating system can run on the electronic device, the first virtual machine can run on the first operating system, and the second virtual machine can run on the second operating system.
  • the first virtual machine and the second virtual machine both support development languages, 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.
  • 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.
  • the same development language is not limited.
  • it can also be java, c, c++, C#, pascal, python, lisp, prolog, FoxPro, VC, easy language, Chinese version Other source languages such as the C language learning language.
  • the installation file of the application program to be installed can be obtained through the first operating system, and the application program can be installed on the first operating system and the second operating system.
  • the development and installation costs of the application are reduced.
  • a method for installing an application program is provided, which is applied to an electronic device, and the electronic device can run a first operating system (Andriod system) and a second operating system (RTOS system) , a first virtual machine (DVM) can run on the first operating system, and a second virtual machine (JVM) can run on the second operating system, and the method includes:
  • the first installation file and the second installation file are written in the same development language;
  • the development language is a source language supported by both the first virtual machine and the second virtual machine;
  • Operation 704 compiling and packaging the first installation file and the second installation file into an installation file of the application
  • Operation 706 obtaining the installation file of the application to be installed through the first operating system
  • Operation 708 parsing the installation file of the application to obtain a first installation file and a second installation file, where the data volume of the first installation file is greater than the data volume of the second installation file;
  • Operation 710 sending the second installation file from the first operating system to the second operating system through the dual-system communication interface
  • Operation 712 receiving the second installation file through the second operating system, and verifying the second installation file to obtain a verification result; wherein the second installation file includes the second resource file and the second code file; if the verification is passed, enter Operation 714; if the verification fails, go to operation 722 to end the installation process.
  • Operation 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;
  • Operation 716 parsing the second code file to obtain bytecodes that can be run in the second virtual machine, and importing the bytecodes into the second code area;
  • the sub-resource file of the second resource area is loaded 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 first installation file is installed in the memory space corresponding to the first operating system by using the same method as that used for installing the second installation file in 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
  • the first virtual machine can run on the first operating system
  • the second operating system can run the first virtual machine.
  • the second virtual machine is run so that applications can be installed on the first operating system and the second operating system. Therefore, the same application program is jointly compiled and deployed on the two operating systems, the distributed architecture of the same application program under the two operating systems is realized, and the cost of installing the application program on the dual systems is reduced.
  • an application program 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 run on the first operating system, and a first virtual machine can run on the second operating system.
  • two virtual machines two virtual machines;
  • the development language of the installation file of the application program is a development language supported by both the first virtual machine and the second virtual machine, and the application program can be installed on the first operating system and the second operating system.
  • the application program is the same type of application program that the first virtual machine and the second virtual machine can run, wherein the same type of application program may be an application program developed based on a development language.
  • the installation file of the application program can be parsed to obtain the first installation file and the second installation file.
  • the electronic device sends the second installation file from the first operating system to the second operating system, so as to install the second installation file in the memory space corresponding to the second operating system, and install the first installation file in the memory space corresponding to the first operating system installation file.
  • an application installation apparatus 800 is provided, which is applied to an electronic device.
  • the electronic device can run a second operating system and a first operating system, and the second operating system can run
  • the second virtual machine which can run the first virtual machine on the first operating system, includes:
  • the installation file obtaining module 820 is configured to obtain 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;
  • the application program installation module 840 is used for installing the application program on the first operating system and the second operating system.
  • the application installation module 840 includes:
  • an installation file parsing unit 842 configured to parse the installation file of the application to obtain a first installation file and a second installation file, where the data volume of the first installation file is greater than the data volume of the second installation file;
  • the second installation file installation unit 844 is configured to send the second installation file to the second operating system, so as to install the second installation file in the memory space corresponding to the second operating system;
  • the first installation file installation unit 846 is configured to install the first installation file in the memory space corresponding to the first operating system.
  • the second installation file installation unit is further configured 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.
  • the second installation file installation unit is further configured 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 bytecodes that can run in the second virtual machine, and the word The section code is imported into the second code area; the sub-resource file of the second resource area is loaded 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.
  • 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.
  • the first installation file installation unit is further configured 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 , then 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 bytecodes that can run in the first virtual machine, and the word The section code is imported into the first code area; the sub-resource file of the first resource area is loaded through the bytecode of the first code area, so as to install the first installation file in the memory space corresponding to the first operating system.
  • the power consumption when running the first operating system on the electronic device is greater than the power consumption when running the second operating system on the electronic device.
  • the first operating system is an Android system
  • the second operating system is an RTOS system.
  • 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
  • the second installation file runs on the JVM virtual machine.
  • an application installation apparatus 800 is provided, further comprising:
  • an installation file writing module used for writing the first installation file and the second installation file in the same development language
  • the compiling and packaging module is used for compiling and packaging the first installation file and the second installation file into installation files of the application.
  • each module in the above-mentioned application installation device is only used for illustration. In other embodiments, the application installation device can be divided into different modules as required, so as to complete all or part of the above application installation device Function.
  • Each module in the above-mentioned application installation device may be implemented in whole or in part by software, hardware, and combinations thereof.
  • the above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
  • an electronic device including a memory and a processor, a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes an application program provided by the above embodiments operation of the installation method.
  • FIG. 10 is a schematic diagram of the internal structure of an electronic device in one embodiment.
  • the electronic device includes a processor and a memory connected by 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 non-volatile storage media and internal memory.
  • the nonvolatile storage medium stores an operating system and a computer program.
  • the computer program can be executed by the processor to implement an application installation method provided by the above embodiments.
  • Internal memory provides a cached execution environment for operating system computer programs in non-volatile storage media.
  • the electronic device may be any terminal device such as a mobile phone, a tablet computer, a PDA (Personal Digital Assistant, personal digital assistant), a POS (Point of Sales, a sales terminal), a vehicle-mounted computer, a wearable device, and the like.
  • a terminal device such as a mobile phone, a tablet computer, a PDA (Personal Digital Assistant, personal digital assistant), a POS (Point of Sales, a sales terminal), a vehicle-mounted computer, a wearable device, and the like.
  • each module in the apparatus for installing an application program provided in the embodiments of the present application may be in the form of a computer program.
  • the computer program can run on or on an electronic device.
  • the program modules constituted by the computer program can be stored on the electronic device or on the memory of the electronic device.
  • Embodiments of the present application also provide a computer-readable storage medium.
  • One or more non-volatile computer-readable storage media containing computer-executable instructions, if executed by one or more processors, cause the processors to perform the operations of the application installation method.
  • Nonvolatile 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 acts as external cache memory.
  • 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).
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDR SDRAM double data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM synchronous Link (Synchlink) DRAM
  • SLDRAM synchronous Link (Synchlink) DRAM
  • Memory Bus Radbus
  • RDRAM Direct RAM
  • DRAM Direct Memory Bus Dynamic RAM
  • RDRAM Memory Bus Dynamic RAM

Abstract

本申请涉及一种应用程序的安装方法和装置、电子设备、计算机可读存储介质,应用于电子设备,电子设备上可运行第一操作系统及第二操作系统,第一操作系统上可运行第一虚拟机,第二操作系统上可运行第二虚拟机。该方法包括:通过第一操作系统获取待安装的应用程序的安装文件,在第一操作系统和第二操作系统上安装应用程序。因为应用程序的安装文件的开发语言为第一虚拟机与第二虚拟机均支持的开发语言,且第一操作系统上可运行第一虚拟机,第二操作系统上可运行第二虚拟机,所以就可以在第一操作系统和第二操作系统上安装应用程序。

Description

应用程序的安装方法和装置、电子设备、可读存储介质
本申请要求于2021年02月24日提交中国专利局,申请号为202110205563.4,发明名称为“应用程序的安装方法和装置、电子设备、可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机技术领域,特别是涉及一种应用程序的安装方法和装置、电子设备、可读存储介质。
背景技术
随着电子设备的功能越来越强大,搭载单一操作系统有时候不能满足人们对电子设备的功能的需求,因此,一些电子设备开始搭载双系统以使用户获得更好的使用体验。
一般情况下,双系统包括一个主系统和一个副系统,且主系统上的应用程序相较于副系统上的应用程序所采用的软件架构和源语言更加高级。所以,在双系统上安装应用程序的成本较高。
发明内容
本申请实施例提供了一种应用程序的安装方法和装置、电子设备、可读存储介质,可以降低在双系统上安装应用程序的成本。
一种应用程序的安装方法,应用于电子设备,所述电子设备可运行第一操作系统及第二操作系统,所述第一操作系统上可运行第一虚拟机,所述第二操作系统上可运行第二虚拟机,所述方法包括:
通过所述第一操作系统获取待安装的应用程序的安装文件;其中,所述应用程序的安装文件的开发语言为所述第一虚拟机与所述第二虚拟机均支持的开发语言;
在所述第一操作系统和所述第二操作系统上安装所述应用程序。
一种应用程序,安装于电子设备,所述电子设备可运行第一操作系统及第二操作系统;所述第一操作系统上可运行第一虚拟机,所述第二操作系统上可运行第二虚拟机;
所述应用程序的安装文件的开发语言为所述第一虚拟机与所述第二虚拟机均支持的开发语言,且可在所述第一操作系统和所述第二操作系统上安装所述应用程序。
一种应用程序的安装装置,应用于电子设备,所述电子设备上可运行第二操作系统及第一操作系统,所述第二操作系统上可运行第二虚拟机,所述第一操作系统上可运行第一虚拟机,所述装置包括:
安装文件获取模块,用于通过所述第一操作系统获取待安装的应用程序的安装文件;其中,所述应用程序的安装文件的开发语言为所述第一虚拟机与所述第二虚拟机均支持的开发语言;
应用程序安装模块,用于在所述第一操作系统和所述第二操作系统上安装所述应用程序。
一种电子设备,包括存储器及处理器,所述存储器中储存有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器执行如上所述的应用程序的安装方法的操作。
一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时 实现如上所述的应用程序的安装方法的操作。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为一个实施例中应用程序的安装方法的应用环境图;
图2为一个实施例中应用程序的安装方法的流程图;
图3为图2中在第一操作系统和第二操作系统上安装应用程序方法的流程图;
图4为一个实施例中基于双虚拟机的应用程序的安装方法的分布式架构示意图;
图5为一个实施例中在第二操作系统中安装第二安装文件方法的流程图;
图6为另一个实施例中应用程序的安装方法的流程图;
图7为一个具体的实施例中应用程序的安装方法的流程图;
图8为一个实施例中应用程序的安装装置的结构框图;
图9为图8中应用程序安装模块的结构框图;
图10为一个实施例中电子设备的内部结构示意图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
图1为一个实施例中应用程序的安装方法的应用场景图。如图1所示,该应用环境包括电子设备120及服务器140,电子设备120与服务器140之间通过网络连接。电子设备上可运行第一操作系统及第二操作系统,且第一操作系统上可运行第一虚拟机,第二操作系统上可运行第二虚拟机。电子设备120通过本申请中的应用程序的安装方法,通过第一操作系统获取待安装的应用程序的安装文件;在第一操作系统和第二操作系统上安装应用程序。其中,应用程序的安装文件的开发语言为第一虚拟机与第二虚拟机均支持的开发语言。这里,电子设备可以是手机、平板电脑、PDA(Personal Digital Assistant,个人数字助理)、穿戴式设备、智能家居设备等任意终端设备,本申请对此不做限定。
传统方法中,搭载双系统的电子设备,一般这里的双系统包括一个主系统和一个副系统,且主系统上的应用程序相较于副系统上的应用程序所采用的软件架构和源语言更加高级。例如,主系统上的应用程序采用JAVA语音进行开发,而副系统上的应用程序采用更底层的C语音进行开发,当然,本申请并不对此进行限定。所以针对同一个应用程序,就需要分别采用不同的源语言和软件架构进行开发,以便所分别开发的两个不同版本的应用程序可以安装并运行在主系统和副系统上。针对同一个应用程序,均开发出两个同版本的应用程序,再分别基于应用程序的安装文件进行安装,显然,应用程序的开发及安装成本太大。
因此,本申请提出了一种应用程序的安装方法,首先,不再需要针对双系统分别采用不同的源语言和软件架构进行开发出两个不同版本的应用程序;其次,也不需要分别基于不同系统下的应用程序的安装文件进行安装。具体的,在电子设备上可运行第一操作系统及第二操作系统,且第一操作系统上可运行第一虚拟机,第二操作系统上可运行第二虚拟机。其中,第一虚拟机与第二虚拟机均支持同一种开发语言,所以,就可以采用该同一种开发语言开发出该应用程序的安装文件,使得该应用程序的安装文件可以同时安装在两个操作系统下。从而,降低了应用程序的开发及安装成本。
图2为一个实施例中应用程序的安装方法的流程图。本实施例中的应用程序的安装方法,以运行于图1中的电子设备120上为例进行描述,电子设备上可运行第一操作系统及第二操作系统,且第一操作系统上可运行第一虚拟机,第二操作系统上可运行第二虚拟机。在应用程序安装阶段,第一操作系统上不需要运行第一虚拟机,第二操作系统上也不需要运行第二虚拟机。在第一操作系统上运行应用程序时,才需要在第一操作系统上运行第一虚拟机;同理,在第二操作系统上运行应用程序时,才需要在第二操作系统上运行第一虚拟机,以创建应用程序的运行环境。
具体的,若第一操作系统为主系统,例如Andriod系统,Andriod系统一般运行在可穿戴设备的主处理器CPU上,而CPU上的软体往往会使用高级架构和语言进行编写,例如JAVA语言。若第二操作系统为副系统,例如RTOS系统,RTOS系统一般运行在可穿戴设备的协处理器MCU上,而MCU上的软体往往采用C语言进行编写。如此,因为RTOS系统与Andriod系统分别采用不同的语言进行编写,所以无法实现共同编译部署,也无法实现分布式架构。
因此,在第一操作系统(例如Andriod系统)中运行DVM(Dalvik Virtual Machine)虚拟机,而在第二操作系统(例如RTOS系统)上运行轻量级JVM虚拟机(JavaVirtualMachine,Java虚拟机)。且第一虚拟机和第二虚拟机能够运行同类应用程序,其中,同类应用程序可以是基于JAVA源语言所开发的应用程序。即通过第一虚拟机和第二虚拟机,实现了在第一操作系统和第二操作系统上均可安装并运行同一种开发语言的(例如JAVA)应用程序。进而,实现了在第一操作系统和第二操作系统中对应用程序采用同一种开发语言进行共同编译部署,提高了编译部署的效率。
其中,JVM是一种虚构出来的计算机,通过在实际的计算机上仿真模拟各种计算机功能来实现的。Java语言的一个非常重要的特点就是与平台的无关性,而使用Java虚拟机是实现这一特点的关键。一般的高级语言如果要在不同的平台上运行,至少需要编译成不同的目标代码。而引入Java虚拟机后,Java语言在不同平台上运行时不需要重新编译。Java语言使用Java虚拟机屏蔽了与具体平台相关的信息,使得Java语言编译程序只需生成在Java虚拟机上运行的目标代码(字节码),就可以在多种平台上不加修改地运行。Java虚拟机在执行字节码时,把字节码解释成具体平台上的机器指令执行。这就是Java能够“一次编译,到处运行”的原因。
Android系统中的所有Java程序都是运行在DVM上的。Android系统上的每个程序都有自己的线程,DVM只执行.dex的Dalvik executable文件。每个Android应用在底层都对应有一个独立的DVM实例并在其解释下执行。
如图2所示,提供了一种应用程序的安装方法,包括操作220至操作240。其中,
操作220,通过第一操作系统获取待安装的应用程序的安装文件;其中,应用程序的安装文件的开发语言为第一虚拟机与第二虚拟机均支持的开发语言。
传统方法中,电子设备上可运行第一操作系统及第二操作系统,且第一操作系统上可运行第一虚拟机,而第二操作系统中并未运行虚拟机。其中,第一操作系统中因为具有第一虚拟机,所以可以借助于第一虚拟机支持更高级的软件架构和源语言。而第二操作系统因为不具有虚拟机,所以无法支持更高级的软件架构和源语言。
因此,在电子设备的第二操作系统上安装并运行第二虚拟机。其中,第一虚拟机与第二虚拟机均支持同一种开发语言。所以,就可以采用同一种开发语言开发出该应用程序的安装文件,使得该应用程序的安装文件可以同时安装在两个操作系统下。
在电子设备上对应用程序进行安装时,电子设备当前运行在第一操作系统下,通过第一操作系统从服务器获取待安装的应用程序的安装文件。具体的,可以是电子设备从服务器上下载待安装的应用程序的安装文件。其中,应用程序的安装文件即为应用程序的安装包。
操作240,在第一操作系统和第二操作系统上安装应用程序。
在电子设备从服务器上下载了待安装的应用程序的安装文件之后,就可以在第一操作系统和第二操作系统上安装应用程序。具体的,可以是对应用程序的安装文件进行解析,得到两部分安装文件,其中一部分安装文件可以安装在第一操作系统下,另一部分安装文件可以安装在第二操作系统下。
且若电子设备运行在第一操作系统下,安装在第一操作系统下的这部分安装文件,可以在第一操作系统下支撑该应用程序的部分功能。相应地,若电子设备运行在第二操作系统下,安装在第二操作系统下的这部分安装文件,可以在第二操作系统下支撑该应用程序的部分功能。
本申请实施例中,因为应用程序的安装文件的开发语言为第一虚拟机与第二虚拟机均支持的开发语言,且第一操作系统上可运行第一虚拟机,第二操作系统上可运行第二虚拟机,所以就可以在第一操作系统和第二操作系统上安装应用程序。从而,实现了对同一应用程序在两个操作系统上进行共同编译部署,实现同一应用程序在两个操作系统下的分布式架构,降低了在双系统上安装应用程序的成本。
在一个实施例中,如图3所示,操作240,在第一操作系统和第二操作系统上安装应用程序,包括:
操作242,对应用程序的安装文件进行解析,得到第一安装文件及第二安装文件,第一安装文件的数据量大于第二安装文件的数据量。
电子设备当前运行在第一操作系统下,通过第一操作系统从服务器获取待安装的应用程序的安装文件。并在第一操作系统下,针对可安装在双系统中的完整的一个应用程序的安装文件进行解析,得到第一安装文件及第二安装文件。其中,第一安装文件可安装在第一操作系统下,第二安装文件可安装在第二操作系统下。这里,对应用程序的安装文件进行解析,可以理解为对应用程序的安装文件进行解压。即对一个应用程序的安装文件(APK安装包)进行解压,得到第一安装文件(主APK安装包)及第二安装文件(mini-APK安装包)。
且第一操作系统为主系统,第二操作系统为副系统,所以在第一操作系统下安装第一安装文件所实现的功能一般是比在第二操作系统下安装第二安装文件所实现的功能更加复杂。为了实现更复杂的功能,相应地,第一安装文件的数据量大于第二安装文件的数据量。另外,若电子设备运行在第一操作系统下,可以仅由安装于第一操作系统下的第一安装文件提供该应用程序的功能。若电子设备运行在第二操作系统下,可以仅由安装于第二操作系统下的第二安装文件提供该应用程序的功能。
操作244,将第二安装文件发送至第二操作系统,以在第二操作系统对应的内存空间中安装第二安装文件。
操作246,在第一操作系统对应的内存空间中安装第一安装文件。
电子设备在第一操作系统下,对应用程序的安装文件进行解析,得到第一安装文件及第二安装文件之后,需要将第二安装文件发送至第二操作系统,以在第二操作系统对应的内存空间中安装第二安装文件。然后,在第一操作系统对应的内存空间中安装第一安装文件。
具体的,电子设备在第一操作系统下,将第二安装文件(mini-APK安装包)发送至第二操作系统,以在第二操作系统对应的内存空间中安装该mini-APK安装包。然后,在第一操作系统对应的内存空间中安装第一安装文件(主APK安装包)。
本申请实施例中,将采用同一种开发语言所开发出的应用程序的安装文件,直接进行解析得到第一安装文件及第二安装文件。然后,分别将第一安装文件及第二安装文件安装在两个不同的操作系统下。通过将应用程序的安装文件解析为两部分的方式,实现了分别在两个不同的操作系统下安装该应用程序的效果。不再需要针对双系统分别采用不同的源 语言和软件架构进行开发出两个不同版本的应用程序;其次,也不需要分别基于不同系统下的应用程序的安装文件进行安装。从而,降低了应用程序的开发及安装成本。
在一个实施例中,将第二安装文件发送至第二操作系统,以在第二操作系统对应的内存空间中安装第二安装文件,包括:
将第二安装文件通过双系统通信接口从第一操作系统发送至第二操作系统;
通过第二操作系统接收第二安装文件,并在第二操作系统对应的内存空间中安装第二安装文件。
如图4所示,为一个实施例中基于双虚拟机的应用程序安装方法的分布式架构示意图。其中,AP(Application Processor,应用处理器)420,其上可运行第一操作系统,例如Android系统。MCU(Microcontroller Unit,微控制单元)440,其上可运行第二操作系统,例如RTOS系统。
在第一操作系统上将一个应用程序的安装文件(APK安装包)进行解析,得到第一安装文件(主APK安装包)及第二安装文件(mini-APK安装包)。可以通过第一操作系统中的服务Service与DVM进行通信,DVM可以通过JNI(Java Native Interface,Java本地接口)与底层的双核通信模块(Dual-core communication)进行通信。其中,双核通信模块基于C语言进行编写。相应地,第二操作系统中的服务Service可以通过虚拟双核通信模块(Virtual Dual-core Communication)与嵌入式JVM(Embeded JVM)进行通信,Embeded JVM可以通过JNI与底层的双核通信模块(Dual-core communication)进行通信。第二操作系统上的双核通信模块与第一操作系统上的双核通信模块之间配置了双系统通信接口460,通过该双系统通信接口460就可以实现双系统的通信。其中,双系统通信接口460可以是SPI接口(Serial Peripheral Interface,串行外设接口),当然,本申请对此不做限定。
其中,第二操作系统上的Virtual Dual-core Communication与第一操作系统上的Virtual Dual-core Communication之间具有的虚拟接口(Virtual API),但实际上通过虚拟接口(Virtual API)是无法直接通信的,必须通过底层的双核通信接口(API,Application Programming Interface)进行中转,具体的理由在此不再赘述。
从而,电子设备当前运行第一操作系统,则在第一操作系统下可以将第二安装文件通过双系统通信接口API从第一操作系统发送至第二操作系统。并在第二操作系统接收第二安装文件,并在第二操作系统对应的内存空间中安装第二安装文件。
本申请实施例中,基于上述分布式架构,就可以控制第一操作系统自上而下将第二安装文件通过双系统通信接口发送至第二操作系统。在第二操作系统对应的内存空间中安装第二安装文件。然后,在Embeded JVM就可以运行该第二安装文件。从而,实现了基于同一个应用程序的安装文件进行解析后,并在两个不同的操作系统下分别进行安装。
在一个实施例中,如图5所示,在第二操作系统对应的内存空间中安装第二安装文件,包括:
操作510,对第二安装文件进行校验,得到校验结果;其中,第二安装文件包括第二资源文件及第二代码文件;若验证通过,进入操作530;若验证失败,进入操作590,结束安装流程。
其中,第二安装文件为安装至第二操作系统下第二虚拟机中的安装文件。在第二操作系统接收了第二安装文件之后,首先,对第二安装文件通过解压缩工具进行解压,得到多个目录或文件。若第二安装文件为基于JAVA编写的安装包,则经过解压所得到的多个目录或文件包括第二资源文件及第二代码文件及其他文件。其中,第二资源文件包括assert文件、lib库文件、res文件、resources.arsc文件等,这些文件可以称之为子资源文件。第二代码文件包括classes.dex文件。具体的目录或文件如下表1-1所示:
表1-1
Figure PCTCN2022072434-appb-000001
Figure PCTCN2022072434-appb-000002
其中,可以采用META-INF里的文件校验结果,来核实安装包中文件的正确性、完整性以及合法性。来确保安装过程的安全性、避免用户安装到遭受过病毒感染或被恶意篡改的应用程序。若验证通过,则对第二资源文件进行解析得到至少一个子资源文件,将子资源文件存储在第二资源区。若验证失败,则结束安装流程。
操作530,若验证通过,则对第二资源文件进行解析得到至少一个子资源文件,将子资源文件存储在第二资源区。
因为第二资源文件包括assert文件、lib库文件、res文件、resources.arsc文件等,这些文件可以称之为子资源文件。所以若验证通过,则对第二资源文件进行解析得到至少一个子资源文件,并将子资源文件存储在第二资源区。这里的第二资源区是为第二操作系统所划分的存储空间,专门用于存放子资源文件。
操作550,对第二代码文件进行解析得到可在第二虚拟机中运行的字节码,将字节码导入第二代码区。
第二代码文件包括classes.dex文件。classes.dex文件是JAVA源码编译后生成的JAVA字节码文件。因此,对第二代码文件进行解析得到可在第二虚拟机中运行的字节码,将字节码导入第二代码区。这里的第二代码区也是为第二操作系统所划分的存储空间,专门用于存放对第二代码文件进行解析得到可在第二虚拟机中运行的字节码。
操作570,通过第二代码区的字节码对第二资源区的子资源文件进行加载,以在第二操作系统对应的内存空间中安装第二安装文件。
在应用程序的安装阶段,通过第二代码区的字节码对第二资源区的子资源文件进行加载,即通过第二代码区的字节码对第二资源区的子资源文件进行调用,以在第二操作系统对应的内存空间中安装第二安装文件。此处的加载,为应用程序安装过程中的预加载过程。
本申请实施例中,在应用程序的安装阶段,首先通过校验来确保安装过程的安全性、避免用户安装到遭受过病毒感染或被恶意篡改的应用程序。其次,再进行解析并进行加载,以在第二操作系统对应的内存空间中安装第二安装文件。从而,实现了在第二操作系统上安装与第一操作系统上采用开发语言开发的应用程序(例如JAVA应用程序)。进而,实现了在第一操作系统和第二操作系统中对应用程序采用同一种开发语言进行共同编译部署,提高了编译部署的效率。
在一个实施例中,子资源文件包括应用程序的图像素材、界面布局文件、动画效果文件、颜色文件中的至少一个。
其中,在子资源文件中以anim开头的文件夹,通常里面存放的是应用程序的动画效果文件。以color开头的文件夹,通常里面存放的是应用程序的各种颜色值即颜色文件。以drawable开头的文件夹,通常里面存放的是应用程序的图像素材,图像素材包括图片或图形素材。以layout开头的文件夹,通常里面存放的是应用程序的界面布局文件。当然,基于应用程序的不同,子资源文件中还可以包括其他文件,本申请对此不做限定。
本申请实施例中,子资源文件包括应用程序的图像素材、界面布局文件、动画效果文件、颜色文件中的至少一个。通过对子资源文件解析并进行加载,以在第二操作系统对应的内存空间中安装第二安装文件。从而,实现了在第二操作系统中快捷高效地安装第二安装文件。
在一个实施例中,在第一操作系统对应的内存空间中安装第一安装文件,包括:
对第一安装文件进行校验,得到校验结果;其中,第一安装文件包括第一资源文件及第一代码文件;
若验证通过,则对第一资源文件进行解析得到至少一个子资源文件,将子资源文件存储在第一资源区;
对第一代码文件进行解析得到可在第一虚拟机中运行的字节码,将字节码导入第一代码区;
通过第一代码区的字节码对第一资源区的子资源文件进行加载,以在第一操作系统对应的内存空间中安装第一安装文件。
其中,第一安装文件为安装至第一操作系统中的安装文件。在第一操作系统接收了第一安装文件之后,首先,对第一安装文件通过解压缩工具进行解压,得到多个目录或文件。若第一安装文件为基于JAVA编写的安装包,则经过解压所得到的多个目录或文件包括第一资源文件及第一代码文件及其他文件。其中,第一资源文件包括assert文件、lib库文件、res文件、resources.arsc文件等,这些文件可以称之为子资源文件。第一代码文件包括classes.dex文件。具体的目录或文件如上表1-1所示,在本申请实施例中不在赘述。
其中,可以采用META-INF里的文件校验结果,来核实安装包中文件的正确性、完整性以及合法性。来确保安装过程的安全性、避免用户安装到遭受过病毒感染或被恶意篡改的应用程序。若验证通过,则对第一资源文件进行解析得到至少一个子资源文件,将子资源文件存储在第一资源区。若验证失败,则结束安装流程。
因为第一资源文件包括assert文件、lib库文件、res文件、resources.arsc文件等,这些文件可以称之为子资源文件。所以若验证通过,则对第一资源文件进行解析得到至少一个子资源文件,并将子资源文件存储在第一资源区。这里的第一资源区是为第一操作系统所划分的存储空间,专门用于存放子资源文件。
第一代码文件包括classes.dex文件。classes.dex文件是JAVA源码编译后生成的JAVA字节码文件。因此,对第一代码文件进行解析得到可在第一虚拟机中运行的字节码,将字节码导入第一代码区。这里的第一代码区也是为第一操作系统所划分的存储空间,专门用于存放对第一代码文件进行解析得到可在第一虚拟机中运行的字节码。
在应用程序的安装阶段,通过第一代码区的字节码对第一资源区的子资源文件进行加载,即通过第一代码区的字节码对第一资源区的子资源文件进行调用,以在第一操作系统对应的内存空间中安装第一安装文件。此处的加载,为应用程序安装过程中的预加载过程。
本申请实施例中,在应用程序的安装阶段,首先通过校验来确保安装过程的安全性、避免用户安装到遭受过病毒感染或被恶意篡改的应用程序。其次,再进行解析并进行加载,以在第一操作系统对应的内存空间中安装第一安装文件。从而,实现了在第一操作系统上安装与第二操作系统上采用同一种开发语言开发的应用程序(例如JAVA应用程序)。进 而,实现了在第二操作系统和第一操作系统中对应用程序采用同一种开发语言进行共同编译部署,提高了编译部署的效率。
在一个实施例中,电子设备上运行第一操作系统时的功耗大于在电子设备上运行第二操作系统时的功耗。
本申请实施例中,电子设备上的双系统包括第一操作系统及第二操作系统。若第一操作系统为主系统,例如Andriod系统,Andriod系统一般运行在可穿戴设备的主处理器CPU上。若第二操作系统为副系统,例如RTOS系统,RTOS系统一般运行在可穿戴设备的协处理器MCU上。且在第一操作系统下所实现的功能一般是比在第二操作系统下所实现的功能更加复杂,所以电子设备上运行第一操作系统时的功耗大于在电子设备上运行第二操作系统时的功耗。
在一个实施例中,第一虚拟机为DVM虚拟机,第二虚拟机为JVM虚拟机,且第一安装文件运行在DVM虚拟机上,第二安装文件运行在JVM虚拟机上。
本申请实施例中,电子设备上可运行第一操作系统及第二操作系统,且第一操作系统上可运行第一虚拟机,第二操作系统上可运行第二虚拟机。若在第一操作系统下安装第一安装文件,便是在第一操作系统对应的内存空间中安装并运行。若在第二操作系统下安装第二安装文件,便是在第二操作系统对应的内存空间中安装并运行。从而,通过不同操作系统下的虚拟机实现了对同一应用程序在两个操作系统上进行共同编译部署,降低了在双系统上安装应用程序的成本。
在一个实施例中,如图6所示,提供了一种应用程序的安装方法,还包括:
操作620,采用同一种开发语言编写第一安装文件及第二安装文件;
操作640,将第一安装文件及第二安装文件编译打包为应用程序的安装文件;
操作660,通过第一操作系统获取待安装的应用程序的安装文件;
操作680,在第一操作系统和第二操作系统上安装应用程序。
本申请实施例中,在电子设备上可运行第一操作系统及第二操作系统,且第一操作系统上可运行第一虚拟机,第二操作系统上可运行第二虚拟机。其中,第一虚拟机与第二虚拟机均支持开发语言,所以,就可以采用开发语言开发出该应用程序的安装文件,使得该应用程序的安装文件可以同时安装在两个操作系统下。
具体的,在应用程序的开发阶段,开发人员采用同一种开发语言编写第一安装文件及第二安装文件,并将第一安装文件及第二安装文件编译打包为应用程序的安装文件。这里,并不对该同一种开发语言编写进行限定,除了上述实施例中的JAVA语言,还可以是java、c、c++、C#、pascal、python、lisp、prolog、FoxPro、VC、易语言、中文版的C语言习语言等其他源语言。
然后,就可以通过第一操作系统获取待安装的应用程序的安装文件,在第一操作系统和第二操作系统上安装应用程序。从而,降低了应用程序的开发及安装成本。
在一个具体的实施例中,如图7所示,提供了一种应用程序的安装方法,应用于电子设备,电子设备可运行第一操作系统(Andriod系统)及第二操作系统(RTOS系统),第一操作系统上可运行第一虚拟机(DVM),第二操作系统上可运行第二虚拟机(JVM),该方法包括:
操作702,采用同一种开发语言编写第一安装文件及第二安装文件;该开发语言为第一虚拟机与第二虚拟机均支持的源语言;
操作704,将第一安装文件及第二安装文件编译打包为应用程序的安装文件;
操作706,通过第一操作系统获取待安装的应用程序的安装文件;
操作708,对应用程序的安装文件进行解析,得到第一安装文件及第二安装文件,第一安装文件的数据量大于第二安装文件的数据量;
操作710,将第二安装文件通过双系统通信接口从第一操作系统发送至第二操作系统;
操作712,通过第二操作系统接收第二安装文件,对第二安装文件进行校验,得到校验结果;其中,第二安装文件包括第二资源文件及第二代码文件;若验证通过,进入操作714;若验证失败,进入操作722,结束安装流程。
操作714,对第二资源文件进行解析得到至少一个子资源文件,将子资源文件存储在第二资源区;
操作716,对第二代码文件进行解析得到可在第二虚拟机中运行的字节码,将字节码导入第二代码区;
操作718,通过第二代码区的字节码对第二资源区的子资源文件进行加载,以在第二操作系统对应的内存空间中安装第二安装文件;
操作720,采用与在第二操作系统中安装第二安装文件相同的方法,在第一操作系统对应的内存空间中安装第一安装文件。
本申请实施例中,因为应用程序的安装文件的开发语言为第一虚拟机与第二虚拟机均支持的开发语言,且第一操作系统上可运行第一虚拟机,第二操作系统上可运行第二虚拟机,所以就可以在第一操作系统和第二操作系统上安装应用程序。从而,实现了对同一应用程序在两个操作系统上进行共同编译部署,实现同一应用程序在两个操作系统下的分布式架构,降低了在双系统上安装应用程序的成本。
在一个实施例中,一种应用程序,安装于电子设备,电子设备可运行第一操作系统及第二操作系统;第一操作系统上可运行第一虚拟机,第二操作系统上可运行第二虚拟机;
应用程序的安装文件的开发语言为第一虚拟机与第二虚拟机均支持的开发语言,且可在第一操作系统和第二操作系统上安装应用程序。
本申请实施例中,该应用程序为第一虚拟机和第二虚拟机能够运行的同类应用程序,其中,同类应用程序可以是基于开发语言所开发的应用程序。且该应用程序的安装文件可以解析,得到第一安装文件及第二安装文件。电子设备从第一操作系统将第二安装文件发送至第二操作系统,以在第二操作系统对应的内存空间中安装第二安装文件,并在第一操作系统对应的内存空间中安装第一安装文件。
因此,不再需要针对双系统分别采用不同的开发语言和软件架构进行开发出两个不同版本的应用程序;其次,也不需要分别基于不同系统下的应用程序的安装文件进行安装。从而,降低了应用程序的开发及安装成本。
在一个实施例中,如图8所示,提供了一种应用程序的安装装置800,应用于电子设备,电子设备上可运行第二操作系统及第一操作系统,第二操作系统上可运行第二虚拟机,第一操作系统上可运行第一虚拟机,装置包括:
安装文件获取模块820,用于通过第一操作系统获取待安装的应用程序的安装文件;其中,应用程序的安装文件的开发语言为第一虚拟机与第二虚拟机均支持的开发语言;
应用程序安装模块840,用于在第一操作系统和第二操作系统上安装应用程序。
在一个实施例中,如图9所示,应用程序安装模块840,包括:
安装文件解析单元842,用于对应用程序的安装文件进行解析,得到第一安装文件及第二安装文件,第一安装文件的数据量大于第二安装文件的数据量;
第二安装文件安装单元844,用于将第二安装文件发送至第二操作系统,以在第二操作系统对应的内存空间中安装第二安装文件;
第一安装文件安装单元846,用于在第一操作系统对应的内存空间中安装第一安装文件。
在一个实施例中,第二安装文件安装单元,还用于将第二安装文件通过双系统通信接口从第一操作系统发送至第二操作系统;通过第二操作系统接收第二安装文件,并在第二操作系统对应的内存空间中安装第二安装文件。
在一个实施例中,第二安装文件安装单元,还用于对第二安装文件进行校验,得到校 验结果;其中,第二安装文件包括第二资源文件及第二代码文件;若验证通过,则对第二资源文件进行解析得到至少一个子资源文件,将子资源文件存储在第二资源区;对第二代码文件进行解析得到可在第二虚拟机中运行的字节码,将字节码导入第二代码区;通过第二代码区的字节码对第二资源区的子资源文件进行加载,以在第二操作系统对应的内存空间中安装第二安装文件。
在一个实施例中,子资源文件包括应用程序的图像素材、界面布局文件、动画效果文件、颜色文件中的至少一个。
在一个实施例中,第一安装文件安装单元,还用于对第一安装文件进行校验,得到校验结果;其中,第一安装文件包括第一资源文件及第一代码文件;若验证通过,则对第一资源文件进行解析得到至少一个子资源文件,将子资源文件存储在第一资源区;对第一代码文件进行解析得到可在第一虚拟机中运行的字节码,将字节码导入第一代码区;通过第一代码区的字节码对第一资源区的子资源文件进行加载,以在第一操作系统对应的内存空间中安装第一安装文件。
在一个实施例中,电子设备上运行第一操作系统时的功耗大于在电子设备上运行第二操作系统时的功耗。
在一个实施例中,第一操作系统为安卓系统,第二操作系统为RTOS系统。
在一个实施例中,第一虚拟机为DVM虚拟机,第二虚拟机为JVM虚拟机,且第一安装文件运行在DVM虚拟机上,第二安装文件运行在JVM虚拟机上。
在一个实施例中,提供了一种应用程序的安装装置800,还包括:
安装文件编写模块,用于采用同一种开发语言编写第一安装文件及第二安装文件;
编译打包模块,用于将第一安装文件及第二安装文件编译打包为应用程序的安装文件。
应该理解的是,虽然上述图中的流程图中的各个操作按照箭头的指示依次显示,但是这些操作并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些操作的执行并没有严格的顺序限制,这些操作可以以其它的顺序执行。而且,上述图中的至少一部分操作可以包括多个子操作或者多个阶段,这些子操作或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子操作或者阶段的执行顺序也不必然是依次进行,而是可以与其它操作或者其它操作的子操作或者阶段的至少一部分轮流或者交替地执行。
上述应用程序的安装装置中各个模块的划分仅用于举例说明,在其他实施例中,可将应用程序的安装装置按照需要划分为不同的模块,以完成上述应用程序的安装装置的全部或部分功能。
关于应用程序的安装装置的具体限定可以参见上文中对于应用程序的安装方法的限定,在此不再赘述。上述应用程序的安装装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
在一个实施例中,还提供了一种电子设备,包括存储器及处理器,存储器中储存有计算机程序,计算机程序被处理器执行时,使得处理器执行以上各个实施例所提供的一种应用程序的安装方法的操作。
图10为一个实施例中电子设备的内部结构示意图。如图10所示,该电子设备包括通过系统总线连接的处理器和存储器。其中,该处理器用于提供计算和控制能力,支撑整个电子设备的运行。存储器可包括非易失性存储介质及内存储器。非易失性存储介质存储有操作系统和计算机程序。该计算机程序可被处理器所执行,以用于实现以上各个实施例所提供的一种应用程序的安装方法。内存储器为非易失性存储介质中的操作系统计算机程序提供高速缓存的运行环境。该电子设备可以是手机、平板电脑、PDA(Personal Digital  Assistant,个人数字助理)、POS(Point of Sales,销售终端)、车载电脑、穿戴式设备等任意终端设备。
本申请实施例中提供的应用程序的安装装置中的各个模块的实现可为计算机程序的形式。该计算机程序可在电子设备或电子设备上运行。该计算机程序构成的程序模块可存储在电子设备或电子设备的存储器上。该计算机程序被处理器执行时,实现本申请实施例中所描述方法的操作。
本申请实施例还提供了一种计算机可读存储介质。一个或多个包含计算机可执行指令的非易失性计算机可读存储介质,若计算机可执行指令被一个或多个处理器执行,使得处理器执行应用程序的安装方法的操作。
一种包含指令的计算机程序产品,若其在计算机上运行时,使得计算机执行应用程序的安装方法。
本申请实施例所使用的对存储器、存储、数据库或其它介质的任何引用可包括非易失性和/或易失性存储器。合适的非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM),它用作外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDR SDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)。
以上应用程序的安装实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。

Claims (20)

  1. 一种应用程序的安装方法,其特征在于,应用于电子设备,所述电子设备可运行第一操作系统及第二操作系统,所述第一操作系统上可运行第一虚拟机,所述第二操作系统上可运行第二虚拟机,所述方法包括:
    通过所述第一操作系统获取待安装的应用程序的安装文件;其中,所述应用程序的安装文件的开发语言为所述第一虚拟机与所述第二虚拟机均支持的开发语言;
    在所述第一操作系统和所述第二操作系统上安装所述应用程序。
  2. 根据权利要求1所述的方法,其特征在于,所述在所述第一操作系统和所述第二操作系统上安装所述应用程序,包括:
    对所述应用程序的安装文件进行解析,得到第一安装文件及第二安装文件,所述第一安装文件的数据量大于所述第二安装文件的数据量;
    将所述第二安装文件发送至所述第二操作系统,以在所述第二操作系统对应的内存空间中安装所述第二安装文件;
    在所述第一操作系统对应的内存空间中安装所述第一安装文件。
  3. 根据权利要求2所述的方法,其特征在于,所述将所述第二安装文件发送至所述第二操作系统,以在所述第二操作系统对应的内存空间中安装所述第二安装文件,包括:
    将所述第二安装文件通过双系统通信接口从所述第一操作系统发送至所述第二操作系统;
    通过所述第二操作系统接收所述第二安装文件,并在所述第二操作系统对应的内存空间中安装所述第二安装文件。
  4. 根据权利要求3所述的方法,其特征在于,所述在所述第二操作系统对应的内存空间中安装所述第二安装文件,包括:
    对所述第二安装文件进行校验,得到校验结果;其中,所述第二安装文件包括第二资源文件及第二代码文件;
    若验证通过,则对所述第二资源文件进行解析得到至少一个子资源文件,将所述子资源文件存储在第二资源区;
    对所述第二代码文件进行解析得到可在所述第二虚拟机中运行的字节码,将所述字节码导入第二代码区;
    通过所述第二代码区的字节码对所述第二资源区的所述子资源文件进行加载,以在所述第二操作系统对应的内存空间中安装所述第二安装文件。
  5. 根据权利要求4所述的方法,其特征在于,所述子资源文件包括所述应用程序的图像素材、界面布局文件、动画效果文件、颜色文件中的至少一个。
  6. 根据权利要求2所述的方法,其特征在于,所述在所述第一操作系统对应的内存空间中安装所述第一安装文件,包括:
    对所述第一安装文件进行校验,得到校验结果;其中,所述第一安装文件包括第一资源文件及第一代码文件;
    若验证通过,则对所述第一资源文件进行解析得到至少一个子资源文件,将所述子资源文件存储在第一资源区;
    对所述第一代码文件进行解析得到可在所述第一虚拟机中运行的字节码,将所述字节码导入第一代码区;
    通过所述第一代码区的字节码对所述第一资源区的所述子资源文件进行加载,以在所述第一操作系统对应的内存空间中安装所述第一安装文件。
  7. 根据权利要求1所述的方法,其特征在于,所述电子设备上运行第一操作系统时的功耗大于在所述电子设备上运行第二操作系统时的功耗。
  8. 根据权利要求1-7任一项所述的方法,其特征在于,所述第一操作系统为安卓系统,所述第二操作系统为RTOS系统。
  9. 根据权利要求1-7任一项所述的方法,其特征在于,所述第一虚拟机为DVM虚拟机,所述第二虚拟机为JVM虚拟机,且所述第一安装文件运行在所述DVM虚拟机上,所述第二安装文件运行在所述JVM虚拟机上。
  10. 根据权利要求1所述的方法,其特征在于,所述方法包括:
    采用同一种开发语言编写所述第一安装文件及所述第二安装文件;
    将所述第一安装文件及所述第二安装文件编译打包为所述应用程序的安装文件。
  11. 一种应用程序,其特征在于,安装于电子设备,所述电子设备可运行第一操作系统及第二操作系统;所述第一操作系统上可运行第一虚拟机,所述第二操作系统上可运行第二虚拟机;
    所述应用程序的安装文件的开发语言为所述第一虚拟机与所述第二虚拟机均支持的开发语言,且可在所述第一操作系统和所述第二操作系统上安装所述应用程序。
  12. 一种应用程序的安装装置,其特征在于,应用于电子设备,所述电子设备上可运行第二操作系统及第一操作系统,所述第二操作系统上可运行第二虚拟机,所述第一操作系统上可运行第一虚拟机,所述装置包括:
    安装文件获取模块,用于通过所述第一操作系统获取待安装的应用程序的安装文件;其中,所述应用程序的安装文件的开发语言为所述第一虚拟机与所述第二虚拟机均支持的开发语言;
    应用程序安装模块,用于在所述第一操作系统和所述第二操作系统上安装所述应用程序。
  13. 根据权利要求12所述的安装装置,其特征在于,安装文件解析单元,用于对所述应用程序的安装文件进行解析,得到第一安装文件及第二安装文件,所述第一安装文件的数据量大于所述第二安装文件的数据量;
    安装文件获取模块,包括第一安装文件安装单元及第二安装文件安装单元;所述第二安装文件安装单元,用于将所述第二安装文件发送至所述第二操作系统,以在所述第二操作系统对应的内存空间中安装所述第二安装文件;
    所述第一安装文件安装单元,用于在所述第一操作系统对应的内存空间中安装所述第一安装文件。
  14. 根据权利要求13所述的安装装置,其特征在于,所述第二安装文件安装单元,还用于将所述第二安装文件通过双系统通信接口从所述第一操作系统发送至所述第二操作系统;通过所述第二操作系统接收所述第二安装文件,并在所述第二操作系统对应的内存空间中安装所述第二安装文件。
  15. 根据权利要求14所述的安装装置,其特征在于,所述第二安装文件安装单元,还用于对所述第二安装文件进行校验,得到校验结果;其中,所述第二安装文件包括第二资源文件及第二代码文件;
    若验证通过,则对所述第二资源文件进行解析得到至少一个子资源文件,将所述子资源文件存储在第二资源区;
    对所述第二代码文件进行解析得到可在所述第二虚拟机中运行的字节码,将所述字节码导入第二代码区;
    通过所述第二代码区的字节码对所述第二资源区的所述子资源文件进行加载,以在所述第二操作系统对应的内存空间中安装所述第二安装文件。
  16. 根据权利要求15所述的安装装置,其特征在于,子资源文件包括应用程序的图像素材、界面布局文件、动画效果文件、颜色文件中的至少一个。
  17. 根据权利要求13所述的安装装置,其特征在于,所述第一安装文件安装单元, 还用于对所述第一安装文件进行校验,得到校验结果;其中,所述第一安装文件包括第一资源文件及第一代码文件;
    若验证通过,则对所述第一资源文件进行解析得到至少一个子资源文件,将所述子资源文件存储在第一资源区;
    对所述第一代码文件进行解析得到可在所述第一虚拟机中运行的字节码,将所述字节码导入第一代码区;
    通过所述第一代码区的字节码对所述第一资源区的所述子资源文件进行加载,以在所述第一操作系统对应的内存空间中安装所述第一安装文件。
  18. 根据权利要求12所述的安装装置,其特征在于,所述电子设备上运行第一操作系统时的功耗大于在所述电子设备上运行第二操作系统时的功耗。
  19. 一种电子设备,包括存储器及处理器,所述存储器中储存有计算机程序,其特征在于,所述计算机程序被所述处理器执行时,使得所述处理器执行如权利要求1至10中任一项所述的应用程序的安装方法的操作。
  20. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至10中任一项所述的应用程序的安装方法的操作。
PCT/CN2022/072434 2021-02-24 2022-01-18 应用程序的安装方法和装置、电子设备、可读存储介质 WO2022179338A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110205563.4A CN114968278A (zh) 2021-02-24 2021-02-24 应用程序的安装方法和装置、电子设备、可读存储介质
CN202110205563.4 2021-02-24

Publications (1)

Publication Number Publication Date
WO2022179338A1 true WO2022179338A1 (zh) 2022-09-01

Family

ID=82973160

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/072434 WO2022179338A1 (zh) 2021-02-24 2022-01-18 应用程序的安装方法和装置、电子设备、可读存储介质

Country Status (2)

Country Link
CN (1) CN114968278A (zh)
WO (1) WO2022179338A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070169024A1 (en) * 2005-11-30 2007-07-19 Ulrich Drepper Purpose domain for in-kernel virtual machine for low overhead startup and low resource usage
CN101655798A (zh) * 2008-08-18 2010-02-24 联想(北京)有限公司 一种计算机和虚拟机环境中应用程序部署和运行的方法
WO2012015083A1 (ko) * 2010-07-29 2012-02-02 주식회사 앵글스톤테크놀러지 Rtos 기반의 안드로이드 어플리케이션 실행 장치
US20140143763A1 (en) * 2012-10-29 2014-05-22 Harsh Bhargava Method and System to develop operating system agnostic software applications for mobile devices using a virtual machine
CN105159732A (zh) * 2015-10-13 2015-12-16 北京奇虎科技有限公司 在移动终端安装或更新应用程序的方法和移动终端

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070169024A1 (en) * 2005-11-30 2007-07-19 Ulrich Drepper Purpose domain for in-kernel virtual machine for low overhead startup and low resource usage
CN101655798A (zh) * 2008-08-18 2010-02-24 联想(北京)有限公司 一种计算机和虚拟机环境中应用程序部署和运行的方法
WO2012015083A1 (ko) * 2010-07-29 2012-02-02 주식회사 앵글스톤테크놀러지 Rtos 기반의 안드로이드 어플리케이션 실행 장치
US20140143763A1 (en) * 2012-10-29 2014-05-22 Harsh Bhargava Method and System to develop operating system agnostic software applications for mobile devices using a virtual machine
CN105159732A (zh) * 2015-10-13 2015-12-16 北京奇虎科技有限公司 在移动终端安装或更新应用程序的方法和移动终端

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
QING, SIHAN: "Research Status and Outlook of Android Security", TELECOMMUNICATIONS SCIENCE, 20 October 2016 (2016-10-20), XP055962541, [retrieved on 20220919], DOI: 10.11959/j.issn.1000-0801.2016256 *

Also Published As

Publication number Publication date
CN114968278A (zh) 2022-08-30

Similar Documents

Publication Publication Date Title
US11354144B2 (en) Java native interface and windows universal app hooking
CN107041158B (zh) 用于模块化反射的限制性访问控制
CN107291480B (zh) 一种函数调用方法及装置
US7506175B2 (en) File language verification
CN108139921B (zh) 仿真器的性能优化方法及系统
US20200065124A1 (en) Shortening just-in-time code warm up time of docker containers
CN107924326B (zh) 对经更新的类型的迁移方法进行覆盖
RU2632163C2 (ru) Общая распаковка приложений для обнаружения вредоносных программ
US8365157B2 (en) System and method for early platform dependency preparation of intermediate code representation during bytecode compilation
US20180239621A1 (en) Method and device of operating functional module cross platforms
JP2008516323A (ja) プラットホーム独立の動的リンキング
Batyuk et al. Developing and benchmarking native linux applications on android
CN114816417B (zh) 一种交叉编译方法、装置、计算设备及存储介质
US7313789B1 (en) Methods and systems for reducing a program size
Oh et al. Snapshot-based loading-time acceleration for web applications
CN109598107A (zh) 一种基于应用安装包文件的代码转换方法及装置
CN112882694A (zh) 一种程序编译方法、装置、电子设备及可读存储介质
CN112612502A (zh) 补丁生成方法、装置、设备及存储介质
US20170090885A1 (en) Automatic determination of compiler configuration
US10552135B1 (en) Reducing a size of an application package
WO2022179338A1 (zh) 应用程序的安装方法和装置、电子设备、可读存储介质
CN114546581A (zh) 一种无服务容器启动方法及相关设备
US20220308991A1 (en) Test processing method and information processing apparatus
CN115629795A (zh) 一种可执行文件的配置方法、装置及电子设备
US9612808B1 (en) Memory use for string object creation

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22758704

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22758704

Country of ref document: EP

Kind code of ref document: A1