Method for generating application installation package and method for running application

By uploading the application's image resources to remote storage and recording the remote address, the problem of excessive installation package file size is solved, faster download speed and lower network consumption are achieved, and user experience is improved.

CN113961229BActive Publication Date: 2025-08-19BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111223895.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-20
Publication Date
2025-08-19
Estimated Expiration
2041-10-20

AI Technical Summary

Technical Problem

The file size of the application installation package is too large, resulting in long download time and large network traffic consumption, affecting the user experience.

Method used

Upload the image resources in the application to the remote storage device, record its remote address, delete the local image resources in the installation package, generate target program data, and download the image resources based on the remote address during installation.

Benefits of technology

Reduces the file size of the application installation package, improves download speed, saves network traffic, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113961229B_ABST
    Figure CN113961229B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method for generating an application installation package, a method for running an application, an apparatus, a device, a storage medium, and a program product, relating to the field of computer technology, and particularly to the field of client technology. A specific implementation scheme comprises: determining at least one image control in original program data; uploading at least one image resource corresponding to the at least one image control to a remote storage device, and obtaining a remote image address for each of the at least one image resource, wherein the remote image address indicates the storage location of the image resource in the remote storage device; recording the remote image address in the original program data, and deleting the image resource in the original program data to obtain target program data; and generating an application installation package based on the target program data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to the field of client technology. Background Art

[0002] The file size of an application installation package (or installation package) influences its download volume and user base to a certain extent. The larger the installation package, the more network traffic it consumes and the longer it takes to download. Therefore, overly large installation packages can drive away potential users who have limited network traffic or are unwilling to wait. Summary of the Invention

[0003] The present disclosure provides a method for generating an application installation package, a method for running an application, an apparatus, a device, a storage medium, and a program product.

[0004] According to one aspect of the present disclosure, a method for generating an application installation package is provided, comprising: determining at least one picture control in original program data; uploading at least one picture resource corresponding to the at least one picture control to a remote storage device, and obtaining a picture remote address of each picture resource in the at least one picture resource, wherein the picture remote address is used to indicate a storage location of the picture resource in the remote storage device; recording the picture remote address in the original program data, and deleting the picture resource in the original program data to obtain target program data; and generating an application installation package based on the target program data.

[0005] According to another aspect of the present disclosure, a method for running an application is provided, comprising: obtaining a remote image address of at least one image resource; and downloading the at least one image resource according to the remote image address of the at least one image resource, and storing the at least one image resource to a local storage device, wherein the application is obtained through an application installation file, and the application installation file is generated by the method for generating an application installation package described in an embodiment of the present disclosure.

[0006] According to another aspect of the present disclosure, a device for generating an application installation package is provided, comprising: a determination module for determining at least one image control in original program data; an upload module for uploading at least one image resource corresponding to the at least one image control to a remote storage device, and obtaining a remote image address of each image resource in the at least one image resource, wherein the remote image address is used to indicate a storage location of the image resource in the remote storage device; a recording module for recording the remote image address in the original program data, and deleting the image resource in the original program data to obtain target program data; and a generation module for generating an application installation package based on the target program data.

[0007] According to another aspect of the present disclosure, a device for running an application is provided, comprising: an acquisition module for acquiring a remote image address of at least one image resource; and a download module for downloading the at least one image resource according to the remote image address of the at least one image resource, and storing the at least one image resource in a local storage device, wherein the application is obtained by installing an application installation file, and the application installation file is generated by the method described in any one of claims 1-4.

[0008] Another aspect of the present disclosure provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method shown in the embodiment of the present disclosure.

[0009] According to another aspect of an embodiment of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method shown in the embodiment of the present disclosure.

[0010] According to another aspect of an embodiment of the present disclosure, a computer program product is provided, including a computer program / instruction, wherein the computer program / instruction implements the steps of the method shown in the embodiment of the present disclosure when executed by a processor.

[0011] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure.

[0013] Figure 1 Schematic diagram of an application scenario of a method and apparatus for generating an application installation package and running an application according to an embodiment of the present disclosure;

[0014] Figure 2 A flowchart schematically illustrates a method for generating an application installation package according to an embodiment of the present disclosure;

[0015] Figure 3 A flowchart schematically illustrates a method for running an application according to an embodiment of the present disclosure;

[0016] Figure 4 Schematically shows a flow chart of a method for generating an application installation package according to another embodiment of the present disclosure;

[0017] Figure 5 Schematically shows a flow chart of a method for obtaining a remote address of a picture resource according to another embodiment of the present disclosure;

[0018] Figure 6 Schematically shows a flow chart of a method for generating an application installation package according to another embodiment of the present disclosure;

[0019] Figure 7 A flowchart schematically illustrates a method for running an application according to another embodiment of the present disclosure;

[0020] Figure 8A Schematically shows a schematic diagram of generating an application installation package according to an embodiment of the present disclosure;

[0021] Figure 8B Schematically shows a schematic diagram of running an application according to an embodiment of the present disclosure;

[0022] Figure 9 A block diagram schematically illustrates an apparatus for generating an application installation package according to an embodiment of the present disclosure;

[0023] Figure 10 A block diagram schematically illustrates an apparatus for running an application according to an embodiment of the present disclosure; and

[0024] Figure 11 A block diagram schematically illustrates an example electronic device that may be used to implement embodiments of the present disclosure. DETAILED DESCRIPTION

[0025] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0026] The following will be combined Figure 1 The application scenarios of the method and device provided by the present disclosure are described.

[0027] Figure 1 This is a schematic diagram of an application scenario of a method and apparatus for generating an application installation package and running an application according to an embodiment of the present disclosure. Figure 1 The examples shown are merely examples of system architectures to which the embodiments of the present disclosure may be applied, to help those skilled in the art understand the technical content of the present disclosure, but do not mean that the embodiments of the present disclosure may not be used in other devices, systems, environments or scenarios.

[0028] like Figure 1 As shown, the application scenario 100 includes a development terminal 110 , a client 120 and a remote storage device 130 .

[0029] The development end 110 and the client 120 may be various electronic devices with display screens and supporting network communication, including but not limited to smartphones, tablet computers, laptop computers, and desktop computers, etc. The development end 110 and the client 120 may respectively interact with the remote storage device 130 to send or receive data.

[0030] Remote storage device 130 can be, for example, a server for providing storage services. The server can be a cloud server, also known as a cloud computing server or cloud host, a host product within a cloud computing service system that addresses the management difficulties and poor scalability of traditional physical hosts and VPS (Virtual Private Server) services. The server can also be a server in a distributed system or a server integrated with blockchain.

[0031] According to an embodiment of the present disclosure, a program developer can develop an application through a development terminal 110 to generate program data 101. An application installation package 102 can then be generated based on the program data 101. A user can run the application installation package 102 through a client 120 to install an application 103.

[0032] According to embodiments of the present disclosure, since applications utilize image resources such as icons or images, program data 101 may include one or more image resources 104. When an application installation package 103 is generated based on the program data, image resources 104 are stored within the application installation package 103 and occupy a portion of the package size, resulting in a larger file size for the application installation package 103.

[0033] Based on this, in this embodiment, the image controls in the program data 103 that use local image resources can be determined. The image resources 104 corresponding to these image controls are uploaded to the remote storage device 130, and the image remote address of each of these image resources 104 is obtained, wherein the image remote address can be used to indicate the storage location of the image resource 104 in the remote storage device 130. The image remote address is then recorded in the program data 103, and the image resource 104 in the program data 103 is deleted. Based on the program data 103 after deleting the image resource 104, the application installation package 102 is generated. Since the image resource 104 is deleted from the application installation package 102, the file size of the application installation package 102 is reduced.

[0034] When the application 103 installed based on the application installation package 102 is run, the recorded image remote addresses of the image resources 104 can be obtained. According to these image remote addresses, the corresponding image resources 104 are downloaded and stored in the local storage device, so that the image control in the application 103 can use the image resources 104 normally.

[0035] It should be noted that in the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of information such as program data and remote addresses are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0036] Figure 2 The flowchart of the method for generating an application installation package according to an embodiment of the present disclosure is schematically shown.

[0037] like Figure 2 As shown, the method 200 for generating an application installation package includes determining at least one picture control in original program data in operation S210 .

[0038] According to an embodiment of the present disclosure, the original program data may include, for example, code files of an application program and corresponding resources.

[0039] According to an embodiment of the present disclosure, an image control may include, for example, a control that uses local image resources. Local image resources include image resources stored in a local storage device. For example, in this embodiment, it may be determined whether each control in the original program data uses local image resources, and then controls that use local image resources may be determined as image controls.

[0040] Then, in operation S220, at least one picture resource corresponding to the at least one picture control is uploaded to a remote storage device, and a picture remote address of each picture resource in the at least one picture resource is obtained.

[0041] According to an embodiment of the present disclosure, the picture remote address may be used to indicate the storage location of the picture resource in the remote storage device.

[0042] In operation S230 , the remote address of the picture is recorded in the original program data, and the picture resource in the original program data is deleted to obtain the target program data.

[0043] In operation S240, an application installation package is generated according to the target program data.

[0044] According to an embodiment of the present disclosure, in the process of generating an application installation package, the image resources used by the image control are uploaded to the storage server, and the image resources in the program data are deleted. Then, the application installation package is generated based on the program data, so that the application installation package no longer contains the above-mentioned image resources, thereby reducing the size of the application installation package.

[0045] Figure 3 The flowchart of the method for running an application according to an embodiment of the present disclosure is schematically shown. The application can be obtained through an application installation file, which can be generated by the method for generating an application installation package shown above, for example.

[0046] like Figure 3 As shown, the method 300 for running an application includes, in operation S310, obtaining a remote image address of at least one image resource.

[0047] Then, in operation S320, at least one picture resource is downloaded according to the picture remote address of the at least one picture resource, and the at least one picture resource is stored in a local storage device.

[0048] According to an embodiment of the present disclosure, when an application is running, the remote address of the image resource can be obtained, and the image resource can be downloaded and stored in the local memory according to the remote address, so that the image control in the application can use the corresponding image resource normally.

[0049] According to embodiments of the present disclosure, during the generation of an application installation package, in order to record the remote address of an image in the original program data, an address table file may be provided within the program data, and the remote address of the image may be recorded in the address table file. According to other embodiments of the present disclosure, in order to further reduce the file size of the application installation package, the address table file may also be uploaded to a remote storage device, with only the remote address of the file in the address table file being retained.

[0050] Based on this, Figure 4 A flowchart of a method for generating an application installation package according to another embodiment of the present disclosure is schematically shown.

[0051] like Figure 4 As shown, the method 400 for generating an application installation package includes determining at least one picture control in original program data in operation S410.

[0052] Then, in operation S420, at least one picture resource corresponding to the at least one picture control is uploaded to a remote storage device, and a picture remote address of each picture resource in the at least one picture resource is obtained.

[0053] In operation S430 , an address table file is generated according to the picture remote address of at least one picture resource.

[0054] In operation S440 , the address table file is uploaded to a remote storage device to obtain a remote address of the address table file.

[0055] The remote address of the file may be used to indicate the storage location of the address table file in the remote storage device.

[0056] In operation S450, the file remote address of the address table file is recorded in the original program data.

[0057] In operation S460 , the image resource in the original program data is deleted to obtain the target program data.

[0058] In operation S470, an application installation package is generated according to the target program data.

[0059] According to an embodiment of the present disclosure, the image resource and the address table file may be stored in the same remote storage device or in different remote storage devices, and the present disclosure does not impose any specific limitation on this.

[0060] Correspondingly, when the application is running, the address table file can be obtained from the remote storage device, and then the remote address of the picture resource can be obtained according to the address table file.

[0061] Based on this, Figure 5The flowchart of the method for obtaining the remote address of a picture resource according to another embodiment of the present disclosure is schematically shown.

[0062] like Figure 5 As shown, the method 510 for obtaining a remote address of a picture resource may include, in operation S511 , obtaining a remote address of an address table file.

[0063] According to an embodiment of the present disclosure, for example, when the application is running, the background thread of the application can be used to detect whether the address table file has been downloaded. If the address table file has not been downloaded, the remote address of the address table file is obtained.

[0064] Then, in operation S512, the address table file is downloaded according to the file remote address.

[0065] According to an embodiment of the present disclosure, since the address table file includes the remote address of at least one image resource, the remote address of each image resource can be obtained by downloading the address table file from the remote storage device through the file remote address recorded by the application.

[0066] Figure 6 A flowchart of a method for generating an application installation package according to another embodiment of the present disclosure is schematically shown.

[0067] like Figure 6 As shown, the method 600 for generating an application installation package includes determining at least one picture control in program data in operation S610.

[0068] Then, in operation S620, at least one picture resource corresponding to the at least one picture control is uploaded to a remote storage device, and a picture remote address of each picture resource in the at least one picture resource is obtained.

[0069] In operation S630, the picture remote address is recorded in the program data, and the picture resource in the program data is deleted.

[0070] In operation S640 , a remote address attribute is added to each picture control of the at least one picture control.

[0071] According to an embodiment of the present disclosure, a remote address attribute may be added to the original picture control to record the remote address of the picture resource corresponding to the picture control.

[0072] In operation S650, the remote address property of the picture control is configured according to the picture remote address of the picture resource corresponding to the picture control.

[0073] According to an embodiment of the present disclosure, the value of the remote address property of the picture control may be set to the picture remote address of the picture resource corresponding to the picture control.

[0074] In operation S660, an application installation package is generated based on the program data.

[0075] According to an embodiment of the present disclosure, operations S610 to S630 and S660 may be described above, and will not be described in detail herein.

[0076] Correspondingly, Figure 7 The flowchart of a method for running an application according to another embodiment of the present disclosure is schematically shown.

[0077] like Figure 7 As shown, the method 700 for running an application includes obtaining a remote address of an address table file in operation S710.

[0078] Then, in operation S720, the address table file is downloaded according to the file remote address.

[0079] In operation S730 , a local address of each picture resource in the at least one picture resource is acquired, where the local address is used to indicate a storage location of the picture resource in a local storage device.

[0080] In operation S740 , a correspondence between a picture remote address and a local address of at least one picture resource is recorded in an address table file.

[0081] According to an embodiment of the present disclosure, an address table file may include, for example, at least one item, each item corresponding to an image resource. Each item may include the image resource's remote address and local address. It should be noted that, in addition to the image resource's remote address and local address, each item may also include other information, such as the image resource's identifier, which is not specifically limited in this disclosure.

[0082] In operation S750, when a target picture control among at least one picture control is executed, a target picture remote address configured in a remote address property of the target picture control is acquired.

[0083] In operation S760 , a target local address corresponding to the target picture remote address in the address table file is determined.

[0084] According to an embodiment of the present disclosure, for example, the item where the remote address of the target image is located can be searched in the address table file, and the target local address in the item can be obtained.

[0085] In operation S770 , it is determined whether a target picture resource corresponding to the target picture control exists in the local location indicated by the target local address.

[0086] In operation S780 , if the target picture resource does not exist in the local location, the target picture resource is downloaded according to the target picture remote address.

[0087] According to an embodiment of the present disclosure, for example, a target image resource can be searched for in a local location indicated by a target local address. If the target image resource exists in the local location, the target image resource can be provided to the image control for use. If the target image resource does not exist in the local location, the target image resource can be downloaded according to the target image remote address, and then the downloaded target image resource can be provided to the image control for use.

[0088] According to other embodiments of the present disclosure, the download of image resources may fail, and the image resources in the local storage device may also be lost. Based on this, when any one of the at least one image resources fails to be downloaded and / or any one of the image resources in the local storage device is lost, the image resource can be re-downloaded according to the image remote address of the image resource in the address table file. The re-downloaded image resource is then stored in the local storage device, the local address of the image resource is obtained, and the correspondence between the image remote address and the local address of the image resource is recorded in the address table file.

