CN114138290A - Method and device for generating application installation package, computer equipment and storage medium - Google Patents

Method and device for generating application installation package, computer equipment and storage medium Download PDF

Info

Publication number
CN114138290A
CN114138290A CN202111464728.6A CN202111464728A CN114138290A CN 114138290 A CN114138290 A CN 114138290A CN 202111464728 A CN202111464728 A CN 202111464728A CN 114138290 A CN114138290 A CN 114138290A
Authority
CN
China
Prior art keywords
static resource
application
installation package
resource
configuration file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111464728.6A
Other languages
Chinese (zh)
Inventor
梁嘉辉
祝绍坤
陈方正
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Kugou Computer Technology Co Ltd
Original Assignee
Guangzhou Kugou Computer Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Kugou Computer Technology Co Ltd filed Critical Guangzhou Kugou Computer Technology Co Ltd
Priority to CN202111464728.6A priority Critical patent/CN114138290A/en
Publication of CN114138290A publication Critical patent/CN114138290A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The application discloses a method and a device for generating an application installation package, computer equipment and a storage medium, and belongs to the technical field of computers. In the embodiment of the application, based on a generation instruction of an application installation package, volume optimization processing on a first static resource in the application can be triggered, a second static resource after the volume optimization processing is stored in a target storage space, a storage address of the second static resource is updated in an application configuration file, and the application installation package is generated based on the updated configuration file.

Description

