Application program compiling method, running method and electronic device

By storing the application's target image on the server during the compilation process and replacing it with a solid-color placeholder image, the problem of excessively large installation package size is solved, thereby reducing download traffic and time on terminal devices.

CN114756237BActive Publication Date: 2026-05-19TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2021-01-11
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

In current technologies, how to effectively process images to reduce the size of the installation package during application compilation has become a research hotspot, especially how to reduce the bandwidth and time consumed by terminal devices when downloading the installation package.

Method used

During compilation, the target image in the application is stored in an image storage server, and a solid color placeholder image with the same size information as the target image is used to replace the target image and packaged into the installation package. At runtime, the target image is retrieved from the server for display.

Benefits of technology

The installation package size was reduced, logical errors were avoided, and the data usage and time consumption for terminal devices to download the installation package were reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114756237B_ABST
    Figure CN114756237B_ABST
Patent Text Reader

Abstract

The embodiment of the application discloses a kind of application program's compiling method, running method and electronic equipment, applied to computer technology field, especially applied to the compilation and running field of application program.The method comprises the following steps: when the target application program is compiled, the target picture in the target application program is obtained, and the target picture is stored in the picture storage server;The placeholder corresponding to the target picture is obtained, and the placeholder corresponding to the target picture and other data of the target application program are compiled and handled to obtain the installation package corresponding to the target application program, wherein the placeholder corresponding to the target picture refers to the monochrome picture with the same size information as the target picture.The size of the installation package corresponding to the target application program can be reduced by the application, so as to reduce the traffic and time consumed by the terminal device in downloading the installation package.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method for compiling an application, a method for running an application, and an electronic device. Background Technology

[0002] With the continuous development of computer technology, users can run applications on their terminal devices to meet their needs for communication, social interaction, or entertainment. These applications can be mobile applications (APPs), which are designed to run on mobile terminal devices such as smartphones and tablets. APPs are also known as mobile software, mobile applications, mobile applications, mobile apps, etc.

[0003] If a user wants to run an application on a terminal device, they need to download the corresponding installation package for that application before running it, such as an Android application package (APK). An APK is an application package file format used by the Android operating system, created by compiling the app code intended to run on an Android device. This APK can be recognized by the Android system, and terminal devices supporting the Android system can run the application corresponding to that APK to meet user needs. APKs can also be used to distribute and install mobile applications and middleware. An APK file contains compiled code files (.dex files), resources, native resource files (assets), certificates, and a manifest file.

[0004] The installation package for any application is compiled from that application. An application may contain one or more images, so the compilation process involves processing these images. Therefore, how to effectively process images within an application to reduce its installation package size has become a hot research topic. Summary of the Invention

[0005] This invention provides a method for compiling an application, a method for running the application, and an electronic device that can optimize the size of the installation package corresponding to the target application, thereby reducing the data traffic and time consumed by the terminal device in downloading the installation package.

[0006] On one hand, embodiments of the present invention provide a method for compiling an application, including:

[0007] When compiling the target application, the target image in the target application is obtained and stored in the image storage server;

[0008] Obtain the placeholder image corresponding to the target image. The placeholder image corresponding to the target image refers to a solid color image with the same size information as the target image.

[0009] The placeholder image corresponding to the target image and other data of the target application are compiled and processed to obtain the installation package corresponding to the target application.

[0010] On one hand, embodiments of the present invention provide a method for running an application, applied to a terminal device, wherein the terminal device has an installation package corresponding to the target application installed. The installation package corresponding to the target application is obtained by compiling and processing a placeholder image corresponding to a target image in the target application and other data of the target application during the compilation of the target application. The placeholder image corresponding to the target image refers to a solid color image with the same size information as the target image. The method includes:

[0011] When the target application is run, if an image display event is detected, the image to be displayed is obtained based on the installation package corresponding to the target application; the image to be displayed is then displayed.

[0012] On one hand, embodiments of the present invention provide an application compilation apparatus, the apparatus comprising:

[0013] The acquisition unit is used to acquire the target image in the target application during the compilation of the target application;

[0014] Storage unit, used to store target images to image storage server;

[0015] The acquisition unit is further configured to acquire a placeholder image corresponding to the target image, wherein the placeholder image corresponding to the target image refers to a solid color image with the same size information as the target image;

[0016] The processing unit is used to compile and process the placeholder image corresponding to the target image and other data of the target application to obtain the installation package corresponding to the target application.

[0017] In one embodiment, the obtaining unit is further configured to obtain the storage address of the target image from the image storage server; the processing unit is further configured to package the storage address of the target image into the installation package corresponding to the target application.

[0018] In one embodiment, the target application also includes other images besides the target image, which are packaged into the installation package corresponding to the target application during the compilation of the target application.

[0019] In one embodiment, the target image is obtained by expanding a preset image in the target application. The target image and the preset image have the same image content but different image attribute information, including any one or more of image resolution and image format.

[0020] On one hand, embodiments of the present invention provide an application running device, which installs an installation package corresponding to a target application. The installation package is obtained by compiling a placeholder image corresponding to a target image in the target application and other data of the target application during the compilation of the target application. The placeholder image corresponding to the target image refers to a solid color image with the same size information as the target image. The device includes:

[0021] The acquisition unit is used to acquire the image to be displayed based on the installation package corresponding to the target application if an image display event is detected when the target application is running.

[0022] The display unit is used to display the image to be displayed.

[0023] In one embodiment, the target image is stored in an image storage server, and the installation package includes the storage address of the target image. If an image display event is detected, when the acquisition unit obtains the image to be displayed based on the installation package corresponding to the target application, it performs the following steps:

[0024] If an image display event is detected, determine the image to be loaded in the target application;

[0025] If the image to be loaded is the target image, then the storage address of the target image is obtained from the installation package, and the target image is retrieved from the image storage server based on the storage address as the image to be displayed.

[0026] In one embodiment, when the acquisition unit obtains the storage address of the target image from the installation package and retrieves the target image from the image storage server based on the storage address, it performs the following steps:

[0027] If the target image has not been downloaded by the terminal device, the storage address of the target image is obtained from the installation package, and the target image is retrieved from the image storage server based on the storage address.

[0028] In one embodiment, the display unit is further configured to obtain a placeholder image from the installation package when the target image has not been downloaded by the terminal device; when displaying the image to be displayed, the display unit performs the following steps: when the target image is obtained from the image storage server, the placeholder image is replaced with the target image.

[0029] In one embodiment, the target image is obtained by expanding a preset image in the target application. The target image has the same image content as the preset image but different image attribute information. The image attribute information includes any one or more of image resolution and image format; and the image attribute information of the target image is the same as the image attributes supported by the terminal device.

[0030] On one hand, embodiments of the present invention provide an electronic device, including:

[0031] A processor, adapted to implement one or more instructions; and

[0032] A computer storage medium storing one or more instructions adapted to be loaded and executed by the processor:

[0033] When compiling the target application, the target image in the target application is obtained and stored in the image storage server; the placeholder image corresponding to the target image is obtained, which is a solid color image with the same size information as the target image; the placeholder image and other data of the target application are compiled and processed to obtain the installation package corresponding to the target application.

[0034] Alternatively, one or more instructions may be loaded and executed by the processor:

[0035] When the target application is run, if an image display event is detected, the image to be displayed is obtained based on the installation package corresponding to the target application; the image to be displayed is then displayed.

[0036] The electronic device contains an installation package corresponding to the target application. The installation package is obtained by compiling the placeholder image corresponding to the target image and other data of the target application during the compilation of the target application. The placeholder image corresponding to the target image is a solid color image with the same size information as the target image.

[0037] On one hand, embodiments of the present invention provide a computer storage medium, characterized in that the computer storage medium stores computer program instructions, which, when executed by a processor, are used to perform:

[0038] When compiling the target application, the target image in the target application is obtained and stored in the image storage server;

[0039] Obtain the placeholder image corresponding to the target image. The placeholder image corresponding to the target image refers to a solid color image with the same size information as the target image.

[0040] The placeholder image corresponding to the target image and other data of the target application are compiled and processed to obtain the installation package corresponding to the target application.

[0041] Alternatively, when the computer program instructions are executed by the processor, they are also used to perform:

[0042] When the target application is run, if an image display event is detected, the image to be displayed is obtained based on the installation package corresponding to the target application; the image to be displayed is then displayed.

[0043] The installation package corresponding to the target application is obtained by compiling the placeholder image corresponding to the target image and other data of the target application during the compilation of the target application. The placeholder image corresponding to the target image refers to a solid color image with the same size information as the target image.

[0044] On one hand, embodiments of the present invention provide a computer program product or a computer program, the computer program product including a computer program stored in a computer storage medium; a server's processor reads the computer instructions from the computer storage medium, and the processor executes:

[0045] When compiling the target application, the target image in the target application is obtained and stored in an image storage server; a placeholder image corresponding to the target image is obtained, wherein the placeholder image is a solid color image with the same size information as the target image; the placeholder image and other data of the target application are compiled to obtain the installation package corresponding to the target application.

[0046] The processor of the terminal device reads the computer instructions from the computer storage medium and executes the computer instructions: when the target application is running, if an image display event is detected, the processor obtains the image to be displayed based on the installation package corresponding to the target application and displays the image to be displayed.

[0047] The installation package corresponding to the target application is obtained by compiling the placeholder image corresponding to the target image and other data of the target application during the compilation of the target application. The placeholder image corresponding to the target image refers to a solid color image with the same size information as the target image.

[0048] In this embodiment of the invention, when compiling the target application, a target image is obtained from the target application and stored in an image storage server; a placeholder image corresponding to the target image is obtained, which is a solid color image with the same size information as the target image; the placeholder image and other data of the target application are compiled to obtain the installation package corresponding to the target application. It should be understood that the size of an image is closely related to its size and color information. Generally, the larger the size and the more colors, the larger the size. Compared with the target image, the placeholder image has fewer colors, therefore its size is smaller. Packaging the placeholder image instead of the target image into the application's installation package can reduce the size of the installation package while avoiding logical errors in the target application. Furthermore, since the target image in the target application is stored in the image storage server, it can be retrieved from the image storage server when it needs to be displayed later, without needing to be loaded from the installation package. This avoids the target image being downloaded along with the installation package of the target application during upgrades, thus preventing unnecessary bandwidth consumption. Attached Figure Description

[0049] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0050] Figure 1 This is a schematic diagram of the structure of an application management system provided in an embodiment of the present invention;

[0051] Figure 2 This is a flowchart illustrating an application compilation method provided in an embodiment of the present invention;

[0052] Figure 3a This is a schematic diagram of a target image provided in an embodiment of the present invention;

[0053] Figure 3b This is a schematic diagram of a placeholder image corresponding to a target image provided in an embodiment of the present invention;

[0054] Figure 4 This is a flowchart illustrating another method for compiling an application provided in an embodiment of the present invention;

[0055] Figure 5 This is a flowchart illustrating an application running method provided in an embodiment of the present invention;

[0056] Figure 6aThis is a schematic diagram of the interface before refresh provided in an embodiment of the present invention;

[0057] Figure 6b This is a schematic diagram of a refreshed interface provided in an embodiment of the present invention;

[0058] Figure 7 This is a flowchart illustrating another method for running an application provided in an embodiment of the present invention;

[0059] Figure 8 This is a flowchart illustrating another method for running an application provided in an embodiment of the present invention;

[0060] Figure 9 This is a schematic diagram of the structure of an application compilation device provided in an embodiment of the present invention;

[0061] Figure 10 This is a schematic diagram of the structure of an application running device provided in an embodiment of the present invention;

[0062] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention;

[0063] Figure 12 This is a schematic diagram of the structure of another electronic device provided in an embodiment of the present invention. Detailed Implementation

[0064] To enable those skilled in the art to better understand the present invention, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0065] This application provides a method for compiling an application during the compilation phase. This method extracts the target image from the application during compilation, stores it in an image storage server, and uses a solid-color placeholder image to represent the image's position, preventing internal logic errors. The solid-color placeholder image is packaged along with other application data into the installation package, reducing the package size and thus reducing the bandwidth and time consumed by the terminal device downloading the installation package. Correspondingly, this application also provides a method for running the application during the runtime phase, allowing the application to be run based on the installation package obtained from the above compilation method.

[0066] To implement the compilation and execution methods of the above-mentioned applications, this embodiment of the invention provides an application management system. Please refer to [link to relevant documentation]. Figure 1 This is a schematic diagram of the structure of an application management system provided in an embodiment of the present invention. The application management system includes, but is not limited to, one or more compilation servers, one or more image storage servers, and one or more terminal devices. Figure 1 Taking a compilation server 101, an image storage server 102, and a terminal device 103 as an example, the compilation server 101, the image storage server 102, and the terminal device 103 can establish a wireless link for communication. Figure 1 The number and form of the devices shown are for illustrative purposes and do not constitute a limitation on the embodiments of the present invention.

[0067] The compilation server 101 can be used to execute the compilation method of the application provided in the embodiment of the present invention to compile any application into a corresponding installation package; the image storage server 102 can be used to store the target image of any application; and the terminal device 103 can execute the running method of the application provided in the embodiment of the present invention to run any application on the terminal device.

[0068] Optionally, the image storage server 102 can be a node device in a blockchain. In this way, the images stored in the image storage server 102 are stored on the blockchain. Due to the immutability of the blockchain, the security of the images stored in the image storage server 102 is guaranteed.

[0069] The image storage server 102 can be a Content Delivery Network (CDN) server. This CDN server supports CDN technology. A CDN is a network of interconnected computers connected via the internet that utilizes servers located closest to each user to deliver music, images, videos, applications, and other files to users faster and more reliably. Delivering network content to users via a CDN offers advantages such as high performance, scalability, and low cost.

