Program package resource processing method and device

By obtaining and utilizing the characteristic parameters of the images in the package, determining and uploading the target image to the cloud, the problem of poor package volume optimization is solved, achieving a smaller package size and less impact on application running.

CN118656105APending Publication Date: 2024-09-17MASHANG CONSUMER FINANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410461249.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-17
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

When the existing technology reduces the size of the program package, the optimization effect is poor, especially because the proportion of the same pictures in the program package is small, resulting in poor volume optimization effect.

Method used

By obtaining the characteristic parameters of each picture in the package, including the importance of business functions, access index values ​​and picture size, the target picture is determined and uploaded to the cloud server, thereby deleting it from the package and generating a new program. Bag.

Benefits of technology

While reducing the size of the program package, it ensures that deleted images are loaded when the application is running, which reduces the impact of deleting package images on the running of the application and improves the effect of volume optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118656105A
    Figure CN118656105A
Patent Text Reader

Abstract

The invention provides a program package resource processing method and device. The method comprises the steps of obtaining feature parameters of each picture in a first image set picture set included in a first program package; determining a target picture in the first image set picture set according to the feature parameter of each picture in the first image set picture set; and uploading the target picture to a cloud server, and deleting the target picture from the first program package to obtain a second program package. By means of the program package resource processing method, the size of the program package can be reduced, the influence of reduction of the size of the program package on running of the application program corresponding to the program package can be reduced, and the effect of optimizing the size of the program package is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information processing technology, and in particular to a method and device for processing program package resources. Background Art

[0002] With the development of Internet technology, there are more and more types of packages, such as packages for various applications, packages for various functional components in applications, etc. As the functions of various applications or various functional components of applications increase, the size of the packages is also increasing. In order to reduce the size of the packages, it is usually necessary to scan the images in the packages and delete similar images from all the images in the packages. However, the proportion of identical images in the packages is usually very small, which results in poor optimization effect of this size optimization method. Summary of the invention

[0003] The embodiments of the present application provide a method and device for processing program package resources to solve the problem that the optimization effect of the program package volume optimization method in the related art is poor.

[0004] In order to solve the above technical problems, this application is implemented as follows:

[0005] In a first aspect, an embodiment of the present application provides a method for processing a program package resource, the method comprising:

[0006] Acquire a characteristic parameter of each picture in a first picture set included in a first program package, wherein the characteristic parameter includes at least one of a first parameter item, a second parameter item, and a third parameter item, wherein the first parameter item is used to indicate the importance of a business function corresponding to the picture, the second parameter item is used to indicate an access index value corresponding to the picture, and the third parameter item is used to indicate a size of the picture;

[0007] Determining a target picture in the first picture set according to a feature parameter of each picture in the first picture set;

[0008] The target image is uploaded to a cloud server, and the target image is deleted from the first program package to obtain a second program package.

[0009] In a second aspect, an embodiment of the present application provides another method for processing program package resources, the method comprising:

[0010] Receiving user information of a target user terminal device, wherein the target user terminal device is a user terminal device that has installed or started an application corresponding to a second program package, and the second program package is a program package obtained by deleting a target image from the first program package according to characteristic parameters of each image included in the first program package;

[0011] Determining a target user group identifier corresponding to the target user terminal device according to the user information of the target user terminal device;

[0012] Acquire a first picture resource package corresponding to the target user group identifier, wherein the first picture resource package includes at least part of the target pictures;

[0013] Send the first image resource package to the target user terminal device.

[0014] In a third aspect, an embodiment of the present application further provides a program package resource processing device, the program package resource processing device comprising:

[0015] an acquisition module, configured to acquire a characteristic parameter of each image in a first image set included in a first program package, wherein the characteristic parameter includes at least one of a first parameter item, a second parameter item, and a third parameter item, wherein the first parameter item is used to indicate the importance of a business function corresponding to the image, the second parameter item is used to indicate an access index value corresponding to the image, and the third parameter item is used to indicate a size of the image;

[0016] A determination module, configured to determine a target picture in the first picture set according to a feature parameter of each picture in the first picture set;

[0017] The processing module is used to upload the target image to a cloud server and delete the target image from the first program package to obtain a second program package.

[0018] In a fourth aspect, the embodiment of the present application further provides another program package resource processing device, the program package resource processing device comprising:

[0019] a receiving module, configured to receive user information of a target user terminal device, wherein the target user terminal device is a user terminal device that has installed or started an application corresponding to a second program package, and the second program package is a program package obtained by deleting a target image from the first program package based on characteristic parameters of each image included in the first program package;

[0020] A first determination module, configured to determine a target user group identifier corresponding to the target user terminal device according to user information of the target user terminal device;

[0021] A first acquisition module, configured to acquire a first picture resource package corresponding to the target user group identifier, wherein the first picture resource package includes at least part of the target pictures;

[0022] The first sending module is used to send the first image resource package to the target user terminal device.

[0023] In a fifth aspect, an embodiment of the present application further provides a package resource processing device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of the package resource processing method provided in the first aspect are implemented, or the steps of the package resource processing method provided in the second aspect are implemented.

[0024] In a sixth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the program package resource processing method provided in the first aspect are implemented, or the steps of the program package resource processing method provided in the second aspect are implemented.

[0025] In an embodiment of the present application, a target image in the first image set is determined according to the characteristic parameters of each image in the first image set included in the first program package, the target image is deleted from the first program package to obtain a second program, and the target image is uploaded to the cloud server for loading when the application corresponding to the second program package is running. In this way, the size of the program package can be reduced while ensuring the loading of the deleted image when the application corresponding to the program package is running. In addition, since the characteristic parameters of the image include at least one of the first parameter item, the second parameter item and the third parameter item, the first parameter item is used to indicate the importance of the business function corresponding to the image, the second parameter item is used to indicate the access index value corresponding to the image, and the third parameter item is used to indicate the size of the image, that is, the importance of the business function corresponding to the image, the access index value corresponding to the image and the size of the image are considered to determine the image uploaded to the cloud server. This is conducive to ensuring that the target image determined to be uploaded to the cloud server has little impact on the operation of the application corresponding to the program package, thereby reducing the impact of the deletion of the image of the program package on the operation of the application corresponding to the program package, and improving the effect of optimizing the size of the program package. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0027] Figure 1 is a flowchart of a method for processing program package resources provided by an embodiment of the present application;

[0028] Figure 2 is a schematic diagram of image format conversion provided by an embodiment of the present application;

[0029] Figure 3 is a flowchart of a method for processing program package resources provided by another embodiment of the present application;

[0030] Figure 4 is a structural diagram of a program package resource processing device provided in an embodiment of the present application;

[0031] Figure 5 is a structural diagram of a program package resource processing device provided by another embodiment of the present application;

[0032] Figure 6 It is a structural diagram of a program package resource processing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0033] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0034] For ease of understanding, some terms involved in the embodiments of the present application are explained below:

[0035] Software Development Kit (SDK): is a software development kit designed to help developers build specific types of software components or modules. For example, the functional component SDK for mobile terminals may include, but is not limited to, SDK for push notifications, SDK for data analysis and statistics, SDK for one-click login, SDK for optical character recognition (OCR), SDK for liveness recognition, SDK for positioning, SDK for payment, SDK for sharing, SDK for login, etc.

[0036] Gradle: is a project automation build tool based on the concepts of Apache Ant and Apache Maven. It uses a domain-specific language based on Groovy to declare project settings instead of the traditional Extensible Markup Language (XML). Gradle is the management of the project, used for dependency, packaging, deployment, release, and difference management of various channels.

[0037] Vector graphics (VectorDrawable): defined in an XML file as a set of points, lines, curves, and related color information. The main advantage of using vector drawable objects is that the image is scalable, and the image can be scaled without reducing the display quality. In other words, the same file can be resized for different screen densities without reducing the quality of the image, which not only reduces the size of the Android application package (Android Application Package, APK) file, but also reduces the maintenance work of developers.

[0038] WebP: is an open source image compression format that aims to provide higher image compression ratios and better image quality to improve web page loading performance. The WebP image format is mainly optimized for web page images. Its main technical features include high compression ratio, lossy and lossless support, transparency support, animation support, wide browser support, open source and free.

[0039] Pngquant: is a command-line utility and library for lossy compression of PNG images. The compression procedure significantly reduces the file size, usually up to 70%, and maintains full alpha transparency. By using the alpha channel, the image can be converted to the more advanced 8-bit PNG format, which is usually 60-80% smaller than 24 / 32-bit PNG files.

[0040] ASM: is an open source framework for analyzing, converting, and generating Java bytecodes. It is usually used to operate Java class files at the bytecode level, enabling developers to dynamically modify and optimize Java applications without modifying the source code. Java ASM is usually used for bytecode enhancement, generation, analysis, and conversion.

[0041] Java HOOK: refers to the technology of intercepting and modifying some behaviors of a Java program during its running. It is usually implemented using Java's reflection and proxy technology, and can change the behavior of a program without changing the source code of the program. The specific implementation of Java Hook can be achieved by inserting your own code before loading a Java program, and by dynamically generating a proxy class (proxy object) during the running of a Java program to modify the behavior of a Java program.

[0042] It should be noted that the program package provided in the embodiment of the present application may also be referred to as an installation package or a functional component SDK, etc.

[0043] The present application embodiment provides a method for processing a program package resource, which can be applied to an electronic device. Figure 1 , Figure 1is a flowchart of a method for processing program package resources provided in an embodiment of the present application. Figure 1 As shown, the following steps are included:

[0044] Step 101: Obtain characteristic parameters of each image in a first image set included in a first program package, wherein the characteristic parameters include at least one of a first parameter item, a second parameter item, and a third parameter item. The first parameter item is used to indicate the importance of a business function corresponding to the image, the second parameter item is used to indicate an access index value corresponding to the image, and the third parameter item is used to indicate the size of the image.

[0045] In this embodiment, the first program package may be any program package to be optimized, for example, any application installation package, functional component SDK, etc. For example, taking the functional component SDK for a mobile terminal as an example, the functional component SDK may include but is not limited to SDK for push notification, SDK for data analysis and statistics, SDK for one-key login, SDK for OCR, SDK for liveness recognition, SDK for positioning, SDK for payment, SDK for sharing, SDK for login, etc.

[0046] The first picture set included in the first package includes multiple pictures included in the first package, wherein the pictures included in the first package can be used in the running process of the application corresponding to the first package. Exemplarily, the file resources of the first package can be traversed, and the pictures of the first package can be obtained according to the format of each resource file, for example, the file resources in the file resources of the first package in the format of png, jpg, webP, tif, gif, etc. are obtained, that is, the pictures of the first package.

[0047] In some optional embodiments, a custom image detection plug-in based on the Gradle plugin hook APK can be pre-defined to detect images in png, jpg, webP, tif, gif, etc. formats in the program package. For example, a MergeResources Task for image detection can be pre-defined based on the Gradle plugin hook APK to filter out images in png, jpg, webP, tif, gif, etc. formats in the program package.

[0048] Among them, the above-mentioned first image set may include all images obtained from the first program package, or the above-mentioned first image set may include images obtained after preprocessing of all images obtained from the first program package, and the preprocessing may include but is not limited to at least one of image filtering, image format conversion, image path obfuscation processing and image compression.

[0049] The above-mentioned first parameter item is used to indicate the importance of the business function corresponding to the picture, wherein the importance of the business function corresponding to the above-mentioned picture can be set by the user; or can be determined according to the access index value of the business function corresponding to the picture, for example, the more frequently accessed the business function, the higher its importance, and the less frequently accessed the business function, the lower its importance.

[0050] The second parameter item is the access index value corresponding to the image, wherein the access index value may include the number of visits, the frequency of visits, etc. For example, the second parameter item is the number of page views (PV) of the image. The access index value corresponding to each image of the first program package may be an access index value obtained based on the statistics of the access to each image when the application corresponding to the first program package is running within a certain period of history. For example, the access index value corresponding to each image when the application corresponding to the first program package is running within a certain period of time (for example, the last month or week) is counted.

[0051] In some optional embodiments, in the process of each user terminal device running the application corresponding to the first program package, the access situation to each of the above-mentioned images can be reported to the cloud server, and then the cloud server can count the access index value of each of the above-mentioned images based on the access situation to each of the above-mentioned images reported by each user terminal device, and send it to the electronic device used to optimize the first program package. For example, in the case where the first program package is the installation package of application A, in the case where each user terminal device runs application A, the access situation of application A to each image of the installation package of the above-mentioned application A can be reported to the cloud server, and then the cloud server can count the access index value of each image of the installation package of application A, and send it to the electronic device that can be used to optimize the installation package of application A. Exemplarily, the above-mentioned cloud server can periodically count the characteristic parameters of each image, for example, at 24:00 every day, trigger the statistics of the characteristic parameters of each image.

[0052] Step 102: Determine a target picture in the first picture set according to the feature parameters of each picture in the first picture set.

[0053] The following examples illustrate step 102 in different situations:

[0054] Case 1: the above-mentioned characteristic parameters include the first parameter item.

[0055] Exemplarily, when the above-mentioned characteristic parameters include a first parameter item (i.e., a parameter item for indicating the importance of the business function corresponding to the picture), pictures with lower importance of the business function in the first picture set can be determined as target pictures. For example, if the importance of the above-mentioned business function is divided into multiple importance levels, wherein a higher importance level indicates a higher importance, in this case, the above-mentioned first parameter item can be an importance level, and pictures with an importance level less than or equal to a preset importance level can be determined as target pictures. Since some pictures with lower importance of the business functions corresponding to the program package are determined as target pictures, and since the user's requirements for the business functions corresponding to these pictures are often relatively low, the deletion of these pictures has less impact on the operation of the application corresponding to the program package.

[0056] Case 2: the above characteristic parameters include a second parameter item.

[0057] Exemplarily, when the above-mentioned characteristic parameters include a second parameter item (i.e., the access index value corresponding to the picture), the picture with a smaller corresponding access index value in the first picture set can be determined as the target picture. For example, the picture with a corresponding access index value less than or equal to the second preset value in the first picture set is determined as the target picture, or the pictures in the first picture set can be sorted in order from small to large according to the corresponding access index value, and the picture located at the front S1 in the sorting result is determined as the target picture, etc., where S1 is a preset positive integer. Since some pictures with smaller corresponding access index values ​​in the program package are determined as target pictures, that is, pictures with lower access frequency are determined as target pictures, it can be ensured that the deletion of the target picture has less impact on the operation of the application corresponding to the program package.

[0058] Case 3: the above characteristic parameters include a third parameter item.

[0059] Exemplarily, when the above-mentioned characteristic parameters include a third parameter item (i.e., the size of the picture), the pictures in the first picture set whose picture size is greater than or equal to the third preset value can be determined as target pictures, or the pictures in the first picture set can be sorted in descending order of picture size, and the pictures in the first S2 of the sorting results are determined as target pictures, etc., where S2 is a preset positive integer. Since some pictures with larger picture sizes in the program package are determined as target pictures, this is conducive to reducing the size of the program package to a greater extent.

[0060] Case 4: the above-mentioned characteristic parameters include a first parameter item and a second parameter item.

[0061] Exemplarily, in the case where the above-mentioned characteristic parameters include a first parameter item and a second parameter item, pictures in the first picture set whose corresponding business function importance is relatively low and whose corresponding access index value is relatively small can be determined as target pictures; or, pictures in the first picture set that meet any one of the following conditions: a relatively low importance of the corresponding business function and a relatively small corresponding access index value can be determined as target pictures; or, the first parameter item and the second parameter item of each picture can be respectively combined to calculate the evaluation value of each picture, and the target picture can be determined based on the evaluation value of each picture.

[0062] Case 5: The above characteristic parameters include a first parameter item and a third parameter item.

[0063] Exemplarily, in the case where the above-mentioned characteristic parameters include the first parameter item and the third parameter item, the pictures in the first picture set whose corresponding business function has a low importance and whose picture size is greater than or equal to the third preset value can be determined as target pictures; or, all pictures in the first picture set that meet any one of the conditions of low importance of the corresponding business function and whose picture size is greater than or equal to the third preset value can be determined as target pictures; or, the first parameter item and the third parameter item of each picture can be respectively combined to calculate the evaluation value of each picture, and the target picture can be determined based on the evaluation value of each picture.

[0064] Case 6: The above characteristic parameters include a second parameter item and a third parameter item.

[0065] Exemplarily, in the case where the above-mentioned characteristic parameters include a second parameter item and a third parameter item, a picture in the first picture set whose corresponding access index value is smaller and whose picture size is greater than or equal to a third preset value can be determined as a target picture; or, all pictures in the first picture set that satisfy any one of the conditions that the corresponding access index value is smaller and the picture size is greater than or equal to the third preset value can be determined as target pictures; or, the second parameter item and the third parameter item of each picture can be respectively combined to calculate an evaluation value of each picture, and the target picture can be determined based on the evaluation value of each picture.

[0066] Case 7: The above-mentioned characteristic parameters include a first parameter item, a second parameter item and a third parameter item.

[0067] Exemplarily, in the case where the above-mentioned characteristic parameters include a first parameter item, a second parameter item, and a third parameter item, a picture in the first picture set whose corresponding business function has a low importance, a small corresponding access index value, and a picture size greater than or equal to a third preset value can be determined as a target picture; or, pictures in the first picture set that meet any one of the following conditions: a low importance of the corresponding business function, a small corresponding access index value, and a picture size greater than or equal to the third preset value can be determined as target pictures; or, the first parameter item, the second parameter item, and the third parameter item of each picture can be respectively combined to calculate an evaluation value of each picture, and the target picture can be determined based on the evaluation value of each picture.

[0068] Step 103: Upload the target image to a cloud server, and delete the target image from the first program package to obtain a second program package.

[0069] In this embodiment, the target image may also be referred to as an image that needs to be dynamically processed.

[0070] In the above step 103, when the target image is uploaded to the cloud server, the target image can be deleted from the first image set to obtain a second program package, that is, the second program package is the first program package obtained after deleting the target image from the first program package. The above second program package can also be called an optimized program package.

[0071] It should be noted that, in the case of uploading the above-mentioned target image to the cloud server, when the application corresponding to the above-mentioned second program package needs to use the above-mentioned target image, the above-mentioned target image can be requested from the cloud server. Accordingly, the reference method for the above-mentioned target image in the second program package can be modified to a remote reference method. For example, the code of the program package can be modified using ASM to change the reference address of the above-mentioned target image in the second program package from "xx / xx / jpg" to "http: / / xxxx / xx / a.jpg". In some optional embodiments, the above-mentioned remote reference method can also include resolution information. For example, the reference address of the above-mentioned remote reference method is "http: / / xxxx / xx / a.jpg?resolution=720*1280", wherein the purpose of adding resolution (Resolution) is to reduce user traffic and increase the speed of image display.

[0072] In an embodiment of the present application, a target image in the first image set is determined according to the characteristic parameters of each image in the first image set included in the first program package, the target image is deleted from the first program package to obtain a second program, and the target image is uploaded to the cloud server for loading when the application corresponding to the second program package is running. In this way, the size of the program package can be reduced while ensuring the loading of the deleted image when the application corresponding to the program package is running. In addition, since the characteristic parameters of the image include at least one of the first parameter item, the second parameter item and the third parameter item, the first parameter item is used to indicate the importance of the business function corresponding to the image, the second parameter item is used to indicate the access index value corresponding to the image, and the third parameter item is used to indicate the size of the image, that is, the importance of the business function corresponding to the image, the access index value corresponding to the image and the size of the image are considered to determine the image uploaded to the cloud server. This is conducive to ensuring that the target image determined to be uploaded to the cloud server has little impact on the operation of the application corresponding to the program package, thereby reducing the impact of the deletion of the image of the program package on the operation of the application corresponding to the program package, and improving the effect of optimizing the size of the program package.

[0073] Optionally, determining the target picture in the first picture set according to the feature parameters of each picture in the first picture set includes:

[0074] determining, according to the characteristic parameters of each picture in the first picture set, an evaluation value corresponding to each picture in the first picture set, wherein the evaluation value corresponding to the first picture is determined based on a parameter evaluation value set corresponding to the first picture, the parameter evaluation value set corresponding to the first picture includes a parameter evaluation value corresponding to each parameter item of the first picture, and the first picture is any picture in the first picture set;

[0075] A target picture in the first picture set is determined according to the evaluation value corresponding to each picture in the first picture set.

[0076] In the present embodiment, the parameter evaluation value corresponding to each parameter item of the first image can be determined according to the value of each parameter item. For example, the parameter evaluation value corresponding to each parameter item can be determined according to the preset value range to which the value of each parameter item belongs. For each parameter item, a plurality of different preset value ranges can be set respectively, and different preset value ranges can correspond to different parameter evaluation values. In this way, based on the preset value range to which the value of each parameter item of the image belongs, the parameter evaluation value corresponding to each parameter item of the image can be determined.

[0077] Exemplarily, for the first parameter item, if the first parameter item is an importance level for indicating the degree of importance, multiple preset importance level ranges may be set, and different preset importance level ranges correspond to different parameter evaluation values. For example, two preset importance level ranges may be set, wherein the first importance level range is from importance level 1 to importance level 3, and the corresponding parameter evaluation value is a1; the second importance level range is from importance level 4 to importance level 6, and the corresponding parameter evaluation value is a2.

[0078] For the above-mentioned second parameter item, multiple preset access index value ranges can be set. For example, 4 preset access index value ranges are set, where the first preset access index value range is [0, 20], and its corresponding parameter evaluation value is b1; the second preset access index value range is (20, 50], and its corresponding parameter evaluation value is b2; the third preset access index value range is (50, 100], and its corresponding parameter evaluation value is b3; the third preset access index value range is (100, +∞), and its corresponding parameter evaluation value is b4.

[0079] For the above-mentioned third parameter item, multiple preset image size value ranges can be set, for example, 4 preset image size value ranges are set, wherein the first preset image size value range is (0kb, 10kb], and its corresponding parameter evaluation value is c1; the second preset image size value range is (10kb, 20kb], and its corresponding parameter evaluation value is c2; the third preset image size value range is (20kb, 30kb], and its corresponding parameter evaluation value is c3; the fourth preset image size value range is (30kb, +∞), and its corresponding parameter evaluation value is c4.

[0080] Among them, the values ​​of a1 to a2, b1 to b4, and c1 to c4 can be reasonably set according to actual needs.

[0081] After determining the parameter evaluation value set corresponding to the first picture, the corresponding evaluation value of the first picture can be determined according to the parameter evaluation value set corresponding to the first picture. Exemplarily, the corresponding evaluation value of the first picture can be determined according to each parameter evaluation value in the parameter evaluation value set corresponding to the first picture and the weight corresponding to each parameter item of the first picture. For example, the parameter evaluation value corresponding to each parameter item of the first picture and the corresponding weight can be weighted summed to obtain the evaluation value corresponding to the first picture.

[0082] Among them, the weight corresponding to each of the above-mentioned parameter items can also be reasonably set according to actual needs. For example, when the above-mentioned characteristic parameters include the first parameter item, the second parameter item and the third parameter item, the weight of the above-mentioned first parameter item is w1, the weight of the above-mentioned second parameter item is w2, and the weight of the above-mentioned third parameter item is w3, wherein the above-mentioned w1 may be greater than w2, and the above-mentioned w2 may be greater than w3; or, the above-mentioned w2 may be greater than w1, and the above-mentioned w1 may be greater than w3.

[0083] When determining the evaluation value corresponding to each picture in the first picture set, the target picture in the first picture set can be determined according to the evaluation value corresponding to each picture in the first picture set. For example, the picture in the first picture set whose corresponding evaluation value is greater than a threshold can be determined as the target picture, or the picture in the first picture set whose corresponding evaluation value is in the top K can be determined as the target picture, where K is a preset value.

[0084] The embodiment of the present application comprehensively considers the parameter evaluation values ​​corresponding to all parameter items included in the characteristic parameters of each image, jointly calculates the evaluation value corresponding to each image, and measures whether the image needs to be uploaded to the cloud server based on the evaluation value corresponding to each image. This is not only relatively simple to implement, but also helps to more accurately evaluate the images that need to be uploaded to the cloud server.

[0085] Optionally, the parameter evaluation value corresponding to the target parameter item of the first image is determined based on the target value range to which the target sorting number belongs, and the target sorting number is the sorting number of the target parameter item of the first image, and the target parameter item of the first image is any one of the parameter items included in the characteristic parameters of the first image.

[0086] In this embodiment, the sorting sequence number of the target parameter item of the first picture can be understood as the sorting sequence number of the value of the target parameter item of the first picture in the sorting result after the values ​​of the target parameter items of all pictures in the first picture set are sorted. Among them, the sorting of the values ​​of the target parameter items of all pictures in the first picture set can be sorting the values ​​of the target parameter items of all pictures in the first picture set in order from large to small, or can be sorting the values ​​of the target parameter items of all pictures in the first picture set in order from small to large. For ease of understanding, the following is an example of sorting the values ​​of the target parameter items of all pictures in the first picture set in order from large to small.

[0087] The above target value range is the value range to which the sorting sequence number of the target parameter item of the above first image belongs. In practical applications, multiple value ranges can be set for the target parameter item, and different value ranges correspond to different parameter evaluation values. Among them, each value in each value range represents a sorting sequence number. The above multiple value ranges can be reasonably set according to actual needs, for example, 0 to 10, 10 to 20, 20 to 30, and so on.

[0088] In some optional embodiments, the parameter evaluation value corresponding to the above value range is positively correlated with the value within the value range, that is, the larger the value within the value range, the larger the parameter evaluation value corresponding to the value range. For example, if the above multiple value ranges include a value range a1, a value range a2, and a value range a3, and the value range a1 is 0 to 10, the value range a2 is 10 to 20, and the value range a3 is 20 to 30, then the parameter evaluation value corresponding to the value range a1 is less than the parameter evaluation value corresponding to the value range a2, and the evaluation value corresponding to the value range a2 is less than the parameter evaluation value corresponding to the value range a3, and so on. In this case, exemplarily, the picture in the first picture set whose corresponding evaluation value is greater than or equal to the threshold value can be determined as the target picture.

[0089] In some optional embodiments, the parameter evaluation value corresponding to the above value range is negatively correlated with the value within the value range, that is, the larger the value within the value range, the smaller the parameter evaluation value corresponding to the value range. For example, if the above multiple value ranges include a value range a1, a value range a2, and a value range a3, and the value range a1 is 0 to 10, the value range a2 is 10 to 20, and the value range a3 is 20 to 30, then the parameter evaluation value corresponding to the value range a1 is greater than the parameter evaluation value corresponding to the value range a2, and the evaluation value corresponding to the value range a2 is greater than the parameter evaluation value corresponding to the value range a3, and so on. In this case, exemplarily, the picture in the first picture set whose corresponding evaluation value is less than or equal to the threshold value can be determined as the target picture.

[0090] The following is an example to illustrate:

[0091] For the target parameter item, the values ​​of the target parameter item of each picture in the first picture set can be sorted in order from large to small, and the parameter evaluation value corresponding to the first target value range to which the sorting sequence number of the target parameter item of each picture belongs can be respectively determined as the parameter evaluation value corresponding to the target parameter item of each picture. For example, if the multiple value ranges corresponding to the target parameter item include a value range a1, a value range a2, and a value range a3, the value range a1 is 0 to 10, the value range a2 is 10 to 20, and the value range a3 is 20 to 30, then if the sorting sequence number of the target parameter item of picture A1 is 2, then the parameter evaluation value of the target parameter item of picture A1 is the parameter evaluation value corresponding to the value range a1; if the sorting sequence number of the target parameter item of picture A2 is 15, then the parameter evaluation value of the target parameter item of picture A2 is the parameter evaluation value corresponding to the value range a2, and so on.

[0092] It should be noted that the multiple value ranges corresponding to the above target parameter items can be reasonably set according to actual needs, and the above description is only an example. In addition, the multiple value ranges corresponding to the first parameter item, the multiple value ranges corresponding to the second parameter item, and the multiple value ranges corresponding to the third parameter item can be set separately.

[0093] In some optional embodiments, the parameter evaluation value corresponding to the first parameter item of the first picture is determined based on the first target value range to which the first target sorting number belongs, and the first target sorting number is the sorting number of the first parameter item of the first picture. The parameter evaluation value corresponding to the second parameter item of the first picture is determined based on the second target value range to which the second target sorting number belongs, and the second target sorting number is the sorting number of the second parameter item of the first picture. The parameter evaluation value corresponding to the third parameter item of the first picture is determined based on the value of the third parameter item of the first picture.

[0094] That is, in this embodiment, for the third parameter item, the parameter evaluation value corresponding to the third target value range to which the value of the third parameter item of each image belongs can be determined as the parameter evaluation value corresponding to the third parameter item of each image. For example, if the multiple value ranges corresponding to the third parameter item include a value range c1, a value range c2, and a value range c3, the value range c1 is 0-10kb, the value range c2 is 10-20kb, and the value range c3 is 20-30kb, then if the value of the third parameter item of image A1 is 22kb, then the parameter evaluation value of the third parameter item of image A1 is the parameter evaluation value corresponding to the value range c3; if the value of the third parameter item of image A2 is 13kb, then the parameter evaluation value of the third parameter item of image A2 is the parameter evaluation value corresponding to the preset value range c2, and so on.

[0095] It should be noted that the multiple value ranges corresponding to the third parameter item can be reasonably set according to actual needs, and the above description is only an example.

[0096] The embodiment of the present application sets the tendency for images with lower corresponding business function importance, smaller corresponding access index value and larger image size to be uploaded to the cloud server. This is not only beneficial for reducing the size of the program package to a greater extent, but also beneficial for reducing the impact of deletion of images in the program package on the operation of the application corresponding to the program package while reducing the size of the program package.

[0097] Optionally, before obtaining the characteristic parameter of each picture in the first picture set included in the first program package, the method further includes:

[0098] The second image set included in the first program package is preprocessed to obtain the first image set, wherein the size of the second image set is larger than the size of the first image set.

[0099] The preprocessing may include but is not limited to at least one of image filtering, image format conversion, image path obfuscation processing, and image compression.

[0100] Exemplarily, the above-mentioned image filtering may include filtering images in the second image set that meet the first preset condition, wherein the above-mentioned second image set may include all images obtained from the first program package, and the above-mentioned first preset condition may include but is not limited to at least one of the following: the size of the image is less than or equal to the first preset value, the image belongs to the image whitelist, the image resolution is not the first preset resolution, the image is not referenced, and the image is invalidly referenced. Among them, the above-mentioned first preset value, the first preset resolution and the image whitelist can all be reasonably set according to actual needs. Exemplarily, the above-mentioned first preset value can be 20KB (kilobytes), 15KB, etc. The above-mentioned first preset resolution is an extra high-precision resolution (Extra High Density Per inch, x-hdpi) or xx-hdpi, etc.

[0101] In some optional embodiments, configuration information for image filtering may be predefined.

[0102] For example, an example of the above configuration information may be as follows:

[0103] size:20, / / file size

[0104] white_list:['a.png','b.so','...'], / / file whitelist

[0105] resolution:[xx-hdpi] / / File resolution

[0106] Based on the above configuration information, images smaller than 20KB will be removed first, then images in the whitelist will be removed, and finally images with other resolutions except the above xx-hdpi will be removed, and only images with the specified resolution will be retained to obtain the above first image set.

[0107] It should be noted that in program package development, usually the same picture will be cut into multiple sets of pictures with different resolutions by the designer and placed in corresponding directories, for example, @2x, @3x, etc. of IOS, hdpi, xhdpi, xxhpdi, etc. of Android) to support the diversification of device sizes and meet users' demand for high-quality user interface (UI). However, this often increases the size of the program package exponentially. Therefore, this embodiment only retains one set of higher-resolution pictures to reduce the size of the program package.

[0108] The above-mentioned image format conversion may include but is not limited to converting the image into a vector image, a Webp format image or a jpg format image, etc., to reduce the image size.

[0109] For the obfuscation of the above-mentioned image path, for example, a preset image obfuscation tool, such as the AndResGuard tool, can be used to obfuscate the image path. An example of the obfuscation result of the image path can be as follows: res / drawable / icon.png->r / d / i.png. Obfuscation of the image path helps to reduce the size of the package, and also increases the difficulty of reading the code after decompilation.

[0110] The above-mentioned picture compression may include compressing the picture using compression formats such as 7-Zip, zip or rar. Preferably, the 7-Zip compression format may be used to compress the picture, because the 7-Zip compression format has a high compression ratio and multiple compression algorithms can be selected during compression, and the compression ratio is higher than that of compression formats such as zip and tar, and the compressed file is the smallest. Exemplarily, a preset 7-Zip compression tool may be used to perform 7-Zip compression on the picture, for example, the AndResGuard tool may be used to perform 7-Zip compression on the picture.

[0111] It should be noted that, when the above-mentioned preprocessing includes at least two of the following processes: image filtering, image format conversion, image path obfuscation processing, and image compression, this embodiment does not limit the order in which the above-mentioned at least two processes are performed. In some optional embodiments, when the above-mentioned preprocessing includes image filtering, image format conversion, image path obfuscation processing, and image compression, image filtering, image format conversion, image path obfuscation processing, and image compression may be performed in sequence.

[0112] In this embodiment, the first image set is obtained by preprocessing the second image set included in the first program package, and the size of the first image set is smaller than the size of the second image set, which is conducive to further reducing the size of the program package.

[0113] Optionally, the first picture set includes pictures obtained after pictures included in the first program package are converted into a picture format;

[0114] The converting the first picture into a picture format includes:

[0115] If the first picture is not a vector picture, convert the first picture into a vector picture;

[0116] In the case where converting the first picture into a vector picture fails, if the first picture is not a WebP format picture, determining whether to convert the first picture into a WebP format picture;

[0117] If yes, convert the first image into a WebP format image;

[0118] If not, determining whether the first picture includes transparency data;

[0119] If yes, then if the first picture is not a png format picture, convert the first picture into a png format picture;

[0120] If not, if the first picture is not a picture in jpg format, convert the first picture into a picture in jpg format;

[0121] The first picture is any picture included in the first program package.

[0122] In this embodiment, each picture that is not a vector picture in the pictures included in the first program package can be converted into a vector picture. For example, a preset vector graphics (Vector Drawable, VD) conversion plug-in or tool, such as the Vector Magic tool, can be called to convert each picture that is not a vector picture in the pictures included in the first program package into a vector picture. Figure 2 shown.

[0123] In the above determination of whether to convert the first image into a WebP format image, illustratively, when the conversion of the first image into a vector image fails, a preset WebP conversion plug-in or tool, such as AnyWebP tool, etc., may be called to convert the first image into a WebP format image, such as Figure 2 As shown, the sizes of the first image before and after the WebP format conversion are compared. If the size of the image after conversion is smaller than the size of the image before conversion, it is determined that the first image is converted into a WebP format image; otherwise, it is determined not to convert the first image into a WebP format image.

[0124] In the case of determining not to convert the first image into a WebP format image, it can be determined whether the first image includes transparency data. If the first image includes transparency data, then if the first image is not a png format image, the first image is converted into a png format image, and a preset pngquant tool is used to compress the png format image. If the first image is a png format image, the preset pngquant tool can be directly used to compress the png format image. If the first image does not include transparency data, then if the first image is not a jpg format image, the first image is converted into a jpg format image, such as Figure 2 As shown. For example, whether the first image includes transparency data can be determined by detecting whether the pixel points of the first image include data of a transparent channel. For example, the first image is converted into pixel data using the buffer and canvas of Node.js, and the transparent channel of each pixel is traversed to determine whether each pixel point of the first image carries transparency data.

[0125] The embodiment of the present application can effectively reduce the size of the images included in the first program package by performing the above-mentioned image format conversion on the images included in the first program package, which is beneficial to further reduce the size of the program package.

[0126] The present application embodiment also provides another method for processing program package resources, which can be applied to a cloud server. Figure 3 , Figure 3 is a flowchart of a method for processing program package resources provided in an embodiment of the present application. Figure 3 As shown, the following steps are included:

[0127] Step 301, receiving user information of a target user terminal device, wherein the target user terminal device is a user terminal device that has installed or started an application corresponding to a second program package, and the second program package is a program package obtained by deleting a target image from the first program package based on characteristic parameters of each image included in the first program package.

[0128] In this embodiment, the target user terminal device may be any user terminal device that has installed or started the application corresponding to the second program package. For example, the target user terminal device may be any user terminal device that has just installed the application corresponding to the second program package or started the application corresponding to the second program package for the first time.

[0129] The above-mentioned user terminal device can be a terminal, wherein the terminal can include a mobile phone, a tablet computer (Tablet Personal Computer), a laptop computer (Laptop Computer), a notebook computer, a personal digital assistant (Personal Digital Assistant, PDA), a handheld computer, a netbook, an ultra-mobile personal computer (Ultra-mobile Personal Computer, UMPC), a mobile Internet device (Mobile Internet Device, MID), an augmented reality (Augmented Reality, AR), a virtual reality (Virtual Reality, VR) device, a robot, a wearable device (Wearable Device), an aircraft (flight vehicle), a vehicle user equipment (VUE), a shipborne equipment, a pedestrian terminal (Pedestrian User Equipment, PUE), a smart home (home appliances with wireless communication functions, such as refrigerators, televisions, washing machines or furniture, etc.), a game console, a personal computer (Personal Computer, PC), a teller machine or a self-service machine and other terminal side devices. Wearable devices include: smart watches, smart bracelets, smart headphones, smart glasses, smart jewelry (smart bracelets, smart bracelets, smart rings, smart necklaces, smart anklets, smart anklets, etc.), smart wristbands, smart clothing, etc. Among them, the vehicle-mounted device can also be called a vehicle-mounted terminal, a vehicle-mounted controller, a vehicle-mounted module, a vehicle-mounted component, a vehicle-mounted chip or a vehicle-mounted unit, etc. It should be noted that the specific type of the terminal is not limited in the embodiments of the present application.

[0130] The second program package is a program package obtained by deleting the target image from the first program package according to the characteristic parameters of each image included in the first program package. The characteristic parameters of the image may include but are not limited to at least one of the size of the image, the resolution of the image, the frequency of use of the image, the importance of the business function corresponding to the image, and the access index value corresponding to the image. It is understandable that the cloud server may store the target image.

[0131] In some optional embodiments, the second program package may be a second program package obtained after being processed by the program package resource processing method provided in any of the aforementioned embodiments.

[0132] The application corresponding to the above-mentioned second program package can be an application obtained by installing the above-mentioned second program package, that is, the above-mentioned second program package is an installation package of the application; or, it can be an application including a target functional component, which is a functional component obtained by installing the above-mentioned second program package, that is, the above-mentioned second program package is an installation package of a functional component of the application.

[0133] The above user information may include but is not limited to at least one of region, gender, age, occupation, income, invitation ID, etc.

[0134] Exemplarily, the target user terminal device may send user information to the cloud server when the application corresponding to the second program package is started for the first time, and the cloud server may determine the user group identifier corresponding to the target user terminal device based on the user information.

[0135] Step 302: Determine a target user group identifier corresponding to the target user terminal device according to the user information of the target user terminal device.

[0136] The above target user group identifier is the user group identifier of the target user terminal device.

[0137] Exemplarily, the cloud server may use a preset user group identifier generation rule to generate a user group identifier based on user information. For example, each parameter item of the user information may be encoded separately, and the encoding results of each parameter item may be concatenated to obtain the user group identifier; or a preset string corresponding to different values ​​of each parameter item of the user information may be pre-established, and the preset string corresponding to the value of each parameter item of the user information may be concatenated to obtain the user group identifier.

[0138] In some optional embodiments, the cloud server may send the target user group identifier to the target user terminal device. Accordingly, the target user terminal device receives the target user group identifier and may send access data to the cloud server each time it accesses a picture in the target picture corresponding to the second program package, wherein the access data includes the identifier of the accessed picture and the target user group identifier. The cloud server may count the access of each user group identifier to the picture in the target picture based on the identifier of the accessed picture and the user group identifier sent by each user terminal device, and may then update the picture resource package corresponding to each user group identifier.

[0139] Step 303: Acquire a first picture resource package corresponding to the target user group identifier, wherein the first picture resource package includes at least part of the target pictures.

[0140] In this embodiment, the first picture resource package is the picture resource package corresponding to the target user group identifier.

[0141] In actual applications, the cloud server can generate an image resource package corresponding to each user group identifier based on the target image in advance. For example, the image resource package corresponding to each user group identifier can be determined based on the statistics of the user groups identified by each user group identifier accessing each image of the target image.

[0142] Step 304: Send the first image resource package to the target user terminal device.

[0143] In this embodiment, the cloud server determines the target user group identifier based on the user information of the target user terminal device, obtains the first image resource package corresponding to the target user group identifier and sends it to the target user terminal device. Since the corresponding image resource package is determined based on the user group identifier corresponding to the user terminal device and fed back to the user terminal device, compared to directly sending all images of the target image to the user terminal device, it can improve the loading speed of the image while ensuring the operation of the application corresponding to the program package of the user terminal device to a greater extent, which is beneficial to improve the operation effect of the application corresponding to the program package.

[0144] Optionally, before obtaining the first picture resource package corresponding to the target user group identifier, the method further includes:

[0145] Obtaining user information of N user-end devices, wherein the N user-end devices are user-end devices that have run the application corresponding to the second program package, and N is a positive integer;

[0146] Determine the user group identifier corresponding to each of the user terminal devices according to the user information of each of the user terminal devices;

[0147] Determine the image resource package corresponding to each of the user group identifiers respectively, wherein the image resource package corresponding to the user group identifier includes images whose total access index value in the target image meets a preset condition, and the total access index value of the image is the access index value of the image by all user terminal devices corresponding to the user group identifier.

[0148] In actual applications, each user terminal device installed with the application corresponding to the second program package can upload its user information to the cloud server, and each user terminal device can upload its access status to each of the above target images to the cloud server. The cloud server can determine the user group identifier corresponding to each user terminal device based on the user information of each user terminal device, wherein user terminal devices with the same corresponding user group identifier belong to the same user group.

[0149] Furthermore, the cloud server can count the total access index values ​​of all user-end devices corresponding to each user group identifier to each image of the target image, and use the image resource package consisting of images whose total access index values ​​meet the preset conditions as the image resource package corresponding to the corresponding user group identifier. For example, count the total access index values ​​of all user-end devices corresponding to the first user group identifier to each image in the target image, and use the image resource package consisting of images whose total access index values ​​meet the preset conditions as the image resource package corresponding to the first user group identifier; count the total access index values ​​of all user-end devices corresponding to the second user group identifier to each image in the target image, and use the image resource package consisting of images whose total access index values ​​meet the preset conditions as the image resource package corresponding to the second user group identifier, and so on.

[0150] Exemplarily, the above-mentioned statistics on the total access index values ​​of all user terminal devices corresponding to each user group identifier to each image of the target image may be statistics on the total access index values ​​of all user terminal devices corresponding to each user group identifier to each image of the target image within a recent preset time length, wherein the above-mentioned preset time length may be reasonably set according to actual needs. For example, the total access index values ​​of all user terminal devices corresponding to each user group identifier to each image of the target image within the recent six months, one month, or one week may be counted.

[0151] The total access index value may include but is not limited to the total access volume or the total access frequency. The preset condition may include but is not limited to at least one of the following: the total access index value is greater than or equal to the fourth preset value, and the total access index value is ranked in the top M when the total access index values ​​are sorted in descending order. The fourth preset value and M can be reasonably set according to actual needs. For example, the fourth preset value is 100 and M is 50.

[0152] This embodiment determines the image resource package corresponding to each user group identifier by separately counting the total access index values ​​of all user terminal devices corresponding to each user group identifier to each image in the target image, that is, setting corresponding image resource packages for different user group identifiers, which is conducive to improving the accuracy of image resource package setting, and further helps to improve the loading speed of the user terminal device corresponding to each user group identifier for the images uploaded to the cloud server.

[0153] Optionally, the user information includes at least one of the following parameter items: region, gender, age, occupation, income, invitation ID;

[0154] The step of determining the target user group identifier corresponding to the target user terminal device according to the user information of the target user terminal device includes:

[0155] Determine respectively the preset character string corresponding to the value of each parameter item of the user information of the target user terminal device;

[0156] The preset character strings corresponding to the values ​​of each parameter item are concatenated in a preset order to obtain the target user group identifier.

[0157] In this embodiment, the above-mentioned invitation identification, for example, an invitation code. The preset character string corresponding to the value of each parameter item of the above-mentioned user information can be reasonably set according to actual needs. The following is an example of the above-mentioned user information including region, gender, age, occupation, income and invitation identification, wherein, in each of the following parameter items, the value of each parameter item is indicated before "->", and the preset character string corresponding to the value of each parameter item is indicated after "->".

[0158] Region: 0~99, for example, Beijing->01, Hebei->07, and so on;

[0159] Gender: Male->01, Female->02;

[0160] Age: 0~18->01, 18~25->02, 25~35->03, and so on;

[0161] Educational background: high school->01, college->02, undergraduate->03, and so on;

[0162] Occupation: Doctor->01, Programmer->02, and so on;

[0163] Income: less than 3,000 -> 01, 3,000-5,000 -> 02, 5,000-8,000 -> 03, and so on;

[0164] Invitation ID: 0996->0996, 0078->0078, and so on;

[0165] If the value of each parameter item of the user information of the target user terminal device is as follows: region is Hebei, gender is male, age is 25-35, education level is undergraduate, occupation is programmer, income is 7000, invitation ID is 0996, then the target user group ID can be: 0701030302030996.

[0166] This embodiment sets preset strings for different values ​​or value ranges of each parameter item of the user information, and concatenates the preset strings corresponding to the value of each parameter item to obtain a user group identifier. This is not only simple to implement, but also can realize the division of user groups more reasonably.

[0167] Optionally, the method further comprises:

[0168] Determining the downloading timing of the image resource package corresponding to the second program package according to the target parameter of the second program package, wherein the target parameter includes at least one of the following: the importance of the business function corresponding to the second program package, and the running frequency of the application corresponding to the second program package;

[0169] Sending the download timing of the picture resource package corresponding to the second program package to the target user terminal device.

[0170] In this embodiment, multiple downloading opportunities can be preset, such as startup download, homepage download, thread idle download, and download during use, etc. Among them, the startup download can be understood as loading the image resource package from the cloud server when the application corresponding to the program package is started; the homepage download can be understood as loading the image resource package from the cloud server when entering or loading the homepage of the application corresponding to the program package; the thread idle download can be understood as loading the image resource package from the cloud server when the thread of the application corresponding to the program package is idle; the download during use can be understood as loading the image resource package from the cloud server when the application or functional component obtained by installing the first program package is used.

[0171] Specifically, the cloud server can determine the downloading time of the image resource package corresponding to the second program package based on the target parameters of the second program package, and send it to the user terminal device that has installed the application corresponding to the second program package. For example, for a program package with a higher degree of importance of the corresponding business function, its access frequency is often higher, and its corresponding downloading time can be startup download or home page download, etc.; for a program package with a lower degree of importance of the corresponding business function, its access frequency is often lower, and its corresponding downloading time can be thread idle download or download when in use, etc.

[0172] Accordingly, when the user-end device receives the download opportunity for the image resource package corresponding to the second program package, the user-end device may send the user information of the target user-end device to the cloud server at the download opportunity to request download of the image resource package corresponding to the second program package; alternatively, the user-end device may send the user information of the user-end device to the cloud server and receive the download opportunity returned by the cloud server, and the user-end device sends a download request to the cloud server at the above-mentioned download opportunity, and receives the image resource package corresponding to the second program package from the cloud server.

[0173] In some optional embodiments, the identifiers corresponding to the above-mentioned various downloading opportunities can be set respectively, for example, 0 for starting download, 1 for home page download, 2 for thread idle download, and 3 for downloading when in use, and then the cloud server can directly configure the identifiers corresponding to various downloading opportunities to the user terminal device. Then the user terminal device can decide when to download or pre-download the image resource package based on the downloading opportunity configured by the cloud server.

[0174] This embodiment determines the downloading timing of the image resource package corresponding to the second program package based on at least one of the importance of the business function corresponding to the second program package and the running frequency of the corresponding application program. This is beneficial for ensuring the image display effect of the application program corresponding to the second program package while reducing the impact of the image resource package download on the running of the application program corresponding to the second program package.

[0175] Optionally, before sending the first picture resource package to the target user terminal device, the method further includes:

[0176] Obtaining the resolution of the target user terminal device;

[0177] Converting the resolution of the pictures in the first picture resource package according to the resolution of the target user terminal device;

[0178] The sending the first picture resource package to the target user terminal device includes:

[0179] The first image resource package after the resolution conversion is sent to the target user terminal device.

[0180] Exemplarily, the target user terminal device may send the user information and the resolution of the target user terminal device to the cloud server together; or, the user information and the resolution of the target user terminal device may be sent to the cloud server separately.

[0181] When the cloud server receives the resolution of the target user-end device, it can convert each image of the first image resource package based on the resolution of the target user-end device to obtain each image with the resolution of the target user-end device. For example, each image of the first image resource package can be cropped according to the resolution of the target user-end device, and the first image resource package after resolution conversion can be sent to the target user-end device. This is beneficial to improving the loading speed of the images of the first image resource package by the target user-end device and reducing user traffic overhead.

[0182] See also Figure 4 , Figure 4 is a structural diagram of a program package resource processing device provided in an embodiment of the present application. Figure 4 As shown, the package resource processing device 400 includes:

[0183] An acquisition module 401 is used to acquire a characteristic parameter of each picture in a first picture set included in a first program package, wherein the characteristic parameter includes at least one of a first parameter item, a second parameter item, and a third parameter item, wherein the first parameter item is used to indicate the importance of a business function corresponding to the picture, the second parameter item is used to indicate an access index value corresponding to the picture, and the third parameter item is used to indicate the size of the picture;

[0184] A determination module 402, configured to determine a target picture in the first picture set according to a feature parameter of each picture in the first picture set;

[0185] The processing module 403 is used to upload the target image to the cloud server and delete the target image from the first program package to obtain a second program package.

[0186] Optionally, the determination module is specifically used to:

[0187] determining, according to the characteristic parameters of each picture in the first picture set, an evaluation value corresponding to each picture in the first picture set, wherein the evaluation value corresponding to the first picture is determined based on a parameter evaluation value set corresponding to the first picture, the parameter evaluation value set corresponding to the first picture includes a parameter evaluation value corresponding to each parameter item of the first picture, and the first picture is any picture in the first picture set;

[0188] A target picture in the first picture set is determined according to the evaluation value corresponding to each picture in the first picture set.

[0189] Optionally, the parameter evaluation value corresponding to the target parameter item of the first image is determined based on the target value range to which the target sorting number belongs, and the target sorting number is the sorting number of the target parameter item of the first image, and the target parameter item of the first image is any one of the parameter items included in the characteristic parameters of the first image.

[0190] Optionally, the first picture set includes pictures obtained after pictures included in the first program package are converted into a picture format;

[0191] The converting the first picture into a picture format includes:

[0192] If the first picture is not a vector picture, convert the first picture into a vector picture;

[0193] In the case where converting the first picture into a vector picture fails, if the first picture is not a WebP format picture, determining whether to convert the first picture into a WebP format picture;

[0194] If yes, convert the first picture into a WebP format picture;

[0195] If not, determining whether the first picture includes transparency data;

[0196] If yes, then if the first picture is not a png format picture, convert the first picture into a png format picture;

[0197] If not, if the first picture is not a picture in jpg format, convert the first picture into a picture in jpg format;

[0198] The first picture is any picture included in the first program package.

[0199] The program package resource processing device 400 provided in the embodiment of the present application can implement each process in the above-mentioned electronic device side method embodiment, and will not be described again here to avoid repetition.

[0200] See also Figure 5 , Figure 5 is a structural diagram of a program package resource processing device provided in an embodiment of the present application. Figure 5 As shown, the package resource processing device 500 includes:

[0201] The receiving module 501 is used to receive user information of a target user terminal device, wherein the target user terminal device is a user terminal device that has installed or started an application corresponding to a second program package, and the second program package is a program package obtained by deleting a target image from the first program package according to characteristic parameters of each image included in the first program package;

[0202] A first determination module 502 is used to determine a target user group identifier corresponding to the target user terminal device according to the user information of the target user terminal device;

[0203] A first acquisition module 503 is used to acquire a first picture resource package corresponding to the target user group identifier, wherein the first picture resource package includes at least part of the target pictures;

[0204] The first sending module 504 is configured to send the first image resource package to the target user terminal device.

[0205] Optionally, the device further comprises:

[0206] A second acquisition module is used to acquire user information of N user terminal devices before acquiring the first picture resource package corresponding to the target user group identifier, wherein the N user terminal devices are user terminal devices that have run the application corresponding to the second program package, and N is a positive integer;

[0207] A second determination module, configured to determine a user group identifier corresponding to each of the user terminal devices according to user information of each of the user terminal devices;

[0208] The third determination module is used to respectively determine the image resource package corresponding to each of the user group identifiers, wherein the image resource package corresponding to the user group identifier includes images whose total access index value in the target image meets a preset condition, and the total access index value of the image is the access index value of the image by all user terminal devices corresponding to the user group identifier.

[0209] Optionally, the device further comprises:

[0210] a fourth determination module, configured to determine a downloading timing of the image resource package corresponding to the second program package according to a target parameter of the second program package, wherein the target parameter includes at least one of the following: an importance of a business function corresponding to the second program package, and an operating frequency of an application corresponding to the second program package;

[0211] The second sending module is used to send the downloading opportunity of the picture resource package corresponding to the second program package to the target user terminal device.

[0212] The program package resource processing device 500 provided in the embodiment of the present application can implement each process in the above-mentioned cloud server side method embodiment, and will not be described again here to avoid repetition.

[0213] See also Figure 6 , Figure 6 is a structural diagram of the program package resource processing device provided by the present application, such as Figure 6 As shown, the program package resource processing device 600 includes: a processor 601, a memory 602, and a computer program stored in the memory 602 and executable on the processor. Each component in the program package resource processing device 600 is coupled together via a bus interface 603. When the computer program is executed by the processor 601, the following steps are implemented:

[0214] Acquire a characteristic parameter of each picture in a first picture set included in a first program package, wherein the characteristic parameter includes at least one of a first parameter item, a second parameter item, and a third parameter item, wherein the first parameter item is used to indicate the importance of a business function corresponding to the picture, the second parameter item is used to indicate an access index value corresponding to the picture, and the third parameter item is used to indicate a size of the picture;

[0215] Determining a target picture in the first picture set according to a feature parameter of each picture in the first picture set;

[0216] Uploading the target image to a cloud server, and deleting the target image from the first program package to obtain a second program package;

[0217] Alternatively, when the computer program is executed by the processor 601, the following steps are implemented:

[0218] Receiving user information of a target user terminal device, wherein the target user terminal device is a user terminal device that has installed or started an application corresponding to a second program package, and the second program package is a program package obtained by deleting a target image from the first program package according to characteristic parameters of each image included in the first program package;

[0219] Determining a target user group identifier corresponding to the target user terminal device according to the user information of the target user terminal device;

[0220] Acquire a first picture resource package corresponding to the target user group identifier, wherein the first picture resource package includes at least part of the target pictures;

[0221] Send the first image resource package to the target user terminal device.

[0222] It should be understood that in the embodiment of the present application, when the computer program is executed by the processor 601, each process in the above-mentioned program package resource processing method embodiment can be implemented, and in order to avoid repetition, it will not be repeated here.

[0223] An embodiment of the present application also provides a program package resource processing device, including a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, each process of the above-mentioned program package resource processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0224] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above-mentioned program package resource processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0225] The embodiment of the present application also provides a computer program product, which is stored in a storage medium. When the computer program product is executed by at least one processor, it implements the various processes of the above-mentioned program package resource processing method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0226] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0227] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0228] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A method for processing package resources, characterized in that: include: Acquire a characteristic parameter of each picture in a first picture set included in a first program package, wherein the characteristic parameter includes at least one of a first parameter item, a second parameter item, and a third parameter item, wherein the first parameter item is used to indicate the importance of a business function corresponding to the picture, the second parameter item is used to indicate an access index value corresponding to the picture, and the third parameter item is used to indicate a size of the picture; Determining a target picture in the first picture set according to a feature parameter of each picture in the first picture set; The target image is uploaded to a cloud server, and the target image is deleted from the first program package to obtain a second program package.

2. The method according to claim 1, characterized in that The determining the target picture in the first picture set according to the characteristic parameters of each picture in the first picture set includes: determining, according to the characteristic parameters of each picture in the first picture set, an evaluation value corresponding to each picture in the first picture set, wherein the evaluation value corresponding to the first picture is determined based on a parameter evaluation value set corresponding to the first picture, the parameter evaluation value set corresponding to the first picture includes a parameter evaluation value corresponding to each parameter item of the first picture, and the first picture is any picture in the first picture set; A target picture in the first picture set is determined according to the evaluation value corresponding to each picture in the first picture set.

3. The method according to claim 2, characterized in that The parameter evaluation value corresponding to the target parameter item of the first picture is determined based on the target value range to which the target sorting number belongs. The target sorting number is the sorting number of the target parameter item of the first picture, and the target parameter item of the first picture is any one of the parameter items included in the characteristic parameters of the first picture.

4. The method according to claim 1, characterized in that: The first picture set includes pictures obtained after the pictures included in the first program package are converted into picture formats; The converting the first picture into a picture format includes: If the first picture is not a vector picture, convert the first picture into a vector picture; In the case where converting the first picture into a vector picture fails, if the first picture is not a WebP format picture, determining whether to convert the first picture into a WebP format picture; If yes, convert the first picture into a WebP format picture; If not, determining whether the first picture includes transparency data; If yes, then if the first picture is not a png format picture, convert the first picture into a png format picture; If not, if the first picture is not a picture in jpg format, convert the first picture into a picture in jpg format; The first picture is any picture included in the first program package.

5. A method for processing package resources, characterized in that: include: Receiving user information of a target user terminal device, wherein the target user terminal device is a user terminal device that has installed or started an application corresponding to a second program package, and the second program package is a program package obtained by deleting a target image from the first program package according to characteristic parameters of each image included in the first program package; Determining a target user group identifier corresponding to the target user terminal device according to the user information of the target user terminal device; Acquire a first picture resource package corresponding to the target user group identifier, wherein the first picture resource package includes at least part of the target pictures; Send the first image resource package to the target user terminal device.

6. The method according to claim 5, characterized in that Before obtaining the first image resource package corresponding to the target user group identifier, the method further includes: Obtaining user information of N user-end devices, wherein the N user-end devices are user-end devices that have run the application corresponding to the second program package, and N is a positive integer; Determine the user group identifier corresponding to each of the user terminal devices according to the user information of each of the user terminal devices; Determine the image resource package corresponding to each of the user group identifiers respectively, wherein the image resource package corresponding to the user group identifier includes images whose total access index value in the target image meets a preset condition, and the total access index value of the image is the access index value of the image by all user terminal devices corresponding to the user group identifier.

7. The method according to claim 5 or 6, characterized in that: The method further comprises: Determining the downloading timing of the image resource package corresponding to the second program package according to the target parameter of the second program package, wherein the target parameter includes at least one of the following: the importance of the business function corresponding to the second program package, and the running frequency of the application corresponding to the second program package; Sending the download timing of the picture resource package corresponding to the second program package to the target user terminal device.

8. A program package resource processing device, characterized in that: include: an acquisition module, configured to acquire a characteristic parameter of each image in a first image set included in a first program package, wherein the characteristic parameter includes at least one of a first parameter item, a second parameter item, and a third parameter item, wherein the first parameter item is used to indicate the importance of a business function corresponding to the image, the second parameter item is used to indicate an access index value corresponding to the image, and the third parameter item is used to indicate a size of the image; A determination module, configured to determine a target picture in the first picture set according to a feature parameter of each picture in the first picture set; The processing module is used to upload the target image to a cloud server and delete the target image from the first program package to obtain a second program package.

9. A program package resource processing device, characterized in that: include: a receiving module, configured to receive user information of a target user terminal device, wherein the target user terminal device is a user terminal device that has installed or started an application corresponding to a second program package, and the second program package is a program package obtained by deleting a target image from the first program package based on characteristic parameters of each image included in the first program package; A first determination module, configured to determine a target user group identifier corresponding to the target user terminal device according to user information of the target user terminal device; A first acquisition module, configured to acquire a first picture resource package corresponding to the target user group identifier, wherein the first picture resource package includes at least part of the target pictures; The first sending module is used to send the first image resource package to the target user terminal device.

10. A program package resource processing device, characterized in that: The method comprises a processor, a memory and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the program package resource processing method as described in any one of claims 1 to 4, or implements the steps of the program package resource processing method as described in any one of claims 5 to 7.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the program package resource processing method according to any one of claims 1 to 4, or implements the steps of the program package resource processing method according to any one of claims 5 to 7.