Application Installation Method, Device, Electronic Device and Storage Medium

By obtaining multi-architecture dynamic library files on the server side and copying them to the preset installation directory, the game operation problem caused by incomplete dynamic library files is solved, and the normal operation of the application and the integrity of the dynamic library files are achieved.

CN114020287BActive Publication Date: 2025-06-13NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111295541.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-03
Publication Date
2025-06-13
Estimated Expiration
2041-11-03

AI Technical Summary

Technical Problem

In the prior art, when installing Android application packages on the server side, if the APK package contains both the dynamic libraries corresponding to the arm and x86 architectures, the dynamic library files may be incomplete during the installation process, resulting in the game not being able to run normally.

Method used

Provide an application installation method, obtains dynamic library files corresponding to at least two processor architectures in the application package, and copys the target dynamic library files and the first dynamic library files corresponding to other processor architectures to a preset installation directory according to the target processor architecture of the server, and runs the application according to the dynamic library files under the directory.

Benefits of technology

Ensure that the preset installation directory contains a collection of dynamic library files with relatively complete functions, avoid the problem of incomplete dynamic library files during installation, and ensure the normal operation of the application.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114020287B_ABST
    Figure CN114020287B_ABST
Patent Text Reader

Abstract

The present application provides an application installation method, apparatus, electronic device and storage medium, relating to the technical field of application programs. The method can be applied to a server and includes: obtaining an application package, where the application package includes dynamic library files corresponding to at least two processor architectures; according to the target processor architecture to which the server belongs, if the application package includes a target dynamic library file corresponding to the target processor architecture, then copying the target dynamic library file to a preset installation directory, and copying first dynamic library files corresponding to other processor architectures to the preset installation directory, which can make the dynamic library file set of the application program with relatively complete functions included under the preset installation directory. Furthermore, when running the application program corresponding to the application package according to each dynamic library file under the preset installation directory, the problem of incomplete dynamic library files extracted during the running process can be avoided, ensuring the normal running of the application program.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of application programs, and particularly to an application program installation method, device, electronic device, and storage medium. Background Art

[0002] Cloud gaming is a new way of running games based on cloud computing. In the cloud gaming mode, the rendering of game screens is completed on the server side. The rendered game screens are encoded and streamed over the network to the terminals of game players; on the client side, game players no longer need high-end game devices and only need basic video decoding capabilities to play games.

[0003] Currently, when installing an Android application package (APK) on the server side, if the APK package contains dynamic libraries corresponding to both the arm and x86 architectures at the same time, the existing Android system installation package manager will extract the dynamic library that best matches the system architecture (for machines with the x86 architecture, extract the x86 format dynamic library) for installation.

[0004] It can be seen that the existing APK installation is relatively simple. If the x86 format dynamic library in the APK is incomplete during the installation process, for example, a third-party software development kit (SDK) on which the game depends only provides the dynamic library for the arm architecture, then after installation, the dynamic library is missing, resulting in the problem that the game cannot run properly. Summary of the Invention

[0005] The purpose of this application is to provide an application program installation method, device, electronic device, and storage medium to avoid the problem of missing dynamic library files during the installation process and ensure the normal operation of the application program, aiming at the deficiencies in the above-mentioned existing technologies.

[0006] To achieve the above purpose, the technical solutions adopted in the embodiments of this application are as follows:

[0007] In a first aspect, the present invention provides an application program installation method, which is applied to a server and includes:

[0008] Obtain an application program package, where the application program package includes: dynamic library files corresponding to at least two processor architectures;

[0009] According to the target processor architecture to which the server belongs, if the application package includes the target dynamic library file corresponding to the target processor architecture, copy the target dynamic library file to the preset installation directory, and copy the first dynamic library files corresponding to other processor architectures to the preset installation directory, where the functions of the first dynamic library files are different from those of the target dynamic library file;

[0010] Run the application corresponding to the application package according to the dynamic library files under the preset installation directory.

[0011] In an alternative embodiment, the file names of the dynamic library files with the same function among the dynamic library files corresponding to each processor architecture are the same;

[0012] Before copying the first dynamic library files corresponding to other processor architectures to the preset installation directory, it further includes:

[0013] According to the file names of the target dynamic library files and the file names of the dynamic library files corresponding to other processor architectures, obtain the dynamic library files with different file names from the file names of the target dynamic library files from the dynamic library files corresponding to other processor architectures as the first dynamic library files.

[0014] In an alternative embodiment, the server is configured to enable a preset dynamic library loading module, and the preset dynamic library loading module is used to run the first dynamic library files corresponding to other processor architectures on the server.

[0015] In an alternative embodiment, the running of the application corresponding to the application package according to the dynamic library files under the preset installation directory includes:

[0016] Determine the processor architecture to which each dynamic library file belongs according to the file content of each dynamic library file under the preset installation directory;

[0017] Use the loading modules corresponding to the processor architectures to which each dynamic library file belongs to load each dynamic library file.

[0018] In an alternative embodiment, the using the loading modules corresponding to the processor architectures to which each dynamic library file belongs to load each dynamic library file includes:

[0019] If it is determined that the dynamic library file to be loaded is the first dynamic library file, use the preset dynamic library loading module to load the first dynamic library file.

[0020] In an alternative embodiment, the using the preset dynamic library loading module to load the first dynamic library file includes:

[0021] If the loading of the first dynamic library file fails using the preset dynamic library loading module, a new dynamic library namespace is created according to the preset creation rule, and the new dynamic library namespace is used to indicate the initial dynamic library files on which the first dynamic library file depends;

[0022] According to the new dynamic library namespace, the first dynamic library file is loaded using the preset dynamic library loading module.

[0023] In an alternative embodiment, determining the processor architecture to which each of the dynamic library files belongs according to the file content of each of the dynamic library files in the preset installation directory includes:

[0024] According to the file content of each of the dynamic library files in the preset installation directory, the target byte value of a preset number of bytes is extracted from each of the file contents;

[0025] According to the target byte value and a preset mapping table, the processor architecture to which each of the dynamic library files belongs is determined, and the preset mapping table includes: the mapping relationship between the byte value and the processor architecture.

[0026] In an alternative embodiment, the server is configured with an application binary interface list, and the application binary interface list includes: at least one type of application binary interface supported by the server;

[0027] Before copying the target dynamic library file corresponding to the target processor architecture to the preset installation directory if the application package includes the target dynamic library file according to the target processor architecture to which the server belongs, further includes:

[0028] According to the application binary interface list supported by the server and a preset selection instruction, the target processor architecture to which the server belongs is determined.

[0029] In an alternative embodiment, the processor architecture includes at least one of the following: ARM architecture, X86 architecture.

[0030] In a second aspect, the present invention provides an application installation device applied to a server, including:

[0031] An acquisition module, configured to acquire an application package, where the application package includes: dynamic library files corresponding to at least two processor architectures;

[0032] A copy module, configured to, according to the target processor architecture to which the server belongs, if the application package includes a target dynamic library file corresponding to the target processor architecture, copy the target dynamic library file to a preset installation directory, and copy a first dynamic library file corresponding to other processor architectures to the preset installation directory, where the functions of the first dynamic library file and the target dynamic library file are different;

[0033] A running module, configured to run the application corresponding to the application package according to the dynamic library files under the preset installation directory.

[0034] In an alternative embodiment, the file names of the dynamic library files with the same function among the dynamic library files corresponding to each processor architecture are the same;

[0035] In an alternative embodiment, the copy module is further configured to, according to the file names of the target dynamic library files and the file names of the dynamic library files corresponding to other processor architectures, obtain, from the dynamic library files corresponding to other processor architectures, a dynamic library file with a file name different from that of the target dynamic library file as the first dynamic library file.

[0036] In an alternative embodiment, the server is configured to enable a preset dynamic library loading module, and the preset dynamic library loading module is used to run the first dynamic library file corresponding to other processor architectures on the server.

[0037] In an alternative embodiment, the running module is specifically configured to determine the processor architecture to which each dynamic library file belongs according to the file content of each dynamic library file under the preset installation directory;

[0038] Use the loading modules corresponding to the processor architectures to which each dynamic library file belongs to load each dynamic library file.

[0039] In an alternative embodiment, the running module is specifically configured to, if it is determined that the loaded dynamic library file is the first dynamic library file, use the preset dynamic library loading module to load the first dynamic library file.

[0040] In an alternative embodiment, the running module is specifically configured to, if the loading of the first dynamic library file using the preset dynamic library loading module fails, create a new dynamic library namespace according to a preset creation rule, where the new dynamic library namespace is used to indicate the initial dynamic library file on which the first dynamic library file depends;

[0041] According to the new dynamic library namespace, use the preset dynamic library loading module to load the first dynamic library file.

[0042] In an alternative embodiment, the running module is specifically configured to extract the target byte values of preset bytes from the file contents of the dynamic library files in the preset installation directory;

[0043] According to the target byte values and a preset mapping table, determine the processor architectures to which the dynamic library files belong, where the preset mapping table includes: the mapping relationship between byte values and processor architectures.

[0044] In an alternative embodiment, the server is configured with a list of application binary interfaces, where the list of application binary interfaces includes: at least one type of application binary interface supported by the server; the copying module is further configured to determine the target processor architecture to which the server belongs according to the list of application binary interfaces supported by the server and a preset selection instruction.

[0045] In an alternative embodiment, the processor architecture includes at least one of the following: arm architecture, x86 architecture.

[0046] In a third aspect, the present invention provides an electronic device, including: a processor, a storage medium, and a bus, where the storage medium stores machine-readable instructions executable by the processor. When the electronic device runs, the processor communicates with the storage medium through the bus, and the processor executes the machine-readable instructions to perform the steps of the application installation method according to any one of the foregoing embodiments.

[0047] In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processor, it performs the steps of the application installation method according to any one of the foregoing embodiments.

[0048] The beneficial effects of this application are:

[0049] An application installation method, device, electronic device, and storage medium provided by an embodiment of the present application are applied to a server and include: obtaining an application package, where the application package includes dynamic library files corresponding to at least two processor architectures; according to the target processor architecture to which the server belongs, if the application package includes a target dynamic library file corresponding to the target processor architecture, then copy the target dynamic library file to a preset installation directory, and copy first dynamic library files corresponding to other processor architectures to the preset installation directory, where the functions of the first dynamic library files are different from those of the target dynamic library file; run the application corresponding to the application package according to the dynamic library files under the preset installation directory. By applying the embodiment of the present application, a set of dynamic library files of the application with relatively complete functions can be included under the preset installation directory. Furthermore, when running the application corresponding to the application package according to the dynamic library files under the preset installation directory, the problem of incomplete extraction of dynamic library files during the installation process can be avoided, ensuring the normal operation of the application. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] To more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only show some embodiments of the present application and should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.

[0051] Figure 1 FIG. [X] is an architecture diagram of a cloud interaction system provided by an embodiment of the present application;

[0052] Figure 2 FIG. [X] is a schematic flowchart of an application installation method provided by an embodiment of the present application;

[0053] Figure 3 FIG. [X] is a schematic flowchart of another application installation method provided by an embodiment of the present application;

[0054] Figure 4 FIG. [X] is a schematic flowchart of yet another application installation method provided by an embodiment of the present application;

[0055] Figure 5 FIG. [X] is a schematic flowchart of another application installation method provided by an embodiment of the present application;

[0056] Figure 6 FIG. [X] is a schematic flowchart of yet another application installation method provided by an embodiment of the present application;

[0057] Figure 7 FIG. [X] is a schematic diagram of the functional modules of an application installation device provided by an embodiment of the present application;

[0058] Figure 8 A schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners

[0059] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Apparently, the described embodiments are some but not all of the embodiments of the present application. Components of the embodiments of the present application generally described and illustrated in the accompanying drawings herein may be arranged and designed in a variety of different configurations.

[0060] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the claimed present application, but merely represents selected embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts fall within the scope of protection of the present application.

[0061] It should be noted that like reference numerals and letters denote like items in the following drawings, and thus, once an item is defined in one drawing, it need not be further defined and explained in subsequent drawings.

[0062] Before introducing the present application, the following explanations are made for relevant terms in the present application:

[0063] ABI: Application Binary Interface. Each operating system provides an ABI for applications running under the system. The ABI contains programming conventions that applications must follow when running under this system.

[0064] x86 architecture: An instruction set processor architecture released by Intel Corporation. Among them, x86, as a version in the x86 architecture, supports 32-bit x86 format, and x86_64, as a version in the x86 architecture, supports 64-bit x86 format.

[0065] arm architecture: A reduced instruction set processor architecture released by arm company; armeabi-v7a, as a version in the arm architecture, supports 32-bit instruction sets, and arm64-v8a, as a version in the arm architecture, supports 64-bit instruction sets.

[0066] PMS: Package Manager Service of the Android system, responsible for the installation and management of applications (Application, App).

[0067] APK: (Android Application Package) is a file format for application packages used by the Android operating system for distributing and installing mobile applications and middleware. For the code of an Android application to run on an Android device, it must first be compiled and then packaged into a file recognizable by the Android system before it can be run, and this file format recognizable and run by the Android system is the "APK".

[0068] NativeBridge: A module (native library running module) in the Android system used to support running native libraries on processors with a binary architecture different from that of the native library.

[0069] NativeLoader: A module in the Android system for loading native libraries.

[0070] Linker: The Android system linker, used to link dynamic link libraries and executable programs and responsible for loading native libraries.

[0071] Cloud gaming is a new way of running games based on cloud computing. In the cloud gaming mode, the rendering of game scenes is completed on the server side. After the rendered game scenes are encoded, they are streamed over the network to the terminals of game players. On the client side, game players no longer need high-end gaming devices and only need basic video decoding capabilities to play games. Currently, there are many ways to implement cloud gaming, and there are also different implementation methods for PC games and mobile games. Among them, one way to implement mobile games is to run an Android container on an x86 architecture server and push the screen in the container to the terminal device.

[0072] When installing a cloud gaming application on an x86 architecture server, since an arm architecture virtual machine can be installed on the x86 architecture server, during actual installation, the x86 architecture server will extract a dynamic library of a certain format from the cloud gaming application package for installation according to the actual architecture. For example, the cloud gaming application package contains both arm and x86 format dynamic libraries. At this time, PMS will extract the dynamic library that best matches the system architecture (for an x86 architecture server, extract the x86 format dynamic library) for installation.

[0073] However, since the existing installation method is relatively simple, there may be an incomplete dynamic library in x86 format in the cloud game application package during the installation process. For example, if a third-party software development kit (SDK) on which the game depends only provides dynamic libraries for the arm architecture, then after installation, this dynamic library will be missing, resulting in the problem that the game cannot run properly.

[0074] In addition, there may be other situations during the installation of the cloud game application. For example, the cloud game application only contains dynamic libraries in x86 format, and there is no problem of selecting an architecture during installation. However, the dynamic libraries of some games are dynamically delivered during runtime (for example, downloaded in the form of a plugin). According to the architecture of the system, the game hot update logic will select the dynamic library of the corresponding architecture for delivery (specifically depending on the game logic). At this time, the dynamically delivered library may be in arm format. Then, there will be a situation where some dynamic libraries in the game application are in arm format and some are in x86 format. In this case, for an x86 architecture server, there will still be a problem that the cloud game cannot run properly.

[0075] In view of this, the embodiments of the present application provide an application installation method. Applying this method can avoid the problem of incomplete extraction of dynamic library files during the installation process and ensure the normal operation of the application.

[0076] Figure 1 A cloud interaction system architecture diagram provided by an embodiment of the present application is as Figure 1 shown. The system may include: a client device 10 and a server 20. Among them, the client device 10 can be connected to the server 20 through a network 30. Optionally, the application installation method provided by the embodiments of the present application can be applied to the server in the cloud interaction system.