[0089] According to an embodiment of the present disclosure, a remote address property may be added to each picture control in at least one picture control, and then the remote address property of the picture control is configured according to the picture remote address of the picture resource corresponding to the picture control.

[0090] Reference below Figures 8A-8B , the method for generating an application installation package and the method for running an application shown above are further described in conjunction with specific embodiments. Those skilled in the art will understand that the following exemplary embodiments are only used to understand the present disclosure and the present disclosure is not limited thereto.

[0091] During application development, a large number of images of varying sizes are used. Most images exist as resources in the image resource folder, and each image is assigned an ID to uniquely identify it. The display of images relies on the ImageView control. The image control has a "src" attribute to which the image ID can be assigned. When the program is running, if it detects that the current control is an image control, it will load the corresponding image resource file based on the image ID in the "src" attribute for display. The image control can also display image files in the phone's file system, that is, it parses and displays the image using the image file path.

[0092] Figure 8AThe diagram schematically shows a schematic diagram of generating an application installation package according to an embodiment of the present disclosure.

[0093] exist Figure 8A As shown in the figure, in this embodiment, for example, the application can be an application running on the Android operating system, and the remote storage device can be an image server 810. According to the embodiment of the present disclosure, all image controls in program data 801 can be traversed to detect whether they use local image resources. If an image control uses local image resources, the image control and the image resource 802 it uses are marked. All marked image resources 802 are then uploaded to image server 810, and the image remote address of image resource 802 is obtained. The image remote addresses of all image resources are recorded in address table file 803, and address table file 803 is uploaded to image server 810. It is assumed that the storage address of address table file 803 in image server 810 is remoteUrl, i.e., the file remote address.

[0094] According to the embodiments of the present disclosure, a custom image control can be set for each native image control. The custom image control is developed based on the native image control, inherits the native image control, has all the functions of the native image control, and can expand new functions. The custom image control adds an attribute relative to the native image control: remoteSrc, which is used to represent the remote address of the image resource. When the program is running, if it is detected that the remoteSrc attribute of the image control has a value, it will first detect whether the image has been downloaded based on the remote address of the image. If it has been downloaded, the downloaded local image will be directly loaded. If it has not been downloaded, the image will be downloaded based on the remote address of the image in the remoteSrc attribute value. After the download is complete, it will be displayed through the image control and the image will be stored locally. There is no need to download it again when it is displayed next time.

[0095] Based on this, in this embodiment, all marked image controls can be replaced with corresponding custom controls, and the remoteSrc value of the custom control can be assigned to the remote address of the image resource 802 corresponding to the original image control. Then, all marked image resources 802 in the program data 801 can be deleted, and the remote address remoteUrl of the address table file 803 can be saved in the program data 801. The program data 801 can then be packaged into an installation package.

[0096] Next, you can run the installation package to install the application.

[0097] Figure 8B A schematic diagram of running an application according to an embodiment of the present disclosure is schematically shown.

[0098] exist Figure 8B , after the application 804 is installed, when the application 804 is started, the background thread will detect whether the address table file 803 has been downloaded according to the remote address remoteUrl of the address table file 803. If not, the address table file 803 will be downloaded locally first.

[0099] The image resource 802 is checked one by one based on the remote address of the image in the address table file 803 to see if it has been downloaded. If not, the image resource 802 is downloaded based on the remote address of the image, and the downloaded image resource 802 is saved to the local storage device, and the correspondence between the local address of the downloaded image resource 802 and the remote address of the image is recorded.

[0100] If a custom image control is detected during the operation of the application 804, the remote address of the corresponding image resource 802 is first obtained according to the remoteSrc attribute of the custom image control, and the corresponding local address is queried according to the remote address of the image, and the queried image resource 802 is displayed.

