Detailed Description
In practical application, in order to promote an App developed by a software developer, the software developer generally needs to publish an installation package of the App to an online platform, so as to promote the App by virtue of the advantage of a large access amount of users of the online platform, wherein for installation packages which are never published on the online platform, when the installation packages are published on the online platform, the installation packages can be called online installation packages, and correspondingly, before the online installation packages are not online, the installation packages which are offline can be called offline installation packages. After a software developer publishes an online installation package on an online platform, the App is subsequently refined and updated to some extent, and as a result, in order to enable a user to use the updated App, the software developer generally needs to publish an installation package corresponding to the updated App to the online platform and replace an existing online installation package on the online platform, wherein the installation package is not published on the online platform and is used for updating the App, and correspondingly, the online update package is called an online update package after being published on the online platform. The offline update package is described with respect to the offline installation package, that is, the offline installation package corresponds to a historical installation package of the offline update package, and correspondingly, the online installation package corresponds to a historical installation package of the online update package.
When the App's installation package is released to the online platform, the online platform performs certain processing on the installation package uploaded by the software developer, so that, in general, the online installation package and the offline installation package are different in size, and in the same way, the online update package and the offline update package are also different in size. In the prior art, the size of the online update package is usually determined by only a part of data in the offline installation package, and the part of data usually intersects with other data, so that the size of the online update package determined based on the part of data is usually inaccurate. In order to accurately determine the size of the online update package, in the embodiment of the present application, the terminal or the server determines each estimation factor according to the size of each type of data in the acquired online installation package and offline installation package, and further determines the size of the online update package according to each estimation factor and the size of each type of data in the offline update package, which will be described in detail below.
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
Fig. 1 is a process for determining a size of a package according to an embodiment of the present application, which specifically includes the following steps:
s101: and acquiring an online installation package and an offline installation package corresponding to the online installation package.
In this embodiment, in order to accurately determine the size of the online update package, a software developer may obtain, through a terminal or a server, an online installation package corresponding to the online update package and an offline installation package corresponding to the online installation package, where the online installation package is already published on an online platform, so the software developer may obtain, through the terminal or the server, the online installation package from the online platform, and the software developer may store, for subsequent use, each time the offline installation package or the offline update package is developed, the offline installation package, so the software developer may directly obtain, from each installation package stored in the terminal or the server, the offline installation package, as shown in fig. 2.
FIG. 2 is a detailed diagram of determining the size of an online update packet according to an embodiment of the present application.
In fig. 2, the terminal may obtain the online installation package from the online platform and obtain the offline installation package corresponding to the online installation package from the terminal itself, and if the offline installation package is not stored in the terminal but in the local server of the software developer, the terminal may obtain the offline installation package from the local server. The terminal mentioned here may be a computer used by a software developer, a smart phone, or other smart devices. Of course, the server may also obtain the online installation package and the offline installation package, and in the subsequent process, send the determined size of the online update package to the terminal for display.
S102: and determining each estimation factor according to the size of each type of data contained in the online installation package and the offline installation package, wherein each data only belongs to one type.
After the terminal or the server obtains the online installation package and the offline installation package corresponding to the online installation package, the data contained in the online installation package and the offline installation package can be divided into various types according to the same division standard, so as to obtain various types of data, wherein each type of data corresponds to only one type of data according to the data divided according to the same classification standard. Then, the terminal or the server may determine, according to the determined sizes of the types of data in the online installation package and the offline installation package, estimation factors for determining the size of the online update package.
Specifically, in practical applications, whether the online installation package or the offline installation package, the data contained in the online installation package or the offline installation package can be generally classified into the following types: the first type is called variable data, and for such data, since the online installation package is obtained by the online platform after processing the offline installation package, a part of data in the online installation package is often different in size compared with the part of data in the offline installation package, and therefore, in the process that the offline installation package is changed into the online installation package via the online platform, such data whose size is changed may be called variable data, and such data generally includes binary data and device-specific data, where the device-specific data mentioned herein refers to data that is included in the online installation package and can be run on some wearable smart devices. In contrast to variable data, an online installation package or an offline installation package usually further includes fixed data, and the size of the data does not change along with the process of converting the offline installation package into the online installation package, that is, the size of the data does not change.
Therefore, in the embodiment of the present application, the terminal or the server may obtain the information according to the same division standardThe terminal or the server may determine the first estimation factor according to the determined sizes of the variable data of the offline installation package and the offline installation package, and may specifically divide the size of the variable data of the online installation package by the size of the variable data of the offline installation package to obtain a scaling factor of the online installation package and the offline installation package on the variable data, where the scaling factor is obtained by using a formula α w1(T)÷w0(T) wherein w1(T) is the size of the variable data in the on-line installation package, w0Of course, the first estimation factor may be determined by dividing the size of the variable data of the offline installation package by the size of the variable data of the online installation package, and the subsequent determination process only needs to be adjusted accordingly, or may be determined in other manners, such as determining according to the sizes of the variable data of the online installation package and the offline installation package and preset coefficients, which is not necessarily described herein.
In practical application, after the online platform performs certain processing on the offline installation package uploaded by the software developer, a part of data is usually added to the online installation package by the online platform according to the requirements of the online platform, and the size of the part of data is usually related to the total size of the offline installation package, for example, the larger the total size of the offline installation package is, the larger the size of the part of data in the online installation package is, since the part of data is provided by the online platform, the part of data can be generally called as third-party data, for example, for the online App platform store of apple, the third-party data in the online installation package refers to SC-Info data generated by the App store.
Since the third party data is typically associated with the total size of the offline installation package, the third party data should also be associated with variable data or fixed data in the offline installation package, and since embodiments of the present application are intended to accurately determine the size of the online update package, the online update packageThe third-party data is usually included in the upper update package, so in this embodiment of the present application, the terminal or the server needs to determine an estimation factor related to the third-party data, and then determine the size of the third-party data in the online update package according to the estimation factor and the size of each type of data in the offline update package, and further determine the size of the online update package accurately, so the terminal or the server needs to determine the size of the third-party data included in the online update package from the acquired online update package, and then, since the third-party data usually has a certain proportional relationship with the variable data or the fixed data in the offline update package, the terminal or the server can arbitrarily select one type of data from the acquired types of data in the offline update package as the first designated data, and according to the size of the first designated data and the determined size of the third-party data in the online update package, determining a second estimation factor, which may be determined by dividing the size of the third-party data in the determined on-line installation package by the size of the first designated data selected from the off-line installation package, for example, the formula δ ═ w1(v)÷w0(T) wherein w1(T) is the size of the third party data in the online installation package, w0(T) is the size of variable data in the offline installation package, and δ is the determined second estimation factor, which can be determined in other ways, and only the relationship between the size of third-party data in the online installation package and the offline installation package needs to be reflected.
For example, in the process of determining the second estimation factor, the terminal or the server may select variable data included in the offline installation package as first specified data, and determine the size of the first specified data, and then, the terminal or the server may determine the size of third party data included in the online installation package from the acquired online installation package, and use the above formula δ — w1(v)÷w0(T), determining a second estimation factor.
It should be noted that, in practical applications, the variable data generally includes binary data and device-specific data, and therefore, in this embodiment of the application, after the terminal or the server acquires the offline installation package and the online installation package, the terminal or the server may also split the variable data included in the online installation package and the offline installation package into the binary data and the device-specific data, and determine the third estimation factor or the fourth estimation factor included in the first estimation factor according to the sizes of the determined binary data and the determined device-specific data, respectively.
Specifically, in the process of determining the third estimation factor, the terminal or the server may determine the size of the binary data from the obtained online installation package and the obtained offline installation package, and determine the third estimation factor according to the determined sizes of the binary data of the online installation package and the offline installation package, where a specific implementation manner may be to divide the size of the binary data of the online installation package by the size of the binary data of the offline installation package, for example, where the formula β is w1(x)÷w0(x) Shown, wherein w in the formula1(x) Size, w, of binary data representing an on-line installation package0(x) It is needless to say that the third estimation factor is not determined exclusively, and a weight, a coefficient, or the like may be added to the above formula, which will not be described herein.
For the determining manner of the fourth estimation factor, the terminal or the server may determine the size of the device-specific data in the online installation package and the offline installation package, respectively, and determine the fourth estimation factor according to the determined size of the device-specific data in the online installation package and the offline installation package, and a specific implementation manner may be that the size of the device-specific data in the online installation package is divided by the size of the device-specific data in the offline installation package to obtain a ratio, and the ratio is used as the fourth estimation factor, for example, a formula γ ═ w1(y)÷w0(y) wherein w1(y) represents the size of device-specific data in the on-line installation package, w0(y) represents the size of the device-specific data in the offline installation package, and γ represents the determined fourth estimation factor. Of course, the fourth estimation factor is not necessarily determined according toThe above formula may be applied to γ ═ w1(y)÷w0Some weights, coefficients, etc. are added to (y), and will not be described in detail here.
S103: the size of each type of data included in the offline update package is determined.
In practical applications, the proportional relationship between the types of data in the online installation package and the offline installation package is usually similar to the proportional relationship between the types of data in the online update package and the offline update package, for example, the proportional relationship between the variable data in the online installation package and the offline installation package is usually the same as or similar to the proportional relationship between the variable data in the online update package and the offline update package, in other words, the size of each type of data in the online update package and the size of each type of data in the offline update package can be determined by the proportional relationship between the types of data in the online installation package and the offline installation package, and the size of the online update package can be determined. Since the embodiment of the present application intends to accurately determine the size of the online update package, after determining each estimation factor through steps S101 to S102, it is necessary to further determine the size of each type of data in the offline update package, and determine the size of the online update package according to the determined size of each type of data in the offline update package and each estimation factor through subsequent steps. Therefore, after determining the estimation factors, the terminal or the server may further determine the sizes of the types of data in the offline update packet, wherein the terminal or the server may divide the data in the offline update packet into variable data and fixed data according to the same division standard as in step S102, and determine the sizes of the variable data and the fixed data included in the offline update packet, or further divide the variable data into binary data and device-specific data, and determine the sizes of the binary data and the device-specific data in the offline update packet.
It should be noted that, instead of determining the estimation factors, the terminal or the server may also obtain the offline update package and determine the size of each type of data included in the offline update package at the same time as obtaining the online update package and the offline update package.
S104: and determining the size of the online update package corresponding to the offline update package according to the determined size of each type of data in the offline update package and each estimation factor.
After determining the size of each type of data included in the offline update package, the terminal or the server may determine the size of each type of data in the online update package according to the determined estimation factors and the size of each type of data in the offline update package, and further determine the size of the online update package according to the determined size of each type of data in the online update package.
Specifically, since the terminal or the server may divide the data in the offline update package into the variable data and the fixed data according to the data division standard in step S102, and determine the sizes of the variable data and the fixed data in the offline update package, therefore, the terminal or the server can determine the size of the variable data in the online update package based on the determined size of the variable data in the offline update package and the first estimation factor, and for the size of the fixed data in the online update package, since the size of the fixed data is not changed with the processing of the installation package by the online platform, therefore, the size of the fixed data in the online update package is actually the size of the fixed data in the offline update package, therefore, the size of the fixed data in the update packet on the line is determined at the same time as the size of the fixed data in the update packet under the line is determined.
Since the third party data obtained by processing the offline update package by the online platform is usually available in the online update package, in order to accurately determine the size of the online update package, the terminal or the server also needs to determine the size of the third party data in the online update package, and since the terminal or the server has determined a second estimation factor related to the third party data in step S102, although the second estimation factor is determined by the size of the third party data in the online update package and the size of any one of the variable data and the fixed data in the offline update package, since the ratio between the types of data of the online update package and the offline update package is similar to or the same as the ratio between the types of data of the online update package and the offline update package, when the terminal or the server determines the size of the third party data in the online update package, the second estimation factor may be used as well. Therefore, in this embodiment of the application, the terminal or the server may determine, according to the second estimation factor, which second estimation factor is obtained based on which data in the offline installation package is, that is, determine the first specified data in the offline installation package selected when the second estimation factor is calculated, and then, the terminal or the server may determine, from the offline update package, the size of the data of the same type as the first specified data, and determine the size of the third party data in the online update package according to the determined size of the data and the second estimation factor.
After the terminal or the server determines the sizes of the fixed data, the variable data and the third-party data in the online update package in sequence, the determined sizes of the three data can be summed to obtain the size of the online update package, for example, the formula a ═ w2(T)×α+w2(i)×δ+w2(z) in the formula, w2(T) is the size of the variable data in the offline update package, and w2(T) x α the result is the size of the variable data in the update packet on the line, w2(i) Updating the size of the first specified data in the package for offline, wherein when the variable data in the offline installation package is taken as the first specified data in the process of determining the second evaluation factor, then w2(i) Can be changed into w correspondingly2(T) representing the size of variable data in the offline update package, and w when the fixed data in the offline update package is taken as the first specified data in the process of determining the second evaluation factor2(i) Can be changed into w correspondingly2(z), i.e. representing the size of the fixed data in the offline update package, correspondingly, w2(i) The result obtained by x δ is the size of the third party data in the online update package, w2(z) represents the size of the fixed data in the offline update packet,the size of the fixed data in the online update package is also shown. Of course, the above formula is not exclusive, and may be represented by formula a ═ w2(T)×α+w2(i)×δ+w2(z) are added with weights, coefficients, etc., which are not described in detail herein.
It should be noted that the terminal or the server may further split the variable data into binary data and device-specific data, and determine the sizes of the binary data and the device-specific data in the online update packet according to the determined third estimation factor and the determined fourth estimation factor. Specifically, the terminal or the server may determine the size of the binary data in the online update package according to the determined binary data in the offline update package and the third estimation factor, and similarly, the terminal or the server may determine the size of the device-specific data in the online update package according to the determined device-specific data in the offline update package and the fourth estimation factor. Correspondingly, after successively determining the size of the third-party data and the fixed data in the online update package, the subsequent terminal or the server may further determine the size of the online update package according to the size of each type of data in the determined online update package, and the specific implementation manner may be that the formula a is w2(x)×β+w2(y)×γ+w2(i)×δ+w2(z) in the formula, w2(x) For the size of the binary data contained in the offline update package, corresponding w2(x) X β results in the size of binary data in an online update packet, w2(y) is the size of the device-specific data contained in the offline update package, and w2The result of (y) × γ is the size of the device-specific data in the online update packet.
According to the above mode, in the process of determining the size of the online update package, the terminal or the server does not determine the size of the online update package based on the size of a part of data in the online update package, but determines the size of the online update package comprehensively according to the sizes of various types of data included in the online update package and the offline update package.
It should be noted that, in practical applications, an installation package is generally composed of units developed by software developers, and therefore, when the size of the offline update package is adjusted according to the determined size of the online update package, the size of each unit in the offline update package is actually adjusted, and therefore, in the embodiment of the present application, the terminal or the server may determine the size of each unit in the online update package while determining the size of the online update package, and adjust the size of each unit in the offline update package according to the determined size of each unit in the online update package, where a specific process is shown in fig. 3.
Fig. 3 is a process for determining sizes of units in an online update package according to an embodiment of the present application, which specifically includes the following steps:
s301: determining each pre-package unit corresponding to each post-package unit included in the offline update package.
In practical application, considering the packaging factor, the sum of the sizes of the units contained in the offline update package before packaging is often different from the sum of the sizes of the units after packaging, and accordingly, the sizes of the units also change before packaging, so when determining the sizes of the units in the online update package, the sizes of the units cannot be regarded as the sizes of the units before packaging, and the factors that the sizes of the units before packaging and after packaging are changed are taken into consideration, and because the sizes of the online update package and the offline update package are often different, the sizes of the online update package and the offline update package are also often different for each unit, so the factors that the sizes of the units in the online update package and the offline update package are changed are also taken into consideration in the process of determining the sizes of the units in the online update package, therefore, before determining the size of each unit in the online update package, each pre-package unit corresponding to each post-package unit in the offline update package needs to be determined, where each post-package unit is a unit packaged in the offline update package or the online update package, and each pre-package unit is a unit not packaged in the offline update package. Since each software developer usually stores each unit in a local terminal or a local server after developing each unit, in this embodiment of the present application, the terminal or the server may retrieve each pre-packaged unit stored in advance from another terminal or the server, and determine the size of each type of data included in each pre-packaged unit in a subsequent process.
S302: and respectively determining the sizes of the binary data, the equipment-specific data and the fixed data contained in each pre-packaging unit and the total size of each type of data in each pre-packaging unit.
Although the size of each unit in the offline update package varies before and after packaging, the size of each packaged unit accounts for the same or similar proportion of the size of the offline update package to the total size of each pre-packaging unit, and the size of each packaged unit in the online update package accounts for the same or similar proportion of the size of each online update package to the size of each packaged unit in the offline update package, the size of each packaged unit in the online update package can be determined by determining the proportion of the size of each packaged unit in the online update package to the size of the offline update package and determining the size of each packaged unit in the online update package according to the estimation factors determined in step S102. Therefore, in this embodiment of the application, the terminal or the server may further determine the size of each type of data included before each package, determine the total size of each type of data included in each unit before package, and further determine each unit factor in the subsequent step S303, where the terminal or the server may divide the data into three types of data, i.e., binary data, device-specific data, and fixed data, according to the same dividing manner in the step S102.
It should be noted that, since the offline update package does not include the third party data included in the online update package, and the third party data is usually present in the online update package in a separate form, rather than being present in each post-package unit scattered in the online update package, each pre-package unit should not include the third party data.
S303: and for each pre-packaging unit, determining each unit factor according to the binary data contained in the pre-packaging unit, the size of the equipment special data and the total size of each type of data in each pre-packaging unit.
The terminal or the server may further determine each unit factor after determining the size of each type of data included in each pre-package unit and the total size of each type of data in each pre-package unit, where the terminal or the server may determine, for each pre-package unit, a first unit factor according to the determined size of the binary data included in the pre-package unit and the total size of the binary data included in each pre-package unit, and may specifically implement the method by dividing the size of the binary data of the pre-package unit by the total size of the binary data included in each pre-package unit, for example, according to a formula
Wherein u is
i(x) Indicating the size of the binary data contained in the ith pre-package unit,
indicates the total size of binary data contained in each pre-package unit, and n indicates the number of pre-package units.
Similarly, the terminal or the server may determine, for each pre-encapsulation unit, the second unit factor according to the determined size of the device-specific data included in the pre-encapsulation unit and the total size of the device-specific data included in each pre-encapsulation unit, and a specific implementation manner may be to divide the determined size of the device-specific data included in the pre-encapsulation unit by each pre-encapsulation unitThe total size of the device-specific data contained in the element, e.g. formula
Wherein u is
i(y) is the size of the device-specific data contained in the ith pre-encapsulation unit,
n is the number of pre-encapsulation units, which is the total size of the device-specific data contained in each pre-encapsulation unit.
It should be noted that the determination method of each unit factor described above is not exclusive, and for example, some coefficients or weights may be added to the formula for determining each unit factor described above, and the description is not necessarily made here.
S304: and determining the size of the packaged unit corresponding to the pre-packaging unit in the online update package according to the determined unit factors, the estimated factors, the size of the fixed data of the pre-packaging unit and the size of each type of data in the offline update package.
After determining each unit factor, the terminal or the server may further determine, for each pre-package unit, a size of each type of data included in the post-package unit corresponding to the pre-package unit in the online update package, and further determine, according to each estimation factor in step S102, a size of the post-package unit corresponding to the pre-package unit in the online update package.
Specifically, in practical applications, once each unit is packaged in an installation package or an update package, the size of each unit cannot be directly determined, but the size of each type of data in each packaged unit in the outgoing line lower update package needs to be determined according to the size of each type of data in each pre-packaging unit and the size of each type of data in the offline update package, so as to determine the size of each packaged unit in the outgoing line lower update package. Therefore, in this embodiment of the application, after determining, by the terminal or the server, the first unit factor corresponding to each pre-package unit, the terminal or the server may determine, according to the first unit factor, the first unit factorThe binary data size included in the offline update packet determined in step S103 is determined, and the binary data size included in the packaged unit corresponding to the pre-packaging unit in the offline update packet is determined, specifically, the binary data size included in the offline update packet may be multiplied by the first unit factor, for example, by formula mi(x)=ai×w2(x) Wherein m isi(x) Represents the size of the binary data contained in the ith packed cell in the offline update package.
Similarly, for each pre-package unit, the terminal or the server may determine, according to the determined second unit factor corresponding to the pre-package unit and the determined size of the device-specific data included in the offline update package, the size of the device-specific data included in the post-package unit corresponding to the pre-package unit in the offline update package, where a specific implementation manner may be that a formula m is usedi(y)=bi×w2(y) applying a second unit factor b corresponding to the ith pre-package unitiAnd multiplying the size of the device-specific data contained in the offline update package by the size of the device-specific data contained in the ith packaged unit corresponding to the ith pre-package unit in the offline update package. Of course, the determination method mentioned here is not unique, and other formulas may be used for determination, which is not described in detail here.
After determining the size of each type of data included in the post-package unit corresponding to the pre-package unit in the lower outgoing line update package for each pre-package unit, the terminal or the server may further determine each estimation factor according to step S102, and determine the size of each type of data included in the post-package unit corresponding to the pre-package unit in the online update package. Specifically, the terminal or the server may further determine the size of the binary data included in the packaged unit corresponding to the pre-packaging unit in the online update package according to the size of the binary data included in the packaged unit corresponding to the pre-packaging unit in the determined offline update package and the third estimation factor, and a specific embodiment may use a formula oi(x)=β×mi(x) Determining a third estimation factor β and a size m of binary data contained in an ith post-packaging cell corresponding to the ith pre-packaging cell in the offline update packagei(x) Multiplying to obtain the size o of binary data contained in the ith packaged unit corresponding to the ith pre-packaged unit in the online update packagei(x)。
Similarly, the terminal or the server may determine the size of the device-specific data included in the packaged unit corresponding to the pre-package unit in the online update package according to the determined size of the device-specific data included in the packaged unit corresponding to the pre-package unit in the offline update package and the fourth estimation factor determined in step S102, and a specific embodiment may adopt the formula oi(y)=γ×mi(y) determining the fourth estimation factor γ and the size m of the device-specific data contained in the ith post-package unit corresponding to the ith pre-package unit in the offline update packagei(y) multiplying to obtain the size o of the device-specific data contained in the ith unit corresponding to the ith pre-encapsulation unit in the online update packeti(y)。
Since the fixed data included in each pre-package unit does not change, the terminal or the server determines, for each pre-package unit, the size of the fixed data included in the pre-package unit, which is actually the size of the fixed data included in the post-package unit corresponding to the pre-package unit in the online update package, and correspondingly, after determining the sizes of the binary data, the device-specific data, and the fixed data included in the post-package unit corresponding to the pre-package unit in the online update package, the sizes of the binary data, the device-specific data, and the fixed data, respectively, the sizes of the three data can be summed, so as to obtain the size of the post-package unit corresponding to the pre-package unit in the online update package.
The terminal or the server can further display the determined size of the online update package and the size of each packaged unit contained in the online update package to a user, wherein the terminal or the server can display the determined result to a software developer in the form of text, pictures and the like in the modes of a webpage, a notebook and the like for viewing.
It should be noted that, in the embodiment of the present application, after the terminal or the server determines the size of the online update package, the offline update package corresponding to the online update package may be adjusted according to a preset adjustment rule, for example, when the size of the online update package exceeds a set threshold, the terminal or the server analyzes data in the offline update package corresponding to the online update package, and integrates some data that can be commonly used in the offline update package according to the analyzed result, and deletes redundant data, thereby achieving the purpose of reducing the size of the online update package by reducing the size of the offline update package.
Since the down update package or the up update package is basically composed of the units after the package, the essence of adjusting the size of the down update package is to adjust the size of each unit after the package in the down update package, and the essence of the adjustment is to adjust the size of each unit before the package. Therefore, in this embodiment of the present application, the terminal or the server may adjust, for each post-package unit in the online update package, a pre-package unit corresponding to the post-package unit in the offline update package according to the determined size of the online update package and the size of the post-package unit, specifically, when the terminal or the server finds that the determined size of the online update package exceeds the first set threshold, it may further check whether the size of each post-package unit in the online update package exceeds a second set threshold, where when the terminal or the server finds that the size of a certain post-package unit exceeds the second set threshold, the size of the pre-package unit corresponding to the post-package unit may be adjusted, so that the size of the post-package unit corresponding to the adjusted pre-package unit does not exceed the second set threshold. Similarly, the sizes of other pre-package units may also be adjusted in this way, so that the size of the online update package subsequently determined again by the terminal or the server can be smaller than the first set threshold.
Of course, after determining that the size of a certain packaged unit in the online update package exceeds the second set threshold, the terminal or the server may further determine, according to the identifier of the packaged unit, which software developer's terminal sent the pre-packaged unit corresponding to the packaged unit, according to the manner shown in fig. 2, and send a notification to the software developer's terminal in the form of information, so that the software developer adjusts the pre-packaged unit corresponding to the packaged unit after checking the notification.
It should be noted that the above-mentioned second set threshold may be a threshold set for all the packaged units in the online update package, or may also be a second set threshold set for each packaged unit in the online update package, and correspondingly, when the terminal or the server determines that the size of the online update package exceeds the first set threshold, each packaged unit included in the online update package may be checked to determine whether each packaged unit exceeds the second set threshold corresponding to the terminal or the server.
It should be noted that, in practical applications, whether the online update package, the offline update package, or the online installation package and the offline installation package exist in a compressed form, and since the embodiment of the present application intends to determine the size of the online update package, in the process of determining the size of each type of data in the offline update package, the online installation package, and the offline installation package, and determining each unit factor and each estimation factor, the determination should also be performed in a compressed form to ensure the rationality of the whole determination process. In addition, since the compression format of the online update package is usually determined by the online platform, in this embodiment of the application, the terminal or the server may first determine the compression format of the online installation package obtained from the online platform, and compress the subsequently obtained offline installation package and the offline update package according to the determined compression format, and then determine the size of the online update package according to the size of each type of data in the compressed online installation package, offline installation package and offline update package, where the compression format may be zip, tar, ditto, cab, bz2, jar, and the like.
Based on the same idea, the method for determining the size of the installation package provided in the embodiment of the present application further provides a device for determining the size of the installation package, as shown in fig. 4.
Fig. 4 is a schematic diagram of an apparatus for determining a size of an installation package according to an embodiment of the present application, which specifically includes:
the obtaining module 401 obtains an online installation package and an offline installation package corresponding to the online installation package;
a determining factor module 402, which determines each estimation factor according to the size of each type of data contained in the online installation package and the offline installation package, wherein each data only belongs to one type;
a first determining module 403, configured to determine sizes of data of various types included in the offline update package;
the second determining module 404 determines the size of the online update package corresponding to the offline update package according to the determined size of each type of data in the offline update package and each estimation factor.
The various types of data included in the offline installation package include: at least one of fixed data and variable data; each type of data included in the online installation package includes: at least one of fixed data, variable data, third party data.
The determination factor module 402 determines the size of the variable data included in the offline installation package and the online installation package, respectively; determining a first estimation factor according to the sizes of the variable data in the offline installation package and the online installation package which are respectively determined; determining the size of third party data contained in the online installation package; selecting any one data from variable data and fixed data contained in the offline installation package as first designated data; and determining a second estimation factor according to the third-party data and the size of the first specified data.
The second determining module 404 determines the size of the variable data in the online update packet according to the determined size of the variable data in the offline update packet and the first estimation factor; determining the size of third-party data in the online update package according to the second estimation factor and the size of data which is contained in the offline update package and has the same type as the first specified data; and determining the size of the online update package according to the determined variable data of the online update package, the size of the third party data and the size of the fixed data of the offline update package.
The variable data includes: at least one of binary data, device specific data; the first estimation factor includes: a third estimation factor and/or a fourth estimation factor;
the determining factor module 402 determines the sizes of binary data included in the offline installation package and the online installation package, and determines a third estimation factor according to the sizes of the binary data in the offline installation package and the online installation package determined respectively; and/or
Determining the size of the device-specific data contained in the offline installation package and the online installation package respectively, and determining a fourth estimation factor according to the size of the device-specific data in the offline installation package and the online installation package respectively determined;
the second determining module 404 determines the size of the binary data in the online update packet according to the determined size of the binary data in the offline update packet and the third estimation factor; determining the size of the device-specific data in the online update package according to the determined size of the device-specific data in the offline update package and the fourth estimation factor; and determining the size of the online update package according to the determined size of the binary data, the equipment special data and the third-party type data of the online update package and the size of the fixed type data of the offline update package.
The device further comprises:
a determining unit module 405 that determines each pre-package unit corresponding to each post-package unit included in the offline update package; respectively determining the sizes of the binary data, the equipment special data and the fixed data contained in each pre-packaging unit and the total size of each type of data in each pre-packaging unit; for each pre-packaging unit, determining each unit factor according to the binary data contained in the pre-packaging unit, the size of the equipment special data and the total size of each type of data in each pre-packaging unit; and determining the size of the packaged unit corresponding to the pre-packaging unit in the online update package according to the determined unit factors, the estimated factors, the size of the fixed data of the pre-packaging unit and the size of each type of data in the offline update package.
The determining unit module 405 determines a first unit factor according to the size of the binary data included in the pre-package unit and the determined total size of the binary data included in each pre-package unit; determining a second unit factor according to the size of the device-specific data contained in the pre-encapsulation unit and the determined total size of the device-specific data contained in each pre-encapsulation unit.
The determining unit module 405 determines, according to the first unit factor and the size of the binary data in the offline update packet, the size of the binary data of the post-package unit corresponding to the pre-package unit in the offline update packet; determining the size of the device-specific data of the encapsulated unit corresponding to the pre-encapsulation unit in the offline update package according to the second unit factor and the size of the device-specific data in the offline update package; determining the size of the binary data of the packaged unit corresponding to the pre-packaging unit in the online update package according to the third estimation factor and the determined size of the binary data of the packaged unit corresponding to the pre-packaging unit in the offline update package; determining the size of the device-specific data of the packaged unit corresponding to the pre-packaging unit in the online update package according to the fourth estimation factor and the determined size of the device-specific data of the packaged unit corresponding to the pre-packaging unit in the offline update package; and determining the size of the packaged unit corresponding to the pre-packaging unit in the online update package according to the size of the fixed data contained in the pre-packaging unit and the size of the binary data and the equipment special data of the packaged unit corresponding to the pre-packaging unit in the online update package.
The device further comprises:
and the adjusting module 406 adjusts the offline update package according to the determined size of the online update package.
The adjusting module 406 adjusts, for each packaged unit in the online update package, a pre-package unit corresponding to the packaged unit in the offline update package according to the determined size of the online update package and the determined size of the packaged unit.
In the method, a terminal or a server can acquire an offline installation package and an online installation package corresponding to an offline update package to be published on an online platform, and determine the size of an online update package corresponding to the offline update package and the online update package by determining the size of each type of data which are contained in the offline installation package and the online update package and are not overlapped with each other. Because the terminal or the server determines the size of the online update package not only by the size of a part of data in the online update package, but also by the size of each type of data included in the online update package and the offline update package, the size of the online update package is determined comprehensively, and the size of the online update package is different from that of each system in the prior art by a certain intersection, in the embodiment of the present application, each type of data determined by the terminal or the server in the process of determining the size of the online update package does not contain an intersection, that is, each type of data corresponds to only one type, so that the situation that the size of the finally determined online update package has a large deviation due to the intersection among the types of data is avoided, and therefore, in sum, compared with the prior art, the size of the online update package can be determined accurately by the method, and further brings convenience to the process that a software developer adjusts the size of the offline update package by determining the size of the online update package.
It should be noted that the execution subjects of the steps of the method provided in embodiment 1 may be the same device, or different devices may be used as the execution subjects of the method. For example, the executing agent of step S102 and step S103 may be a terminal, and the executing agent of step S101 may be a server; for another example, the execution subject of step 101 may be a terminal, and the execution subjects of step 102 and step 103 may be a server; and so on.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.