Application program running method and device, computer equipment and storage medium
By generating an installation package containing installation files and environment files, and directly simulate an adaptive environment to run the application on the terminal, it solves the complex operation problems in the existing technology, improves the distribution and operation efficiency of the application, and expands the scope of application.
Patent Information
- Application Number
- CN202510480186.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-16
- Publication Date
- 2025-08-01
AI Technical Summary
In the prior art, mobile applications need to install a simulator with a mobile operating system running on a computer, which is complex in operation and affects efficiency.
By generating an installation package that supports the application in the adaptive running environment, including the installation files and environment files, we can directly simulate the adaptive environment and install and run the application on the terminal without installing an emulator.
It simplifies the operation process of applications on different terminals, improves distribution efficiency and operation efficiency, lowers the threshold for use, and expands the scope of application application.
Smart Images

Figure CN120406967A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and particularly to a method and apparatus for running an application program, a computer device, and a storage medium. Background Art
[0002] With the development of computer technology, application programs on mobile phones are becoming increasingly rich. However, with the continuous enhancement of mobile phone functions, users hope to be able to run the application programs on mobile phones on devices with larger screens to obtain a better visual experience and more convenient operation. How to run the application programs on mobile phones on devices with larger screens is the focus of research in this field.
[0003] Currently, the commonly adopted method is to transfer the application programs on mobile phones to a computer so that the application programs on mobile phones can be run on the computer with a larger screen. Among them, usually, an emulator of the operating system on the mobile phone is first downloaded and installed on the computer, and the emulator is used to simulate the running environment of the mobile phone; then, the application programs on the mobile phone are downloaded based on the emulator, and finally, the application programs are run through the computer.
[0004] However, in the above technical solution, the prerequisite for running the application programs on mobile phones on a computer is to install an emulator of the operating system on the mobile phone, and the installation and running of the emulator require certain technical knowledge, and the operation process is complex, which affects the running efficiency of the application programs. Summary of the Invention
[0005] Embodiments of this application provide a method and apparatus for running an application program, a computer device, and a storage medium, which simplify the process of running an application program that was originally not supported on a first terminal, and are conducive to improving the distribution efficiency and running efficiency of the application program. The technical solution is as follows:
[0006] On the one hand, a method for running an application program is provided, and the method includes:
[0007] In response to a running instruction of the first terminal for the application program, obtain the installation file of the application program. The running environment of the first terminal is different from the running environment adapted to the application program, and the installation file supports the application program to run in the adapted running environment;
[0008] Based on the installation file and the environment file of the application program, generate an installation package of the application program. The environment file is used to simulate the running environment adapted to the application program, and the installation package is used to run the application program on the first terminal;
[0009] Return the installation package to the first terminal.
[0010] On the other hand, a method for running an application program is provided, and the method includes:
[0011] In response to an operation of running an application, send a running instruction for the application to a server, where the running instruction is used to instruct the server to generate an installation package capable of running the application on a first terminal, and the running environment of the first terminal is different from the running environment adapted to the application;
[0012] Download the installation package of the application returned by the server, and install the application based on the installation package, where the installation package is used to run the application on the first terminal;
[0013] In response to an operation of starting the application, display the interface of the application.
[0014] On the other hand, a running device for an application is provided, and the device includes:
[0015] An acquisition module, configured to acquire an installation file of the application in response to a running instruction of the application by a first terminal, where the running environment of the first terminal is different from the running environment adapted to the application, and the installation file supports the application to run in the adapted running environment;
[0016] A generation module, configured to generate an installation package of the application based on the installation file and an environment file of the application, where the environment file is used to simulate the running environment adapted to the application, and the installation package is used to run the application on the first terminal;
[0017] A sending module, configured to return the installation package to the first terminal.
[0018] In some embodiments, the device further includes:
[0019] A determination module, configured to determine a virtual machine, a system image manager, and a view manager of the application based on the running environment of the first terminal and the running environment adapted to the application, where the virtual machine is used to simulate the running environment adapted to the application, the system image manager is used to manage the running of the application in the running environment simulated by the virtual machine, and the view manager is used to manage the display of the application on the first terminal; and determine the environment file of the application based on the virtual machine, the system image manager, and the view manager of the application.
[0020] In some embodiments, the determination module is configured to determine the version of the software development kit corresponding to the application based on the installation file; and determine the system image manager based on the version of the software development kit corresponding to the application, where the system image manager matches the version of the software development kit.
[0021] In some embodiments, the generating module includes:
[0022] A parsing unit configured to parse the installation file to obtain resource information, metadata, and dependency information of the application program, where the resource information is used to represent resources used when the application program runs, and the dependency information is used to represent a database on which the application program runs depends;
[0023] A conversion unit configured to perform format conversion on the resource information, metadata, and dependency information of the application program based on the running environment of the first terminal to obtain configuration information, where the resource information, metadata, and dependency information in the configuration information conform to the running environment of the first terminal;
[0024] A generating unit configured to generate the installation package based on the installation file, the environment file, and the configuration information.
[0025] In some embodiments, the generating unit is configured to add call paths of the installation file, the environment file, and the configuration information to an application execution template to obtain a startup script of the application program, where the application execution template is used to indicate a loading order among the installation file, the environment file, and the configuration information when the application program runs on the first terminal; package the installation file, the environment file, and the configuration information to obtain a resource package of the application program; and package the startup script and the resource package to obtain the installation package.
[0026] In some embodiments, the device further includes:
[0027] A storage module configured to store the installation package in an installation package database, where the installation package database is used to store installation packages of application programs that can run across running environments.
[0028] In some embodiments, the obtaining module is configured to query the installation package database in response to a running instruction of the first terminal for the application program, where the installation package database is used to store installation packages of application programs that can run across running environments; and obtain the installation file when the installation package of the application program does not exist in the installation package database.
[0029] In some embodiments, the sending module is further configured to return the installation package to the first terminal when the installation package of the application program exists in the installation package database.
[0030] In some embodiments, the sending module is further configured to, in response to a sending instruction of the installation package from the first terminal, send the installation package to a second terminal indicated by the sending instruction, where the operating environments of the first terminal and the second terminal are the same, and the installation package is used to run the application program on the second terminal.
[0031] On the other hand, a device for running an application program is provided, and the device includes:
[0032] A sending module, configured to, in response to an operation of running an application program, send a running instruction for the application program to a server, where the running instruction is used to instruct the server to generate an installation package capable of running the application program on a first terminal, and the operating environment of the first terminal is different from the operating environment adapted to the application program;
[0033] A processing module, configured to download the installation package of the application program returned by the server and install the application program based on the installation package, where the installation package is used to run the application program on the first terminal;
[0034] A running module, configured to, in response to a start operation of the application program, display an interface of the application program.
[0035] In some embodiments, the device further includes:
[0036] A first display module, configured to display an instruction input control, where the instruction input control is used to obtain a running instruction of an object for the application program;
[0037] The sending module is configured to, in response to an input operation on the instruction input control, obtain the information already input in the instruction input control; when the information in the instruction input control is used to indicate running the application program, generate the running instruction and send the running instruction to the server.
[0038] In some embodiments, the device further includes:
[0039] A second display module, configured to display a running control of the application program, where the running control is used to control running the application program;
[0040] The sending module is configured to, in response to a triggering operation on the running control, generate a running instruction for the application program and send the running instruction to the server.
[0041] In some embodiments, the installation package includes the installation file of the application, the environment file, and the configuration information. The installation file supports the application to run in the adapted operating environment. The environment file is used to simulate the application in the adapted operating environment. The format of the configuration information conforms to the operating environment of the first terminal.
[0042] The processing module is configured to configure the call paths of the installation file of the application, the call path of the environment file, and the call path of the configuration information; based on the call path of the environment file, call the environment file to create a virtualized operating environment for the application; based on the call paths of the installation file and the configuration information, call the installation file and the configuration information respectively, and install the application in the virtualized operating environment.
[0043] In some embodiments, the processing module is configured to create a virtual machine, a system image manager, and a view manager based on the environment file. The virtual machine is used to simulate the operating environment adapted to the application. The system image manager is used to manage the operation of the application in the operating environment simulated by the virtual machine. The view manager is used to manage the display of the application on the first terminal.
[0044] In some embodiments, the device further includes:
[0045] A third display module is configured to hide the display window of the virtual machine and display the window of the application based on the view manager.
[0046] On the other hand, a computer device is provided. The computer device includes a processor and a memory. The memory is used to store at least one segment of computer program. The at least one segment of computer program is loaded and executed by the processor to implement the running method of the application in the embodiments of the present application.
[0047] On the other hand, a computer-readable storage medium is provided. At least one segment of computer program is stored in the computer-readable storage medium. The at least one segment of computer program is loaded and executed by a processor to implement the running method of the application as in the embodiments of the present application.
[0048] On the other hand, a computer program product is provided, including a computer program. The computer program is stored in a computer-readable storage medium. The processor of the computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the running method of the application provided in the above various aspects or various optional implementation manners of the various aspects.
[0049] In the solution provided by the embodiments of the present application, since the operating environment of the first terminal is different from the operating environment of the application program, it indicates that the first terminal itself does not support the operation of the application program. When an application program that was originally not supported needs to be run on the first terminal, an installation package of the application program is automatically generated through an installation file that supports the application program to run in an adapted operating environment and an environment file for simulating the adapted operating environment of the application program, and the installation package is returned to the first terminal, facilitating the first terminal to directly simulate the adapted environment of the application program through the installation package and install and run the application program, without the need for the first terminal to install an emulator and then install the application program, simplifying the process of running an application program that was originally not supported on the first terminal and being conducive to improving the distribution efficiency and operation efficiency of the application program. Brief Description of the Drawings
[0050] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0051] Figure 1 is a schematic diagram of the implementation environment of a method for running an application program provided by an embodiment of the present application;
[0052] Figure 2 is a flowchart of a method for running an application program provided by an embodiment of the present application;
[0053] Figure 3 is a flowchart of another method for running an application program provided by an embodiment of the present application;
[0054] Figure 4 is a schematic diagram of the generation of an installation package provided by an embodiment of the present application;
[0055] Figure 5 is a flowchart of still another method for running an application program provided by an embodiment of the present application;
[0056] Figure 6 is a framework diagram of running an application program provided by an embodiment of the present application;
[0057] Figure 7 is a block diagram of a device for running an application program provided by an embodiment of the present application;
[0058] Figure 8 is a block diagram of another device for running an application program provided by an embodiment of the present application;
[0059] Figure 9It is a block diagram of a terminal according to an embodiment of the present application;
[0060] Figure 10 It is a schematic structural diagram of a server according to an embodiment of the present application. Detailed implementation manners
[0061] To make the objectives, technical solutions, and advantages of the present application clearer, the following will further describe the embodiments of the present application in detail with reference to the accompanying drawings.
[0062] In the present application, terms such as "first" and "second" are used to distinguish identical or similar items with basically the same functions. It should be understood that there is no logical or temporal dependence between "first", "second", and "nth", nor are the quantity and execution order limited.
[0063] In the present application, the term "at least one" means one or more, and the meaning of "a plurality" means two or more.
[0064] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data for analysis, stored data, displayed data, etc.), and signals involved in the present application are all authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant laws, regulations, and standards of relevant countries and regions. For example, the installation files and environment files involved in the present application are obtained under full authorization.
[0065] The method for running an application program provided by an embodiment of the present application can be executed by a computer device. In some embodiments, the computer device is a terminal or a server. First, taking the computer device as a server as an example, the implementation environment of the method for running an application program provided by an embodiment of the present application will be introduced. Figure 1 It is a schematic diagram of the implementation environment of a method for running an application program according to an embodiment of the present application. Refer to Figure 1 , the implementation environment includes a terminal 101 and a server 102. The terminal 101 and the server 102 can be directly or indirectly connected through wired or wireless communication methods, and the present application does not limit this.
[0066] In some embodiments, the terminal 101 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a smart voice interaction device, a smart home appliance, a vehicle-mounted terminal, etc., but is not limited thereto. An application program may be installed and run on the terminal 101, and the type or function of the application program is not limited in the embodiments of the present application. The operating environment of the terminal 101 may be the same as the operating environment adapted to the application program, or the operating environment of the terminal 101 may also be different from the operating environment adapted to the application program, which is not limited in the embodiments of the present application. That is to say, an application program adapted to its own operating environment may be installed and run on the terminal 101, or an application program not adapted to its own operating environment may also be installed and run. During the process of running any application program on the terminal 101, if the application program has been installed on the terminal 101, the terminal 101 may directly start and run the application program; if the application program has not been installed on the terminal 101, the terminal 101 may request the installation package of the application program from the server 102, so as to install the application program based on the installation package and then start and run the application program.
[0067] Those skilled in the art can know that the number of the above terminals may be more or less. For example, the above terminal may be only one, or the above terminals may be dozens or hundreds, or even more. The embodiments of the present application do not limit the number and device type of the terminals.
[0068] In some embodiments, the server 102 is an independent physical server, and can also be a server cluster or a distributed system composed of multiple physical servers, and can also be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), big data, and artificial intelligence platforms. The server 102 is used to provide the installation package of the application program. In some embodiments, the server 102 undertakes the main computing work, and the terminal 101 undertakes the secondary computing work; or, the server 102 undertakes the secondary computing work, and the terminal 101 undertakes the main computing work; or, the server 102 and the terminal 101 adopt a distributed computing architecture for collaborative computing.
[0069] Figure 2 is a flowchart of a method for running an application program provided by an embodiment of the present application. Refer to Figure 2 In the embodiments of the present application, it is described by taking the execution by the server as an example. The method for running the application program includes the following steps:
[0070] 201. In response to a running instruction of an application from a first terminal, the server obtains the installation file of the application. The running environment of the first terminal is different from the running environment adapted to the application, and the installation file supports the application to run in the adapted running environment.
[0071] In the embodiment of the present application, the first terminal is Figure 1 the terminal 101 shown. The application can be a multimedia application, an office application, a game application, a teaching application, etc. The embodiment of the present application does not limit the category and function of the application.
[0072] The running environment can include a hardware environment and a software environment. The hardware environment can include a processor, a memory, a storage device (such as a hard disk), and a graphics card, etc., and the embodiment of the present application does not limit this. The software environment includes an operating system, system software and libraries, middleware, etc., and the embodiment of the present application does not limit this. The operating system is the basic platform for the application to run and can be a Windows operating system, an Android operating system, a macOS operating system, or a Linux operating system, etc., and the embodiment of the present application does not limit this. System software and libraries refer to various software libraries and tools provided by the operating system that the application may call during operation. For example, some applications will call the standard library of the C language to complete basic input and output operations; some graphics applications will rely on graphics libraries such as OpenGL or DirectX to implement graphics rendering functions. Middleware is used to connect two independent applications or systems, enabling them to exchange information with each other even if they have different interfaces. Through middleware, the application can run in a multi-platform or operating system environment, realizing cross-platform data exchange and function sharing.
[0073] The running environment of the first terminal is the above-mentioned configured hardware environment and software environment on the first terminal. The running environment adapted to the application refers to the above-mentioned hardware environment and software environment on which the application depends for normal operation. If the running environment of the first terminal is different from the running environment adapted to the application, it means that the first terminal itself does not support the running of the application. In this case, when receiving the running instruction of the application from the first terminal, the server obtains the installation file of the application. The installation file refers to the file used to install the application and supports the application to run in the adapted running environment. After that, the server can generate an installation file that supports the application to run on the first terminal based on this installation file. For details, please refer to the following steps.
[0074] 202. The server generates an installation package of the application based on the installation file and the environment file of the application. The environment file is used to simulate the running environment adapted to the application, and the installation package is used to run the application on the first terminal.
[0075] In an embodiment of the present application, the server obtains the environment file of the application. The environment file can simulate an adapted running environment for the application, and the specific content in the environment file is not limited in the embodiment of the present application. Then, the server generates an installation package for the application based on the installation file and the environment file of the application. The installation package refers to the installation file that supports the application to run on the first terminal. That is, the installation package includes the installation file that supports the application to run in the adapted running environment and the environment file for simulating the adapted running environment.
[0076] 203. The server returns the installation package to the first terminal.
[0077] In an embodiment of the present application, the server sends the generated installation package to the first terminal, so that the first terminal can simulate the adapted running environment of the application based on the environment file in the installation package, and install the application in the simulated running environment based on the installation file in the installation package.
[0078] For example, the first terminal is a computer, and the running environment of the first terminal is the Windows operating system. The running environment adapted for the application is the Android operating system. When the first terminal triggers a running instruction for the application, the server obtains the APK (Android application package) file of the application, generates an installation package for the application based on the APK file and the environment file of the application, and returns the installation package to the first terminal, so that the first terminal can run the application based on the installation package. Among them, the APK file is the installation package of the application adapted to the Android operating system, and contains all components required to run the application, including the compiled code file (.dex file), resource files (such as pictures, audio), and configuration files (such as AndroidManifest.xml), etc.
[0079] The embodiment of the present application provides a method for running an application program. Since the running environment of the first terminal is different from the running environment of the application program, it indicates that the first terminal itself does not support the running of the application program. When running an application program that was originally not supported on the first terminal, an installation package of the application program is automatically generated through an installation file that supports the application program to run in an adapted running environment and an environment file for simulating the adapted running environment of the application program, and the installation package is returned to the first terminal, so that the first terminal can directly simulate the adapted environment of the application program through the installation package and install and run the application program, without the need for the first terminal to install simulator software and then install the application program, which simplifies the process of running an application program that was originally not supported on the first terminal, is conducive to improving the distribution efficiency and running efficiency of the application program, and thus is conducive to improving the conversion rate of the application program. Moreover, the above method can realize the installation and use of the application program across running environments or platforms, greatly expanding the applicable scope of the application program.
[0080] Figure 3 is a flowchart of another method for running an application program provided according to the embodiment of the present application. Refer to Figure 3 , and in the embodiment of the present application, it is described by taking the execution by the server as an example. The method for running the application program includes the following steps:
[0081] 301. In response to a running instruction of the application program from the first terminal, the server obtains the installation file and the environment file of the application program. The running environment of the first terminal is different from the running environment adapted to the application program. The installation file supports the application program to run in the adapted running environment, and the environment file is used to simulate the adapted running environment of the application program.
[0082] In the embodiment of the present application, when receiving the running instruction of the application program from the first terminal, the server obtains the installation file that supports the application program to run in the adapted running environment and the environment file for simulating the adapted running environment of the application program, so as to subsequently generate an installation package that supports the application program to run on the first terminal based on the installation file and the environment file.
[0083] The embodiments of the present application do not limit the acquisition method of the installation file. The installation file can be provided by the first terminal. Correspondingly, the installation file can be sent to the server by the first terminal together with the running instruction. The installation file is temporarily stored in the OSS (Object Storage Service) cloud storage and waits for subsequent processing. Alternatively, the installation file can be provided by the third terminal. The running environment of the third terminal is the same as the running environment adapted to the application. The application is installed on the third terminal. Correspondingly, the running instruction can include the identifier of the application and the identifier of the third terminal, so that the server can request the installation file of the application from the third terminal. Among them, the currently logged-in objects of the third terminal and the first terminal can be the same object, that is, the object wants to use the application on another device on one of its own devices. Alternatively, the installation file can also be provided by the provider of the application. Correspondingly, the running instruction can include the identifier of the application, so that the server can request the installation file of the application from the background server of the application.
[0084] Among them, the installation file can include the code file, resource file, and configuration file of the application. The code file contains the logic and function implementation of the application and is the core part of the application. The resource file contains all the static content used in the application, such as pictures, audio, videos, etc. The configuration file contains the metadata and setting information of the application and is used to guide the installation and running process. The formats of the various files in the installation file conform to the running environment adapted to the application.
[0085] The embodiments of the present application do not limit the acquisition method of the environment file. The server can use the same method as the above-mentioned acquisition method of the installation file to acquire the environment file. Alternatively, the server can also pre-store environment files for simulating various running environments. When receiving the running instruction of the application from the first terminal, the server determines the running environment adapted to the application, so as to screen out the environment file matching the application from the multiple pre-stored environment files.
[0086] Among them, the environment file may include the identifier of the virtual machine, the identifier of the system image manager, and the identifier of the view manager. The virtual machine is used to simulate the operating environment adapted to the application, the system image manager is used to manage the operation of the application in the operating environment simulated by the virtual machine, and the view manager is used to manage the display of the application on the first terminal. Correspondingly, the process of obtaining the environment file includes: The server determines the virtual machine, system image manager, and view manager of the application based on the operating environment of the first terminal and the operating environment adapted to the application. Then, the server determines the environment file of the application based on the virtual machine, system image manager, and view manager of the application. That is, the server aggregates the identifiers of the virtual machine, system image manager, and view manager and the files on which their operations depend to obtain the environment file of the application.
[0087] For example, the environment file may include a virtual machine configuration file (.vmx), a status file of the virtual machine BIOS (Basic Input / Output System) (.nvram), a virtual disk file (.vmdk), a snapshot file, a virtual machine memory page file (.vmem), a virtual machine snapshot metadata file (.vmsd), a virtual machine status file (.vmss), a virtual machine log file (.log), a virtual machine memory swap file (.vswp), a virtual machine auxiliary configuration file (.vmxf), an Open Virtualization Format file (.ovf / .ova), etc. The embodiments of the present application do not limit this.
[0088] The solution provided by the embodiments of the present application ensures that the first terminal can accurately simulate the operating environment adapted to the application through the virtual machine in the environment file, can accurately manage the operation of the application on the first terminal based on the system image manager, and can accurately display the application on the first terminal based on the view manager. That is, the environment file obtained through the above method provides a guarantee for the accurate operation of the application on the first terminal.
[0089] Among them, in the process of determining the system image manager, the server can determine the version of the software development kit (SDK) corresponding to the application based on the installation file. Then, the server determines the system image manager based on the version of the software development kit corresponding to the application. The system image manager is matched with the version of the software development kit. The solution provided by the embodiments of the present application, by selecting a system image manager that matches the version of the software development kit corresponding to the application, not only ensures the accurate operation of the application in the adapted operating environment, but also helps the application use system resources more efficiently with a suitable system image, improving the performance of the application.
[0090] For example, the operating environment adapted by the application is the operating environment corresponding to the Android operating system. During the process of determining the environment file, the server can use a lightweight Android virtual machine (such as Android-x86) or a custom virtualization environment. For the system image manager, the server can select an appropriate Android system image manager according to the target SDK version of the APK file of the application. For the view manager, the server can determine the corresponding view manager according to the operating environment of the first terminal, so as to ensure that the application adapts to the screen of the first terminal through the view manager.
[0091] 302. The server parses the installation file to obtain the resource information, metadata, and dependency information of the application. The resource information is used to represent the resources used when the application runs, and the dependency information is used to represent the database on which the application runs depends.
[0092] In the embodiment of the present application, the server can use corresponding information extraction tools to respectively parse the resource information, metadata, and dependency information of the application from the installation file.
[0093] Among them, the server can obtain the resource information from the installation file of the application through a resource extraction tool. The resource extraction tool can be an aapt tool, an apktool tool, etc., and the embodiment of the present application does not limit this. The resource information may include information such as the icon, layout file, and string resource of the application, and the embodiment of the present application does not limit this. The layout file is used to indicate the layout and appearance style of each component (such as buttons, text boxes, etc.) in the application. The string resource is used to indicate the text content in the application.
[0094] The server can obtain the metadata of the application from the installation file of the application through a metadata extraction tool. The metadata extraction tool can be a dex2jar tool or a JD-GUI tool, etc., and the embodiment of the present application does not limit this. The metadata may include information such as the name, package name, version number, and startup Activity of the application, and the embodiment of the present application does not limit this. The startup Activity is used to start an Activity component in an application in a certain way (such as user operation or code call), so that the application is displayed on the screen and starts to run.
[0095] The server can obtain the dependency information of the application from the installation file of the application by relying on a dependency information extraction tool. The dependency information extraction tool can be a tool such as LibRadar or LibScout, and the embodiments of the present application do not limit this. The dependency information can be third-party libraries such as.so files (native libraries) and.jar files (Java libraries), and the embodiments of the present application do not limit this. The.so file (native library) is usually used to provide underlying system functions or hardware acceleration; the.jar file (Java library) usually contains Java classes and resources.
[0096] In some embodiments, before parsing the installation file of the application, the server can verify the installation file of the application to ensure the security, integrity, and legality of the installation file. Among them, the server can perform a legality verification on the installation file of the application to ensure that the installation file conforms to the basic format and requirements of the application. The server can also perform a format verification on the installation file of the application to ensure that the installation file conforms to the basic format and requirements and check whether the installation file contains the necessary file structure. The server can also perform a permission verification on the installation file of the application to ensure that there are no incompatible permissions (such as camera permissions). The server can also perform a virus scan on the installation file of the application to ensure that the installation file does not contain malicious code.
[0097] For example, the application is an Android application and the installation file is an APK file. Then the server performs a legality verification on the APK file to ensure that it conforms to the basic format and requirements of the Android application; checks whether the APK file contains the necessary file structure (such as AndroidManifest.xml, classes.dex, etc.); checks the permission declarations in the APK file to ensure that there are no incompatible permissions; uses a virus scan tool (such as ClamAV) to scan the APK file to ensure that it does not contain malicious code.
[0098] 303. The server converts the format of the resource information, metadata, and dependency information of the application based on the running environment of the first terminal to obtain configuration information, and the resource information, metadata, and dependency information in the configuration information conform to the running environment of the first terminal.
[0099] In the embodiments of the present application, the server can use the running environment of the first terminal as a reference to convert the format of the original resource information, metadata, and dependency information of the application, so that the resource information, metadata, and dependency information after format conversion are adapted to the application of the first terminal. The server aggregates the resource information, metadata, and dependency information after format conversion to obtain the configuration information of the application.
[0100] For example, the application is an Android application and the installation file is an APK file; the first terminal is a PC (Personal Computer) terminal, and the operating environment of the first terminal is the operating environment corresponding to the Windows operating system. The server can extract from the AndroidManifest.xml file <application>The value of the android:label attribute of the label, i.e., the name of the application, is obtained; the icon files related to ic_launcher are extracted from the res / mipmap or res / drawable directory; the.so files (native libraries) and.jar files (Java libraries) in the APK are extracted to obtain the dependency information. Then, the server sets the name of the PC-side application, usually the same as the Android application name; converts the extracted Android application icon to a format supported by the PC application (such as.ico) and sets it as the icon of the PC application; configures the extracted dependency libraries (.so and.jar files) into the dependency path of the PC application, thereby obtaining the configuration information of the application.
[0101] In some embodiments, considering that the operating environment of the first terminal is different from the operating environment adapted by the application, some functions of the application may not be directly converted, and the server can adapt or modify the relevant files of this part of the functions. According to the characteristics of the operating environment of the first terminal, the server can also optimize the performance of the application, such as adjusting the resource loading method, optimizing the code, etc., which are not limited in the embodiments of the present application.
[0102] 304. The server generates an installation package based on the installation file, the environment file, and the configuration information.
[0103] In the embodiments of the present application, the server can package the installation file, the environment file, and the configuration information of the application to obtain the installation package of the application. That is, the installation package includes the installation file, the environment file, and the configuration information of the application, so that the first terminal can directly simulate the adaptation environment of the application through the installation package and install and run the application, without the need for the first terminal to install the emulator software and then install the application, which simplifies the process of the first terminal running the application that was originally not supported, is conducive to improving the distribution efficiency and running efficiency of the application, and thus is conducive to improving the conversion rate of the application.
[0104] In some embodiments, to ensure that the installation package can be started and run properly on the first terminal, the server may add the loading order among the installation file, the environment file, and the configuration information in the installation package to indicate that each file in the installation package is loaded in order. Accordingly, the process of the server generating the installation package includes: The server adds the call path of the installation file, the call path of the environment file, and the call path of the configuration information in the application execution template to obtain the startup script of the application. The application execution template is used to indicate the loading order among the installation file, the environment file, and the configuration information when running the application on the first terminal. Then, the server packages the installation file, the environment file, and the configuration information to obtain the resource package of the application. Then, the server packages the startup script and the resource package to obtain the installation package. The solution provided by the embodiments of the present application, by providing the application execution template, not only standardizes the loading order among the installation file, the environment file, and the configuration information of the application, ensures that the installation package can start and run the application properly on the first terminal, but also only needs to add the call path of the installation file, the call path of the environment file, and the call path of the configuration information to the application execution template to obtain the startup script of the application, with simple operation, which can improve the generation efficiency of the installation package, thereby improving the distribution efficiency and running efficiency of the application, and thus facilitating the improvement of the conversion rate of the application.
[0105] For example, the specific content of the startup script (.bat file) is as follows:
[0106]
[0107]
[0108] Among them, VM_PATH is the call path of the environment file, APK_PATH is the call path of the installation file (APK file), and CONFIG_PATH is the call path of the configuration information. After setting the call path of the installation file, the call path of the environment file, and the call path of the configuration information, the first terminal calls the environment file to start the virtual machine to simulate the running environment adapted to the application. Then, the first terminal can use the ADB tool to install the APK file into the virtual machine and use the ADB tool to start the Activity specified in the APK file. By checking whether the exit code of the previous command is 1 (indicating an error) through "if errorlevel 1", if there is an error, output "Failed to start the application." and pause, and then exit the startup script. If everything goes well, output "Application started successfully." and pause, waiting for the user to press any key to continue.
[0109] In some embodiments, the server is also capable of compressing and optimizing the generated installation package to reduce the file size and improve the running efficiency. Among them, the server can use any compression algorithm (such as ZIP, 7z) to compress the installation package of the application program. The server can also remove unnecessary resource files in the installation package to further reduce the volume of the installation package.
[0110] To more clearly describe the above process of generating the installation package, the following further describes the process of generating the installation package in conjunction with the accompanying drawings. For example, Figure 4 is a schematic diagram of the generation of the installation package provided according to an embodiment of the present application. Refer to Figure 4 , the server obtains the installation file of the application program, verifies the installation file, and in the case of successful verification, parses the installation file to obtain the resource information, metadata, and dependency information of the application program, performs format conversion on the resource information, metadata, and dependency information of the application program to obtain configuration information, and then generates a startup script for the application program based on the installation file, environment file, and configuration information, packs the installation file, environment file, and configuration information to obtain a resource package for the application program. Then, the server packs the startup script and the resource package to obtain an installation package. Then, the server compresses and optimizes the installation package.
[0111] 305. The server returns the installation package to the first terminal.
[0112] In the embodiment of the present application, the server sends the installation package of the application program to the first terminal so that the first terminal can simulate the running environment adapted to the application program based on the environment file in the installation package and install the application program in the simulated running environment based on the installation file and configuration information in the installation package.
[0113] The embodiment of the present application provides a running device for an application program. Since the running environment of the first terminal is different from the running environment of the application program, it means that the first terminal itself does not support the running of the application program. When an application program that is not originally supported is to be run on the first terminal, an installation package of the application program is automatically generated through an installation file that supports the application program to run in an adapted running environment and an environment file used to simulate the running environment adapted to the application program, and the installation package is returned to the first terminal, facilitating the first terminal to directly simulate the adapted environment of the application program through the installation package and install and run the application program. There is no need for the first terminal to install an emulator and then install the application program, simplifying the process of running an application program that is not originally supported on the first terminal, reducing the usage threshold of the application program, facilitating improving the distribution efficiency and running efficiency of the application program, and thus facilitating improving the conversion rate of the application program. Moreover, the above method can achieve the installation and use of the application program across running environments or platforms, greatly expanding the applicable scope of the application program.
[0114] In some embodiments, the server may also store the installation package in an installation package database. The installation package database is used to store the installation packages of application programs that can run across different operating environments. The solution provided by the embodiments of the present application, by storing the installation packages of application programs in the installation package database, when other terminals with operating environments different from the operating environment adapted to the application program need to run the application program, they can directly use the application programs already prepared in the installation package database without regenerating them, which is conducive to improving the distribution efficiency and running efficiency of the application program, and thus conducive to improving the conversion rate of the application program.
[0115] In the case where the installation package can be stored, in response to a running instruction of the application program from the first terminal, the server may first query the installation package database. In the case where the installation package of the application program does not exist in the installation package database, the server then obtains the installation file. In the case where the installation package of the application program exists in the installation package database, the server returns the installation package to the first terminal. That is, when receiving the running instruction of the application program from the first terminal, the server may first determine whether the required installation package exists in the installation package database. If not, step 301 is executed; if so, step 305 is directly executed. This method is conducive to improving the distribution efficiency and running efficiency of the application program, and thus conducive to improving the conversion rate of the application program.
[0116] In some other embodiments, the first terminal may also share the installation package of the application program with other terminals. Correspondingly, in response to a sending instruction of the first terminal for the second installation package, the server sends the second installation package to the second terminal indicated by the sending instruction. The operating environments of the first terminal and the second terminal are the same, and the installation package is used to run the application program on the second terminal. That is, in the case where the operating environments of the first terminal and the second terminal are the same, the installation package of the application program can be directly shared with the second terminal, and this installation package also supports the application program to run on the second terminal without regenerating it, which is conducive to improving the distribution efficiency and running efficiency of the application program, and thus conducive to improving the conversion rate of the application program.
[0117] Figure 5 is a flowchart of another method for running an application program provided by the embodiments of the present application. Refer to Figure 5 , which is described by taking the execution by the first terminal as an example in the embodiments of the present application. The method for running the application program includes the following steps:
[0118] 501. In response to a running operation of the application program, the first terminal sends a running instruction for the application program to the server. The running instruction is used to instruct the server to generate an installation package capable of running the application program on the first terminal, and the operating environment of the first terminal is different from the operating environment adapted to the application program.
[0119] In an embodiment of the present application, when a running operation for an application is triggered, the first terminal sends a running instruction for the application to the server, so as to instruct the server to generate an installation package capable of running the application on the first terminal. The embodiment of the present application does not limit the triggering manner of the running operation.
[0120] In some embodiments, the first terminal displays an instruction input control. The instruction input control is used to obtain an instruction for running the application from an object (user). Then, in response to an input operation on the instruction input control, the first terminal obtains the information already input in the instruction input control. When the information in the instruction input control is used to indicate running the application, the first terminal generates a running instruction and sends the running instruction to the server. That is, the object can directly input various instructions (such as a running instruction) for the application through the instruction input control on the first terminal, which facilitates the object's manipulation of the application and has strong operability.
[0121] The embodiment of the present application does not limit the display position and display style of the instruction input control. In some embodiments, the instruction input control may be an information input control in the AI (Artificial Intelligence) assistant on the first terminal. In response to a startup operation for the AI assistant, the first terminal displays an interaction interface of the AI assistant. An information input control is displayed in the interaction interface. The object can input any interaction information in the information input control to interact with the AI assistant. For example, the object can input a running instruction in the information input control, such as "Run the program package on the current system", "I want to convert this APK file into a PC application", or "Help me package this application", etc. The embodiment of the present application does not limit the specific content of the running instruction input by the object. The running instruction may be a text instruction or a voice instruction, etc., and the embodiment of the present application does not limit this. Among them, after the object inputs any interaction information, if the AI assistant cannot recognize the interaction information, when the interaction information in the instruction input control is used to indicate running the application, the first terminal generates a running instruction and sends the running instruction to the server.
[0122] In addition to inputting the above running instruction in the instruction input control, the object can also input an installation file of the application in the instruction input control. The embodiment of the present application does not limit the input manner of the installation file. Optionally, the installation file can be dragged into the instruction input control, or by triggering the "Upload File" control in the interaction interface, a file selector is used to select the installation file of the application; or the download link of the installation file is input in the instruction input control, such as a QR code, a URI (Uniform Resource Identifier) address, text with a program name, etc., and the embodiment of the present application does not limit this.
[0123] The embodiments of the present application do not limit the startup method of the AI assistant. Optionally, the AI assistant is started by triggering the icon of the AI assistant on the screen of the first terminal; or, "AI assistant" is searched in the start menu and started; or, the AI assistant is started using a preset shortcut key.
[0124] In some other embodiments, the first terminal displays a running control for the application program, and the running control is used to control the running of the application program. Then, in response to the triggering operation on the running control, the first terminal generates a running instruction for the application program and sends the running instruction to the server. That is, the object can directly trigger the running operation for the application program by triggering the running control, the operation is simple, the usage threshold of the application program is reduced, and it is beneficial to improve the distribution efficiency and running efficiency of the application program.
[0125] The embodiments of the present application do not limit the display position and display style of the running control. Optionally, an application mall is installed and run on the first terminal, and the application mall includes multiple application programs. Each application program corresponds to a running control. When the running control of the application program is triggered, the first terminal generates a running instruction for the application program and sends the running instruction to the server.
[0126] 502. The first terminal downloads the installation package of the application program returned by the server and installs the application program based on the installation package, and the installation package is used to run the application program on the first terminal.
[0127] In the embodiments of the present application, after the server generates the installation package of the application program, the first terminal can download the installation package of the application program and install the application program based on the installation package. Among them, after the server generates the installation package of the application program, the server can first return the download link of the installation package to the first terminal, and in response to the confirmation download operation based on the download link, the first terminal then downloads the installation package of the application program. This method conforms to the object's intention, and the operability and controllability for the application program are strong.
[0128] Among them, the installation package includes the installation file, environment file, and configuration information of the application. The installation file supports the application to run in the adapted operating environment. The environment file is used to simulate the application in the adapted operating environment. The format of the configuration information conforms to the operating environment of the first terminal. During the process of installing the application based on the installation package, the first terminal configures the call paths of the installation file, environment file, and configuration information of the application. Then, based on the call path of the environment file, the first terminal calls the environment file to create a virtualized operating environment for the application. Then, based on the call paths of the installation file and configuration information, the first terminal calls the installation file and configuration information respectively to install the application in the virtualized operating environment. That is, the first terminal can sequentially load the installation file, environment file, and configuration information of the application according to the startup script of the application to achieve the purpose of installing and running the application.
[0129] During the process of creating a virtualized operating environment for the application based on the environment file, the first terminal creates a virtual machine, a system image manager, and a view manager based on the environment file. The virtual machine is used to simulate the operating environment adapted to the application. The system image manager is used to manage the operation of the application in the operating environment simulated by the virtual machine. The view manager is used to manage the display of the application on the first terminal.
[0130] After installing the application, the first terminal can display the startup control of the application on the screen for subsequent startup of the application based on the startup control.
[0131] 503. In response to the startup operation of the application, the first terminal displays the interface of the application.
[0132] In the embodiment of the present application, when the startup operation for the application is triggered, the first terminal displays the interface of the application. In some embodiments, the first terminal can hide the display window of the virtual machine and display the window of the application based on the view manager. This method can make the screen (desktop) or interface of the first terminal cleaner and simpler, facilitating the user to use the application.
[0133] To more clearly describe the method for running the application provided in the embodiment of the present application, the process of running the application will be further described below with reference to the accompanying drawings. Figure 6 It is a framework diagram for running an application provided according to an embodiment of the present application. Refer to Figure 6 , the file upload module on the first terminal is used to provide the installation file of the application. The installation file can be temporarily stored in the OSS cloud storage and wait for subsequent processing. After the upload is completed, the file address after upload on the first terminal is returned. The AI assistant client interaction module on the first terminal supports the object to trigger the subsequent installation package generation process through the instruction input control in the AI assistant. Among them, the object is allowed to select the installation file and trigger the installation package generation process, and the object request is sent to the AI assistant service module to trigger the subsequent installation package generation process. Moreover, the AI assistant client interaction module can also monitor the status of the packaging process in real time and feedback the installation package generation progress to the object. The operation control in the application mall on the first terminal can also trigger the installation package generation process.
[0134] The AI assistant server module on the server can receive the object request and decide whether to trigger the installation package generation process according to the request content. Among them, the AI assistant server module can use natural language processing technology to analyze the interaction information input by the object and judge whether the interaction information contains the semantics of running the application. If the interaction information contains the semantics of running the application, the running instruction is forwarded to the packaging trigger control service. The OSS storage module on the server can store the installation file and application resources of the application.
[0135] The packaging trigger control service on the server: receives the object request and decides whether to trigger the installation package generation process according to the request content. The packaging trigger control service is responsible for triggering the installation package generation process and managing each step in the installation package generation process. Among them, the packaging trigger control service can query the installation package database before triggering the installation package generation process to check whether there is an installation package that meets the requirements. If the installation package database does not exist, it triggers the installation package generation process and monitors the generation process. Then, the packaging trigger control service returns the generated installation package to the downloader on the first terminal. The downloader on the first terminal is used to download the generated installation package to the first terminal.
[0136] The single-package packaging module on the server is responsible for converting the installation file into an installation package that can run on the first terminal. For details, please refer to steps 301 to 305 and will not be elaborated here.
[0137] The installation package database on the server is used to cache the generated installation package to avoid repeated generation. Moreover, the installation package database provides an efficient cache management mechanism, supporting fast query and storage. The server can manage the installation packages stored in the installation package database according to the cache policy to ensure the effectiveness of the cache. In some embodiments, the server can also regularly clean up the expired or invalid installation packages in the installation package database to free up storage space.
[0138] The embodiment of the present application provides a method for running an application. Since the running environment of the first terminal is different from the running environment of the application, it indicates that the first terminal itself does not support the running of the application. When running an application that is not originally supported on the first terminal, an installation package containing an installation file that supports the application to run in the adapted running environment and an environment file for simulating the running environment adapted to the application can be directly obtained, facilitating the first terminal to directly simulate the adapted environment of the application through the installation package and install and run the application. There is no need for the first terminal to install an emulator and then install the application, simplifying the process of running an application that is not originally supported on the first terminal, reducing the usage threshold of the application, and being conducive to improving the distribution efficiency and running efficiency of the application, thereby being conducive to improving the conversion rate of the application. Moreover, the above method can realize the installation and use of the application across running environments or platforms, greatly expanding the applicable scope of the application.
[0139] The beneficial effects produced by the method for running an application provided by the embodiment of the present application may include the following aspects:
[0140] (1) Enterprise office: Enterprises can package Android applications used internally into executable files for employees to use on their computers conveniently;
[0141] (2) Game entertainment: The user can package Android games into executable files to enjoy a better gaming experience on the computer;
[0142] (3) Education and learning: The user can package Android learning applications into executable files to study on the computer;
[0143] (4) Cross-terminal dissemination: The user can package Android applications into executable files to disseminate them on the computer.
[0144] Figure 7 It is a block diagram of an application running device provided according to an embodiment of the present application. The application running device is used to execute the steps when the above method for running an application is executed. Refer to Figure 7 , the application running device includes:
[0145] An acquisition module 701, configured to acquire an installation file of the application in response to a running instruction of the application by the first terminal. The running environment of the first terminal is different from the running environment adapted to the application, and the installation file supports the application to run in the adapted running environment;
[0146] A generation module 702, configured to generate an installation package of the application based on the installation file and the environment file of the application. The environment file is used to simulate the running environment adapted to the application, and the installation package is used to run the application on the first terminal;
[0147] A sending module 703, configured to return an installation package to a first terminal.
[0148] In some embodiments, the apparatus further includes:
[0149] A determination module, configured to determine a virtual machine, a system image manager, and a view manager of an application based on the operating environment of the first terminal and the operating environment adapted to the application. The virtual machine is used to simulate the operating environment adapted to the application, the system image manager is used to manage the operation of the application in the operating environment simulated by the virtual machine, and the view manager is used to manage the display of the application on the first terminal; determine an environment file of the application based on the virtual machine, the system image manager, and the view manager of the application.
[0150] In some embodiments, the determination module is configured to determine the version of the software development kit corresponding to the application based on the installation file; determine the system image manager based on the version of the software development kit corresponding to the application, and the system image manager matches the version of the software development kit.
[0151] In some embodiments, the generation module 702 includes:
[0152] A parsing unit, configured to parse the installation file to obtain resource information, metadata, and dependency information of the application. The resource information is used to represent the resources used when the application runs, and the dependency information is used to represent the database on which the application runs depends;
[0153] A conversion unit, configured to perform format conversion on the resource information, metadata, and dependency information of the application based on the operating environment of the first terminal to obtain configuration information, and the resource information, metadata, and dependency information in the configuration information conform to the operating environment of the first terminal;
[0154] A generation unit, configured to generate an installation package based on the installation file, the environment file, and the configuration information.
[0155] In some embodiments, the generation unit is configured to add the call paths of the installation file, the environment file, and the configuration information to the application execution template to obtain a startup script of the application. The application execution template is used to indicate the loading order among the installation file, the environment file, and the configuration information when the application runs on the first terminal; package the installation file, the environment file, and the configuration information to obtain a resource package of the application; package the startup script and the resource package to obtain an installation package.
[0156] In some embodiments, the apparatus further includes:
[0157] A storage module for storing the installation package in an installation package database, which is used to store the installation packages of application programs that can run across operating environments.
[0158] In some embodiments, an acquisition module 701 is configured to query the installation package database in response to a running instruction of an application program on a first terminal. The installation package database is used to store the installation packages of application programs that can run across operating environments. In the case where the installation package of the application program does not exist in the installation package database, obtain the installation file.
[0159] In some embodiments, the sending module 703 is further configured to return the installation package to the first terminal in the case where the installation package of the application program exists in the installation package database.
[0160] In some embodiments, the sending module 703 is further configured to, in response to a sending instruction of the installation package on the first terminal, send the installation package to a second terminal indicated by the sending instruction. The running environments of the first terminal and the second terminal are the same, and the installation package is used to run the application program on the second terminal.
[0161] The embodiment of the present application provides an operating device for an application program. Since the operating environment of the first terminal is different from the operating environment of the application program, it indicates that the first terminal itself does not support the running of the application program. When an application program that is not originally supported needs to be run on the first terminal, an installation package of the application program is automatically generated through the installation file that supports the application program to run in the adapted operating environment and the environment file used to simulate the adapted operating environment of the application program, and the installation package is returned to the first terminal, facilitating the first terminal to directly simulate the adapted environment of the application program through the installation package and install and run the application program, without the need for the first terminal to install a simulator and then install the application program, simplifying the process of running an application program that is not originally supported on the first terminal, being conducive to improving the distribution efficiency and running efficiency of the application program, and thus being conducive to improving the conversion rate of the application program. Moreover, the above device can realize the installation and use of the application program across operating environments or platforms, greatly expanding the applicable range of the application program.
[0162] Figure 8 It is a block diagram of another operating device for an application program provided according to an embodiment of the present application. The operating device for the application program is used to execute the steps when the above-mentioned operating method of the application program is executed. Refer to Figure 8 , and the operating device for the application program includes:
[0163] A sending module 801 is configured to send a running instruction for the application program to the server in response to a running operation of the application program. The running instruction is used to instruct the server to generate an installation package that can run the application program on a first terminal, and the running environment of the first terminal is different from the operating environment adapted to the application program;
[0164] A processing module 802, configured to download an installation package of an application returned by a server, install the application based on the installation package, and the installation package is used to run the application on a first terminal;
[0165] A running module 803, configured to display an interface of the application in response to a startup operation on the application.
[0166] In some embodiments, the apparatus further includes:
[0167] A first display module, configured to display an instruction input control, and the instruction input control is used to obtain an operation instruction of an object for the application;
[0168] A sending module 801, configured to obtain the information already input in the instruction input control in response to an input operation on the instruction input control; when the information in the instruction input control is used to indicate running the application, generate a running instruction and send the running instruction to the server.
[0169] In some embodiments, the apparatus further includes:
[0170] A second display module, configured to display a running control of the application, and the running control is used to control running the application;
[0171] A sending module 801, configured to generate a running instruction for the application in response to a triggering operation on the running control, and send the running instruction to the server.
[0172] In some embodiments, the installation package includes an installation file, an environment file, and configuration information of the application. The installation file supports the application to run in an adapted running environment. The environment file is used to simulate the application in the adapted running environment, and the format of the configuration information conforms to the running environment of the first terminal;
[0173] A processing module 802, configured to configure the call paths of the installation file, the environment file, and the configuration information of the application; based on the call path of the environment file, call the environment file to create a virtualized running environment for the application; based on the call paths of the installation file and the configuration information, call the installation file and the configuration information respectively to install the application in the virtualized running environment.
[0174] In some embodiments, a processing module 802 is configured to create a virtual machine, a system image manager, and a view manager based on the environment file. The virtual machine is used to simulate the running environment adapted to the application. The system image manager is used to manage the running of the application in the running environment simulated by the virtual machine. The view manager is used to manage the display of the application on the first terminal.
[0175] In some embodiments, the apparatus further includes:
[0176] A third display module, configured to hide the display window of the virtual machine and display the window of the application program based on the view manager.
[0177] An embodiment of the present application provides an operating device for an application program. Since the operating environment of the first terminal is different from the operating environment of the application program, it indicates that the first terminal itself does not support the operation of the application program. When an application program that is not originally supported needs to be run on the first terminal, an installation package containing an installation file for running the supported application program in the adapted operating environment and an environment file for simulating the adapted operating environment of the application program can be directly obtained. This facilitates the first terminal to directly simulate the adapted environment of the application program through the installation package and install and run the application program, without the need for the first terminal to install an emulator and then install the application program, simplifying the process of running an application program that is not originally supported on the first terminal, which is beneficial to improving the distribution efficiency and running efficiency of the application program, and thus beneficial to improving the conversion rate of the application program. Moreover, the above device can realize the installation and use of the application program across operating environments or platforms, greatly expanding the applicable scope of the application program.
[0178] It should be noted that: when the operating device for the application program provided in the above embodiment processes the application program, only the division of the above functional modules is used for illustration. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the operating device for the application program provided in the above embodiment and the embodiment of the operating method for the application program belong to the same concept. For the specific implementation process, please refer to the method embodiment, which will not be elaborated here.
[0179] In an embodiment of the present application, the computer device can be configured as a terminal or a server. When the computer device is configured as a terminal, the terminal can be used as the execution subject to implement the technical solution provided in the embodiment of the present application. When the computer device is configured as a server, the server can be used as the execution subject to implement the technical solution provided in the embodiment of the present application, or the technical solution provided in the present application can be implemented through the interaction between the terminal and the server. The embodiment of the present application does not make any limitations in this regard.
[0180] Figure 9 It is a block diagram of the structure of a terminal 900 according to an embodiment of the present application.
[0181] Generally, the terminal 900 includes a processor 901 and a memory 902.
[0182] The processor 901 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. The processor 901 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 901 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the wake state, also known as the CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 901 may be integrated with a GPU (Graphics Processing Unit), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 901 may further include an AI (Artificial Intelligence) processor, and the AI processor is used to process computational operations related to machine learning.
[0183] The memory 902 may include one or more computer-readable storage media, and the computer-readable storage media may be non-transitory. The memory 902 may further include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash storage devices. In some embodiments, the non-transitory computer-readable storage media in the memory 902 is used to store at least one computer program, and the at least one computer program is used to be executed by the processor 901 to implement the running method of the application program provided in the method embodiments of the present application.
[0184] In some embodiments, the terminal 900 may further optionally include: a peripheral device interface 903 and at least one peripheral device. The processor 901, the memory 902, and the peripheral device interface 903 may be connected through a bus or signal lines. Each peripheral device may be connected to the peripheral device interface 903 through a bus, signal lines, or a circuit board. Specifically, the peripheral devices include at least one of a radio frequency circuit 904, a display screen 905, a camera assembly 906, an audio circuit 907, and a power supply 908.
[0185] The peripheral device interface 903 can be used to connect at least one I / O (Input / Output) related peripheral device to the processor 901 and the memory 902. In some embodiments, the processor 901, the memory 902, and the peripheral device interface 903 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 901, the memory 902, and the peripheral device interface 903 can be implemented on separate chips or circuit boards, and this embodiment does not limit this.
[0186] The radio frequency circuit 904 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 904 communicates with the communication network and other communication devices through electromagnetic signals. The radio frequency circuit 904 converts electrical signals into electromagnetic signals for transmission, or converts the received electromagnetic signals into electrical signals. In some embodiments, the radio frequency circuit 904 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and so on. The radio frequency circuit 904 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to: the World Wide Web, a metropolitan area network, an intranet, various generations of mobile communication networks (2G, 3G, 4G, and 5G), a wireless local area network, and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 904 may further include a circuit related to NFC (Near Field Communication), and this application does not limit this.
[0187] The display screen 905 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 905 is a touch display screen, the display screen 905 also has the ability to collect touch signals on or above the surface of the display screen 905. The touch signals can be input as control signals to the processor 901 for processing. At this time, the display screen 905 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen 905, which is disposed on the front panel of the terminal 900; in other embodiments, there may be at least two display screens 905, which are respectively disposed on different surfaces of the terminal 900 or are in a folding design; in other embodiments, the display screen 905 may be a flexible display screen, which is disposed on the curved surface or the folding surface of the terminal 900. Even further, the display screen 905 can also be set to an irregular non-rectangular shape, that is, a special-shaped screen. The display screen 905 can be prepared using materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
[0188] The camera module 906 is used to capture images or videos. In some embodiments, the camera module 906 includes a front camera and a rear camera. Generally, the front camera is disposed on the front panel of the terminal, and the rear camera is disposed on the back of the terminal. In some embodiments, there are at least two rear cameras, which are respectively any one of a main camera, a depth camera, a wide-angle camera, and a telephoto camera, so as to implement the function of background blurring by fusing the main camera and the depth camera, panoramic shooting by fusing the main camera and the wide-angle camera, and VR (Virtual Reality) shooting function or other fused shooting functions. In some embodiments, the camera module 906 may further include a flash. The flash can be a single-color-temperature flash or a dual-color-temperature flash. The dual-color-temperature flash refers to the combination of a warm-light flash and a cold-light flash, which can be used for light compensation under different color temperatures.
[0189] The audio circuit 907 may include a microphone and a speaker. The microphone is used to collect sound waves of the user and the environment, and convert the sound waves into electrical signals for input to the processor 901 for processing, or input to the radio frequency circuit 904 to enable voice communication. For the purpose of stereo collection or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal 900. The microphone may also be an array microphone or an omnidirectional collection microphone. The speaker is used to convert the electrical signals from the processor 901 or the radio frequency circuit 904 into sound waves. The speaker may be a traditional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert electrical signals into sound waves audible to humans, but also convert electrical signals into sound waves inaudible to humans for uses such as ranging. In some embodiments, the audio circuit 907 may further include a headphone jack.
[0190] The power supply 908 is used to supply power to each component in the terminal 900. The power supply 908 may be alternating current, direct current, a primary battery or a rechargeable battery. When the power supply 908 includes a rechargeable battery, the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery charged through a wired line, and a wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0191] In some embodiments, the terminal 900 further includes one or more sensors 909. The one or more sensors 909 include but are not limited to: an acceleration sensor 910, a gyroscope sensor 911, a pressure sensor 912, an optical sensor 913, and a proximity sensor 914.
[0192] The acceleration sensor 910 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established with the terminal 900. For example, the acceleration sensor 910 can be used to detect the components of the gravitational acceleration on the three coordinate axes. The processor 901 can control the display screen 905 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 910. The acceleration sensor 910 can also be used for collecting game or user's motion data.
[0193] The gyroscope sensor 911 can detect the body direction and rotation angle of the terminal 900. The gyroscope sensor 911 can cooperate with the acceleration sensor 910 to collect the 3D actions of the user on the terminal 900. According to the data collected by the gyroscope sensor 911, the processor 901 can implement the following functions: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
[0194] The pressure sensor 912 can be disposed on the side frame of the terminal 900 and / or the lower layer of the display screen 905. When the pressure sensor 912 is disposed on the side frame of the terminal 900, it can detect the holding signal of the user on the terminal 900, and the processor 901 can perform left / right hand recognition or quick operation according to the holding signal collected by the pressure sensor 912. When the pressure sensor 912 is disposed on the lower layer of the display screen 905, the processor 901 can control the operable controls on the UI interface according to the pressure operation of the user on the display screen 905. The operable controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
[0195] The optical sensor 913 is used to collect the ambient light intensity. In one embodiment, the processor 901 can control the display brightness of the display screen 905 according to the ambient light intensity collected by the optical sensor 913. Specifically, when the ambient light intensity is high, the display brightness of the display screen 905 is increased; when the ambient light intensity is low, the display brightness of the display screen 905 is decreased. In another embodiment, the processor 901 can also dynamically adjust the shooting parameters of the camera assembly 906 according to the ambient light intensity collected by the optical sensor 913.
[0196] The proximity sensor 914, also known as the distance sensor, is usually disposed on the front panel of the terminal 900. The proximity sensor 914 is used to collect the distance between the user and the front of the terminal 900. In one embodiment, when the proximity sensor 914 detects that the distance between the user and the front of the terminal 900 is gradually decreasing, the processor 901 controls the display screen 905 to switch from the lit state to the off state; when the proximity sensor 914 detects that the distance between the user and the front of the terminal 900 is gradually increasing, the processor 901 controls the display screen 905 to switch from the off state to the lit state.
[0197] Those skilled in the art can understand that Figure 9 the structure shown in
[0198] Figure 10 It is a schematic structural diagram of a server provided by an embodiment of the present application. The server 1000 may vary greatly due to different configurations or performances, and may include one or more processors (Central Processing Units, CPUs) 1001 and one or more memories 1002. Among them, at least one computer program is stored in the memory 1002, and the at least one computer program is loaded and executed by the processor 1001 to implement the running method of the application program provided by each of the above method embodiments. Of course, the server may also have components such as wired or wireless network interfaces, keyboards, and input / output interfaces for input and output. The server may also include other components for implementing the functions of the device, which will not be elaborated here.
[0199] An embodiment of the present application also provides a computer-readable storage medium in which at least one segment of computer program is stored. The at least one segment of computer program is loaded and executed by a processor of a computer device to implement the operations performed by the computer device in the running method of the application program in the above embodiment. For example, the computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a Compact Disc Read-Only Memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.
[0200] In some embodiments, the computer program involved in the embodiments of the present application may be deployed to be executed on a single computer device, or on multiple computer devices located at one place. Or, it may be executed on multiple computer devices distributed at multiple locations and interconnected through a communication network. The multiple computer devices distributed at multiple locations and interconnected through a communication network may form a blockchain system.
[0201] An embodiment of the present application also provides a computer program product, including a computer program. The computer program is stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the running method of the application program provided in the above various alternative implementation manners.
[0202] Those of ordinary skill in the art can understand that all or part of the steps for implementing the above embodiments can be completed by hardware, or can be completed by a program instructing related hardware. The program mentioned above can be stored in a computer-readable storage medium, and the storage medium mentioned above can be a read-only memory, a magnetic disk, an optical disc, etc.
[0203] The above are only alternative embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included within the protection scope of the present application.< / application>
Claims
1. A method for running an application, characterized in that, The method includes: In response to a running instruction of an application from a first terminal, obtaining an installation file of the application, where the running environment of the first terminal is different from the running environment adapted to the application, and the installation file supports the application to run in the adapted running environment; Generating an installation package of the application based on the installation file and an environment file of the application, where the environment file is used to simulate the running environment adapted to the application, and the installation package is used to run the application on the first terminal; Returning the installation package to the first terminal.
2. The method according to claim 1, characterized in that, The method further includes: Based on the running environment of the first terminal and the running environment adapted to the application, determining a virtual machine, a system image manager, and a view manager of the application, where the virtual machine is used to simulate the running environment adapted to the application, the system image manager is used to manage the running of the application in the running environment simulated by the virtual machine, and the view manager is used to manage the display of the application on the first terminal; Determining the environment file of the application based on the virtual machine, the system image manager, and the view manager of the application.
3. The method according to claim 2, wherein The process of determining the system image manager includes: Based on the installation file, determining the version of the software development kit corresponding to the application; Based on the version of the software development kit corresponding to the application, determining the system image manager, where the system image manager matches the version of the software development kit.
4. The method according to claim 1, characterized in that, The generating the installation package of the application based on the installation file and the environment file of the application includes: Parsing the installation file to obtain resource information, metadata, and dependency information of the application, where the resource information is used to represent the resources used when the application runs, and the dependency information is used to represent the database on which the application runs depends; Based on the running environment of the first terminal, performing format conversion on the resource information, metadata, and dependency information of the application to obtain configuration information, where the resource information, metadata, and dependency information in the configuration information conform to the running environment of the first terminal; Generating the installation package based on the installation file, the environment file, and the configuration information.
5. The method according to claim 4, characterized in that, The generating the installation package based on the installation file, the environment file, and the configuration information includes: Adding the call paths of the installation file, the environment file, and the configuration information to an application execution template to obtain a startup script of the application, where the application execution template is used to indicate the loading order among the installation file, the environment file, and the configuration information when running the application on the first terminal; Packaging the installation file, the environment file, and the configuration information to obtain a resource package of the application; Packaging the startup script and the resource package to obtain the installation package.
6. The method according to claim 1, characterized in that, [[ID= Store the installation package in an installation package database, which is used to store installation packages of application programs that can run across operating environments.
7. The method according to claim 1, characterized in that The obtaining of the installation file of the application program in response to a running instruction of the application program by the first terminal includes: In response to the running instruction of the application program by the first terminal, query the installation package database, which is used to store installation packages of application programs that can run across operating environments; In the case where the installation package of the application program does not exist in the installation package database, obtain the installation file.
8. The method according to claim 7, wherein The method further includes: In the case where the installation package of the application program exists in the installation package database, return the installation package to the first terminal.
9. The method according to claim 1, characterized in that The method further includes: In response to a sending instruction of the installation package by the first terminal, send the installation package to a second terminal indicated by the sending instruction. The running environments of the first terminal and the second terminal are the same, and the installation package is used to run the application program on the second terminal.
10. A method for running an application program, characterized in that, The method includes: In response to a running operation on the application program, send a running instruction for the application program to the server. The running instruction is used to instruct the server to generate an installation package that can run the application program on the first terminal. The running environment of the first terminal is different from the running environment adapted to the application program; Download the installation package of the application program returned by the server, and install the application program based on the installation package. The installation package is used to run the application program on the first terminal; In response to a start operation on the application program, display the interface of the application program.
11. The method according to claim 10, wherein The method further includes: Display an instruction input control, which is used to obtain a running instruction of an object for the application program; The sending of the running instruction for the application program to the server in response to a running operation on the application program includes: In response to an input operation on the instruction input control, obtain the information already input in the instruction input control; In the case where the information in the instruction input control is used to indicate running the application program, generate the running instruction and send the running instruction to the server.
12. The method according to claim 10, wherein The method further includes: Display a running control of the application program, which is used to control the running of the application program; The sending of the running instruction for the application program to the server in response to a running operation on the application program includes: In response to a triggering operation on the running control, generate a running instruction for the application program and send the running instruction to the server.
13. The method according to claim 10, wherein The installation package includes the installation file, environment file, and configuration information of the application program. The installation file supports the application program to run in the adapted running environment. The environment file is used to simulate the application program in the adapted running environment. The format of the configuration information conforms to the running environment of the first terminal; The installing of the application program based on the installation package includes: Configure the call paths of the installation file of the application program, the call path of the environment file, and the call path of the configuration information; Based on the call path of the environment file, call the environment file to create a virtualized running environment for the application program; Based on the call paths of the installation file and the configuration information, call the installation file and the configuration information respectively, and install the application program in the virtualized running environment.
14. The method according to claim 13, wherein The creating a virtualized running environment for the application program based on the environment file includes: Based on the environment file, create a virtual machine, a system image manager, and a view manager. The virtual machine is used to simulate the running environment adapted to the application program. The system image manager is used to manage the running of the application program in the running environment simulated by the virtual machine. The view manager is used to manage the display of the application program on the first terminal.
15. The method according to claim 10, wherein The method further includes: Based on the view manager, hide the display window of the virtual machine and display the window of the application program.
16. An operating device for an application program, characterized in that, The device includes: An acquisition module, configured to acquire the installation file of the application program in response to a running instruction of the application program on a first terminal. The running environment of the first terminal is different from the running environment adapted to the application program, and the installation file supports the application program to run in the adapted running environment; A generation module, configured to generate an installation package of the application program based on the installation file and the environment file of the application program. The environment file is used to simulate the running environment adapted to the application program, and the installation package is used to run the application program on the first terminal; A sending module, configured to return the installation package to the first terminal.
17. An operating device for an application program, characterized in that The device includes: A sending module, configured to send a running instruction for the application program to a server in response to a running operation on the application program. The running instruction is used to instruct the server to generate an installation package capable of running the application program on a first terminal. The running environment of the first terminal is different from the running environment adapted to the application program; A processing module, configured to download the installation package of the application program returned by the server and install the application program based on the installation package. The installation package is used to run the application program on the first terminal; A running module, configured to display the interface of the application program in response to a start operation on the application program.
18. A computer device, characterized in that, The computer device includes a processor and a memory. The memory is used to store at least one segment of computer program, and the at least one segment of computer program is loaded and executed by the processor to perform the running method of the application program according to any one of claims 1 to 15.
19. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store at least one segment of computer program, and the at least one segment of computer program is used to perform the running method of the application program according to any one of claims 1 to 15.
20. A computer program product comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the running method of the application program according to any one of claims 1 to 15.