[0101] If the download of picture resource 802 fails or the downloaded picture resource 802 is lost, the picture resource 802 is directly re-downloaded according to the corresponding picture remote address, the downloaded picture resource 802 is saved locally, and the correspondence between the remote address and the downloaded local picture file is recorded for subsequent use, so that there is no need to download it again for subsequent use.

[0102] According to the embodiments of the present disclosure, operations such as traversing image controls, uploading and deleting local image resources, and downloading remote images are all automatically processed without manual intervention, which can save manpower. Secondly, the processing process is completely transparent to developers, and the development process does not require any changes. In addition, the installation package packaged by the application does not contain processed local image resources, thereby reducing the size of the installation package. At the same time, the user experience is almost the same as the installation package generated by the original packaging method, which is very suitable for scenarios that are sensitive to the size of the installation package.

[0103] Figure 9 A block diagram schematically illustrates an apparatus for generating an application installation package according to an embodiment of the present disclosure.

[0104] like Figure 9 As shown, the apparatus 900 for generating an application installation package includes a determination module 910 , an upload module 920 , a recording module 930 and a generation module 940 .

[0105] The determination module 910 is configured to determine at least one image control in the original program data.

[0106] The upload module 920 is used to upload at least one image resource corresponding to at least one image control to a remote storage device, and obtain the image remote address of each image resource in the at least one image resource, wherein the image remote address is used to indicate the storage location of the image resource in the remote storage device.

[0107] The recording module 930 is used to record the remote address of the image in the original program data and delete the image resource in the original program data to obtain the target program data.

[0108] The generating module 940 is used to generate an application installation package according to the target program data.

[0109] Figure 10 A block diagram schematically shows a device for running an application according to an embodiment of the present disclosure.

[0110] like Figure 10 As shown, the device 1000 for running an application includes an acquisition module 1010 and a download module 1020 .

[0111] The acquisition module 1010 is configured to acquire a remote image address of at least one image resource.

[0112] The download module 1020 is configured to download at least one image resource according to the remote image address of the at least one image resource, and store the at least one image resource in a local storage device.

[0113] The application is obtained by installing an application installation file, and the application installation file is generated by the method for generating an application installation package according to an embodiment of the present disclosure.

[0114] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0115] Figure 11 A block diagram of an example electronic device 1100 that can be used to implement embodiments of the present disclosure is schematically shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided as examples only and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0116] like Figure 11As shown, the device 1100 includes a computing unit 1101, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1102 or a computer program loaded from a storage unit 1108 into a random access memory (RAM) 1103. Various programs and data required for the operation of the device 1100 can also be stored in the RAM 1103. The computing unit 1101, the ROM 1102, and the RAM 1103 are connected to each other via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.

[0117] Various components in device 1100 are connected to I / O interface 1105, including an input unit 1106, such as a keyboard and mouse; an output unit 1107, such as various types of displays and speakers; a storage unit 1108, such as a magnetic disk and optical disk; and a communication unit 1109, such as a network card, a modem, a wireless communication transceiver, etc. Communication unit 1109 allows device 1100 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0118] The computing unit 1101 can be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1101 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1101 performs the various methods and processes described above, such as the method for generating an application installation package and the method for running an application. For example, in some embodiments, the method for generating an application installation package and the method for running an application can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 1108. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 1100 via the ROM 1102 and / or the communication unit 1109. When the computer program is loaded into the RAM 1103 and executed by the computing unit 1101, one or more steps of the method for generating an application installation package and the method for running an application described above can be performed. Alternatively, in other embodiments, the computing unit 1101 may be configured in any other appropriate manner (eg, by means of firmware) to execute the method for generating an application installation package and the method for running an application.

[0119] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0120] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0121] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0122] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0123] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0124] Computer systems may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The client and server relationship arises through computer programs running on the respective computers and having a client-server relationship to each other.

[0125] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not a limitation herein.

[0126] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.

Claims