[0077] In an alternative embodiment, various cloud applications can run under the cloud interaction system, such as cloud gaming. Taking cloud gaming as an example, cloud gaming refers to a gaming method based on cloud computing. In the operation mode of cloud gaming, the running entity of the game program and the presenting entity of the game screen are separated. The storage and running of the game character transfer method are completed on the cloud gaming server. The role of the client device 10 is for data reception, sending, and presenting the game screen. For example, the client device 10 can be a display device with data transmission function near the user side, such as a mobile terminal, a television, a computer, a personal digital assistant, etc.; however, the terminal device for information processing is the cloud gaming server in the cloud. When playing a game, the player operates the client device 10 to send an operation instruction to the cloud gaming server. The cloud gaming server runs the game according to the operation instruction, encodes and compresses data such as the game screen, returns it to the client device 10 through the network, and finally, decodes it through the client device 10 and outputs the game screen.

[0078] In an alternative embodiment, the terminal device can be a local terminal device. Taking a game as an example, the local terminal device stores the game program and is used to present the game screen. The local terminal device is used to interact with the player through the graphical user interface, that is, conventionally, the game program is downloaded and installed on the electronic device and run. The way the local terminal device provides the graphical user interface to the player can include various methods. For example, it can be rendered and displayed on the display screen of the terminal, or provided to the player through holographic projection. For example, the local terminal device can include a display screen and a processor. The display screen is used to present the graphical user interface, which includes the game screen. The processor is used to run the game, generate the graphical user interface, and control the display of the graphical user interface on the display screen.

[0079] Figure 2 It is a schematic flowchart of a method for installing an application program provided by an embodiment of the present application. The execution entity of this method can be the aforementioned server. For example, it can be a cloud gaming server, which may vary according to the actual application scenario. As Figure 2 shown, this method can include:

[0080] S101. Obtain an application program package, where the application program package includes dynamic library files corresponding to at least two processor architectures.

[0081] Among them, the application package can be a game application package, a chat application, a beauty application, etc., which is not limited here. The type of the processor architecture can include but is not limited to the x86 architecture and the arm architecture. That is, the application package can include: a dynamic library file corresponding to the x86 architecture and a dynamic library file corresponding to the arm architecture. In some embodiments, the application package can specifically be an Android application package, but it is not limited thereto, and it can also be other according to the actual application scenario.

[0082] S102. According to the target processor architecture to which the server belongs, if the application package includes a target dynamic library file corresponding to the target processor architecture, copy the target dynamic library file to a preset installation directory, and copy a first dynamic library file corresponding to other processor architectures to the preset installation directory, where the function of the first dynamic library file is different from that of the target dynamic library file.

[0083] Optionally, the target processor architecture to which the server belongs can be obtained from the configuration information of the server. According to the obtained target processor architecture, specifically during installation, the dynamic library files in the application package can be analyzed to determine whether the application package includes a target dynamic library file corresponding to the target processor architecture. If so, the target dynamic library file can be copied to the preset installation directory. In this case, in order to avoid the problem of missing dynamic library files during the subsequent application loading process, the first dynamic library file corresponding to other processor architectures should also be copied to the preset installation directory. It can be understood that when copying the dynamic library files corresponding to other processor architectures, in order to avoid duplicate copying, the first dynamic library file corresponding to other processor architectures in the application package can be copied to the preset installation directory, and the function of the first dynamic library file is different from that of the target dynamic library file.

[0084] Of course, it should be noted that the target dynamic library file corresponding to the target processor architecture can include one or more, which is not limited here, and the first dynamic library file can also include one or more, which is not limited here.

[0085] Optionally, the preset installation directory can be the default installation directory or the installation directory specified by the user before installation, which is not limited here; the server can be a cloud server, and specifically can be a cloud game server, etc. according to the actual application scenario, which is not limited here.

[0086] S103. Run the application corresponding to the application package according to the dynamic library files under the preset installation directory.

[0087] Based on the above description, it can be seen that at this time, the preset installation directory includes the target dynamic library files corresponding to the target processor architecture and the first dynamic library files corresponding to other processor architectures with different functions from those of the target dynamic library files. That is, the preset installation directory includes a set of dynamic library files of the application program with relatively complete functions. At this time, the application program corresponding to the application program package can be run according to the dynamic library files in the preset installation directory, avoiding the problem of incomplete dynamic library files extracted during the running process and ensuring the normal operation of the application program.

[0088] In summary, the embodiment of the present application provides an application program installation method applied to a server, including: obtaining an application program package, where the application program package includes dynamic library files corresponding to at least two processor architectures; according to the target processor architecture to which the server belongs, if the application program package includes the target dynamic library files corresponding to the target processor architecture, then copy the target dynamic library files to the preset installation directory, and copy the first dynamic library files corresponding to other processor architectures to the preset installation directory, where the functions of the first dynamic library files are different from those of the target dynamic library files; run the application program corresponding to the application program package according to the dynamic library files in the preset installation directory. By applying the embodiment of the present application, it can be ensured that the preset installation directory includes a set of dynamic library files of the application program with relatively complete functions. Furthermore, when running the application program corresponding to the application program package according to the dynamic library files in the preset installation directory, the problem of incomplete dynamic library files extracted during the running process can be avoided, and the normal operation of the application program can be ensured.

[0089] It can also be seen that the server in the present application can be an x86 server. In this way, when installing an application program on the x86 server, it is not necessary to upgrade the hardware of the x86 server to ensure the normal operation of the application program. A large number of existing x86 servers can be fully utilized, reducing the hardware cost and further reducing the installation cost. In some embodiments, in order to improve the development efficiency of the present application, optionally, it can be improved on the basis of the existing installation method. For example, it can be improved based on the apk installation process in PMS, but not limited thereto.

[0090] Optionally, the file names of the dynamic library files with the same functions in the dynamic library files corresponding to each processor architecture are the same. For example, an application program package includes dynamic library files A1 and A2 corresponding to the arm processor architecture, and dynamic library files B1, B2, and B3 corresponding to the x86 processor architecture. If the function of dynamic library file A1 is the same as that of dynamic library file B1, then the file names of dynamic library file A1 and dynamic library file B1 can be configured to be the same. Optionally, for the application program package, the dynamic library files corresponding to different processor architectures can be placed in different file directories to distinguish the dynamic library files corresponding to different processor architectures through the file directory identifiers.

[0091] According to this principle, the following method can be referred to obtain the first dynamic library file, and the specific content is as follows. Optionally, before copying the first dynamic library file corresponding to other processor architectures to the preset installation directory, it further includes:

[0092] According to the file names of each target dynamic library file and the file names of the dynamic library files corresponding to other processor architectures, obtain the dynamic library files with different file names from the target dynamic library files from the dynamic library files corresponding to other processor architectures as the first dynamic library files.

[0093] Among them, the file names of each target dynamic library file and the file names of the dynamic library files corresponding to other processor architectures can be obtained. According to the file names of the two, obtain the dynamic library files with different file names from the target dynamic library files from the dynamic library files corresponding to other processor architectures. It can be understood that the dynamic library files obtained at this time can be used as the first dynamic library files. Of course, the obtaining method of the first dynamic library file is not limited to this. According to the actual application scenario, it can also be obtained according to a preset configuration table. The preset configuration table can include the difference information between the dynamic library files corresponding to any processor architecture in the application package and the dynamic library files corresponding to other processor architectures. According to this difference information, the first dynamic library file can be obtained.

[0094] Optionally, the server is configured to enable a preset dynamic library loading module, and the preset dynamic library loading module is used to run the first dynamic library file corresponding to other processor architectures on the server.

[0095] In some embodiments, the preset dynamic library loading module can be a NativeBridge module, or other modules with the same or similar functions as the NativeBridge module, which are not limited herein. Through this configuration, it can be ensured that in any case, when the application package includes dynamic library files corresponding to multiple processor architectures, each dynamic library file can still be loaded normally, and the applications installed according to the application package can run normally. Taking an x86 architecture server as an example, when the target dynamic library file of the x86 architecture and the first dynamic library file of the arm architecture are included in the preset installation directory, each dynamic library file can be loaded normally and the application can run normally. The application of the arm architecture server is similar and will not be elaborated here. It should be noted that the x86 architecture server described in this application refers to that the hardware of the server is of the x86 architecture, and the arm architecture server refers to that the hardware of the server is of the arm architecture.

[0096] For example, when the target processor architecture to which the server belongs is the x86 architecture and the other processor architecture is the arm architecture, the server is configured to enable a preset dynamic library loading module. Through this configuration, the first dynamic library file corresponding to the arm architecture can run on the x86 architecture server.

[0097] Figure 3 The flowchart of another application installation method provided by the embodiments of this application. Optionally, as Figure 3 shown, running the application corresponding to the application package according to each dynamic library file in the preset installation directory includes:

[0098] S301. Determine the processor architecture to which each dynamic library file belongs according to the file content of each dynamic library file in the preset installation directory.

[0099] S302. Use the loading module corresponding to the processor architecture to which each dynamic library file belongs to load each dynamic library file.

[0100] It can be understood that since the preset installation directory includes the target dynamic library file corresponding to the target processor architecture and the first dynamic library file corresponding to other processor architectures with different functions from the target dynamic library file, when running the application on the server corresponding to the target processor architecture, the target dynamic library file and the first dynamic library file should be loaded using different loading modules to ensure successful loading. Therefore, during specific operation, the file content of each dynamic library file in the preset installation directory can be read, and the processor architecture to which each dynamic library file belongs can be determined according to this file content. Among them, if the processor architecture to which a certain dynamic library file belongs is the target processor architecture, the local loading module in the server corresponding to the target processor architecture can be used for loading.

[0101] For example, if the target processor architecture is the x86 architecture and the processor architecture to which a certain dynamic library file belongs is the x86 architecture, the local loading module in the x86 architecture server can be used for loading. Optionally, the dlopen module can be used for loading, the linker module can be used for method registration, symbol resolution, etc., which are not limited here.

[0102] Optionally, using the loading module corresponding to the processor architecture to which each dynamic library file belongs to load each dynamic library file includes:

[0103] If it is determined that the loaded dynamic library file is the first dynamic library file, use the preset dynamic library loading module to load the first dynamic library file.

[0104] Referring to the above description of the preset dynamic library loading module, it can be understood that if the loaded dynamic library file is the first dynamic library file, then the local loading module may have the problem of being unable to recognize it. At this time, the preset dynamic library loading module can be used to load the first dynamic library file, and the instruction transcoder can be cooperated to perform method registration, symbol resolution, etc., so as to convert the first dynamic library file into a dynamic library file recognizable by the target processor architecture for loading, so as to ensure that the first dynamic library file corresponding to other processor architectures with different functions from the target dynamic library file can be normally loaded on the server corresponding to the target processor architecture.

[0105] It is understandable that since dynamic libraries are generally not independent and will depend on other dynamic libraries, including the user's own or the system's built-in libraries, when they depend on other dynamic libraries, they need to find the corresponding dependent libraries in the search path for loading before loading themselves. Therefore, if the search path is incorrect, the loading may not be successful at this time. In this case, you can refer to the following method to solve the problem.

[0106] Figure 4 A flowchart of another application installation method provided in an embodiment of the present application. Figure 4 As shown, the above-mentioned use of a preset dynamic library loading module to load the first dynamic library file includes:

[0107] S401: If loading the first dynamic library file using a preset dynamic library loading module fails, a new dynamic library namespace is created according to a preset creation rule, and the new dynamic library namespace is used to indicate an initial dynamic library file on which the first dynamic library file depends.

[0108] S402: According to the new dynamic library namespace, a preset dynamic library loading module is used to load the first dynamic library file.

[0109] Among them, if the use of the preset dynamic library loading module to load the first dynamic library file fails, it means that the first dynamic library file depends on other dynamic libraries. In this case, a new dynamic library namespace can be created according to the cause of the failure and the preset creation rules, so that the new dynamic library namespace indicates the initial dynamic library file on which the first dynamic library file depends. At this time, the first dynamic library file can be successfully loaded using the preset dynamic library loading module according to the new dynamic library namespace.

[0110] Optionally, other dynamic libraries that the first dynamic library file depends on may be public dynamic libraries of the x86 architecture, other dynamic libraries that come with the application, etc., which are not limited here and may vary according to actual application scenarios.

[0111] Figure 5 A flowchart of another application installation method provided in an embodiment of the present application.Figure 5 As shown in Figure 5 , determining the processor architecture to which each dynamic library file belongs according to the file content of each dynamic library file in the preset installation directory includes:

[0112] S501. Extract the target byte value of the preset byte in the file content of each dynamic library file according to the file content of each dynamic library file in the preset installation directory.

[0113] S502. Determine the processor architecture to which each dynamic library file belongs according to the target byte value and the preset mapping table. The preset mapping table includes: the mapping relationship between the byte value and the processor architecture.

[0114] Optionally, the preset byte can be any single byte, multi-byte, etc. in the file content, which is not limited herein. Among them, the preset mapping table includes: the mapping relationship between the byte value and the processor architecture. Optionally, when the preset mapping relationship is that the byte values are 0x0028, 0x00b7, 0x0003, 0x003e, the corresponding versions of the processor architecture are armeabi-v7a, arm64-v8a, x86, x86_64, respectively, but not limited thereto.

[0115] Among them, for any dynamic library file in the preset installation directory, the target byte value of the preset byte in the file content of the dynamic library file can be extracted. Referring to the preset mapping table, the processor architecture corresponding to the target byte value can be determined, that is, the processor architecture to which the dynamic library file belongs can be determined.

[0116] Exemplarily, for a certain dynamic library file, the target byte value of the double byte of the 18th and 19th bytes in the file content of the dynamic library file can be extracted. Optionally, if the target byte value is 0x00b7, it means that the version of the processor architecture corresponding to the dynamic library file is arm64-v8a.

[0117] Optionally, the server is configured with an application binary interface list, and the application binary interface list includes: at least one type of application binary interface supported by the server.

[0118] Among them, through the application binary interface list, the type of the binary interface of the dynamic library file supported by the server can be known, that is, the type of the binary interface of the dynamic library file that the server can load. It should be noted that the server can support, which can be that the server's hardware can support, or that the server can support through an emulator or installing a virtual machine, which is not limited herein.

[0119] Exemplarily, a list of application binary interfaces is [arm64-v8a, armeabi-v7a], indicating that the server corresponding to the target processing architecture supports application binary interfaces of arm 64-bit and arm 32-bit. Alternatively, a list of application binary interfaces is [x86, x86_64, armeabi-v7a, arm64-v8a], indicating that the server corresponding to the target processing architecture supports application binary interfaces of x86 32-bit, x86 64-bit, arm32-bit, and arm 32-bit.

[0120] Figure 6 FIG. is a schematic flowchart of another application installation method provided by an embodiment of the present application. Optionally, as Figure 6 shown, before copying the target dynamic library file corresponding to the target processor architecture to the preset installation directory if it is determined that the application package includes the target dynamic library file corresponding to the target processor architecture according to the target processor architecture to which the server belongs, it further includes:

[0121] S601. Determine the target processor architecture to which the server belongs according to the list of application binary interfaces supported by the server and the preset selection instruction.

[0122] In some application scenarios, in order to improve the applicability of the method of the present application and facilitate the user to install an application in the target processor architecture specified in the server, optionally, the target application binary interface type can be selected from the list of application binary interfaces supported by the server according to the preset selection instruction, and according to the target application binary interface type, the target processor architecture to which the server belongs is specified, that is, the processor architecture environment in which the server installs the application. Based on the foregoing description, the target dynamic library file corresponding to the target processor architecture can be matched in the application package according to the target application binary interface type.

[0123] Optionally, after determining the target processor architecture to which the server belongs, the first dynamic library file can be determined according to the arrangement order of each application binary interface type in the list of application binary interfaces. For example, it is possible to traverse from the beginning of the list of application binary interfaces to determine the processor architecture corresponding to the first dynamic library file copied to the preset installation directory, but the specific determination method is not limited thereto.

[0124] Optionally, the foregoing processor architecture may include at least one of the following: arm architecture, x86 architecture. Of course, according to the iteration and update of the processor architecture, other types of processor architectures may also be included, which are not limited herein.

[0125] Figure 7The figure is a schematic diagram of the functional modules of an application installation device provided by an embodiment of the present application, which is applied to a server. The basic principle and technical effects of this device are the same as those of the corresponding method embodiment described above. For the sake of brief description, for the parts not mentioned in this embodiment, reference can be made to the corresponding content in the method embodiment. As Figure 7 shown, the application installation device 100 includes:

[0126] An acquisition module 110, configured to acquire an application package, where the application package includes: dynamic library files corresponding to at least two processor architectures;

[0127] A copy module 120, configured to, according to the target processor architecture to which the server belongs, if the application package includes a target dynamic library file corresponding to the target processor architecture, copy the target dynamic library file to a preset installation directory, and copy first dynamic library files corresponding to other processor architectures to the preset installation directory, where the functions of the first dynamic library files are different from those of the target dynamic library file;

[0128] A running module 130, configured to run the application corresponding to the application package according to the dynamic library files in the preset installation directory.

[0129] In an alternative embodiment, the file names of the dynamic library files with the same function in the dynamic library files corresponding to each processor architecture are the same;

[0130] In an alternative embodiment, the copy module 120 is further configured to, according to the file names of the target dynamic library files and the file names of the dynamic library files corresponding to other processor architectures, obtain, from the dynamic library files corresponding to other processor architectures, dynamic library files with file names different from those of the target dynamic library files as the first dynamic library files.

[0131] In an alternative embodiment, the server is configured to enable a preset dynamic library loading module, and the preset dynamic library loading module is used to run the first dynamic library files corresponding to other processor architectures on the server.

[0132] In an alternative embodiment, the running module 130 is specifically configured to determine the processor architectures to which the dynamic library files belong according to the file contents of the dynamic library files in the preset installation directory;

[0133] Use the loading modules corresponding to the processor architectures to which the dynamic library files belong to load the dynamic library files.

[0134] In an alternative embodiment, the running module 130 is specifically configured to, if it is determined that the loaded dynamic library file is the first dynamic library file, load the first dynamic library file by using the preset dynamic library loading module.

[0135] In an alternative embodiment, the running module 130 is specifically configured to, if the loading of the first dynamic library file by using the preset dynamic library loading module fails, create a new dynamic library namespace according to a preset creation rule, where the new dynamic library namespace is used to indicate the initial dynamic library file on which the first dynamic library file depends;

[0136] According to the new dynamic library namespace, load the first dynamic library file by using the preset dynamic library loading module.

[0137] In an alternative embodiment, the running module 130 is specifically configured to extract the target byte value of a preset byte from the file content of each dynamic library file in the preset installation directory;

[0138] According to the target byte value and a preset mapping table, determine the processor architecture to which each dynamic library file belongs, where the preset mapping table includes: the mapping relationship between the byte value and the processor architecture.

[0139] In an alternative embodiment, the server is configured with an application binary interface list, where the application binary interface list includes: at least one type of application binary interface supported by the server; the copying module 120 is further configured to determine the target processor architecture to which the server belongs according to the application binary interface list supported by the server and a preset selection instruction.

[0140] In an alternative embodiment, the processor architecture includes at least one of the following: arm architecture, x86 architecture.

[0141] The above device is used to execute the method provided in the foregoing embodiment, and its implementation principle and technical effects are similar, which will not be elaborated here.

[0142] The above modules may be one or more integrated circuits configured to implement the above methods. For example, one or more Application Specific Integrated Circuits (ASICs), or one or more microprocessors, or one or more Field Programmable Gate Arrays (FPGAs), etc. For another example, when a certain above module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processors that can call program code. For yet another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0143] Figure 8 Schematic diagram of the structure of an electronic device provided by an embodiment of the present application. As Figure 8 shown, the electronic device may include: a processor 210, a storage medium 220, and a bus 230. The storage medium 220 stores machine-readable instructions executable by the processor 210. When the electronic device is running, the processor 210 communicates with the storage medium 220 through the bus 230, and the processor 210 executes the machine-readable instructions to perform the steps of the above method embodiment. The specific implementation manners and technical effects are similar and will not be elaborated here.

[0144] Optionally, the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processor, it executes the steps of the above method embodiment. The specific implementation manners and technical effects are similar and will not be elaborated here.

[0145] In several embodiments provided by the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other may be through some interfaces. The indirect couplings or communication connections of devices or units may be in electrical, mechanical or other forms.

[0146] The unit described as a separation component may or may not be physically separated. The component shown as a unit may or may not be a physical unit, that is, it may be located in one place or may be distributed across multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0147] In addition, in each embodiment of the present application, each functional unit may be integrated in a processing unit, may exist separately as individual physical units, or two or more units may be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of hardware plus software functional units.