[0070] Terminal device 103 can be referred to as user equipment (UE). Terminal device 103 can be a mobile phone, a computer with wireless transceiver capabilities, a virtual reality (VR) terminal, an augmented reality (AR) terminal, a wireless terminal in self-driving vehicles, a wireless terminal in remote medical care, a wireless terminal in a smart grid, a wireless terminal in transportation safety, or wearable devices such as smartwatches and wristbands.

[0071] Based on the application management system described above, this embodiment of the invention provides a method for compiling an application. Please refer to... Figure 2 This is a flowchart illustrating a method for compiling an application provided in an embodiment of the present invention. This method for compiling the application can be applied to... Figure 1 The application's management system is executed by the compilation server, specifically by the compilation server's processor. The compilation method for this application includes the following steps:

[0072] S201. When compiling the target application, the compilation server obtains the target image from the target application and stores the target image in the image storage server.

[0073] In one embodiment, the target image is obtained by expanding a preset image in the target application. The target image and the preset image have the same image content but different image attribute information, which includes any one or more of image resolution and image format.

[0074] The extended processing can include any one or more of resolution processing and compression rate processing. If the extended processing is resolution processing, the target image and the preset image have different image attribute information: the target image and the preset image have different image resolutions. For example, if the preset image has a resolution of 1x, after resolution processing, three images with resolutions of 2x, 3x, and 4x can be obtained, and all three images can be used as the target image.

[0075] If the extended processing is compression, the target image and the preset image will have different image attribute information: they will have different image formats. For example, if the preset image is in PNG format, after compression, two images with WebP and Sharppp formats can be obtained, both of which can be used as the target image.

[0076] In one embodiment, the preset image can refer to all images included in the target application, or it can be a specified image included in the target application, which may be an image from an image blacklist. The image blacklist is set by the compilation server for the target application. The images in the image blacklist do not have high requirements for real-time display. For example, images in the image blacklist do not need to be loaded and displayed when the target application starts running. They can be loaded and displayed when a certain page or function of the target application is launched.

[0077] In one embodiment, the number of image storage servers can be one or more. If there are multiple image storage servers, the compilation server can store the target image in each of the image storage servers separately.

[0078] S202. The compilation server obtains the placeholder image corresponding to the target image.

[0079] The placeholder image corresponding to the target image refers to a solid color image with the same dimensions as the target image. The dimensions may include width and height information (which can be represented by resolution), and the solid color image can be a transparent solid color image. Figure 3a and Figure 3b , Figure 3a This is a schematic diagram of a target image provided in an embodiment of the present invention. Figure 3b This is a schematic diagram of a placeholder image corresponding to a target image provided in an embodiment of the present invention. As can be seen from the figure, the target image and the placeholder image are the same size, but the target image has richer color information than the placeholder image.

[0080] In one embodiment, the compilation server obtaining the placeholder image corresponding to the target image may include: the compilation server compressing the pixels of the target image using a compression algorithm to obtain a solid-color image, which serves as the placeholder image corresponding to the target image. The resolution of the placeholder image can be the same as the resolution of the target image. Since image size is closely related to resolution and color, for example, higher resolution images are larger, or images with more colors are larger, compressing the pixels of an image using a compression algorithm can significantly reduce the image size. In other words, the size of the placeholder image corresponding to the target image obtained by the compilation server is much smaller than the size of the target image. For example, for a target image with a resolution of 1200x1200 and its corresponding placeholder image, the target image size is 253.1KB, while the solid-color placeholder image obtained through compression is only 0.3KB; it can be seen that the placeholder image size is reduced by more than 99% compared to the target image size.

[0081] S203. The compilation server compiles the placeholder image corresponding to the target image and other data of the target application to obtain the installation package corresponding to the target application.

[0082] Since the placeholder image corresponding to the target image has the same size information as the target image, the compilation server can avoid internal program logic errors that might be caused by replacing the target image in the target application with the placeholder image during the compilation process.

[0083] In one embodiment, after the compilation server stores the target image to the image storage server in step S201, the compilation server can also obtain the storage address of the target image from the image storage server; and package the storage address of the target image into the installation package corresponding to the target application, so that when the terminal device runs the target application later, it can retrieve and display the target image from the image storage server according to the storage address in the installation package. It should be noted that even if there are multiple image storage servers, the storage address of the target image is unique.

[0084] Optionally, while the compilation server packages the storage address of the target image into the installation package corresponding to the target application, the method may also include: the compilation server uploading the storage address of the target image to the application management server. The application management server can be used to manage the mapping between the storage address of the target image and the image storage server. If the image storage server fails, i.e., the terminal device cannot obtain the target image from the image storage server, the application management server can reassign a port to the storage address of the target image, pointing to a valid image storage server, thus ensuring that the storage address of the target image points to a valid image storage server during the runtime of the target application, thereby guaranteeing that the terminal device can obtain the target image from a valid image storage server.

[0085] In one embodiment, if a newly added image exists in the target application, the application management server can also be used to store the storage address of the newly added image in the target application. The newly added image may be displayed in a location where no image previously appeared in the target application, or it may replace an existing image in the target application. When an image is updated in the target application, the newly added image is stored in an image storage server, and the storage address of the newly added image obtained from the image storage server is uploaded to the application management server. This allows the terminal device to update the image assets in the target application by downloading the storage address of the newly added image during the application's runtime.

[0086] As can be seen, storing newly added images in an image storage server reduces the size of the upgraded installation package compared to directly packaging the newly added images into the installation package corresponding to the target application. This can speed up the download and installation time of the upgraded installation package. Furthermore, for target images in the target application before the upgrade, the terminal device does not need to download these images again when downloading the upgraded installation package, reducing the distribution traffic of these images and thus reducing the traffic and time consumed by the terminal device.

[0087] Optionally, the implementation method for packaging the storage address corresponding to the target image into the installation package can be to write the storage address into a configuration file and then package the configuration file into the installation package. Correspondingly, uploading the storage address of the target image to the application management server can be done by uploading the configuration file to the application management server.

[0088] In one embodiment, the target application also includes other images besides the target image. When the compilation server compiles the target application, the other images are packaged into the installation package corresponding to the target application.

[0089] In one embodiment, the other images are obtained by expanding non-preset images in the target application. These non-preset images may be images located in an image whitelist. The image whitelist is pre-set by the compilation server, and the images in the whitelist are those in the target application that have high real-time display requirements; for example, images in the whitelist need to be loaded and displayed when the target application starts running. Optionally, the implementation method for expanding non-preset images to obtain other images is the same as the implementation method for expanding preset images to obtain target images described above, and will not be repeated here.

[0090] In one embodiment, the compilation server configures a list of all images in the target application to obtain a preset image whitelist and image blacklist. This may include: the compilation server determining whether to add an image to the image whitelist or image blacklist based on the application attributes of the image preset by the business side during the runtime of the target application. The application attributes may include any one or more of the image's display position, display time, and display probability during the runtime of the target application.

[0091] For example, if the business side presupposes that a certain image has a low probability of being displayed during the operation of the target application, then it is determined that the image can be added to the image blacklist; or, if the business side presupposes that a certain image needs to be displayed in real time during the operation of the target application, then it is determined that the image can be added to the image whitelist.

[0092] Based on the above Figure 2The compilation method of the application shown can be concretized as follows: Figure 4 The compilation method for the application shown is illustrated. Please refer to [link / reference]. Figure 4 This is a flowchart illustrating another application compilation method provided by an embodiment of the present invention. The compilation method for this application includes the following steps: S31, the compilation of the target application begins; S32, target image processing, specifically including: S321, replacing the target image with a placeholder image; S322, storing the target image in an image storage server; S323, writing the storage address of the target image into the installation package corresponding to the target application; S33, the compilation of the target application is complete.

[0093] In summary, in this embodiment of the invention, when compiling the target application, the target image in the target application is obtained and stored in an image storage server; a placeholder image corresponding to the target image is obtained, which is a solid color image with the same size information as the target image; the placeholder image and other data of the target application are compiled to obtain the installation package corresponding to the target application. It should be understood that the size of an image is closely related to its size and color information. Generally, the larger the size and the more colors, the larger the size. Compared with the target image, the placeholder image has fewer colors, therefore its size is smaller. Packaging the placeholder image into the application's installation package, instead of the target image, can reduce the size of the installation package while avoiding logical errors in the target application, compared to directly packaging all or some images in the application into the corresponding installation package.

[0094] Furthermore, compared to reducing the installation package size by compressing the images themselves, the application compilation method proposed in this invention also avoids the problem of image quality degradation. Additionally, the target images in the target application are stored in an image storage server. When the target images are needed to be displayed later, they can be retrieved from the image storage server without being loaded from the installation package. This avoids consuming unnecessary bandwidth by downloading the target images along with the target application's installation package when the target application is upgraded.

[0095] Please see Figure 5 This is a flowchart illustrating an application running method provided in an embodiment of the present invention. The application running method can be applied to... Figure 1 The management system for the application shown is executed by the terminal device. This terminal device has the installation package corresponding to the target application installed, which can be accessed via... Figure 2The application's compilation method is shown below. In other words, the installation package is obtained by compiling the placeholder image corresponding to the target image in the target application and other data of the target application during compilation. The placeholder image corresponding to the target image refers to a solid color image with the same size information as the target image. The application's execution method includes the following steps:

[0096] S401. When the terminal device runs the target application, if an image display event is detected, the image to be displayed is obtained based on the installation package corresponding to the target application.

[0097] In one embodiment, the target image is stored in an image storage server, and the installation package includes the storage address of the target image. If the terminal device detects an image display event, it obtains the image to be displayed based on the installation package corresponding to the target application. This may include: if an image display event is detected, determining the image to be loaded in the target application; if the image to be loaded is the target image, obtaining the storage address of the target image from the installation package, and obtaining the target image from the image storage server based on the storage address as the image to be displayed. The image to be loaded is the image loaded by the terminal device before obtaining the image to be displayed. For a more detailed explanation of the image storage server, please refer to [link to relevant documentation]. Figure 2 The relevant explanations regarding the compilation methods of the application shown will not be repeated here.

[0098] Optionally, the target application may also include other images besides the target image, and the installation package may also include other images; correspondingly, if the image to be loaded is another image, then that other image will be obtained from the installation package. For a detailed explanation of these other images, please refer to [link to relevant documentation]. Figure 2 The relevant explanations regarding the compilation methods of the application shown will not be repeated here.

[0099] Optionally, after the terminal device determines the image to be loaded in the target application, it further includes: detecting whether the image to be loaded is the target image. The terminal device can detect whether the image to be loaded is the target image by: checking whether the image to be loaded is defined in the configuration file; if the image to be loaded is defined in the configuration file, then the image to be loaded is the target image; if the image to be loaded is not defined in the configuration file, then the image to be loaded is another image. Correspondingly, if the image to be loaded is the target image, the terminal device obtains the storage address of the target image from the installation package, which can be done by: the terminal device obtains the configuration file from the installation package and obtains the storage address of the target image from the configuration file. For a detailed explanation of this configuration file, please refer to the above. Figure 2 The relevant explanations are provided in the compilation method of the application shown.

[0100] Optionally, the terminal device may retrieve the target image from the image storage server based on the storage address. This can be achieved by: the terminal device requesting the target image from the image storage server physically closest to it based on the storage address; if the image storage server physically closest to the terminal device stores the target image, then the image storage server returns the target image to the terminal device; if the image storage server physically closest to the terminal device does not store the target image, then the image storage server retrieves the target image from the image storage server that stores the target image and returns the target image to the terminal device.

[0101] Optionally, the terminal device obtains the storage address of the target image from the installation package and retrieves the target image from the image storage server based on the storage address. This may include: if the target image has not been downloaded by the terminal device, obtaining the storage address of the target image from the installation package and retrieving the target image from the image storage server based on the storage address.

[0102] In one embodiment, the target image is obtained by expanding a preset image in the target application. The target image and the preset image have the same image content but different image attribute information. The image attribute information includes any one or more of image resolution and image format. The image attribute information of the target image is the same as the image attributes supported by the terminal device. For further details regarding the target image, please refer to [link to relevant information]. Figure 2 The relevant explanations are provided in the compilation method of the application shown.

[0103] Optionally, to ensure that the image attribute information of the target image is the same as the image attributes supported by the terminal device, the method further includes: the terminal device determining the target image from all images obtained by expanding the preset image according to its own supported image attributes. For a detailed description of the above implementation method of expanding the preset image, please refer to... Figure 2 The relevant explanations regarding the compilation methods of the application shown will not be repeated here.

[0104] The image attributes supported by the terminal device include one or more of image resolution and image format. If the supported image attribute is image resolution, the target image determined by the terminal device will have the same resolution as its own supported resolutions. For example, if the terminal device supports a resolution of 3x, and the preset image is expanded to produce images including: image 1 at 2x resolution, image 2 at 3x resolution, and image 3 at 4x resolution, then the target image determined by the terminal device will be image 2.

[0105] The terminal device determines the target image format based on its supported image attributes and the highest compression rate it supports. Since a higher compression rate results in less bandwidth usage for downloading the image, selecting the highest supported compression rate format reduces the bandwidth consumed during download.

[0106] For example, if the terminal device supports PNG as the image format with the required compression ratio, and all images obtained by expanding the preset image include: image 1 in PNG format and image 2 in WebP format, where image 2 has a higher compression ratio than image 1, then the target image determined by the terminal device is image 1.

[0107] For example, the terminal device supports image formats with compression ratios including PNG, WebP, and SharpPP. All images obtained by expanding the preset image include: image 1 in PNG format, image 2 in WebP format, and image 3 in SharpPP format. Among them, image 3 has a higher compression ratio than image 2, and image 2 has a higher compression ratio than image 1. Therefore, the target image determined by the terminal device is image 3.