1. A method for generating an application installation package, comprising: determining at least one picture control in the original program data; Uploading at least one image resource corresponding to the at least one image control to a remote storage device, and obtaining a remote image address of each image resource in the at least one image resource, wherein the remote image address is used to indicate a storage location of the image resource in the remote storage device; Generate an address table file including the remote address of the at least one picture resource according to the remote address of the at least one picture resource; Uploading the address table file to the remote storage device to obtain a file remote address of the address table file, wherein the file remote address is used to indicate a storage location of the address table file in the remote storage device; recording the file remote address in the original program data, and deleting the image resource in the original program data to obtain target program data; and An application installation package is generated according to the target program data.

2. The method according to claim 1, wherein Determining at least one picture control in the original program data includes: Determining whether each control in the original program data uses a local image resource, wherein the local image resource includes an image resource stored in a local storage device; and Determine a control that uses the local image resource as the image control.

3. The method according to claim 1, further comprising: adding a remote address property to each picture control in the at least one picture control; as well as The remote address property of the picture control is configured according to the picture remote address of the picture resource corresponding to the picture control.

4. A method for running an application, comprising: Get the remote address of at least one image resource; as well as Downloading the at least one picture resource according to the remote picture address of the at least one picture resource and storing the at least one picture resource in a local storage device, The application is obtained through an application installation file, and the application installation file is generated by the method according to any one of claims 1 to 3. The step of obtaining the remote address of at least one image resource includes: Get the remote address of the address table file; and The address table file is downloaded according to the file remote address, wherein the address table file includes the picture remote address of the at least one picture resource.

5. The method according to claim 4, wherein The remote address of the file for obtaining the address table file includes: Using a background thread of the application program, detecting whether the address table file has been downloaded; and When the address table file has not been downloaded, the remote address of the address table file is obtained.

6. The method according to claim 4, further comprising: Obtaining a local address of each image resource in the at least one image resource, wherein the local address is used to indicate a storage location of the image resource in the local storage device; as well as The correspondence between the remote address and the local address of the at least one picture resource is recorded in the address table file.

7. The method according to claim 6, further comprising: When a target picture control in the at least one picture control is executed, obtaining a target picture remote address configured in a remote address property of the target picture control; Determine the target local address corresponding to the target image remote address in the address table file; Determine whether a target image resource corresponding to the target image control exists in the local location indicated by the target local address; as well as In the case that the target image resource does not exist in the local location, the target image resource is downloaded according to the target image remote address.

8. The method according to claim 6, further comprising: In the event that downloading of any one of the at least one picture resource fails and / or any picture resource in the local storage device is lost, re-downloading the picture resource according to the picture remote address of the picture resource in the address table file; Storing the re-downloaded image resource in a local storage device to obtain a local address of the image resource; as well as The correspondence between the remote address and the local address of the picture resource is recorded in the address table file.

9. A device for generating an application installation package, comprising: a determination module, configured to determine at least one image control in the original program data; an uploading module, configured to upload at least one picture resource corresponding to the at least one picture control to a remote storage device, and obtain a picture remote address of each picture resource in the at least one picture resource, wherein the picture remote address is used to indicate a storage location of the picture resource in the remote storage device; generate an address table file including the picture remote address of the at least one picture resource based on the picture remote address of the at least one picture resource; upload the address table file to the remote storage device, and obtain a file remote address of the address table file, wherein the file remote address is used to indicate a storage location of the address table file in the remote storage device; a recording module, configured to record the remote address of the file in the original program data, and delete the image resource in the original program data to obtain target program data; and A generation module is used to generate an application installation package according to the target program data.

10. A device for running an application, comprising: An acquisition module, used to obtain the remote address of at least one image resource; as well as A download module, configured to download the at least one image resource according to the remote image address of the at least one image resource, and store the at least one image resource in a local storage device, The application is obtained by installing an application installation file, and the application installation file is generated by the method according to any one of claims 1 to 3. The acquisition module is used to acquire the file remote address of the address table file, and the download module is used to download the address table file according to the file remote address, wherein the address table file includes the image remote address of the at least one image resource.

11. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 8.

12. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-8.

13. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Picture downloading method and terminal

    CN108390916A