[0148] The above-mentioned integrated units implemented in the form of software functional units can be stored in a computer-readable storage medium. The above-mentioned software functional units stored in a storage medium include several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to execute some steps of the methods in each embodiment of the present application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (English: Read-Only Memory, abbreviated as: ROM), random access memories (English: Random Access Memory, abbreviated as: RAM), magnetic disks, or optical discs that can store program codes.

[0149] It should be noted that in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of another identical element in the process, method, article or device including the element.

[0150] The above are only the preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the protection scope of the present application. It should be noted that similar reference numerals and letters indicate similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. The above are only the preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the protection scope of the present application.

Claims

1. An application installation method, characterized in that, applied to a server, including: obtaining an application package, where the application package includes: dynamic library files corresponding to at least two processor architectures; according to the target processor architecture to which the server belongs, if the application package includes a target dynamic library file corresponding to the target processor architecture, then copy the target dynamic library file to a preset installation directory, and copy first dynamic library files corresponding to other processor architectures to the preset installation directory, where the functions of the first dynamic library files are different from those of the target dynamic library file; running an application corresponding to the application package according to each dynamic library file under the preset installation directory; the file names of the dynamic library files with the same function in the dynamic library files corresponding to each processor architecture are the same; before copying the first dynamic library files corresponding to other processor architectures to the preset installation directory, further including: obtaining, from the dynamic library files corresponding to other processor architectures, dynamic library files with file names different from those of the target dynamic library file as the first dynamic library files according to the file names of the target dynamic library files and the file names of the dynamic library files corresponding to other processor architectures.

2. The method according to claim 1, characterized in that, the server is configured to enable a preset dynamic library loading module, and the preset dynamic library loading module is used to run the first dynamic library files corresponding to other processor architectures on the server.

3. The method according to claim 2, characterized in that, the running the application corresponding to the application package according to each dynamic library file under the preset installation directory includes: determining the processor architecture to which each dynamic library file belongs according to the file content of each dynamic library file under the preset installation directory; loading each dynamic library file by using a loading module corresponding to the processor architecture to which each dynamic library file belongs.

4. The method according to claim 3, characterized in that, the loading each dynamic library file by using a loading module corresponding to the processor architecture to which each dynamic library file belongs includes: if it is determined that the dynamic library file to be loaded is the first dynamic library file, then loading the first dynamic library file by using the preset dynamic library loading module.

5. The method according to claim 4, characterized in that, the loading the first dynamic library file by using the preset dynamic library loading module includes: if the loading of the first dynamic library file by using the preset dynamic library loading module fails, then creating a new dynamic library namespace according to a preset creation rule, where the new dynamic library namespace is used to indicate the initial dynamic library file on which the first dynamic library file depends; loading the first dynamic library file by using the preset dynamic library loading module according to the new dynamic library namespace.

6. The method according to claim 3, characterized in that, the determining the processor architecture to which each dynamic library file belongs according to the file content of each dynamic library file under the preset installation directory includes: Extract the target byte values of preset bytes from the file contents of each of the dynamic library files in the preset installation directory; Determine the processor architecture to which each of the dynamic library files belongs according to the target byte values and a preset mapping table, where the preset mapping table includes the mapping relationship between byte values and processor architectures.

7. The method according to claim 1, wherein, the server is configured with an application binary interface list, and the application binary interface list includes at least one type of application binary interface supported by the server; before copying the target dynamic library file to the preset installation directory if the application package includes the target dynamic library file corresponding to the target processor architecture according to the target processor architecture to which the server belongs, further comprising: Determine the target processor architecture to which the server belongs according to the application binary interface list supported by the server and a preset selection instruction.

8. The method according to any one of claims 1-7, wherein, the processor architecture includes at least one of the following: arm architecture, x86 architecture.

9. An application installation device, wherein, applied to a server, comprising: an acquisition module, configured to acquire an application package, where the application package includes dynamic library files corresponding to at least two processor architectures; a copying module, configured to copy the target dynamic library file to the preset installation directory if the application package includes the target dynamic library file corresponding to the target processor architecture according to the target processor architecture to which the server belongs, and copy the first dynamic library files corresponding to other processor architectures to the preset installation directory, where the functions of the first dynamic library files are different from those of the target dynamic library files; a running module, configured to run the application corresponding to the application package according to the dynamic library files in the preset installation directory; the file names of the dynamic library files with the same function in the dynamic library files corresponding to each of the processor architectures are the same; the copying module is further configured to obtain, as the first dynamic library files, the dynamic library files with file names different from those of the target dynamic library files from the dynamic library files corresponding to other processor architectures according to the file names of the target dynamic library files and the file names of the dynamic library files corresponding to other processor architectures.

10. An electronic device, wherein, comprising: a processor, a storage medium, and a bus, where the storage medium stores machine-readable instructions executable by the processor. When the electronic device runs, the processor communicates with the storage medium through the bus, and the processor executes the machine-readable instructions to perform the steps of the application installation method according to any one of claims 1-8.

11. A computer-readable storage medium, wherein, a computer program is stored on the computer-readable storage medium, and when the computer program is run by a processor, it performs the steps of the application installation method according to any one of claims 1-8.

Citation Information

Patent Citations

  • Loading and linking method and device of dynamic link library

    CN103365668A

  • Shelled dynamic link library loading method and device

    CN110378081A