[0108] S402. The terminal device displays the image to be displayed.

[0109] In one embodiment, if the target image has not been downloaded by the terminal device, the terminal device displays a placeholder image obtained from the installation package. The terminal device displays the image to be displayed, including replacing the placeholder image with the target image when the target image is obtained from the image storage server. Specifically, the terminal device obtains the placeholder image corresponding to the target image from the installation package and downloads the target image asynchronously; when the target image download is complete, it notifies the image control to refresh the display position of the placeholder image to display the target image.

[0110] It is important to note that the execution order of the steps for loading the placeholder image from the installation package and for retrieving the target image from the installation package is not limited. For example, after determining that the target image has not been downloaded, the terminal device can first retrieve the placeholder image from the installation package and then download the target image from the image storage server according to the storage address in the installation package; or, the terminal device can also, after determining that the target image has not been downloaded, first retrieve the target image from the image storage server according to the storage address in the installation package and then retrieve the placeholder image from the installation package.

[0111] In other embodiments, if the target image has already been downloaded by the terminal device, the terminal device directly displays the target image.

[0112] Combination Figure 6a and Figure 6b As shown, Figure 6a This is a schematic diagram of the interface before refresh provided by an embodiment of the present invention. Figure 6b This is a schematic diagram of a refreshed interface provided in an embodiment of the present invention, wherein, Figure 6a In the interface diagram shown, since the target image has not yet been downloaded, there is a blank period in the interface where the image is being downloaded; that is, the displayed image is a placeholder image corresponding to the target image, such as... Figure 6a As shown in step 601; when the target image is downloaded, the display position of the placeholder image will be refreshed to display the target image, as shown in step 601. Figure 6b As shown in 602.

[0113] In one embodiment, before the terminal device displays the image to be displayed, the method further includes: the terminal device encapsulating the image to be displayed using an encapsulation tool, wherein the encapsulation tool may include a Drawable. Correspondingly, when the image to be displayed is a target image and the target image has not been downloaded, before the terminal device displays the placeholder image obtained from the installation package, the terminal device may also encapsulate the placeholder image corresponding to the target image using an encapsulation tool.

[0114] In summary, Figure 5 In the application's execution method shown, when the terminal device runs the target application, if an image display event is detected, the image to be displayed is obtained based on the installation package corresponding to the target application, and then displayed. If the terminal device does not detect that the image to be loaded is the target image, then there is no need to download the target image. Compared with directly downloading the installation package that stores all images, this method can save the bandwidth consumed by downloading the target image, thereby reducing the bandwidth consumed by the terminal device.

[0115] Please see Figure 7 This is a flowchart illustrating another method for running an application provided in an embodiment of the present invention. The method for running this application may include:

[0116] S501. When the terminal device runs the target application, determine whether an image display event is detected; if the terminal device does not detect an image display event, continue to execute step S501; if the terminal device detects an image display event, execute step S502.

[0117] S502, The terminal device determines the image to be loaded in the target application.

[0118] S503. The terminal device detects whether the image to be loaded is the target image; if the image to be loaded is the target image, then steps S504 to S509 are executed; if the image to be loaded is another image, then steps S510 to S511 are executed.

[0119] S504. The terminal device detects whether the target image has been downloaded by the terminal device; if it has been downloaded, proceed to step S505; if it has not been downloaded, proceed to step S506.

[0120] S505, The terminal device displays the target image.

[0121] S506. The terminal device obtains the storage address of the target image from the installation package and retrieves the target image from the image storage server based on the storage address.

[0122] S507. The terminal device encapsulates the placeholder image corresponding to the target image obtained from the installation package and displays the placeholder image corresponding to the target image.

[0123] The execution order between steps S506 and S507 is not limited.

[0124] S508. The terminal device detects whether it has obtained the target image from the image storage server. If the terminal device detects that it has obtained the target image from the image storage server, then proceed to step S509. If the terminal device does not detect that it has obtained the target image from the image storage server, then continue to proceed to step S508.

[0125] S509: The terminal device encapsulates the target image and replaces the placeholder image with the target image.

[0126] S510: The terminal device obtains other images from the installation package and encapsulates those other images.

[0127] S511, The terminal device displays this other image.

[0128] For a detailed explanation of steps S501 to S511, please refer to [link to relevant documentation]. Figure 4 The relevant explanations regarding the operation methods of the application shown will not be repeated here.

[0129] Based on the above Figure 7 The way the application runs, as shown, can be summarized as follows: Figure 8 The example shows how to run the application. Please see [link / reference]. Figure 8 This is a flowchart illustrating another method for running an application provided in this application embodiment. Figure 8 The application's execution method, as shown, includes the following steps:

[0130] S71, The target application begins running.

[0131] S721. The terminal device detects whether the target image has been downloaded by the terminal device.

[0132] If the target image has already been downloaded by the terminal device, then execute S722, use the target image, and execute S73, encapsulate the image using the encapsulation tool; the image is the target image.

[0133] If the target image has not been downloaded by the terminal device, then S723 is executed, using a placeholder image, and then S73 is executed, using a packaging tool to package the image, which is a placeholder image. While executing S723, S724 is also executed, asynchronously downloading the target image; after the target image is downloaded, the packaged placeholder image is refreshed to replace the placeholder image with the target image.

[0134] As can be seen, since many images packaged in typical applications are never actually displayed to the user, this method does not actually download images that are not intended for display. In other words, when the terminal device does not detect that the image to be loaded is the target image, it does not need to download the target image, reducing the bandwidth consumption for target image distribution and thus reducing the bandwidth consumed by the terminal device. Furthermore, this process can be automated during the runtime of the target application, without impacting the development process.

[0135] In summary, Figure 2 The compilation method of the application shown and Figure 5 In the application's execution method shown, the compilation server stores the target image in an image storage server and packages the corresponding placeholder image into the installation package of the target application. Correspondingly, when the terminal device runs the target application, if an image display event is detected, the image to be displayed is retrieved from the installation package of the target application and then displayed. This method reduces the size of the installation package, thereby reducing the bandwidth and time consumed by the terminal device in downloading the installation package. For users, this method facilitates downloading the installation package, significantly reduces bandwidth consumption, speeds up downloads, and thus lowers the cost of installing the target application.

[0136] Based on the above-described application compilation method, this embodiment of the invention provides an application compilation apparatus. Please refer to... Figure 9 This is a schematic diagram of the structure of an application compilation device 900 provided in an embodiment of the present invention. The application compilation device 900 can run the following units:

[0137] The acquisition unit 901 is used to acquire the target image in the target application when compiling the target application;

[0138] Storage unit 902 is used to store the target image to the image storage server;

[0139] The acquisition unit 901 is further configured to acquire a placeholder image corresponding to the target image, wherein the placeholder image corresponding to the target image refers to a solid color image with the same size information as the target image;

[0140] The processing unit 903 is used to compile and process the placeholder image corresponding to the target image and other data of the target application to obtain the installation package corresponding to the target application.

[0141] In one embodiment, the acquisition unit 901 is further configured to acquire the storage address of the target image from the image storage server; the processing unit 903 is further configured to package the storage address of the target image into the installation package corresponding to the target application.

[0142] In one embodiment, the target application also includes other images besides the target image, which are packaged into the installation package corresponding to the target application during the compilation of the target application.

[0143] In one embodiment, the target image is obtained by expanding a preset image in the target application. The target image and the preset image have the same image content but different image attribute information, including any one or more of image resolution and image format.

[0144] According to one embodiment of the present invention, Figure 2 The compilation method of the application shown can involve various steps that can be achieved by... Figure 9 The application shown is executed by individual units within the compilation unit. For example, Figure 2 Steps S201 and S202 can be performed by Figure 9 The application compiler 900 shown is used to execute the acquisition unit 901 and storage unit 902, and step S203 can be performed by... Figure 9 The application is executed by the processing unit 903 in the compilation device 900 shown.

[0145] According to another embodiment of the present invention, Figure 9 The various units in the application compilation apparatus shown can be individually or entirely merged into one or more other units, or some of the units can be further divided into multiple functionally smaller units. This achieves the same operation without affecting the technical effects of the embodiments of the present invention. The above units are based on logical function division. In practical applications, the function of one unit can be implemented by multiple units, or the function of multiple units can be implemented by one unit. In other embodiments of the present invention, the application-based compilation apparatus may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented collaboratively by multiple units.

[0146] According to another embodiment of the present invention, the following can be performed by running on a general-purpose computing device, such as a computer, which includes processing elements and storage elements such as a central processing unit (CPU), random access memory (RAM), and read-only memory (ROM). Figure 2 The computer program (including program code) for each step involved in the corresponding method shown, to construct such... Figure 9 The document describes the compilation apparatus for the application program shown, as well as the compilation method for implementing the application program of the embodiments of the present invention. The computer program may be stored on, for example, a computer storage medium, loaded onto the aforementioned computing device via the computer storage medium, and run therein.

[0147] In this embodiment of the invention, when compiling the target application, a target image is obtained from the target application and stored in an image storage server; a placeholder image corresponding to the target image is obtained, which is a solid color image with the same size information as the target image; the placeholder image and other data of the target application are compiled to obtain the installation package corresponding to the target application. It should be understood that the size of an image is closely related to its size and color information. Generally, the larger the size and the more colors, the larger the size. Compared with the target image, the placeholder image has fewer colors, therefore its size is smaller. Packaging the placeholder image instead of the target image into the application's installation package can reduce the size of the installation package while avoiding logical errors in the target application. Furthermore, since the target image in the target application is stored in the image storage server, it can be retrieved from the image storage server when needed later, without loading it from the installation package. This avoids the target image being downloaded along with the installation package during target application upgrades, thus preventing unnecessary bandwidth consumption.

[0148] Based on the above-described application running method, this embodiment of the invention provides an application running apparatus. Please refer to... Figure 10 This is a schematic diagram of the structure of an application running device provided in an embodiment of the present invention. The application running device 1000 can run on a terminal device. The terminal device can install an installation package corresponding to the target application. The installation package corresponding to the target application is obtained by compiling and processing the placeholder image corresponding to the target image and other data of the target application during the compilation of the target application. The placeholder image corresponding to the target image refers to a solid color image with the same size information as the target image. Figure 10 The application running device 1000 shown can run the following units:

[0149] The acquisition unit 1001 is used to acquire the image to be displayed based on the installation package corresponding to the target application if an image display event is detected when the target application is running.

[0150] Display unit 1002 is used to display the acquired image to be displayed.

[0151] In one embodiment, the target image is stored in an image storage server, and the installation package includes the storage address of the target image; when the acquisition unit 1001 detects an image display event and, based on the image to be displayed in the installation package corresponding to the target application, performs the following steps:

[0152] If an image display event is detected, determine the image to be loaded in the target application; if the image to be loaded is the target image, obtain the storage address of the target image from the installation package, and retrieve the target image from the image storage server based on the storage address as the image to be displayed.

[0153] In one embodiment, when the acquisition unit 1001 obtains the storage address of the target image from the installation package and retrieves the target image from the image storage server based on the storage address, it performs the following steps:

[0154] If the target image has not been downloaded by the terminal device, the storage address of the target image is obtained from the installation package, and the target image is retrieved from the image storage server based on the storage address.

[0155] In one embodiment, when the target image is not downloaded by the terminal device, the display unit 1002 is also used to display a placeholder image obtained from the installation package;

[0156] When displaying an image to be displayed, the display unit 1002 performs the following steps: when the target image is obtained from the image storage server, the placeholder image is replaced with the target image.

[0157] In one embodiment, the target image is obtained by expanding a preset image in the target application. The target image and the preset image have the same image content but different image attribute information. The image attribute information includes any one or more of image resolution and image format. Furthermore, the image attribute information of the target image is the same as the image attributes supported by the application's running device 1000.

[0158] According to one embodiment of the present invention, Figure 5 The steps involved in running the application shown can be... Figure 10 The application shown is executed by various units within the running device. For example, Figure 5 The aforementioned step S401 can be performed by Figure 10The application running device 1000 shown is used to execute the acquisition unit 1001, and step S402 can be performed by... Figure 10 The application is executed by the display unit 1002 in the running device 1000 shown.

[0159] According to another embodiment of the present invention, Figure 10 The various units in the application running device shown can be individually or entirely merged into one or more other units, or some of the units can be further divided into multiple functionally smaller units. This achieves the same operation without affecting the technical effects of the embodiments of the present invention. The above-mentioned units are based on logical function division. In practical applications, the function of one unit can also be implemented by multiple units, or the function of multiple units can be implemented by one unit. In other embodiments of the present invention, the application running device may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented collaboratively by multiple units.

[0160] According to another embodiment of the present invention, the following can be performed by running on a general-purpose computing device, such as a computer, which includes processing elements and storage elements such as a central processing unit (CPU), random access memory (RAM), and read-only memory (ROM). Figure 5 The computer program (including program code) for each step involved in the corresponding method shown, to construct such... Figure 10 The diagram illustrates the apparatus for running the application, and the method for running the application according to the embodiments of the present invention. The computer program may be stored on, for example, a computer storage medium, loaded onto the aforementioned computing device via the computer storage medium, and run therein.

[0161] In this embodiment of the invention, when the target application is running, if an image display event is detected, the image to be displayed is obtained based on the installation package corresponding to the target application; the image to be displayed is then displayed. If no image to be loaded is detected as the target image, then there is no need to download the target image; compared with directly downloading the installation package that stores all images, this method can save the bandwidth consumed by downloading the target image.

[0162] Based on the embodiments of the above-described application compilation method and compilation apparatus, this invention provides an electronic device, which corresponds to the aforementioned compilation server. Please refer to... Figure 11This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. The electronic device 1100 may include at least: a processor 1101, an input interface 1102, an output interface 1103, and a computer storage medium 1104. The processor 1101, the input interface 1102, the output interface 1103, and the computer storage medium 1104 may be connected via a bus or other means.

[0163] Computer storage medium 1104 can be stored in memory 1105 of electronic device 1100. Computer storage medium 1101 is used to store computer programs, which include program instructions. Processor 1101 is used to execute the program instructions stored in computer storage medium 1104. Processor 1101 (or CPU (Central Processing Unit)) is the computing and control core of electronic device 1100, suitable for implementing one or more instructions, specifically suitable for loading and executing:

[0164] When compiling the target application, the target image in the target application is obtained and stored in an image storage server; a placeholder image corresponding to the target image is obtained, wherein the placeholder image is a solid color image with the same size information as the target image; the placeholder image and other data of the target application are compiled and processed to obtain the installation package corresponding to the target application.

[0165] In this embodiment of the invention, when compiling the target application, a target image is obtained from the target application and stored in an image storage server; a placeholder image corresponding to the target image is obtained, which is a solid color image with the same size information as the target image; the placeholder image and other data of the target application are compiled to obtain the installation package corresponding to the target application. It should be understood that the size of an image is closely related to its size and color information. Generally, the larger the size and the more colors, the larger the size. Compared with the target image, the placeholder image has fewer colors, therefore its size is smaller. Packaging the placeholder image instead of the target image into the application's installation package can reduce the size of the installation package while avoiding logical errors in the target application. Furthermore, since the target image in the target application is stored in the image storage server, it can be retrieved from the image storage server when needed later, without loading it from the installation package. This avoids the target image being downloaded along with the installation package during target application upgrades, thus preventing unnecessary bandwidth consumption.

[0166] Based on the above embodiments of the application running method and application running device, this invention also provides another electronic device, which corresponds to the aforementioned terminal device. Please see [link to documentation]. Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. The electronic device 1200 may include at least: a processor 1201, an input interface 1202, an output interface 1203, and a computer storage medium 1204, which can be connected by a bus or other means.

[0167] The electronic device 1200 is equipped with an installation package corresponding to the target application. The installation package corresponding to the target application is obtained by compiling and processing the placeholder image corresponding to the target image in the target application and other data of the target application during the compilation of the target application. The placeholder image corresponding to the target image refers to a solid color image with the same size information as the target image.

[0168] Computer storage medium 1204 can be stored in memory 1205 of electronic device 1200. Computer storage medium 1201 is used to store computer programs, which include program instructions. Processor 1201 is used to execute the program instructions stored in computer storage medium 1204. Processor 1201 (or CPU (Central Processing Unit)) is the computing and control core of the electronic device, suitable for implementing one or more instructions, specifically suitable for loading and executing:

[0169] When the target application is run, if an image display event is detected, the image to be displayed is obtained based on the installation package corresponding to the target application; and the image to be displayed is then displayed.

[0170] In this embodiment of the invention, when the target application is running, if an image display event is detected, the image to be displayed is obtained based on the installation package corresponding to the target application; the image to be displayed is then displayed. If no image to be loaded is detected as the target image, then there is no need to download the target image; compared with directly downloading the installation package that stores all images, this method can save the bandwidth consumed by downloading the target image.

[0171] This invention also provides a computer storage medium (Memory), which is a memory device in an electronic device used to store programs and data. It is understood that the computer storage medium here can include both built-in storage media in the electronic device and extended storage media supported by the electronic device. The computer storage medium provides storage space that stores the operating system of the electronic device. Furthermore, the storage space also stores one or more instructions suitable for loading and execution by processor 1101 or 1201. These instructions can be one or more computer programs (including program code). It should be noted that the computer storage medium here can be high-speed RAM or non-volatile memory, such as at least one disk storage device; optionally, it can also be at least one computer storage medium located remotely from the aforementioned processor.

[0172] In one embodiment, the computer storage medium may be loaded by the processor 1101 and one or more instructions stored in the computer storage medium may be executed to achieve the aforementioned related... Figure 2 The corresponding steps of the compilation method for the application shown are as follows. In specific implementation, one or more instructions in the computer storage medium are loaded by processor 1101 and executed as follows:

[0173] When compiling the target application, the target image in the target application is obtained and stored in the image storage server; the placeholder image corresponding to the target image is obtained, which is a solid color image with the same size information as the target image; the placeholder image corresponding to the target image and other data of the target application are compiled and processed to obtain the installation package corresponding to the target application.

[0174] In one embodiment, after the processor 1101 stores the target image to the image storage server, it performs the following steps: obtaining the storage address of the target image from the image storage server; and packaging the storage address of the target image into the installation package corresponding to the target application.

[0175] In one embodiment, the target application also includes other images besides the target image, and these other images are packaged into the installation package corresponding to the target application during the compilation of the target application.

[0176] In one embodiment, the target image is obtained by expanding a preset image in the target application. The target image and the preset image have the same image content but different image attribute information. The image attribute information includes any one or more of image resolution and image format.

[0177] In this embodiment of the invention, when compiling the target application, a target image is obtained from the target application and stored in an image storage server; a placeholder image corresponding to the target image is obtained, which is a solid color image with the same size information as the target image; the placeholder image and other data of the target application are compiled to obtain the installation package corresponding to the target application. It should be understood that the size of an image is closely related to its size and color information. Generally, the larger the size and the more colors, the larger the size. Compared with the target image, the placeholder image has fewer colors, therefore its size is smaller. Packaging the placeholder image instead of the target image into the application's installation package can reduce the size of the installation package while avoiding logical errors in the target application. Furthermore, since the target image in the target application is stored in the image storage server, it can be retrieved from the image storage server when needed later, without loading it from the installation package. This avoids the target image being downloaded along with the installation package during target application upgrades, thus preventing unnecessary bandwidth consumption.

[0178] In other embodiments, the computer storage medium may be loaded by the processor 1201 and one or more instructions stored in the computer storage medium may be executed to achieve the above-mentioned... Figure 5 The corresponding steps of the application's execution method are shown. In a specific implementation, one or more instructions from the computer's storage medium are loaded by the processor 1201 and executed as follows:

[0179] When the target application is run, if an image display event is detected, the image to be displayed is obtained based on the installation package corresponding to the target application; and the image to be displayed is then displayed.

[0180] The installation package corresponding to the target application is obtained by compiling the placeholder image corresponding to the target image in the target application and other data of the target application during the compilation of the target application. The placeholder image corresponding to the target image refers to a solid color image with the same size information as the target image.

[0181] In one embodiment, the target image is stored in an image storage server, and the installation package includes the storage address of the target image; when the processor 1201 detects an image display event and obtains the image to be displayed based on the installation package corresponding to the target application, it performs the following steps:

[0182] If an image display event is detected, determine the image to be loaded in the target application;

[0183] If the image to be loaded is the target image, then the storage address of the target image is obtained from the installation package, and the target image is obtained from the image storage server based on the storage address as the image to be displayed.

[0184] In one embodiment, when the processor 1201 obtains the storage address of the target image from the installation package and retrieves the target image from the image storage server based on the storage address, it performs the following steps:

[0185] If the target image has not been downloaded by the terminal device, the storage address of the target image is obtained from the installation package, and the target image is obtained from the image storage server based on the storage address.

[0186] In one embodiment, the processor 1201 further performs the following steps: if the target image has not been downloaded by the terminal device, display the placeholder image obtained from the installation package;

[0187] When displaying the image to be displayed, the processor 1201 performs the following steps:

[0188] When the target image is obtained from the image storage server, the placeholder image is replaced with the target image.

[0189] In one embodiment, the target image is obtained by expanding a preset image in the target application. The target image and the preset image have the same image content but different image attribute information. The image attribute information includes any one or more of image resolution and image format. Furthermore, the image attribute information of the target image is the same as the image attributes supported by the terminal device.

[0190] In this embodiment of the invention, when the target application is running, if an image display event is detected, the image to be displayed is obtained based on the installation package corresponding to the target application; the image to be displayed is then displayed. If no image to be loaded is detected as the target image, then there is no need to download the target image; compared with directly downloading the installation package that stores all images, this method can save the bandwidth consumed by downloading the target image.

[0191] According to one aspect of this application, embodiments of the present invention also provide a computer product or computer program, the computer product or computer program including computer instructions stored in a computer storage medium. Optionally, a processor 1101 reads the computer instructions from the computer storage medium, and the processor 1101 executes the computer instructions, causing the electronic device to perform... Figure 2 The compilation method for the application shown is as follows:

[0192] When compiling the target application, the target image in the target application is obtained and stored in an image storage server; a placeholder image corresponding to the target image is obtained, wherein the placeholder image is a solid color image with the same size information as the target image; the placeholder image and other data of the target application are compiled and processed to obtain the installation package corresponding to the target application.

[0193] Optionally, the processor 1201 reads the computer instructions from the computer storage medium, and executes the computer instructions to cause the electronic device to perform... Figure 5 The application shown is run in the following specific way:

[0194] When the target application is run, if an image display event is detected, the image to be displayed is obtained based on the installation package corresponding to the target application; and the image to be displayed is then displayed.

[0195] The installation package corresponding to the target application is obtained by compiling the placeholder image corresponding to the target image in the target application and other data of the target application during the compilation of the target application. The placeholder image corresponding to the target image refers to a solid color image with the same size information as the target image.

[0196] Those skilled in the art will recognize that the units and steps of the various examples described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0197] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in or transmitted through a computer storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).

[0198] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this invention should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for compiling an application, characterized in that, Applied to a compilation server, the method includes: When compiling the target application, the target image in the target application is obtained and stored in the image storage server. The target image includes multiple images obtained by expanding the preset image in the target application. The target image and the preset image have the same image content but different image attribute information. The expansion processing includes any one or more of resolution processing and compression ratio processing. The resolution processing makes the target image and the preset image have different image resolutions, and the compression ratio processing makes the target image and the preset image have different image formats. A placeholder image corresponding to the target image is obtained. The placeholder image is a solid color image with the same size information as the target image, obtained by compressing the pixels of the target image using a compression algorithm. The data size of the placeholder image obtained after compression is smaller than that of the target image. When the target application needs to load the target image corresponding to the placeholder image during the operation of the terminal device, it determines one image from multiple images obtained through extended processing based on the image attributes supported by the terminal device as the target image for display. The placeholder image corresponding to the target image and other data of the target application are compiled and processed to obtain the installation package corresponding to the target application.

2. The method according to claim 1, characterized in that, After storing the target image to the image storage server, the method further includes: Obtain the storage address of the target image from the image storage server; The storage address of the target image is packaged into the installation package corresponding to the target application.

3. The method according to claim 1 or 2, characterized in that, The target application also includes other images besides the target image. When the target application is compiled, the other images are packaged into the installation package corresponding to the target application.

4. A method for running an application, characterized in that, The method is applied to a terminal device, wherein the terminal device has an installation package corresponding to a target application installed. The installation package is obtained by compiling the target application, including a placeholder image corresponding to a target image and other data of the target application. The target image includes multiple images obtained by expanding a preset image in the target application. The target image and the preset image have the same image content but different image attribute information. The expansion processing includes any one or more of resolution processing and compression rate processing. Resolution processing makes the target image and the preset image have different image resolutions, and compression rate processing makes the target image and the preset image have different image formats. The placeholder image corresponding to the target image is a solid color image with the same size information as the target image, obtained by compressing the pixels of the target image using a compression algorithm. The data size of the compressed placeholder image is smaller than the data size of the target image. The method includes: When the target application is run, if an image display event is detected, the image to be loaded in the target application is determined. If the image to be loaded is a target image, the target image to be displayed is obtained as the image to be displayed. The target image to be displayed refers to an image determined from multiple images obtained from extended processing based on the image attributes supported by the terminal device. Display the image to be displayed.

5. The method according to claim 4, characterized in that, The target image is stored in an image storage server, and the installation package includes the storage address of the target image; if the image to be loaded is the target image, then obtaining the target image for display as the image to be displayed includes: If the image to be loaded is the target image, then the storage address of the target image is obtained from the installation package, and the target image is obtained from the image storage server based on the storage address as the image to be displayed.

6. The method according to claim 5, characterized in that, The step of obtaining the storage address of the target image from the installation package and obtaining the target image from the image storage server based on the storage address includes: If the target image has not been downloaded by the terminal device, the storage address of the target image is obtained from the installation package, and the target image is obtained from the image storage server based on the storage address.

7. The method according to claim 5, characterized in that, The method further includes: if the target image has not been downloaded by the terminal device, displaying the placeholder image obtained from the installation package; The process of displaying the image to be displayed includes: When the target image is obtained from the image storage server, the placeholder image is replaced with the target image.

8. The method according to any one of claims 4 to 7, characterized in that, The image attribute information includes any one or more of the following: image resolution and image format.

9. An electronic device, characterized in that, include: A processor, adapted to implement one or more instructions; as well as A computer storage medium storing one or more instructions adapted to be loaded by the processor and executed as described in any one of claims 1 to 3; or, the one or more instructions adapted to be loaded by the processor and executed as described in any one of claims 4 to 8.

10. A computer storage medium, characterized in that, The computer storage medium stores one or more instructions, which are adapted to be loaded by a processor and executed as described in any one of claims 1 to 3; or, the one or more instructions are adapted to be loaded by a processor and executed as described in any one of claims 4 to 8.

11. A computer program product, comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the method as described in any one of claims 1 to 3; or, implements the method as described in any one of claims 4 to 8.