Method and device for generating application installation package, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for generating an application installation package, a computer device, and a storage medium.
Background
With the continuous development of computer technology and application technology, various application programs have appeared to meet various needs of users. In the process of developing the application program, an installation package of the application program needs to be generated, so that a user can download the installation package of the application program, install the application program according to the installation package, and use the application program.
At present, when an installation package of an application program is generated, a developer needs to perform manual processing on static resources included in the application program, and then compress the static resources based on the manually processed static resources, so as to generate the installation package of the application program, where the static resources refer to fixed resources preset in the application program, such as picture resources, video resources, text resources, and the like.
However, in the above-described technical solutions, the time consumed for the developer to manually process is long, which results in low efficiency of generating the application installation package.
Disclosure of Invention
The embodiment of the application provides a method and a device for generating an application installation package, computer equipment and a storage medium, so that the problem that long time is consumed due to manual processing is avoided, and the efficiency of generating the application installation package is improved. The technical scheme is as follows:
in one aspect, a method for generating an application installation package is provided, and the method includes:
based on a generation instruction of an installation package of the application, carrying out volume optimization processing on a first static resource in the application to obtain a second static resource, wherein the volume optimization processing is used for obtaining the static resource with the reduced volume;
storing the second static resource to a 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;
and generating an installation package of the application based on the configuration file after replacing the storage address.
In some embodiments, performing volume optimization processing on a first static resource in an application based on a generation instruction of an installation package of the application comprises:
acquiring a configuration file of the first static resource based on a generation instruction of the installation package of the application;
acquiring the first static resource based on the storage address of the first static resource in the configuration file of the first static resource;
and carrying out volume optimization processing on the acquired first static resource.
In some embodiments, the volume optimization processing of the first static resource in the application includes at least one of:
compressing the first static resource, and determining the compressed first static resource as the second static resource;
cutting the first static resource, and determining the first static resource after cutting as the second static resource;
and converting the first static resource into a static resource in a target format, and determining the static resource in the target format as the second static resource, wherein the static resource in the target format is the static resource with the reduced volume.
In some embodiments, performing volume optimization processing on a first static resource in an application based on a generation instruction of an installation package of the application to obtain a second static resource includes:
executing a generation flow of the installation package based on a generation instruction of the installation package of the application;
when the generation flow is executed, if a target event is detected, performing volume optimization processing on a first static resource in the application to obtain a second static resource, wherein the target event is used for indicating processing of the first static resource.
In some embodiments, the target storage space is a cloud storage space;
storing the second static resource to a target storage space comprises:
and storing the second static resource to the cloud storage space through a cloud storage service interface.
In one aspect, an apparatus for generating an application installation package is provided, and the apparatus includes:
the processing module is used for carrying out volume optimization processing on the first static resource in the application based on a generation instruction of the installation package of the application to obtain a second static resource, and the volume optimization processing is used for obtaining the static resource with the reduced volume;
the storage module is used for storing the second static resource to a 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;
and the generating module is used for generating the installation package of the application based on the configuration file after the storage address is replaced.
In some embodiments, the processing module is to:
acquiring a configuration file of the first static resource based on a generation instruction of the installation package of the application;
acquiring the first static resource based on the storage address of the first static resource in the configuration file of the first static resource;
and carrying out volume optimization processing on the acquired first static resource.
In some embodiments, the processing module comprises at least one of:
a compressing unit, configured to compress the first static resource, and determine the compressed first static resource as the second static resource;
the cutting unit is used for cutting the first static resource and determining the first static resource after cutting as the second static resource;
and the conversion unit is used for converting the first static resource into a static resource in a target format, determining the static resource in the target format as the second static resource, and determining the static resource in the target format as the static resource with the reduced volume.
In some embodiments, the processing module is to:
executing a generation flow of the installation package based on a generation instruction of the installation package of the application;
when the generation flow is executed, if a target event is detected, performing volume optimization processing on a first static resource in the application to obtain a second static resource, wherein the target event is used for indicating processing of the first static resource.
In some embodiments, the target storage space is a cloud storage space;
the storage module is used for:
and storing the second static resource to the cloud storage space through a cloud storage service interface.
In one aspect, a computer device is provided, which includes a processor and a memory, where at least one program code is stored in the memory, and the at least one program code is loaded by the processor and executed to implement the method for generating an application installation package described above.
In one aspect, a computer-readable storage medium having at least one program code stored therein is provided, the at least one program code being loaded and executed by a processor to implement the method for generating an application installation package described above.
In one aspect, a computer program product is provided, the computer program product comprising computer program code stored in a computer readable storage medium, the computer program code being read from the computer readable storage medium by a processor of a computer device, the processor executing the computer program code to cause the computer device to perform the above method of generating an application installation package.
According to the technical scheme, based on the generation instruction of the application installation package, volume optimization processing on the first static resource in the application can be triggered, the second static resource after the volume optimization processing is stored in the target storage space, the storage address of the second static resource is updated in the configuration file of the application, and the application installation package is generated based on the updated configuration file.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of an implementation environment of a method for generating an application installation package according to an embodiment of the present application;
FIG. 2 is a flowchart of a method for generating an application installation package according to an embodiment of the present disclosure;
FIG. 3 is a flowchart of a method for generating an application installation package according to an embodiment of the present application;
FIG. 4 is a schematic flowchart of generating an application installation package according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an apparatus for generating an application installation package according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a terminal according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a server according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Fig. 1 is a schematic diagram of an implementation environment of a method for generating an application installation package according to an embodiment of the present application. Referring to fig. 1, the implementation environment includes: a terminal 101.
The terminal 101 may be at least one of a smartphone, a smart watch, a desktop computer, a laptop computer, a virtual reality terminal, an augmented reality terminal, a wireless terminal, a laptop portable computer, and the like. The terminal 101 has a communication function and can access the internet, and the terminal 101 may be generally referred to as one of a plurality of terminals, and this embodiment is only illustrated by the terminal 101. Those skilled in the art will appreciate that the number of terminals described above may be greater or fewer.
The terminal 101 may run a variety of different types of applications, for example, the applications run by the terminal may include one or more of the following: drawing applications, gaming applications, video applications, telephony applications, social applications, live applications, email applications, digital camera applications, spreadsheet applications, and the like.
In some embodiments, the method for generating an application installation package provided by the embodiments of the present disclosure is executed by the terminal 101, and the corresponding process is as follows: the terminal 101 performs volume optimization processing on the first static resource in the application based on a generation instruction of the installation package of the application to obtain a second static resource, stores the second static resource to a target storage space, replaces a storage address of the second static resource with a 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.
In some embodiments, the implementation environment further comprises: a server 102.
The server 102 may be an independent physical server, a server cluster or a distributed file system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a CDN (Content Delivery Network), a big data and artificial intelligence platform, and the like.
In some embodiments, the server 102 and the terminal 101 are connected directly or indirectly through wired or wireless communication, which is not limited in this application. Alternatively, the number of the servers 102 may be more or less, and the embodiment of the present application is not limited thereto. Of course, the server 102 may also include other functional servers to provide more comprehensive and diverse services.
In some embodiments, the method for generating an application installation package provided by the embodiments of the present disclosure is executed by the server 102, and the corresponding process is: the server 102 performs volume optimization processing on the first static resource in the application based on a generation instruction of an installation package of the application to obtain a second static resource, stores the second static resource to a target storage space, replaces a storage address of the second static resource with a storage address of the target storage space in a configuration file of the application, and generates the installation package of the application based on the configuration file after replacing the storage address.
In some embodiments, the present application further provides a system for generating an application installation package, where the system includes an application resource analysis 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 the embodiments of the present application may be applied to the system, and optionally, the system for generating an application installation package is deployed on the terminal 101 or on the server 102.
In the embodiment of the application, the application resource analysis module is configured to analyze an application configuration file, and acquire the configuration file of the first static resource from the application configuration file, so as to perform subsequent volume optimization processing and a process of replacing a storage address based on the configuration file of the first static resource; the application resource processing module is used for carrying out volume optimization processing on the first static resource in the application based on a generation instruction of an installation package of the application to obtain a second static resource; the application resource uploading module is used for storing the second static resource to a 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; the cloud storage service module is used for providing the target storage space.
The embodiment of the present application will be described with a computer device as an execution subject.
Fig. 2 is a flowchart of a method for generating an application installation package according to an embodiment of the present application. The embodiment is described by taking a computer device as an execution subject, and referring to fig. 2, the embodiment includes:
201. the computer equipment performs volume optimization processing on the first static resource in the application based on the generation instruction of the installation package of the application to obtain a second static resource, wherein the volume optimization processing is used for obtaining the static resource with the reduced volume.
In the embodiment of the application, based on the generation instruction of the installation package, the computer device can be triggered to execute a process of performing volume optimization processing on the first static resource in the application.
The first static resource in the application refers to a picture resource, a video resource, a text resource and the like included in the application. The volume optimization process is a process of optimizing the volume of the first static resource in the application, for example, a process of reducing the volume of the first static resource, so that the effect of optimizing the volume of the installation package can be achieved. It should be noted that, in the embodiment of the present application, the first static resource is used to refer to a static resource before the volume optimization processing, and the second static resource is used to refer to a static resource after the volume optimization processing.
It should be understood that the volume of the installation package determines the time for the user to wait for downloading later and the problem of the flow rate that may be consumed, and therefore, the operation experience of the user is improved by optimizing the volume of the installation package.
202. And the computer equipment stores the second static resource to a 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.
In the embodiment of the application, after the second static resource subjected to volume optimization is obtained, the second static resource is stored in the target storage space, and then the storage address of the second static resource is replaced by the storage address of the target storage space in the configuration file of the application, so that a basis is provided for a subsequent user to download the application.
203. And the computer equipment generates an installation package of the application based on the configuration file after replacing the storage address.
In the embodiment of the application, the storage address of the second static resource is replaced in the configuration file of the application, so that the second static resource can be obtained based on the storage address of the target storage space when a subsequent user downloads the application, and the real second static resource does not need to be carried in the installation package through the process, so that the optimization of the volume of the installation package is also realized.
According to the technical scheme, based on the generation instruction of the application installation package, volume optimization processing on the first static resource in the application can be triggered, the second static resource after the volume optimization processing is stored in the target storage space, the storage address of the second static resource is updated in the configuration file of the application, and the application installation package is generated based on the updated configuration file.
Fig. 2 is a basic flow chart of the present application, and the following further explains a scheme provided in the present application based on a specific implementation, and fig. 3 is a flow chart of a method for generating an application installation package according to an embodiment of the present application. The embodiment is described by taking a computer device as an execution subject, and referring to fig. 3, the embodiment includes:
301. the computer equipment executes the generation flow of the installation package based on the generation instruction of the installation package of the application.
In this embodiment of the present application, the instruction for generating the installation package is an instruction for packaging the installation package for the configuration file of the application. In some embodiments, the generation instruction of the installation package is triggered by a terminal operated by a developer when the application installation package needs to be generated. For example, the terminal responds to the generation operation of the application installation package by the developer, and sends a generation instruction of the application installation package to the computer device so as to trigger the computer device to execute the process of generating the application installation package. In other embodiments, the instructions for generating the installation package are triggered automatically by the computer device, for example, the computer device triggers the instructions for generating the installation package for the application in response to the version of the application having been updated.
Wherein, the configuration file of the application refers to the code file of the application. In some embodiments, the configuration file for the application includes an underlying data file for the application, a configuration file for static resources in the application, or other types of configuration files, and so forth. The basic data file includes implementation code of the client of the application, for example, after the user installs the application on the terminal, if the application is started, the terminal starts the client of the application based on the basic data file.
In some embodiments, the computer device, in response to a generation instruction for the installation package of the application, obtains a configuration file of the application, and packages the installation package based on a basic data file or other type of configuration file included in the configuration file of the application.
In an alternative embodiment, the process of the computer device obtaining the configuration file of the application is as follows: when a developer generates an installation package of an application, the configuration file of the application is uploaded to the computer device, and then the computer device can obtain the configuration file of the application. In another alternative embodiment, the process of the computer device obtaining the configuration file of the application is as follows: and the computer equipment acquires a configuration file corresponding to the application identifier from a configuration information base based on the application identifier carried by the generation instruction of the installation package of the application. The application identifier may be an application name, an application number, and an application ID (Identity number). The configuration information base is used for storing application identifications of a plurality of applications and corresponding configuration files.
302. When the computer device executes the generation flow, if a target event is detected, step 303 is executed, where the target event is used to instruct to process the first static resource.
In some embodiments, the computer device sequentially performs installation package packaging on the basic data files or other types of configuration files in the configuration files of the application by using an installation package packaging tool, and in the installation package packaging process, if the target event is detected, a subsequent process of performing volume optimization processing on the first static resource is triggered.
In this embodiment of the present application, the target event is used to indicate that the first static resource is to be processed, and specifically, the target event is used to indicate that the first static resource is to be packaged in an installation package. In some embodiments, the target event is triggered based on the installation package packaging tool, and optionally, the installation package packaging tool triggers an event hook when processing to a static resource during packaging, that is, the target event is triggered. Taking the installation package packing tool as the webpack, the target event may be an event triggered by a file-loader in the webpack.
In some embodiments, the first static resource comprises 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 is not limited in this embodiment.
In the above embodiment, when the target event is detected, a subsequent process of optimizing the first static resource volume is triggered to be executed, so that automatic optimization of the first static resource volume is realized, and thus the efficiency of generating the application installation package is improved.
303. And the computer equipment performs volume optimization processing on the first static resource in the application to obtain a second static resource, wherein the volume optimization processing is used for obtaining the static resource with the reduced volume.
In some embodiments, the first static resource and the second static resource are represented with a resource identification. For example, the resource identification may be a resource name, a resource number, a resource ID.
In some embodiments, the computer device obtains the configuration file of the first static resource, obtains the first static resource based on the storage address of the first static resource in the configuration file of the first static resource, and performs volume optimization processing on the obtained first static resource. The configuration file of the first static resource is a code file of the first static resource, and the configuration file of the first static resource is used for indicating the code reference condition of the first static resource. The memory address of the first static resource may also be referred to as a reference address.
In an alternative embodiment, the process of the computer device obtaining the configuration file of the first static resource is as follows: and the computer equipment analyzes the configuration file of the application to obtain the configuration file of the first static resource. Optionally, the computer device analyzes the configuration file of the application by using an analysis function provided by an installation package packaging tool to obtain the configuration file of the first static resource.
In an alternative embodiment, the process of the computer device acquiring the first static resource is: the computer equipment accesses the storage space corresponding to the storage address based on the storage address of the first static resource in the configuration file of the first static resource, and acquires the first static resource from the storage space corresponding to the storage address based on the resource identifier of the first static resource.
In some embodiments, the volume optimization process for the first static resource in the application includes at least one of:
(1) in an alternative embodiment, the computer device compresses the first static resource and determines the compressed first static resource as the second static resource.
In some embodiments, taking the first static resource as an example of a picture resource, the computer device compresses the picture resource by using a picture compression tool. In an alternative embodiment, the computer device employs a picture compression tool to compress the size of the picture resource. In other embodiments, taking the first static resource as the text resource as an example, the computer device compresses the text resource by using a text compression tool. Illustratively, the text compression tool may be a gzip compression tool.
(2) In an alternative embodiment, the computer device performs clipping on the first static resource, and determines the clipped first static resource as the second static resource.
In some embodiments, taking the first static resource as an example of a picture resource, the computer device uses a picture cropping tool to crop the picture resource. In an alternative embodiment, the computer device employs a picture cropping tool to crop the size of the picture asset.
(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 reduced-volume static resource.
The target format is a preset fixed format. In some embodiments, taking the first static resource as an image resource as an example, the target format is any one of a webp format, a bmp format, and a gif format; taking the first static resource as a text resource as an example, the target format is any one of an xml format, a zip format, a gzip format, and a rar format. Taking the xml format as an example, accordingly, the static resource of the target format is an xml file, which is a file of the xml format containing a preset number of pixels.
Thus, based on the three volume optimization processing modes, automatic optimization of the first static resource volume can be realized, and the optimization workload of manual processing in the related technology can be greatly reduced. In other embodiments, the computer device can also implement optimization of the first static resource volume by using other volume optimization processes.
304. And the computer equipment stores the second static resource to a 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.
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 to the target storage space includes: and the computer equipment stores the second static resource into the cloud storage space through a cloud storage service interface. Therefore, the second static resource is stored in the cloud storage space, so that the second static resource does not need to be carried when the subsequent installation package is packaged, the second static resource can be obtained according to the replaced storage address only by replacing the storage address of the second static resource, and the optimization of the volume of the installation package is realized.
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. Therefore, three types of storage spaces are provided, and the flexibility of selecting the storage spaces is improved.
305. And the computer equipment generates an installation package of the application based on the configuration file after replacing the storage address.
In some embodiments, the computer device packages an installation package based on the configuration file after replacing the storage address to obtain an installation package of the application. In an optional embodiment, the computer device performs installation package packaging based on the configuration file after replacing the storage address, and a basic data file and other types of configuration files in the configuration file of the application, so as to obtain an installation package of the application.
Fig. 4 is a schematic diagram of a flow of generating an application installation package according to an embodiment of the present application, and referring to fig. 4, in the schematic diagram shown in fig. 4, an application resource parsing module, an application resource processing module, an application resource uploading module, and a cloud storage service module included in a system for generating an application installation package are shown, when an application starts to be packaged, a resource reference map in the application is parsed by the application resource parsing module to obtain a configuration file of a first static resource, where the resource reference map is used to indicate code reference conditions of various types of static resources in the application; then, the application resource processing module is used for carrying out pretreatment optimization on the first static resource to obtain a pretreated and optimized static resource (namely a second static resource); then, uploading the preprocessed and optimized static resources to a cloud storage space (namely a target storage space) through an application resource uploading module, and replacing the storage address of the static resources with the storage address of the cloud storage space in the configuration file of the application; storing the static resource after the processing optimization through a cloud storage service module; and further, generating an installation package of the application based on the configuration file which is output by the application resource uploading module and replaces the storage address.
Through the above steps 301 to 305, an installation package of an application can be generated, further, when a user wants to use the application, the user can operate on a terminal, a download instruction of the application is triggered, the terminal responds to the download instruction of the application and sends a download request of the application to a 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 to obtain a configuration file of the application included in the installation package, and downloads and installs the application based on the configuration file of the application.
According to the technical scheme, based on the generation instruction of the application installation package, volume optimization processing on the first static resource in the application can be triggered, the second static resource after the volume optimization processing is stored in the target storage space, the storage address of the second static resource is updated in the configuration file of the application, and the application installation package is generated based on the updated configuration file.
Fig. 5 is a schematic structural diagram of an apparatus for generating an application installation package according to an embodiment of the present application, and referring to fig. 5, the apparatus includes:
a processing module 501, configured to perform volume optimization processing on a first static resource in an application based on a generation instruction of an installation package of the application to obtain a second static resource, where the volume optimization processing is used to obtain a static resource with a reduced volume;
a storage module 502, configured to store the second static resource in a target storage space, and replace a storage address of the second static resource with a storage address of the target storage space in the configuration file of the application;
a generating module 503, configured to generate an installation package of the application based on the configuration file after replacing the storage address.
According to the technical scheme, based on the generation instruction of the application installation package, volume optimization processing on the first static resource in the application can be triggered, the second static resource after the volume optimization processing is stored in the target storage space, the storage address of the second static resource is updated in the configuration file of the application, and the application installation package is generated based on the updated configuration file.
In some embodiments, the processing module 501 is configured to:
acquiring a configuration file of the first static resource based on a generation instruction of the installation package of the application;
acquiring the first static resource based on the storage address of the first static resource in the configuration file of the first static resource;
and carrying out volume optimization processing on the acquired first static resource.
In some embodiments, the processing module 501 includes at least one of:
a compressing unit, configured to compress the first static resource, and determine the compressed first static resource as the second static resource;
the cutting unit is used for cutting the first static resource and determining the first static resource after cutting as the second static resource;
and the conversion unit is used for converting the first static resource into a static resource in a target format, determining the static resource in the target format as the second static resource, and determining the static resource in the target format as the static resource with the reduced volume.
In some embodiments, the processing module 501 is configured to:
executing a generation flow of the installation package based on a generation instruction of the installation package of the application;
when the generation flow is executed, if a target event is detected, performing volume optimization processing on a first static resource in the application to obtain a second static resource, wherein the target event is used for indicating processing of the first static resource.
In some embodiments, the target storage space is a cloud storage space;
the storage module 502 is configured to:
and storing the second static resource to the cloud storage space through a cloud storage service interface.
It should be noted that: in the apparatus for generating an application installation package according to the foregoing embodiment, when generating an installation package of an application, only the division of each function module is described as an example, and in practical applications, the function distribution may be completed by different function modules according to needs, that is, the internal structure of the device is divided into different function modules, so as to complete all or part of the functions described above. In addition, the apparatus for generating an application installation package and the method for generating an application installation package provided in the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
Fig. 6 shows a block diagram of a terminal 600 according to an exemplary embodiment of the present application. The terminal 600 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, motion video Experts compression standard Audio Layer 3), an MP4 player (Moving Picture Experts Group Audio Layer IV, motion video Experts compression standard Audio Layer 4), a notebook computer, or a desktop computer. The terminal 600 may also be referred to by other names such as user equipment, portable terminal, laptop terminal, desktop terminal, etc.
In general, the terminal 600 includes: a processor 601 and a memory 602.
The processor 601 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so on. The processor 601 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 601 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a 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 that the display screen needs to display. In some embodiments, processor 601 may also include an AI (Artificial Intelligence) processor for processing computational operations related to machine learning.
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, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in the memory 602 is used to store at least one program code for execution by the processor 601 to implement the method of generating an application installation package provided by the method embodiments herein.
In some embodiments, the terminal 600 may further optionally include: a peripheral interface 603 and at least one peripheral. The processor 601, memory 602, and peripheral interface 603 may be connected by buses or signal lines. Various peripheral devices may be connected to the peripheral interface 603 via a bus, signal line, or circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 604, a display 605, a camera assembly 606, an audio circuit 607, a positioning component 608, and a power supply 609.
The peripheral interface 603 may be used to connect at least one peripheral related to I/O (Input/Output) to the processor 601 and the memory 602. In some embodiments, the processor 601, memory 602, and peripheral 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 interface 603 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
The Radio Frequency circuit 604 is used for receiving and transmitting RF (Radio Frequency) signals, also called electromagnetic signals. The radio frequency circuitry 604 communicates with communication networks and other communication devices via electromagnetic signals. The rf circuit 604 converts an electrical signal into an electromagnetic signal to transmit, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 604 comprises: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and so forth. The radio frequency circuitry 604 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocols include, but are not limited to: metropolitan area networks, various generation mobile communication networks (2G, 3G, 4G, and 5G), Wireless local area networks, and/or WiFi (Wireless Fidelity) networks. In some embodiments, the rf circuit 604 may further include NFC (Near Field Communication) related circuits, which are not limited in this application.
The display 605 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display screen 605 is a touch display screen, the display screen 605 also has the ability to capture touch signals on or over the surface of the display screen 605. The touch signal may be input to the processor 601 as a control signal for processing. At this point, the display 605 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, the display 605 may be one, disposed on the front panel of the terminal 600; in other embodiments, the display 605 may be at least two, respectively disposed on different surfaces of the terminal 600 or in a folded design; in other embodiments, the display 605 may be a flexible display disposed on a curved surface or a folded surface of the terminal 600. Even more, the display 605 may be arranged in a non-rectangular irregular pattern, i.e., a shaped screen. The Display 605 may be made of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), and the like.
The camera assembly 606 is used to capture images or video. Optionally, camera assembly 606 includes a front camera and a rear camera. Generally, a front camera is disposed at a front panel of the terminal, and a rear camera is disposed at a rear surface of the terminal. In some embodiments, the number of the rear cameras is at least two, and each rear camera is any one of a main camera, a depth-of-field camera, a wide-angle camera and a telephoto camera, so that the main camera and the depth-of-field camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize panoramic shooting and VR (Virtual Reality) shooting functions or other fusion shooting functions. In some embodiments, camera assembly 606 may also include a flash. The flash lamp can be a monochrome temperature flash lamp or a bicolor temperature flash lamp. The double-color-temperature flash lamp is a combination of a warm-light flash lamp and a cold-light flash lamp, and can be used for light compensation at different color temperatures.
Audio circuitry 607 may include a microphone and a speaker. The microphone is used for collecting sound waves of a user and the environment, converting the sound waves into electric signals, and inputting the electric signals to the processor 601 for processing or inputting the electric signals to the radio frequency circuit 604 to realize voice communication. For the purpose of stereo sound collection or noise reduction, a plurality of microphones may be provided at different portions of the terminal 600. The microphone may also be an array microphone or an omni-directional pick-up microphone. The speaker is used to convert electrical signals from the processor 601 or the radio frequency circuit 604 into sound waves. The loudspeaker can be a traditional film loudspeaker or a piezoelectric ceramic loudspeaker. When the speaker is a piezoelectric ceramic speaker, the speaker can be used for purposes such as converting an electric signal into a sound wave audible to a human being, or converting an electric signal into a sound wave inaudible to a human being to measure a distance. In some embodiments, audio circuitry 607 may also include a headphone jack.
The positioning component 608 is used for positioning the current geographic Location of the terminal 600 to implement navigation or LBS (Location Based Service). The Positioning component 608 can be a Positioning component based on the united states GPS (Global Positioning System), the chinese beidou System, the russian graves System, or the european union's galileo System.
Power supply 609 is used to provide power to the various components in terminal 600. The power supply 609 may be ac, dc, disposable or rechargeable. When the power supply 609 includes a rechargeable battery, the rechargeable battery may support wired or wireless charging. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, the terminal 600 also includes one or more sensors 610. The one or more sensors 610 include, but are not limited to: acceleration sensor 611, gyro sensor 612, pressure sensor 613, fingerprint sensor 614, optical sensor 615, and proximity sensor 616.
The acceleration sensor 611 may detect the magnitude of acceleration in three coordinate axes of the coordinate system established with the terminal 600. For example, the acceleration sensor 611 may be used to detect components of the gravitational acceleration in three coordinate axes. The processor 601 may control the display screen 605 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 611. The acceleration sensor 611 may also be used for acquisition of motion data of a game or a user.
The gyro sensor 612 may detect a body direction and a rotation angle of the terminal 600, and the gyro sensor 612 and the acceleration sensor 611 may cooperate to acquire a 3D motion of the user on the terminal 600. The processor 601 may implement the following functions according to the data collected by the gyro sensor 612: motion sensing (such as changing the UI according to a user's tilting operation), image stabilization at the time of photographing, game control, and inertial navigation.
Pressure sensors 613 may be disposed on the side bezel of terminal 600 and/or underneath display screen 605. When the pressure sensor 613 is disposed on the side frame of the terminal 600, a user's holding signal of the terminal 600 can be detected, and the processor 601 performs left-right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 613. When the pressure sensor 613 is disposed at the lower layer of the display screen 605, the processor 601 controls the operability control on the UI interface according to the pressure operation of the user on the display screen 605. The operability control comprises at least one of a button control, a scroll bar control, an icon control and a menu control.
The fingerprint sensor 614 is used for collecting a fingerprint of a user, and the processor 601 identifies the identity of the user according to the fingerprint collected by the fingerprint sensor 614, or the fingerprint sensor 614 identifies the identity of the user according to the collected fingerprint. Upon identifying that the user's identity is a trusted identity, the processor 601 authorizes the user to perform relevant sensitive operations including unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings, etc. The fingerprint sensor 614 may be disposed on the front, back, or side of the terminal 600. When a physical button or vendor Logo is provided on the terminal 600, the fingerprint sensor 614 may be integrated with the physical button or vendor Logo.
The optical sensor 615 is used to collect the ambient light intensity. In one embodiment, processor 601 may control the display brightness of display screen 605 based on the ambient light intensity collected by optical sensor 615. Specifically, when the ambient light intensity is high, the display brightness of the display screen 605 is increased; when the ambient light intensity is low, the display brightness of the display screen 605 is adjusted down. In another embodiment, the processor 601 may also dynamically adjust the shooting parameters of the camera assembly 606 according to the ambient light intensity collected by the optical sensor 615.
A proximity sensor 616, also known as a distance sensor, is typically disposed on the front panel of the terminal 600. The proximity sensor 616 is used to collect the distance between the user and the front surface of the terminal 600. In one embodiment, when proximity sensor 616 detects that the distance between the user and the front face of terminal 600 gradually decreases, processor 601 controls display 605 to switch from the bright screen state to the dark screen state; when the proximity sensor 616 detects that the distance between the user and the front face of the terminal 600 is gradually increased, the processor 601 controls the display 605 to switch from the breath-screen state to the bright-screen state.
Those skilled in the art will appreciate that the configuration shown in fig. 6 is not intended to be limiting of terminal 600 and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components may be used.
The computer device provided by the embodiment of the application can be provided as a server. Fig. 7 is a schematic structural diagram of a server 700 according to an embodiment of the present application, where the server 700 may generate a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 701 and one or more memories 702, where the memory 1002 stores at least one program code, and the at least one program code is loaded and executed by the processors 701 to implement the method for generating an application installation package according to the above-mentioned method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input/output interface, so as to perform input/output, and the server may also include other components for implementing the functions of the device, which are not described herein again.
In an exemplary embodiment, a computer readable storage medium, such as a memory including program code, which is executable by a processor in a computer device to perform the method of generating an application installation package in the above embodiments, is also provided. For example, the computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a Compact-Disc Read-Only Memory (cd-ROM), a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program product is also provided, which includes computer program code stored in a computer readable storage medium, from which a processor of a computer device reads the computer program code, and executes the computer program code, so that the computer device executes the method for generating an application installation package described above.
In some embodiments, the computer program according to the embodiments of the present application may be deployed to be executed on one computer device or on multiple computer devices located at one site, or may be executed on multiple computer devices distributed at multiple sites and interconnected by a communication network, and the multiple computer devices distributed at the multiple sites and interconnected by the communication network may constitute a block chain system.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by hardware associated with program code, and the program may be stored in a computer readable storage medium, and the above mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present application and should not be taken as limiting, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (10)

1. A method of generating an application installation package, the method comprising:
based on a generation instruction of an installation package of an application, carrying out volume optimization processing on a first static resource in the application to obtain a second static resource, wherein the volume optimization processing is used for obtaining the static resource with a reduced volume;
storing the second static resource to a target storage space, and replacing a storage address of the second static resource with a storage address of the target storage space in a configuration file of the application;
and generating an installation package of the application based on the configuration file after replacing the storage address.
2. The method of claim 1, wherein performing a volume optimization process on a first static resource in an application based on a generation instruction of an installation package of the application comprises:
acquiring a configuration file of the first static resource based on a generation instruction of the installation package of the application;
acquiring the first static resource based on the storage address of the first static resource in the configuration file of the first static resource;
and carrying out volume optimization processing on the acquired first static resource.
3. The method of claim 1, wherein the volume optimization processing of the first static resource in the application comprises at least one of:
compressing the first static resource, and determining the compressed first static resource as the second static resource;
cutting the first static resource, and determining the cut first static resource as the second static resource;
and converting the first static resource into a static resource in a target format, and determining 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 volume.
4. The method according to claim 1, wherein the performing volume optimization processing on the first static resource in the application based on the instruction for generating the installation package of the application to obtain the second static resource comprises:
executing a generation flow of the installation package based on a generation instruction of the installation package of the application;
and when the generation flow is executed, if a target event is detected, performing volume optimization processing on the first static resource in the application to obtain a second static resource, wherein the target event is used for indicating the processing of the first static resource.
5. The method of claim 1, wherein the target storage space is a cloud storage space;
the storing the second static resource to a target storage space comprises:
and storing the second static resource to the cloud storage space through a cloud storage service interface.
6. An apparatus that generates an application installation package, the apparatus comprising:
the processing module is used for carrying out volume optimization processing on the first static resource in the application based on a generation instruction of an installation package of the application to obtain a second static resource, and the volume optimization processing is used for obtaining the static resource with the reduced volume;
the storage module is used for storing the second static resource to a 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;
and the generating module is used for generating the installation package of the application based on the configuration file after the storage address is replaced.
7. The apparatus of claim 6, wherein the processing module is configured to:
acquiring a configuration file of the first static resource based on a generation instruction of the installation package of the application;
acquiring the first static resource based on the storage address of the first static resource in the configuration file of the first static resource;
and carrying out volume optimization processing on the acquired first static resource.
8. A computer device comprising a processor and a memory, the memory having stored therein at least one program code, the at least one program code being loaded and executed by the processor to implement the method of generating an application installation package according to any one of claims 1 to 5.
9. A computer-readable storage medium having stored therein at least one program code, the at least one program code being loaded and executed by a processor to implement the method of generating an application installation package according to any one of claims 1 to 5.
10. A computer program product, characterized in that the computer program product comprises computer program code, the computer program code being stored in a computer readable storage medium, the computer program code being read from the computer readable storage medium by a processor of a computer device, the processor executing the computer program code to cause the computer device to perform the method of generating an application installation package according to any one of claims 1 to 5.
CN202111464728.6A 2021-12-03 2021-12-03 Method and device for generating application installation package, computer equipment and storage medium Pending CN114138290A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111464728.6A CN114138290A (en) 2021-12-03 2021-12-03 Method and device for generating application installation package, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111464728.6A CN114138290A (en) 2021-12-03 2021-12-03 Method and device for generating application installation package, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114138290A true CN114138290A (en) 2022-03-04

Family

ID=80387371

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111464728.6A Pending CN114138290A (en) 2021-12-03 2021-12-03 Method and device for generating application installation package, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114138290A (en)

Similar Documents

Publication Publication Date Title
CN110674022B (en) Behavior data acquisition method and device and storage medium
CN110837378B (en) Calling method and device for software development kit SDK function
CN110569220B (en) Game resource file display method and device, terminal and storage medium
CN110147503B (en) Information issuing method and device, computer equipment and storage medium
CN111159604A (en) Picture resource loading method and device
CN111625315A (en) Page display method and device, electronic equipment and storage medium
CN111737100A (en) Data acquisition method, device, equipment and storage medium
CN112612539B (en) Data model unloading method and device, electronic equipment and storage medium
CN110677713A (en) Video image processing method and device and storage medium
CN112770177B (en) Multimedia file generation method, multimedia file release method and device
CN109413190B (en) File acquisition method and device, electronic equipment and storage medium
CN112118353A (en) Information display method, device, terminal and computer readable storage medium
CN111275607A (en) Interface display method and device, computer equipment and storage medium
CN111258683A (en) Detection method, detection device, computer equipment and storage medium
CN107800720B (en) Hijacking reporting method, device, storage medium and equipment
CN112181442A (en) Unloaded page display method, device, terminal, server and storage medium
CN110889060A (en) Webpage display method and device, computer equipment and storage medium
CN113051015B (en) Page rendering method and device, electronic equipment and storage medium
CN112597417B (en) Page updating method and device, electronic equipment and storage medium
CN112612540B (en) Data model configuration method, device, electronic equipment and storage medium
CN113076452A (en) Application classification method, device, equipment and computer readable storage medium
CN109618018B (en) User head portrait display method, device, terminal, server and storage medium
CN112783533A (en) Version information updating method, version information updating device, terminal and storage medium
CN114138290A (en) Method and device for generating application installation package, computer equipment and storage medium
CN113448692A (en) Distributed graph computing method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination