Method, device, computer equipment and storage medium for generating application installation package
Through the volume optimization processing of application static resources and the storage address update, the installation package volume is automatically optimized, which solves the problem of inefficient efficiency in generating application installation packages and improves the generation efficiency.
Patent Information
- Application Number
- CN202111464728.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-03
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2041-12-03
AI Technical Summary
In the prior art, when generating application installation packages, developers need to manually process static resources, resulting in inefficient generation.
By volume optimization processing of the static resources in the application, the second static resource after the volume is reduced is generated, and stored in the target storage space, the storage address in the configuration file is updated, and the installation package is generated.
Automatic optimization during the generation of application installation packages is realized, avoiding the time consumption of manual processing and improving generation efficiency.
Smart Images

Figure CN114138290B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, computer device, and storage medium for generating an application installation package. Background Art
[0002] With the continuous development of computer technology and application technology, various applications have emerged to meet the various needs of users. In the process of developing applications, it is also necessary to generate an installation package of the application so that users can download the installation package of the application and install the application according to the installation package to use the application.
[0003] Currently, when generating an installation package for an application, developers need to manually process the static resources contained in the application, and then compress the manually processed static resources to generate an installation package for the application. Static resources refer to fixed resources pre-set in the application, such as image resources, video resources, text resources, etc.
[0004] However, in the above technical solution, the manual processing by developers takes a long time, resulting in low efficiency in generating the application installation package. Summary of the Invention
[0005] The embodiments of the present application provide a method, apparatus, computer device, and storage medium for generating an application installation package, which avoids the time-consuming manual processing and improves the efficiency of generating the application installation package. The technical solution is as follows:
[0006] In one aspect, a method for generating an application installation package is provided, the method comprising:
[0007] Based on the instruction for generating the installation package of the application, performing volume optimization processing on the first static resource in the application to obtain a second static resource, wherein the volume optimization processing is used to obtain a static resource with a reduced volume;
[0008] Storing the second static resource in the target storage space, and replacing the storage address of the second static resource with the storage address of the target storage space in the configuration file of the application;
[0009] Based on the configuration file after the storage address is replaced, an installation package for the application is generated.
[0010] In some embodiments, based on the instruction for generating the installation package of the application, performing volume optimization processing on the first static resource of the application includes:
[0011] Based on the generation instruction of the installation package of the application, obtaining the configuration file of the first static resource;
[0012] Acquire the first static resource based on the storage address of the first static resource in the configuration file of the first static resource;
[0013] Perform volume optimization processing on the acquired first static resource.
[0014] In some embodiments, performing volume optimization on the first static resource in the application includes at least one of the following:
[0015] compressing the first static resource, and determining the compressed first static resource as the second static resource;
[0016] Tailoring the first static resource, and determining the tailored first static resource as the second static resource;
[0017] The first static resource is converted into a static resource in a target format, and the static resource in the target format is determined as the second static resource, where the static resource in the target format is a static resource with a reduced size.
[0018] In some embodiments, based on the instructions for generating the installation package of the application, performing volume optimization processing on the first static resource in the application to obtain the second static resource includes:
[0019] Based on the generation instruction of the installation package of the application, executing the generation process of the installation package;
[0020] When executing the generation process, if a target event is detected, the volume optimization process is performed on the first static resource in the application to obtain a second static resource. The target event is used to instruct the processing of the first static resource.
[0021] In some embodiments, the target storage space is a cloud storage space;
[0022] Storing the second static resource in the target storage space includes:
[0023] The second static resource is stored in the cloud storage space through a cloud storage service interface.
[0024] In one aspect, a device for generating an application installation package is provided, the device comprising:
[0025] a processing module configured to perform volume optimization processing on a first static resource in the application based on an instruction for generating an installation package of the application to obtain a second static resource, wherein the volume optimization processing is used to obtain a static resource with a reduced volume;
[0026] a storage module, configured to store the second static resource in a target storage space, and replace the storage address of the second static resource with the storage address of the target storage space in a configuration file of the application;
[0027] The generation module is used to generate an installation package of the application based on the configuration file after the storage address is replaced.
[0028] In some embodiments, the processing module is configured to:
[0029] Based on the generation instruction of the installation package of the application, obtaining the configuration file of the first static resource;
[0030] Acquire the first static resource based on the storage address of the first static resource in the configuration file of the first static resource;
[0031] Perform volume optimization processing on the acquired first static resource.
[0032] In some embodiments, the processing module includes at least one of the following:
[0033] a compression unit, configured to compress the first static resource and determine the compressed first static resource as the second static resource;
[0034] a clipping unit, configured to clip the first static resource and determine the clipped first static resource as the second static resource;
[0035] The conversion unit is configured to convert the first static resource into a static resource in a target format, and determine the static resource in the target format as the second static resource, wherein the static resource in the target format is a static resource with a reduced size.
[0036] In some embodiments, the processing module is configured to:
[0037] Based on the generation instruction of the installation package of the application, executing the generation process of the installation package;
[0038] When executing the generation process, if a target event is detected, the volume optimization process is performed on the first static resource in the application to obtain a second static resource. The target event is used to instruct the processing of the first static resource.
[0039] In some embodiments, the target storage space is a cloud storage space;
[0040] The storage module is used to:
[0041] The second static resource is stored in the cloud storage space through a cloud storage service interface.
[0042] In one aspect, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one program code, and the at least one program code is loaded and executed by the processor to implement the above-mentioned method for generating an application installation package.
[0043] On the one hand, a computer-readable storage medium is provided, in which at least one program code is stored. The at least one program code is loaded and executed by a processor to implement the above-mentioned method for generating an application installation package.
[0044] On the one hand, a computer program product is provided, which includes a computer program code, the computer program code is stored in a computer-readable storage medium, a processor of a computer device reads the computer program code from the computer-readable storage medium, and the processor executes the computer program code, so that the computer device executes the above-mentioned method of generating an application installation package.
[0045] The technical solution provided in the embodiment of the present application can trigger volume optimization processing of the first static resource in the application based on the generation instruction of the application installation package, and then transfer the second static resource after volume optimization processing to the target storage space, and at the same time update the storage address of the second static resource in the configuration file of the application, and generate the installation package of the application based on the updated configuration file. In the above technical process, a method for automatically optimizing the volume size of the installation package during the generation of the application installation package is provided, which avoids a long time spent on manual processing and improves the efficiency of generating the application installation package. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0047] Figure 1 Schematic diagram of an implementation environment of a method for generating an application installation package provided in an embodiment of the present application;
[0048] Figure 2 This is a flowchart of a method for generating an application installation package provided by an embodiment of the present application;
[0049] Figure 3 This is a flowchart of a method for generating an application installation package provided by an embodiment of the present application;
[0050] Figure 4 This is a flow chart of generating an application installation package provided by an embodiment of the present application;
[0051] Figure 5 This is a structural diagram of a device for generating an application installation package provided in an embodiment of the present application;
[0052] Figure 6This is a schematic diagram of the structure of a terminal provided in an embodiment of the present application;
[0053] Figure 7 This is a structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0054] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0055] Figure 1 This is a schematic diagram of an implementation environment for a method of generating an application installation package provided by an embodiment of the present application. Figure 1 , the implementation environment includes: terminal 101.
[0056] Terminal 101 can be at least one of a smartphone, a smartwatch, a desktop computer, a laptop computer, a virtual reality terminal, an augmented reality terminal, a wireless terminal, and a portable laptop computer. Terminal 101 has communication capabilities and can access the Internet. Terminal 101 can generally refer to one of multiple terminals. This embodiment uses terminal 101 as an example. Those skilled in the art will appreciate that the number of terminals described above may be greater or lesser.
[0057] The terminal 101 can run various types of applications. For example, the applications run by the terminal may include one or more of the following applications: drawing applications, game applications, video applications, telephone applications, social applications, live broadcast applications, email applications, digital camera applications, spreadsheet applications, etc.
[0058] In some embodiments, the method for generating an application installation package provided by the embodiments of the present disclosure is executed by terminal 101, and the corresponding process is: terminal 101 performs volume optimization processing on the first static resource in the application based on the generation instruction of the application installation package, obtains the second static resource, stores the second static resource in the target storage space, and replaces the storage address of the second static resource with the storage address of the target storage space in the configuration file of the application, and generates the installation package of the application based on the configuration file after replacing the storage address.
[0059] In some embodiments, the implementation environment further includes: a server 102 .
[0060] Server 102 can be an independent physical server, or a server cluster or distributed file system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms.
[0061] In some embodiments, the server 102 is directly or indirectly connected to the terminal 101 via wired or wireless communication, which is not limited in this embodiment of the present application. Optionally, the number of the above-mentioned servers 102 can be more or less, which is not limited in this embodiment of the present application. Of course, the server 102 can also include other functional servers to provide more comprehensive and diversified services.
[0062] In some embodiments, the method for generating an application installation package provided by the embodiments of the present disclosure is executed by server 102, and the corresponding process is: server 102 performs volume optimization processing on the first static resource in the application based on the generation instruction of the application installation package, obtains the second static resource, stores the second static resource in the target storage space, replaces the storage address of the second static resource with the storage address of the target storage space in the configuration file of the application, and generates the installation package of the application based on the configuration file after replacing the storage address.
[0063] In some embodiments, embodiments of the present application further provide a system for generating an application installation package, the system comprising an application resource parsing module, an application resource processing module, an application resource uploading module, and a cloud storage service module. In some embodiments, the method for generating an application installation package provided in embodiments of the present application can be applied to the system. Optionally, the system for generating an application installation package is deployed on the terminal 101 or on the server 102.
[0064] In an embodiment of the present application, the application resource parsing module is used to parse the configuration file of the application and obtain the configuration file of the first static resource from the configuration file of the application, so as to perform subsequent volume optimization processing and replace the storage address based on the configuration file of the first static resource; the application resource processing module is used to perform volume optimization processing on the first static resource in the application based on the generation instruction of the application installation package to obtain the second static resource; the application resource uploading module is used to store the second static resource in the target storage space, and replace the storage address of the second static resource with the storage address of the target storage space in the configuration file of the application; the cloud storage service module is used to provide the above-mentioned target storage space.
[0065] The embodiments of this application will be described later using a computer device as the execution subject.
[0066] Figure 2 This is a flow chart of a method for generating an application installation package provided by an embodiment of the present application. This embodiment is described with a computer device as the execution subject, see Figure 2 , the embodiment includes:
[0067] 201. The computer device performs volume optimization processing on a first static resource in the application based on an instruction for generating an installation package of the application to obtain a second static resource. The volume optimization processing is used to obtain a static resource with a reduced volume.
[0068] In an embodiment of the present application, based on the generation instruction of the installation package, a computer device can be triggered to execute a process of performing volume optimization processing on the first static resource in the application.
[0069] Among them, the first static resource in the application refers to the image resources, video resources, text resources, etc. included in the application. Volume optimization processing refers to the process of optimizing the volume of the first static resource in the application, for example, the process of reducing the volume of the first static resource, so that the volume of the installation package can be optimized. It should be noted that in the embodiment of the present application, the first static resource is used to refer to the static resource before the volume optimization processing, and the second static resource is used to refer to the static resource after the volume optimization processing.
[0070] It should be understood that the size of the installation package determines the time the user has to wait for the download and the traffic that may be consumed. Therefore, by optimizing the size of the installation package, the user's operating experience is improved.
[0071] 202. The computer device stores the second static resource in the target storage space, and replaces the storage address of the second static resource with the storage address of the target storage space in the configuration file of the application.
[0072] In an embodiment of the present application, after obtaining the second static resource after volume optimization processing, the second static resource is stored in the target storage space, and then in the configuration file of the application, the storage address of the second static resource is replaced with the storage address of the target storage space, providing a basis for subsequent users to download the application.
[0073] 203. The computer device generates an installation package for the application based on the configuration file with the replaced storage address.
[0074] In an embodiment of the present application, by replacing the storage address of the second static resource in the configuration file of the application, subsequent users can obtain the second static resource based on the storage address of the target storage space when downloading the application. Moreover, through the above process, there is no need to carry the real second static resource in the installation package, thereby also achieving optimization of the size of the installation package.
[0075] The technical solution provided in the embodiment of the present application can trigger volume optimization processing of the first static resource in the application based on the generation instruction of the application installation package, and then transfer the second static resource after volume optimization processing to the target storage space, and at the same time update the storage address of the second static resource in the configuration file of the application, and generate the installation package of the application based on the updated configuration file. In the above technical process, a method for automatically optimizing the volume size of the installation package during the generation of the application installation package is provided, which avoids a long time spent on manual processing and improves the efficiency of generating the application installation package.
[0076] above Figure 2 The following is a basic process of this application. The solution provided by this application is further explained based on a specific implementation method. Figure 3 This is a flow chart of a method for generating an application installation package provided by an embodiment of the present application. This embodiment is described with a computer device as the execution subject, see Figure 3 , the embodiment includes:
[0077] 301. The computer device executes a process for generating the installation package based on an instruction for generating the application installation package.
[0078] In an embodiment of the present application, the installation package generation instruction is an instruction for packaging the configuration file of the application into an installation package. In some embodiments, the installation package generation instruction is triggered by a terminal operated by a developer when an application installation package needs to be generated. For example, in response to the developer's operation to generate the application installation package, the terminal sends the application installation package generation instruction to the computer device to trigger the computer device to execute the process of generating the application installation package. In other embodiments, the installation package generation instruction is automatically triggered by the computer device. For example, the computer device triggers the application installation package generation instruction in response to the application version being updated.
[0079] The application configuration file refers to the code file of the application. In some embodiments, the application configuration file includes the application's basic data file, the configuration file of the static resources in the application, or other types of configuration files. The basic data file includes the implementation code of the application's client. For example, after the user installs the application on the terminal, when the application is launched, the terminal launches the application's client based on the basic data file.
[0080] In some embodiments, the computer device obtains a configuration file of the application in response to an instruction to generate an installation package for the application, and packages the installation package based on basic data files or other types of configuration files included in the configuration file of the application.
[0081] In an optional embodiment, the process for a computer device to obtain the configuration file of the application is as follows: when a developer generates an installation package for the application, the developer uploads the configuration file of the application to the computer device, and the computer device is then able to obtain the configuration file of the application. In another optional embodiment, the process for a computer device to obtain the configuration file of the application is as follows: based on the application identifier carried by the generation instruction of the installation package of the application, the computer device obtains the configuration file corresponding to the application identifier from the configuration information library. The application identifier can be an application name, an application number, or an application ID (Identity). The configuration information library is used to store the application identifiers of multiple applications and the corresponding configuration files.
[0082] 302. When the computer device executes the generation process, if a target event is detected, step 303 is executed. The target event is used to instruct processing of the first static resource.
[0083] In some embodiments, the computer device uses an installation package packaging tool to package the basic data files or other types of configuration files in the application's configuration file into installation packages in sequence. During the installation package packaging process, if the target event is detected, the subsequent volume optimization process of the first static resource is triggered.
[0084] In an embodiment of the present application, the target event is used to indicate that the first static resource is about to be processed. Specifically, the target event is used to indicate that the first static resource is about to be packaged into an installation package. In some embodiments, the target event is triggered based on an installation package packaging tool. Optionally, when the installation package packaging tool processes a static resource during packaging, it triggers an event hook, that is, triggers the target event. Taking the installation package packaging tool as webpack as an example, the target event can be an event triggered by the file-loader in the webpack.
[0085] In some embodiments, the first static resource includes at least one of a picture resource, a text resource, a video resource, an animation file, or a font file. Of course, the first static resource can also include other types of static resources, which are not limited in this embodiment of the present application.
[0086] In the above embodiment, when a target event is detected, the subsequent process of optimizing the first static resource volume is triggered to achieve automatic optimization of the first static resource volume, thereby improving the efficiency of generating the application installation package.
[0087] 303. The computer device performs volume optimization processing on the first static resource in the application to obtain a second static resource. The volume optimization processing is used to obtain a static resource with a reduced volume.
[0088] In some embodiments, the first static resource and the second static resource are represented by resource identifiers, for example, resource names, resource numbers, and resource IDs.
[0089] In some embodiments, the computer device obtains a configuration file for the first static resource, obtains the first static resource based on the storage address of the first static resource in the configuration file, and performs volume optimization on the obtained first static resource. The configuration file for the first static resource refers to a code file for the first static resource, and the configuration file for the first static resource is used to indicate code references for the first static resource. The storage address of the first static resource may also be referred to as a reference address.
[0090] In an optional embodiment, the computer device obtains the configuration file of the first static resource by parsing the configuration file of the application to obtain the configuration file of the first static resource. Optionally, the computer device uses a parsing function provided by an installation package packaging tool to parse the configuration file of the application to obtain the configuration file of the first static resource.
[0091] In an optional embodiment, the process of the computer device obtaining the first static resource is: the computer device accesses the storage space corresponding to the storage address of the first static resource in the configuration file of the first static resource based on the storage address of the first static resource, and obtains the first static resource from the storage space corresponding to the storage address based on the resource identifier of the first static resource.
[0092] In some embodiments, the process of optimizing the size of the first static resource in the application includes at least one of the following:
[0093] (1) In an optional embodiment, the computer device compresses the first static resource and determines the compressed first static resource as the second static resource.
[0094] In some embodiments, taking the first static resource as an image resource as an example, the computer device uses an image compression tool to compress the image resource. In an optional embodiment, the computer device uses the image compression tool to compress the size of the image resource. In other embodiments, taking the first static resource as a text resource as an example, the computer device uses a text compression tool to compress the text resource. For example, the text compression tool can be a gzip compression tool.
[0095] (2) In an optional embodiment, the computer device crops the first static resource and determines the cropped first static resource as the second static resource.
[0096] In some embodiments, taking the first static resource as an image resource as an example, the computer device uses an image cropping tool to crop the image resource. In an optional embodiment, the computer device uses an image cropping tool to crop the size of the image resource.
[0097] (3) In an optional embodiment, the computer device converts the first static resource into a static resource in a target format, and determines the static resource in the target format as the second static resource, where the static resource in the target format is a static resource with a reduced size.
[0098] The target format is a pre-set fixed format. In some embodiments, taking the first static resource as an image resource as an example, the target format is any one of the webp format, bmp format, and gif format; taking the first static resource as a text resource as an example, the target format is any one of the xml format, zip format, gzip format, and rar format. Taking the xml format as an example, the static resource in the target format is an xml file, which is an xml file containing a preset number of pixels.
[0099] Thus, based on the three volume optimization methods shown above, the volume of the first static resource can be automatically optimized, which can significantly reduce the manual optimization workload in related technologies. In other embodiments, the computer device can also use other volume optimization methods to optimize the volume of the first static resource.
[0100] 304. The computer device stores the second static resource in the target storage space, and replaces the storage address of the second static resource with the storage address of the target storage space in the configuration file of the application.
[0101] In some embodiments, the target storage space is a cloud storage space, which is a storage space deployed and virtualized in a cloud computing environment. Accordingly, the process of storing the second static resource in the target storage space includes: the computer device stores the second static resource in the cloud storage space through the cloud storage service interface. In this way, by storing the second static resource in the cloud storage space, the subsequent installation package does not need to carry the real second static resource when packaging. It only needs to replace the storage address of the second static resource, and the second static resource can be obtained according to the replaced storage address, thereby optimizing the size of the installation package.
[0102] In some embodiments, the target storage space is any one of a cloud database, a cloud storage space associated with a third-party application, or a cloud storage space associated with the application. Thus, three types of storage spaces are provided, which increases the flexibility of selecting storage spaces.
[0103] 305. The computer device generates an installation package for the application based on the configuration file with the replaced storage address.
[0104] In some embodiments, the computer device packages the installation package based on the configuration file after the storage address is replaced to obtain the installation package of the application. In an optional embodiment, the computer device packages the installation package based on the configuration file after the storage address is replaced and the basic data files and other types of configuration files in the configuration file of the application to obtain the installation package of the application.
[0105] For example, Figure 4 This is a flow chart of generating an application installation package provided by an embodiment of the present application, see Figure 4 ,exist Figure 4 The schematic diagram shown shows an application resource parsing module, an application resource processing module, an application resource uploading module and a cloud storage service module included in the system for generating an application installation package. When the application starts to be packaged, the application resource parsing module is used to parse the resource reference graph in the application to obtain a configuration file of the first static resource. The resource reference graph is used to indicate the code reference status of various types of static resources in the application; then, the application resource processing module is used to pre-process and optimize the first static resource to obtain a pre-processed and optimized static resource (that is, a second static resource); then, the application resource uploading module is used to upload the pre-processed and optimized static resource to the cloud storage space (that is, the target storage space), and in the configuration file of the application, the storage address of the static resource is replaced with the storage address of the cloud storage space; the cloud storage service module is used to store the processed and optimized static resource; and then, based on the configuration file after the storage address is replaced output by the application resource uploading module, the installation package of the application is generated.
[0106] Through the above steps 301 to 305, an installation package of the application can be generated. Furthermore, when the user wants to use the application, he can perform operations on the terminal to trigger the download instruction of the application. The terminal responds to the download instruction of the application and sends a download request of the application to the server. The server sends the installation package of the application to the terminal based on the download request of the application. The terminal receives the installation package of the application, decompresses the installation package, obtains the configuration file of the application included in the installation package, and then downloads and installs the application based on the configuration file of the application.
[0107] The technical solution provided in the embodiment of the present application can trigger volume optimization processing of the first static resource in the application based on the generation instruction of the application installation package, and then transfer the second static resource after volume optimization processing to the target storage space, and at the same time update the storage address of the second static resource in the configuration file of the application, and generate the installation package of the application based on the updated configuration file. In the above technical process, a method for automatically optimizing the volume size of the installation package during the generation of the application installation package is provided, which avoids a long time spent on manual processing and improves the efficiency of generating the application installation package.
[0108] Figure 5 This is a schematic diagram of the structure of a device for generating an application installation package provided by an embodiment of the present application, see Figure 5 , the device comprises:
[0109] Processing module 501, configured to perform volume optimization processing on a first static resource in the application based on an instruction for generating an installation package of the application to obtain a second static resource, wherein the volume optimization processing is used to obtain a static resource with a reduced volume;
[0110] The storage module 502 is configured to store the second static resource in the target storage space, and replace the storage address of the second static resource with the storage address of the target storage space in the configuration file of the application;
[0111] The generating module 503 is configured to generate an installation package of the application based on the configuration file after the storage address is replaced.
[0112] The technical solution provided in the embodiment of the present application can trigger volume optimization processing of the first static resource in the application based on the generation instruction of the application installation package, and then transfer the second static resource after volume optimization processing to the target storage space, and at the same time update the storage address of the second static resource in the configuration file of the application, and generate the installation package of the application based on the updated configuration file. In the above technical process, a method for automatically optimizing the volume size of the installation package during the generation of the application installation package is provided, which avoids a long time spent on manual processing and improves the efficiency of generating the application installation package.
[0113] In some embodiments, the processing module 501 is configured to:
[0114] Based on the generation instruction of the installation package of the application, obtaining the configuration file of the first static resource;
[0115] Acquire the first static resource based on the storage address of the first static resource in the configuration file of the first static resource;
[0116] Perform volume optimization processing on the acquired first static resource.
[0117] In some embodiments, the processing module 501 includes at least one of the following:
[0118] a compression unit, configured to compress the first static resource and determine the compressed first static resource as the second static resource;
[0119] a clipping unit, configured to clip the first static resource and determine the clipped first static resource as the second static resource;
[0120] The conversion unit is configured to convert the first static resource into a static resource in a target format, and determine the static resource in the target format as the second static resource, wherein the static resource in the target format is a static resource with a reduced size.
[0121] In some embodiments, the processing module 501 is configured to:
[0122] Based on the generation instruction of the installation package of the application, executing the generation process of the installation package;
[0123] When executing the generation process, if a target event is detected, the volume optimization process is performed on the first static resource in the application to obtain a second static resource. The target event is used to instruct the processing of the first static resource.
[0124] In some embodiments, the target storage space is a cloud storage space;
[0125] The storage module 502 is used to:
[0126] The second static resource is stored in the cloud storage space through a cloud storage service interface.
[0127] It should be noted that the device for generating an application installation package provided in the above embodiment only uses the division of the above functional modules as an example to illustrate when generating an application installation package. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the device for generating an application installation package provided in the above embodiment and the method embodiment for generating an application installation package are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0128] Figure 6 The following is a block diagram of a terminal 600 according to an exemplary embodiment of the present application. Terminal 600 may be a smartphone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III), MP4 player (Moving Picture Experts Group Audio Layer IV), laptop computer, or desktop computer. Terminal 600 may also be referred to as user equipment, portable terminal, laptop terminal, desktop terminal, or other similar names.
[0129] Typically, the terminal 600 includes a processor 601 and a memory 602 .
[0130] The processor 601 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 601 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor 601 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 601 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 601 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0131] The memory 602 may include one or more computer-readable storage media, which may be non-transitory. The memory 602 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 602 is used to store at least one program code, which is executed by the processor 601 to implement the method for generating an application installation package provided in the method embodiment of the present application.
[0132] In some embodiments, terminal 600 may optionally include a peripheral device interface 603 and at least one peripheral device. Processor 601, memory 602, and peripheral device interface 603 may be connected via a bus or signal lines. Each peripheral device may be connected to peripheral device interface 603 via a bus, signal lines, or circuit boards. Specifically, the peripheral device may include at least one of a radio frequency circuit 604, a display screen 605, a camera assembly 606, an audio circuit 607, a positioning assembly 608, and a power supply 609.
[0133] The peripheral device interface 603 can be used to connect at least one I / O (Input / Output)-related peripheral device to the processor 601 and the memory 602. In some embodiments, the processor 601, the memory 602, and the peripheral device interface 603 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 601, the memory 602, and the peripheral device interface 603 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.
[0134] The radio frequency circuit 604 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 604 communicates with communication networks and other communication devices via electromagnetic signals. The radio frequency circuit 604 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency circuit 604 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The radio frequency circuit 604 can communicate with other terminals via at least one wireless communication protocol. Such wireless communication protocols include, but are not limited to, metropolitan area networks, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, the radio frequency circuit 604 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.
[0135] Display screen 605 is used to display a user interface (UI). This UI may include graphics, text, icons, videos, or any combination thereof. If display screen 605 is a touchscreen display, it is also capable of collecting touch signals on or above the surface of display screen 605. These touch signals can be input as control signals to processor 601 for processing. Display screen 605 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there can be a single display screen 605, located on the front panel of terminal 600. In other embodiments, there can be at least two display screens 605, located on different surfaces of terminal 600 or in a foldable design. In still other embodiments, display screen 605 can be a flexible display screen, located on a curved or foldable surface of terminal 600. Display screen 605 can also be configured as a non-rectangular, irregular shape, also known as a special-shaped screen. Display screen 605 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
[0136] The camera assembly 606 is used to capture images or videos. Optionally, the camera assembly 606 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 606 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.
[0137] The audio circuit 607 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals that are input into the processor 601 for processing, or input into the radio frequency circuit 604 to achieve voice communication. For the purpose of stereo sound collection or noise reduction, there may be multiple microphones, each located in different parts of the terminal 600. The microphone may also be an array microphone or an omnidirectional collection microphone. The speaker is used to convert electrical signals from the processor 601 or the radio frequency circuit 604 into sound waves. The speaker may be a traditional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert electrical signals into sound waves audible to humans, but also convert electrical signals into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 607 may also include a headphone jack.
[0138] Positioning component 608 is used to locate the current geographic location of terminal 600 to implement navigation or LBS (Location Based Service). Positioning component 608 can be based on the US GPS (Global Positioning System), China's BeiDou system, Russia's Greninja system, or the European Union's Galileo system.
[0139] Power supply 609 is used to power various components in terminal 600. Power supply 609 can be AC power, DC power, disposable batteries, or rechargeable batteries. When power supply 609 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.
[0140] In some embodiments, the terminal 600 further includes one or more sensors 610 , including but not limited to: an acceleration sensor 611 , a gyroscope sensor 612 , a pressure sensor 613 , a fingerprint sensor 614 , an optical sensor 615 , and a proximity sensor 616 .
[0141] The accelerometer 611 can detect the magnitude of acceleration along the three coordinate axes of the coordinate system established by the terminal 600. For example, the accelerometer 611 can be used to detect the components of gravity acceleration along the three coordinate axes. The processor 601 can control the display screen 605 to display the user interface in a landscape or portrait view based on the gravity acceleration signal collected by the accelerometer 611. The accelerometer 611 can also be used to collect game or user motion data.
[0142] The gyroscope sensor 612 can detect the orientation and rotation angle of the terminal 600. It can work with the accelerometer 611 to collect the user's 3D movements on the terminal 600. Based on the data collected by the gyroscope sensor 612, the processor 601 can implement the following functions: motion sensing (for example, changing the UI based on the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
[0143] The pressure sensor 613 can be set on the side frame of the terminal 600 and / or the lower layer of the display screen 605. When the pressure sensor 613 is set on the side frame of the terminal 600, it can detect the user's grip signal of the terminal 600, and the processor 601 performs left and right hand recognition or shortcut operations based on the grip signal collected by the pressure sensor 613. When the pressure sensor 613 is set on the lower layer of the display screen 605, the processor 601 controls the operable controls on the UI interface based on the user's pressure operation on the display screen 605. Operable controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.
[0144] The fingerprint sensor 614 is used to collect the user's fingerprint. The processor 601 identifies the user's identity based on the fingerprint collected by the fingerprint sensor 614, or the fingerprint sensor 614 identifies the user's identity based on the collected fingerprint. When the user's identity is recognized as a trusted identity, the processor 601 authorizes the user to perform relevant sensitive operations, such as unlocking the screen, viewing encrypted information, downloading software, making payments, and changing settings. The fingerprint sensor 614 can be set on the front, back, or side of the terminal 600. When a physical button or manufacturer logo is provided on the terminal 600, the fingerprint sensor 614 can be integrated with the physical button or manufacturer logo.
[0145] Optical sensor 615 is used to detect ambient light intensity. In one embodiment, processor 601 can control the display brightness of display screen 605 based on the ambient light intensity detected by optical sensor 615. Specifically, when the ambient light intensity is high, the display brightness of display screen 605 is increased; when the ambient light intensity is low, the display brightness of display screen 605 is decreased. In another embodiment, processor 601 can also dynamically adjust the shooting parameters of camera assembly 606 based on the ambient light intensity detected by optical sensor 615.
[0146] Proximity sensor 616, also known as a distance sensor, is typically located on the front panel of terminal 600. Proximity sensor 616 is used to detect the distance between the user and the front of terminal 600. In one embodiment, when proximity sensor 616 detects that the distance between the user and the front of terminal 600 is gradually decreasing, processor 601 controls display screen 605 to switch from the screen-on state to the screen-off state. When proximity sensor 616 detects that the distance between the user and the front of terminal 600 is gradually increasing, processor 601 controls display screen 605 to switch from the screen-off state to the screen-on state.
[0147] Those skilled in the art will understand that Figure 6 The structure shown in the figure does not constitute a limitation on the terminal 600, and the terminal 600 may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.
[0148] The computer device provided in the embodiment of the present application can be provided as a server. Figure 7 This is a schematic diagram of the structure of a server provided in an embodiment of the present application. The server 700 may have relatively large differences due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 701 and one or more memories 702, wherein the memory 1002 stores at least one program code, and the at least one program code is loaded and executed by the processor 701 to implement the method for generating an application installation package provided in each of the above method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output. The server may also include other components for implementing device functions, which will not be described in detail here.
[0149] In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory including program code. The program code can be executed by a processor in a computer device to perform the method for generating an application installation package in the above embodiment. For example, the computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a compact disc (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.
[0150] In an exemplary embodiment, a computer program product is also provided, which includes a computer program code, which is stored in a computer-readable storage medium. A processor of a computer device reads the computer program code from the computer-readable storage medium, and the processor executes the computer program code, so that the computer device executes the above-mentioned method of generating an application installation package.
[0151] In some embodiments, the computer program involved in the embodiments of the present application may be deployed and executed on a computer device, or on multiple computer devices located at one location, or on multiple computer devices distributed at multiple locations and interconnected through a communication network. Multiple computer devices distributed at multiple locations and interconnected through a communication network may constitute a blockchain system.
[0152] Those skilled in the art will understand that all or part of the steps of implementing the above embodiments can be completed by hardware, or by hardware related to program code, and the program can be stored in a computer-readable storage medium, which can be a read-only memory, a disk or an optical disk, etc.
[0153] The above description is merely an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for generating an application installation package, characterized in that: The method comprises: Based on the instruction for generating the installation package of the application, executing the process of generating the installation package; When executing the generation process, if a target event is detected, the resource reference graph within the application is parsed to obtain a configuration file of the first static resource in the application, the resource reference graph is used to indicate the code reference status of various types of static resources in the application, the configuration file of the first static resource is used to indicate the code reference status of the first static resource, the target event is used to indicate that the first static resource is about to be packaged into an installation package, and the target event is triggered when the installation package packaging tool processes the static resource during packaging; Based on the storage address of the first static resource in the configuration file of the first static resource, access the storage space corresponding to the storage address, and based on the resource identifier of the first static resource, obtain the first static resource from the storage space corresponding to the storage address; Performing volume optimization processing on the acquired first static resource to obtain a second static resource, wherein the volume optimization processing is used to obtain a static resource with a reduced volume; Storing the second static resource in a target storage space, and replacing the storage address of the second static resource with the storage address of the target storage space in a configuration file of the application, where the configuration file of the application includes basic data files of the application, configuration files of static resources in the application, and other types of configuration files, and the configuration file of the application refers to the code file of the application, and the target storage space is any one of a cloud database, a cloud storage space associated with a third-party application, or a cloud storage space associated with the application; The installation package is packaged based on the configuration file after the storage address is replaced and the basic data file and the other types of configuration files in the configuration file to generate the installation package of the application.
2. The method according to claim 1, characterized in that The performing volume optimization processing on the acquired first static resource includes at least one of the following: compressing the first static resource, and determining the compressed first static resource as the second static resource; Tailoring the first static resource, and determining the tailored first static resource as the second static resource; The first static resource is converted into a static resource in a target format, and the static resource in the target format is determined as the second static resource, where the static resource in the target format is a static resource with a reduced size.
3. The method according to claim 1, characterized in that Storing the second static resource in the target storage space includes: The second static resource is stored in the cloud storage space through a cloud storage service interface.
4. A device for generating an application installation package, characterized in that: The device comprises: A processing module for executing a generation process of the installation package based on a generation instruction for the application installation package; when executing the generation process, if a target event is detected, parsing the resource reference graph within the application to obtain a configuration file of the first static resource in the application, the resource reference graph is used to indicate the code reference status of various types of static resources in the application, the configuration file of the first static resource is used to indicate the code reference status of the first static resource, the target event is used to indicate that the first static resource is about to be packaged into an installation package, and the target event is triggered when the installation package packaging tool processes the static resource during packaging; based on the storage address of the first static resource in the configuration file of the first static resource, accessing the storage space corresponding to the storage address, based on the resource identifier of the first static resource, obtaining the first static resource from the storage space corresponding to the storage address; performing volume optimization processing on the obtained first static resource to obtain a second static resource, and the volume optimization processing is used to obtain a static resource with a reduced volume; a storage module, configured to store the second static resource in a target storage space, and replace the storage address of the second static resource with the storage address of the target storage space in a configuration file of the application, wherein the configuration file of the application includes a basic data file of the application, a configuration file of static resources in the application, and other types of configuration files, the configuration file of the application refers to a code file of the application, and the target storage space is any one of a cloud database, a cloud storage space associated with a third-party application, or a cloud storage space associated with the application; A generating module is used to package the installation package based on the configuration file after the storage address is replaced and the basic data file and the other types of configuration files in the configuration file to generate the installation package of the application.
5. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one program code, and the at least one program code is loaded and executed by the processor to implement the method for generating an application installation package according to any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that At least one program code is stored in the computer-readable storage medium, and the at least one program code is loaded and executed by the processor to implement the method for generating an application installation package according to any one of claims 1 to 3.
7. A computer program product, characterized in that The computer program product includes a computer program code, which is stored in a computer-readable storage medium. The processor of a computer device reads the computer program code from the computer-readable storage medium, and the processor executes the computer program code, so that the computer device executes the method for generating an application installation package as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Picture set packaging method and device, equipment and storage medium
CN112073730A
Volume optimization method and device of application installation package, equipment and storage medium
CN113282300A
Off-line package packaging method and device and computer equipment
CN113342400A