Channel package generation method, electronic device, computer readable medium and program product

By presetting the wedge module in non-source code files and writing channel information in files compiled into binary format, the problem of wasted time and resource when generating multiple channel packages is solved, and efficient and low-cost channel package generation is achieved.

CN119440543BActive Publication Date: 2025-04-11SHANGHAI JIAMIAN TECH INFORMATION SERVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510039233.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-10
Publication Date
2025-04-11
Estimated Expiration
2045-01-10

AI Technical Summary

Technical Problem

When generating multiple channel packages, the existing technology requires multiple modifications to the source code, compilation, and packaging, which takes a long time, resulting in high time and resource costs.

Method used

By presetting the wedge module in the non-source code file used to generate the installation package, compiling and packaging the installation package, decompressing and writing channel information into the file compiled into binary format, and compressing it to generate the channel package, avoiding repeated compilation operations.

Benefits of technology

There is no need to repeat the time-consuming operation such as compilation, which significantly reduces the time and resource costs of generating channel packages, improves efficiency, and ensures that channel information is not lost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119440543B_ABST
    Figure CN119440543B_ABST
Patent Text Reader

Abstract

The present application relates to the field of computer technology, and specifically to a channel package generation method, an electronic device, a computer-readable medium, and a program product. A wedge module for writing channel information can be defined in a non-source code file used to generate an installation package, and all files used to generate the installation package are compiled and packaged to generate the installation package. When making a channel package, the electronic device can decompress the installation package to obtain all compiled files, including compiled non-source code files, including compiled wedge modules. Furthermore, the electronic device can compile the channel information into the same format as the compiled non-source code file, and write the compiled channel information into the compiled wedge module. Furthermore, the electronic device can compress all compiled files to generate a channel package. This method does not require repeated source code modification and compilation operations, which reduces the time cost and resource cost of generating a channel package.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a channel package generation method, electronic equipment, computer-readable medium, and program product. Background Art

[0002] Application developers can distribute applications to users through multiple distribution channels (e.g., application stores, websites, social media, and other channels that enable users to download applications). The promotion effects of different distribution channels may be different. Specifically, the greater the number of application downloads on a distribution channel, the better the promotion effect of the distribution channel. Therefore, application developers can count the number of downloads on each distribution channel to adjust promotion strategies based on the promotion effect of each distribution channel.

[0003] In order to count the download volume of each distribution channel, the application developer can create a corresponding channel package for each distribution channel. For example, the electronic device of the application developer can add channel information A corresponding to distribution channel A in the source code of the application program, and then the electronic device of the application developer can compile, package and perform other operations on the source code and other files with the added channel information A to generate an installation package including channel information A, which is the channel package corresponding to distribution channel A. Based on this method, channel packages corresponding to each distribution channel can be created. Then, the electronic device of the application developer can upload different channel packages to the corresponding distribution channel for users to download.

[0004] When the user's terminal device downloads the corresponding channel package through a distribution channel and installs the application, the application can transmit the channel information in the channel package back to the electronic device of the application developer. In turn, the electronic device of the application developer can count the download volume of each distribution channel based on the received channel information.

[0005] However, based on the above-mentioned method of adding channel information to the source code, in the process of generating multiple channel packages, the application developer needs to perform operations such as modifying the source code, compiling, and packaging for multiple times, which is time-consuming. Summary of the invention

[0006] The present application provides a channel package generation method, electronic device, computer-readable medium and program product, which can generate multiple channel packages without performing multiple source code modification, compilation, packaging and other operations, thereby reducing the time cost and resource cost of generating channel packages.

[0007] In a first aspect, the present application provides a channel package generation method, which is applied to an electronic device, the method comprising: presetting a first element in a first file for generating an installation package of an application, wherein the first element is used to write channel information, and the first element includes a first content attribute for determining a first string; compiling and packaging multiple files including the first file to obtain an installation package of the application; decompressing the installation package to obtain multiple files including a second file, wherein the second file is the first file compiled into a binary format, the second element in the second file is the first element compiled into a binary format, the second element includes a second content attribute for determining the first string in a binary format, and the second file includes a string block and a content block, and the string block includes a binary format a first string of characters in binary format, and a first index value corresponding to the first string of characters in binary format, the content block includes a second content attribute, the attribute value of the second content attribute is a second index value, wherein the second index value is used to determine the first index value; determine first channel information in binary format; add the first channel information in binary format and a third index value corresponding to the first channel information in binary format to the string block; modify the attribute value of the second content attribute in the content block from the second index value to a fourth index value, wherein the fourth index value is used to determine the third index value, and obtain a third file; replace the second file among multiple files with the third file; compress multiple files including the third file to obtain a first channel package; wherein the first channel information is used to determine a distribution channel for the first channel package.

[0008] Here, in order to generate multiple channel packages of an application, the electronic device needs to preset a first element in a first file in advance, and perform operations such as compiling and packaging the first file and other files to generate an installation package of the application. It can be understood that the aforementioned operations are preparatory operations performed to generate a channel package, and only need to be performed once for an application, and do not need to be repeated.

[0009] After performing the above-mentioned preparation operations, if the electronic device needs to generate a first channel package of the application in the first distribution channel, the electronic device can decompress the installation package to obtain multiple files including the second file. Then, the electronic device can write the first channel information into the second file to obtain a third file. Then, the electronic device can re-compress the multiple files including the third file to obtain the first channel package. Based on the above method, the electronic device does not need to repeatedly perform time-consuming operations such as compilation in the process of generating multiple channel packages, which effectively reduces the time cost and resource cost required to generate channel packages.

[0010] It can be understood that when it is necessary to generate a second channel package for a second distribution channel, the electronic device can generate the second channel package based on substantially the same process as the foregoing, with the only difference being that the first channel information is replaced with the second channel information corresponding to the second distribution channel.

[0011] Here, the electronic device may be the electronic device 10 mentioned below. The first file may be the non-source code file, XML file, XML file 1, or AndroidManifest.XML file mentioned below. The first element may be the wedge module, the custom XML element, or XML element 1 mentioned below. The second file may be the target file, the binary XML file, the binary XML file 1, or the AndroidManifest.XML file in binary format mentioned below. The second element may be the target module, the binary XML element, or the binary XML element 1 mentioned below. The third file may be the binary XML file 2 mentioned below.

[0012] Here, in the process of generating a channel package, the file into which the electronic device writes the channel information is a compiled file. For example, the file into which the channel information is written is a compiled first file. There is no need to write the channel information into an uncompiled file, for example, a source code file, a configuration file, a resource file, etc., for generating an application.

[0013] Obviously, if the channel information is written into an uncompiled file, when generating each channel package of the application, the electronic device needs to perform a compilation process after writing the channel information, and the compilation process is time-consuming, which will reduce the efficiency of generating the channel package. Based on the method provided in the embodiment of the present application, the channel information is written into the compiled file, which avoids the time-consuming repeated compilation operation and effectively improves the efficiency of generating the channel package.

[0014] Here, corresponding to the second file being in binary format, the electronic device can convert the first channel information into binary format, and then set the element value of the second element according to the first channel information in binary format. In this way, the consistency of the data format can be guaranteed, and the validity of the written first channel information can be ensured.

[0015] The first content attribute may be attribute 2 of XML element 1 described below. The second content attribute may be attribute unit 608 described below. The first string may be the default channel information described below, or the attribute value "none" of attribute 2. The first string in binary format may be a binary string of the default channel information or a binary string of "none". The first channel information in binary format may be a binary string of the first channel information.

[0016] Among them, the string block can be the string block 601 described below. The first string in binary format can be the string content of the string unit 602e described below, that is, the binary string of "none". The first index value can be the starting address of the binary string of "none" recorded in the array unit 603e described below, for example, the starting address E. The content block can be the content block corresponding to the binary XML element 1 described below, such as the content block 604. The second content attribute can be the attribute unit 608 corresponding to the attribute 2 described below. The second index value can be the index value of the attribute value "none" described below, for example, the index value Z2 in the attribute value field 608b.

[0017] Here, the second index value is used to determine the first index value, which means that the electronic device can determine the first index value according to the second index value. For example, after determining that the value of the attribute value field 608b is Z2 (i.e., the second index value), the following electronic device 10 can index to the array unit 603e with the array subscript Z2 in the following string pool offset array 603, and then index to the binary string "none" with the first address E in the following string pool 602 based on the first address E (i.e., the first index value) recorded in the array unit 603e.

[0018] Adding the first channel information in binary format to the string block may be by adding a string unit 602f to the string pool 602 of the string block 601, and the fourth index value may be an index value of the first channel information in binary format, for example, an array subscript Q of the string unit 602f.

[0019] The third index value corresponding to the first channel information in binary format may be the first address of the first channel information in binary format, for example, the first address F recorded in the digital unit 603f below. Adding the third index value corresponding to the first channel information in binary format to the string block may be adding an array unit 603f to the string pool offset array 603 of the string block 601 below.

[0020] Modifying the attribute value of the second content attribute in the content block from the second index value to the fourth index value may be to modify the value of the attribute value field 608b below from Z2 to the index value Q of the first channel information in binary format.

[0021] The fourth index value is used to determine the third index value, which means that the electronic device can determine the third index value according to the fourth index value. For example, after determining that the value of the attribute value field 608b is changed to Q (i.e., the fourth index value), the electronic device 10 can index the array unit 603f with the array subscript Q in the string pool offset array 603, and then index the first channel information in binary format with the first address F in the string pool 602 based on the first address F (i.e., the third index value) recorded in the array unit 603f.

[0022] Based on the aforementioned method of adding the first channel information and modifying the index value, in the process of generating the first channel package, the second file can be modified into the third file by adding the first channel information and modifying the index value.

[0023] In a possible implementation of the first aspect above, the distribution channels include: application stores, websites, social media, and peer-to-peer sharing.

[0024] In a second aspect, the present application provides an electronic device comprising: one or more processors; one or more memories; one or more memories storing one or more programs, and when one or more programs are executed by one or more processors, the electronic device executes the channel package generation method provided by the first aspect and various possible implementations of the first aspect.

[0025] In a third aspect, the present application provides a computer-readable medium having instructions stored thereon, which, when executed on a computer, causes the computer to execute the channel package generation method provided by the first aspect and various possible implementations of the first aspect.

[0026] In a fourth aspect, the present application provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the channel package generation method provided by the above-mentioned first aspect and various possible implementations of the above-mentioned first aspect.

[0027] The beneficial effects of the second to fourth aspects mentioned above can be referred to the relevant descriptions in the first aspect mentioned above and various possible implementations of the first aspect mentioned above, and will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 The figure is a schematic diagram of a process of generating a channel package by an electronic device 10 provided in an embodiment of the present application.

[0029] Figure 2 Shown is a schematic diagram of a process of generating a channel package by another electronic device 10 provided in an embodiment of the present application.

[0030] Figure 3The figure is a flow chart of a channel package generation method implemented by an electronic device 10 provided in an embodiment of the present application.

[0031] Figure 4 Shown is a schematic diagram of the structure of a binary XML file provided in an embodiment of the present application.

[0032] Figure 5 The electronic device 10 provided in the embodiment of the present application generates an application for Android TM Flowchart of the system's channel package.

[0033] Figure 6a Shown is a schematic diagram of the structure of a binary XML element 1 in a binary XML file 1 provided in an embodiment of the present application.

[0034] Figure 6b The figure is a schematic diagram of the structure of a binary XML file 2 generated based on a binary XML file 1 provided in an embodiment of the present application.

[0035] Figure 7 The figure is a schematic diagram of a flow chart of an electronic device 10 modifying the content of an attribute value field provided by an embodiment of the present application.

[0036] Figure 8 The figure shows an interaction diagram of generating a channel package based on an electronic device 10 and a server 20 according to an embodiment of the present application.

[0037] Fig. 9 Shown is a schematic structural diagram of an electronic device 10 provided in an embodiment of the present application. DETAILED DESCRIPTION

[0038] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0039] It can be understood that the channel package generation method provided in the embodiment of the present application can be applicable to electronic devices including but not limited to tablet computers, desktops, laptops, handheld computers, netbooks, servers, etc. that can generate application installation packages and other electronic devices with network access capabilities.

[0040] It can be understood that the terminal device in the embodiment of the present application can also be called a terminal, a user equipment (UE), a mobile station (MS), a mobile terminal (MT), etc. The terminal device can be a mobile phone, a smart TV, a wearable device, a tablet computer (Pad), a computer with a wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in self driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, etc.

[0041] Below, firstly, taking the example of an application developer distributing an application based on distribution channel 1 to distribution channel n, a feasible way for the application developer's electronic device 10 to generate a channel package is illustrated.

[0042] Here, distribution channel 1 to distribution channel n can be any channel that can download application programs, such as application stores, websites, social media, peer-to-peer (P2P) sharing, etc. This application does not make any restrictive description on the specific types of distribution channels.

[0043] For example, Figure 1 A schematic diagram of a process of generating a channel package by an electronic device 10 of an application developer is shown.

[0044] See also Figure 1 , the electronic device 10 may add channel information 1 corresponding to the distribution channel 1 in the source code of the application to generate the source code 1. The electronic device 10 may compile, package, and perform other operations on the files including the source code 1 to generate the channel package 1 corresponding to the distribution channel 1. Similarly, the electronic device 10 may generate channel packages 2 to channel packages n corresponding to the distribution channels 2 to distribution channels n based on substantially the same process as that of generating the channel package 1.

[0045] Here, the channel information can be identification information for determining the distribution channel. For example, the channel information can be a string, a numerical value, etc. for determining the distribution channel. This application does not restrict the data format and content of the channel information. Taking the distribution channel as distribution channel 1 as an example, the channel information can be the string "qudao1".

[0046] Obviously, in the process of generating channel package 1 to channel package n, the electronic device 10 needs to perform n operations of modifying the source code, compiling and packaging. Repeatedly performing the operations of modifying the source code, compiling and packaging will cause a large waste of time and resources, and increase the time cost and resource cost of generating the channel package.

[0047] For example, Figure 2 A schematic diagram of the process of generating a channel package by an electronic device 10 of another application developer is shown.

[0048] See also Figure 2 , the electronic device 10 can compile, package and perform other operations on files including the source code of the application to generate an installation package of the application. The electronic device 10 can sign the installation package to generate an installation package including a signature block. Here, the signature block can be a module in the installation package for storing signature data. In addition to the signature data, the signature block can also store other contents such as the signature certificate and the signature algorithm identifier. This application does not make a restrictive description of the detailed contents in the signature block.

[0049] Furthermore, the electronic device 10 may write the channel information 1 corresponding to the distribution channel 1 into the signature block of the installation package to generate the channel package 1 corresponding to the distribution channel 1. Similarly, the electronic device 10 may generate channel packages 2 to channel packages n corresponding to the distribution channels 2 to distribution channels n based on substantially the same process as generating channel package 1. Furthermore, the electronic device 10 may upload channel packages 1 to channel packages n to the corresponding distribution channels respectively.

[0050] Here, the distribution channel may re-sign the channel package. Taking distribution channel 1 as application market A, application market A may have a corresponding signature certificate. After channel package 1 is uploaded to application market A, application market A will re-sign channel package 1 based on the signature certificate, and the signature block generated based on the re-signature will overwrite the signature block containing channel information 1 in channel package 1.

[0051] Obviously, the aforementioned re-signing process will cause the channel information 1 in the channel package 1 to be lost. Furthermore, when the user's terminal device downloads the channel package 1 through the application market A, the channel information 1 cannot be transmitted back to the electronic device 10, resulting in the electronic device 10 being unable to count the number of downloads of the application in the application market A.

[0052] Based on the above Figure 1 and Figure 2It can be seen from the description that the aforementioned feasible methods of generating channel packages cannot ensure that channel information is not lost while reducing time and resource costs.

[0053] To solve this technical problem, an embodiment of the present application provides a channel package generation method, which can define a data module (hereinafter referred to as a "wedge module") for writing channel information in a non-source code file used to generate an installation package. Furthermore, the electronic device can compile and package all files used to generate the installation package (including non-source code files that define the wedge module) to generate an installation package. When it is necessary to make a channel package for a distribution channel, the electronic device can decompress the installation package to obtain all compiled files, including the compiled non-source code file (hereinafter referred to as the "target file"), and the target file includes a compiled wedge module (hereinafter referred to as the "target module"). Furthermore, the electronic device can compile the channel information corresponding to the distribution channel into the same format as the target file, and write the compiled channel information (hereinafter referred to as the "target information") into the target module. Furthermore, the electronic device can compress all compiled files (including the target file with the target information written) to generate a channel package for the distribution channel.

[0054] It can be understood that the channel package generation method provided in the embodiment of the present application is to modify the compiled non-source code file. Obviously, in the process of generating different channel packages, there is no need to repeat the source code modification and compilation operations, which effectively reduces the time cost and resource cost of generating channel packages and improves the efficiency of generating channel packages. In addition, the aforementioned non-source code files may include configuration files, resource files, and other files that are different from the signature block. Therefore, even if the distribution channel performs a package weight signature on the channel package and covers the signature block in the channel package, it will not cause the channel information to be lost. Therefore, it is ensured that the electronic device can receive the returned channel information.

[0055] Below, the channel package generation method provided in the embodiment of the present application will be described in detail with reference to the accompanying drawings.

[0056] It should also be stated that the steps in the methods and processes in the embodiments of the present application are numbered for ease of reference, rather than to limit the order of precedence. If there is an order between the steps, the text description shall prevail.

[0057] For example, Figure 3 A schematic diagram of a flow chart of an electronic device 10 implementing the aforementioned channel package generation method is shown.

[0058] Figure 3 The execution subject of the process shown includes the electronic device 10. Figure 3 The execution subject of each step is repeatedly described.

[0059] See also Figure 3 The process of the electronic device 10 implementing the aforementioned channel package generation method may include:

[0060] S300: Acquire an installation package of an application, wherein the installation package is generated based on a first file of the application, and the first file includes a preset first element.

[0061] Exemplarily, the electronic device 10 may preset a wedge module (as an example of a "first element") in a non-source code file (as an example of a "first file") in advance. The wedge module is used to write channel information. The channel information in the preset wedge module may be a default channel information value, which may be a string type, an integer value, or a value of other data types. This application does not restrict the specific data type and specific value of the default channel information value. Taking the case where the channel information is a string type, the default channel information value may be a string type, and its content may be "none" or the like.

[0062] After the electronic device 10 defines the wedge module in the non-source code file, it can compile and package multiple files including the non-source code file to generate an installation package of the application. The multiple files used to generate the installation package may include source code files, configuration files, resource files, native library files, script files, multimedia files, etc. The non-source code file can be any of the configuration files, resource files, native library files, script files, multimedia files, etc. For example, the non-source code file can be a configuration file.

[0063] S301: decompress the installation package to obtain multiple files including a second file, wherein the second file corresponds to the first file, and the second file includes a second element corresponding to the first element.

[0064] Exemplarily, when it is necessary to add channel information to the installation package to generate a channel package, the electronic device 10 may decompress the installation package obtained based on the aforementioned S300 to obtain multiple files including a target file (as an example of a "second file"). The multiple files obtained at this time may be the compilation result of the multiple files used to generate the installation package. The target file may be the compilation result of the aforementioned non-source code file, and the target module in the target file (as an example of a "second element") may be the compilation result of the aforementioned wedge module.

[0065] S302: Setting the element value of the second element according to the predetermined first channel information to obtain a third file.

[0066] Exemplarily, if the electronic device 10 needs to generate a channel package for a first distribution channel, the first channel information corresponding to the first distribution channel may be compiled into the same format as the target file to obtain the target information corresponding to the first distribution channel. For example, if the target file is in binary format, the electronic device needs to convert the first channel information into binary format to obtain the target information corresponding to the first distribution channel. It is understood that the present application does not make a restrictive description on the specific format of the target file.

[0067] Furthermore, the electronic device 10 can locate the target module in the target file, and modify the channel information in the target module from the compilation result of the default channel information to the target information corresponding to the first distribution channel. The modified target file is the aforementioned third file.

[0068] In an example method of modifying channel information, the target module includes the compilation result of the default channel information, and the compilation result has a fixed first storage location (for example, the string unit 602e described below). Therefore, when it is necessary to generate a channel package of the first distribution channel, the electronic device 10 can decompress the installation package, and then locate the first storage location in the decompressed target file, and directly modify the content stored in the first storage location to the target information corresponding to the first distribution channel. Similarly, when it is necessary to generate a channel package of the second distribution channel, the electronic device 10 can also locate the first storage location in the decompressed target file, and directly modify the content stored in the first storage location to the compilation result of the second channel information corresponding to the second distribution channel (equivalent to the "target information" corresponding to the second distribution channel). It can be understood that based on this example method, in a scenario where multiple channel packages need to be generated, after the electronic device 10 performs a decompression operation to obtain the target file, it only needs to modify the content stored in the first storage location multiple times to complete the writing of the channel information of multiple channel packages. This process does not require the electronic device 10 to repeatedly modify the source code, and then, does not need to repeat the time-consuming compilation and packaging operations, effectively shortening the time required to generate the channel package. Furthermore, in the scenario of generating multiple channel packages, the electronic device 10 only needs to perform a decompression operation on the installation package once, further reducing the time required to generate multiple channel packages.

[0069] In another example method of modifying channel information, the target module includes an index value of the channel information and a compilation result of the default channel information, the index value is used to index the compilation result of the default channel information, and the index value has a fixed second storage location (for example, the attribute value field 608b below). Therefore, after the electronic device 10 decompresses the target file, if it is necessary to generate a channel package corresponding to the first distribution channel, the target information corresponding to the first distribution channel can be written into the target module of the target file, and indexed to the second storage location, and the content stored in the second storage location is modified to the index value corresponding to the target information. Similarly, when it is necessary to generate a channel package for the second distribution channel, the electronic device 10 can write the target information corresponding to the second distribution channel into the target module, and index to the second storage location, and modify the content stored in the second storage location to the index value corresponding to the target information corresponding to the second distribution channel.

[0070] It can be understood that based on this example method, in a scenario where multiple channel packages need to be generated, after the electronic device 10 performs a decompression operation to obtain the target file, it only needs to modify the content stored in the second storage location multiple times to complete the writing of the channel information of multiple channel packages. This process does not require the electronic device to repeatedly modify the source code, and thus, does not need to repeat the time-consuming compilation and packaging operations, effectively shortening the time required to generate the channel package. Moreover, in the scenario where multiple channel packages are generated, it is only necessary to perform a decompression operation on the installation package once, further reducing the time required to generate multiple channel packages.

[0071] S303: Replace the second file among the multiple files with the third file.

[0072] Exemplarily, after generating the third file based on the aforementioned S302, the electronic device 10 may replace the target file among the multiple files obtained by decompressing the installation package with the third file.

[0073] S304: compress multiple files including the third file to obtain a first channel package.

[0074] Exemplarily, the electronic device 10 may compress the multiple files obtained after executing S303 to obtain a first channel package. The third file in the first channel package includes the target information corresponding to the first channel information, which is equivalent to that the first channel package has written the first channel information based on the above S300 to S303.

[0075] It can be understood that based on the above S300 to S304, the electronic device 10 does not need to modify the source code in the process of generating the channel package (for example, the first channel package, etc.), avoiding repeated time-consuming compilation and packaging operations, and shortening the time required to generate the channel package. In addition, the channel information (for example, the first channel information, etc.) is not written in the signature block, and even if the distribution channel re-signs the channel package, the channel information will not be lost.

[0076] Next, the application runs on Android TM Taking the system as an example, the process of implementing the aforementioned channel package generation method by the electronic device 10 is described in detail.

[0077] Here, corresponding to the application running on Android TM The system, the installation package of the application can be an Android application package (APK). The non-source code file can be a file in the extensible markup language (XML) format in the APK (hereinafter referred to as an "XML file"), and the XML file can be a configuration file in the XML format, for example, an AndroidManifest.XML file. The wedge module can be a custom XML element in the XML file, for example, a custom XML element in the AndroidManifest.XML file.

[0078] Correspondingly, the target file can be an XML file compiled into a binary format (hereinafter referred to as a "binary XML file"), for example, an AndroidManifest.XML file compiled into a binary format, etc. The target module can be an XML element compiled into a binary format (hereinafter referred to as a "binary XML element"), for example, a binary XML element in an AndroidManifest.XML file in a binary format, etc.

[0079] In the process of generating a channel package based on the aforementioned channel package generation method, the electronic device 10 needs to convert the channel information into target information in binary format. Then, the electronic device 10 can write the target information into a target module as a binary XML element, and compress all files used to generate the APK (including the target file in the binary XML file format in which the target information is written) to generate the channel package.

[0080] The following describes in detail the process of implementing the aforementioned channel package generation method on the electronic device 10, taking the application installation package as APK, the non-source code file as XML file, the wedge module as XML element, the target file as binary XML file, and the target module as binary XML element as an example.

[0081] First, in order to facilitate understanding of the specific process of the electronic device 10 writing the target information into the binary XML element based on the aforementioned channel package generation method, the data structure of the binary XML file is described below.

[0082] For example, Figure 4 A schematic diagram of the structure of a binary XML file is shown. It can be understood that only part of the data structure in the binary XML file related to the implementation of the aforementioned channel package generation method is shown here.

[0083] See also Figure 4 The binary XML file may include a header chunk 400 , a string chunk 401 , and a content chunk 402 .

[0084] The header block 400 is used to record information such as the file size (filesize) of the binary XML file.

[0085] The string block 401 is used to store the string in the binary XML file.

[0086] Specifically, the string block 401 may include a chunk size field 401a, a string count field 401b, a string pool offset field 401c, a string pool offset array 401d, a string pool 401e, and the like.

[0087] The block size field 401 a is used to record the size of the character string block 401 .

[0088] The string quantity field 401b is used to record the number of strings in the string pool 401e. For example, the content of the string quantity field 401b is n, indicating that the number of strings in the binary XML file is n.

[0089] The string pool offset field 401c is used to record the starting address of the string pool 401e.

[0090] The string pool offset array 401d is used to record the starting address of each string unit in the string pool 401e, and the array subscript of the string pool offset array 401d can be used as the index value of each string unit. For example, the string pool offset array 401d is an offset array, offset[0]=0, offset[1]=14, ... offset[n-1]=m, indicating that there are n string units in the string pool 401e, the first address of string unit 1 is 0, and its index value is 0; the first address of string unit 2 is 14, and its index value is 1; ... the first address of string unit n is m, and its index value is n-1.

[0091] The string pool 401e is used to store all the strings in the binary XML file. Each string has a corresponding string unit in the string pool 401e. The string unit includes the string length and the string content. Figure 4 Taking the example of storing all strings in the binary XML file as string 1 to string n, string unit 1 to string unit n in the string pool 401e are shown.

[0092] The content block 402 is used to store the attributes, hierarchical structure and mutual relationship of each binary XML element in the binary XML file. The content block 402 may include a number of start tag chunks, etc. The start tag chunks correspond to the binary XML elements one by one.

[0093] Specifically, taking the start tag block 403 among several start tag blocks as an example, the start tag block 403 may include a name field 404, an attribute count field 405, multiple attribute units (the figure takes the start tag block 403 including attribute units 406_1 to 406_n as an example), etc.

[0094] The name field 404 may be used to indicate the tag of the binary XML element corresponding to the start tag block 403. Specifically, the name field 404 corresponds to the index value of the tag of the binary XML element corresponding to the start tag block 403. For ease of understanding, the process of indicating the tag of the binary XML element by the name field 404 is described below by way of example.

[0095] Exemplarily, the label of the binary XML element corresponding to the start tag block 403 is the string "meta-data", the string content of the string unit 2 in the string pool 401e is the binary "meta-data", and the index value of the string unit 2 is 1, then the value of the name field 404 in the start tag block 403 can be 1. Correspondingly, in the process of determining the label of the binary XML element according to the name field 404, the digital unit offset[1] in the string pool offset array 401d can be first indexed according to the value of the name field 404 being 1. Furthermore, according to offset[1]=14, it can be determined that the first address of the label of the binary XML element in the string pool 401e is 14. Therefore, according to the first address of the string unit 2 in the string pool 401e being 14, it can be determined that the label of the binary XML element is the string content "meta-data" in the string unit 2.

[0096] The attribute quantity field 405 is used to record the attribute quantity in the binary XML element corresponding to the start tag block 403 .

[0097] The multiple attribute units correspond one-to-one to the multiple attributes in the binary XML element corresponding to the start tag block 403, and each attribute unit is used to indicate its corresponding attribute. For example, attribute unit 406_1 to attribute unit 406_n correspond to attribute 1 to attribute n in the binary XML element respectively.

[0098] Taking attribute unit 406_1 as an example, attribute unit 406_1 includes attribute name field 407 and attribute value field 408. Attribute name field 407 can be used to indicate the attribute name of attribute 1. Attribute value field 408 can be used for the attribute value of attribute 1. Taking attribute 1 as "tag=pool" as an example, the string "tag" is the attribute name of attribute 1, and the content of attribute name field 407 can be the index value of the string unit where the string "tag" is located; the string "pool" is the attribute value of attribute 1, and the content of attribute value field 408 can be the index value of the string unit where the string "pool" is located.

[0099] For example, Figure 5 Based on the above Figure 4 The content shown is a schematic diagram of a flow chart of an electronic device 10 implementing the aforementioned channel package generation method.

[0100] It should be made clear that Figure 5 The execution subject of the illustrated process is the electronic device 10. For the convenience of description, the execution subject will not be repeatedly described below.

[0101] See also Figure 5 The process of the electronic device 10 implementing the aforementioned channel package generation method may include:

[0102] S500: Add a custom XML element 1 to XML file 1.

[0103] Exemplarily, the electronic device 10 may add a custom XML element 1 (as an example of a "wedge module") to an XML file 1 (as an example of a "non-source code file") used to generate an APK. Here, the XML file 1 may be an AndroidManifest.XML file required to generate an APK.

[0104] In one example, the custom XML element 1 may be:

[0105] <meta-data

[0106] android:name="boom.channel"

[0107] android:value="none" / >

[0108] meta-data is a tag of XML element 1.

[0109] android:name="boom.channel" is attribute 1 of XML element 1, and attribute 1 is used to indicate that the function of XML element 1 is to write channel information. Among them, android:name is the attribute name of attribute 1, and "boom.channel" is the attribute value of attribute 1.

[0110] android:value="none" is attribute 2 of XML element 1, and attribute 2 is used to write specific channel information. Among them, android:value is the attribute name of attribute 2, and "none" is the attribute value of attribute 2. Here, the attribute value "none" can be the aforementioned default channel information.

[0111] It is understood that the structure and content of the aforementioned XML element 1 are only examples, and the present application does not restrict the structure, content, and specific location of the XML element 1 in the XML file 1. In an example, the XML element 1 may be located in the application block (i.e., <application>block).

[0112] S501: Generate an installation package of the application based on the XML file 1 to which the XML element 1 is added.

[0113] For example, the electronic device 10 may generate an APK of the application based on the XML file 1 to which the XML element 1 is added. Here, the content of the APK generated by the electronic device 10 is substantially the same as the content of the installation package generated by the electronic device 10 in the aforementioned S300. For details, please refer to the detailed description of the aforementioned S300, which will not be repeated here. Here, the electronic device 10 may generate the APK based on the ZIP compression format.

[0114] S502: Decompress the installation package to obtain a binary XML file 1, wherein the binary XML file 1 includes a binary XML element 1 corresponding to the XML element 1.

[0115] Exemplarily, when a channel package needs to be generated, the electronic device 10 may decompress the APK to obtain multiple files including the binary XML file 1 (as an example of a "target file"). Taking the XML file 1 as an AndroidManifest.XML file as an example, the electronic device 10 decompresses the APK, and the multiple files that can be obtained may include: a binary AndroidManifest.XML file (as an example of a "binary XML file 1"), assets files, classes.dex files, classes2.dex files, classesn.dex files, lib files, META-INF files, res files, resources.arsc files, etc.

[0116] Here, corresponding to the electronic device 10 generating the APK based on the ZIP compression format, the electronic device 10 may decompress the APK based on the ZIP format.

[0117] Here, the binary XML element 1 in the binary XML file 1 (as an example of a “target module”) is the compilation result of the XML element 1.

[0118] Here, Figure 6a The structure diagram of the binary XML element 1 in the binary XML file 1 is shown. It can be understood that Figure 6a Only the content related to the binary XML element 1 in the binary XML file 1 is shown, and other content is not shown.

[0119] See also Figure 6a The binary XML file 1 includes a header block 600 , a string block 601 and a content block 604 .

[0120] The header block 600 is substantially the same as the aforementioned header block 400 and will not be described in detail herein.

[0121] The string block 601 includes a string pool 602 and a string pool offset array 603 .

[0122] The string pool 602 includes a string unit 602a, a string unit 602b, a string unit 602c, a string unit 602d, and a string unit 602e. The string content of the string unit 602a is a binary string of meta-data, and its first address is A; the string content of the string unit 602b is a binary string of android:name, and its first address is B; the string content of the string unit 602c is a binary string of "boom.channel", and its first address is C; the string content of the string unit 602d is a binary string of android:value, and its first address is D; the string content of the string unit 602e is a binary string of "none", and its first address is E.

[0123] The string pool offset array 603 may be an offset array, and the string pool offset array 603 includes array unit 603a, array unit 603b, array unit 603c, array unit 603d, and array unit 603e. Among them, the array subscript of array unit 603a may be X, and its value is the first address A of the string unit 602a corresponding to meta-data; the array subscript of array unit 603b may be Y1, and its value is the first address B of the string unit 602b corresponding to android:name; the array subscript of array unit 603c may be Z1, and its value is the first address C of the string unit 602c corresponding to "boom.channel"; the array subscript of array unit 603d may be Y2, and its value is the first address D of the string unit 602d corresponding to android:value; the array subscript of array unit 603e may be Z2, and its value is the first address E of the string unit 602e corresponding to "none".

[0124] The content block 604 is a content block corresponding to the binary XML element 1. The content block 604 may include a start tag block 605 corresponding to the binary XML element 1. The start tag block 605 may include a name field 606, an attribute unit 607, and an attribute unit 608.

[0125] The content of the name field 606 may be the index value corresponding to the tag meta-data of the binary XML element 1, that is, the array subscript X of the array unit 603a.

[0126] Attribute unit 607 corresponds to attribute 1 of binary XML element 1. Attribute unit 607 includes attribute name field 607a and attribute value field 607b. The content of attribute name field 607a may be the index value corresponding to the attribute name android:name of attribute 1, that is, the array subscript Y1 of array unit 603b. The content of attribute value field 607b may be the index value corresponding to the attribute value "boom.channel" of attribute 1, that is, the array subscript Z1 of array unit 603c.

[0127] Attribute unit 608 corresponds to attribute 2 of binary XML element 1. Attribute unit 608 includes attribute name field 608a and attribute value field 608b. The content of attribute name field 608a may be the index value corresponding to the attribute name android:value of attribute 2, that is, the array subscript Y2 of array unit 603d. The content of attribute value field 608b may be the index value corresponding to the attribute value "none" of attribute 2, that is, the array subscript Z2 of array unit 603e.

[0128] S503: Write the target information corresponding to the first channel information into the string pool of the binary XML file 1, and determine the index value of the target information.

[0129] Exemplarily, the electronic device 10 may convert the first channel information into a binary format to obtain the target information. Further, after obtaining the binary XML file 1 based on the aforementioned S502, the electronic device 10 writes the target information into the string pool of the binary XML file 1 and determines the index value of the target information. For example, if the first distribution channel is distribution channel 1 and the first channel information corresponding to distribution channel 1 is the string "qudao1", the electronic device may use the binary string "qudao1" as the target information.

[0130] Here, the process of the electronic device 10 writing the target information into the string pool of the binary XML file 1 and determining the index value of the target information will be described below. Figure 6b In the description.

[0131] S504: modify the index value used to determine the channel information in the binary XML element 1 to the index value corresponding to the target information, and generate a binary XML file 2.

[0132] Exemplarily, after determining the index value of the target information based on the aforementioned S503 , the electronic device may modify the index value used to determine the channel information in the binary XML element 1 to the index value corresponding to the target information to generate the binary XML file 2 .

[0133] Here, Figure 6b FIG. 2 shows a schematic diagram of the structure of a binary XML file 2 generated based on a binary XML file 1. It can be understood that Figure 6b Only the content related to the binary XML element 1 is shown, and other content is not shown.

[0134] See also Figure 6b , taking the binary string of the target information "qudao1" as an example, the electronic device 10 may add a string unit 602f to the string pool 602. Here, writing the target information into the string pool of the binary XML file 1 and determining the index value of the target information may include: the electronic device 10 determines the string content of the string unit 602f as the binary string of "qudao1", and records the first address F of the string unit 602f. In addition, an array unit 603f is added to the string pool offset array 603, and the array subscript of the array unit 603f may be Q, and its value is the first address F of the string unit 602f corresponding to "qudao1". Here, the array subscript Q of the array unit 603f is the index value of the string unit 602f corresponding to "qudao1".

[0135] Furthermore, the electronic device 10 modifies the index value used to determine the channel information in the binary XML element 1 to the index value corresponding to the target information, which may include: the electronic device 10 indexes the attribute value field 608b, and modifies the content of the attribute value field 608b (taking Z2 as an example in the figure) to the index value Q of the string unit 602f corresponding to "qudao1".

[0136] Here, the electronic device 10 modifies the content of the attribute value field 608b from Z2 to "qudao1" and the specific content of the index value Q of the string unit 602f corresponding to the attribute value field 608b will be described in the following. Figure 7 It is understood that after the electronic device 10 completes the operations of adding a new string unit 602f, adding an array unit 603f, and modifying the content of the attribute value field 608b to Q, the binary XML file 1 is converted into the binary XML file 2. Moreover, the operations of adding a new string unit 602f, adding an array unit 603f, and modifying the content of the attribute value field 608b to Q are equivalent to writing the first channel information into the binary XML file 2.

[0137] In addition, in another way of writing the first channel information into the binary XML file 2, the electronic device 10 may not modify the content of the attribute value field 608b, but modify the content of the string corresponding to the attribute value field 608b. Specifically, the electronic device 10 may index to offset[Z2] (i.e., the content of array unit 603e) in the string pool offset array based on the content Z2 of the attribute value field 608b. Based on offset[Z2]=E in array unit 603e, index to string unit 602e with the first address E in string pool 602. Then, modify the string content in string unit 602e to the binary string "qudao1". The process of the electronic device 10 locating the attribute value field 608b can be seen below. Figure 7 S700 to S702 in the above are not described in detail here.

[0138] S505: Generate a first channel package based on the binary XML file 2.

[0139] For example, after the electronic device 10 generates the binary XML file 2 based on the aforementioned S504, the binary XML file 1 among the multiple files obtained by decompressing the APK may be replaced with the binary XML file 2. In addition, the multiple files including the binary XML file 2 may be compressed to obtain a first channel package. Furthermore, the electronic device 10 may send the first channel package to the first distribution channel to distribute the application to users through the first distribution channel.

[0140] For example, Figure 7 A schematic diagram of a process of the electronic device 10 modifying the content of the attribute value field 608b from Z2 to the index value Q of the string unit 602f is shown.

[0141] It should be made clear that Figure 7 The execution subject of the illustrated process is the electronic device 10. For the convenience of description, the execution subject will not be repeatedly described below.

[0142] See also Figure 7 The process of modifying the content of the attribute value field 608b from Z2 to the index value Q of the string unit 602f includes:

[0143] S700: Traverse the content blocks to determine the first type of start tag block, wherein the name field of the first type of start tag block is the index value of the tag meta-data.

[0144] Exemplarily, the electronic device 10 may traverse all start tag blocks in the content block 604 of the binary XML file 1, determine one or more start tag blocks whose name field content is the index value X of the tag meta-data of the binary XML element 1, and determine the determined one or more start tag blocks as the first type of start tag blocks.

[0145] Specifically, for each start tag block, the electronic device 10 may first determine the value of the name field of the start tag block (hereinafter referred to as the "name field value"), and determine the array unit whose array subscript is the name field value in the string pool offset array 603 of the binary XML file 1. Furthermore, the electronic device 10 may determine the value of the array unit (hereinafter referred to as the "array unit value"), and determine the string unit whose first address is the array unit value in the string pool 602 of the binary XML file 1. Furthermore, the electronic device 10 may determine whether the string content of the string unit is the binary string of the tag meta-data of the binary XML element 1. If the judgment is yes, the start tag block belongs to the first type of start tag block.

[0146] It can be understood that based on the above process, all binary XML elements tagged as meta-data can be determined in the binary XML file 1, including the binary XML element 1.

[0147] S701: traverse the first type of start tag blocks to determine the start tag block corresponding to the binary XML element 1, wherein the start tag block corresponding to the binary XML element 1 has an attribute unit corresponding to the attribute 1 of the binary XML element 1.

[0148] Exemplarily, after determining one or more first-category start tag blocks, the electronic device 10 may traverse each first-category start tag block to determine a first-category start tag block whose attribute unit corresponds to attribute 1 (android:name="boom.channel") of binary XML element 1. It can be understood that since attribute 1 is used to mark binary XML element 1, the first-category start tag block having an attribute unit corresponding to attribute 1 is the start tag block corresponding to binary XML element 1.

[0149] Specifically, for each first-category start tag block, the electronic device 10 can traverse each attribute unit in the first-category start tag block. For the traversed attribute unit, the electronic device 10 can first determine the value of the attribute name field of the attribute unit (hereinafter referred to as "attribute name field value"), and determine the array unit whose array subscript is the attribute name field value in the string pool offset array 603 of the binary XML file 1. Furthermore, the electronic device 10 can determine the value of the array unit (hereinafter referred to as "array unit value"), and determine the string unit whose first address is the array unit value in the string pool 602 of the binary XML file 1. Furthermore, the electronic device 10 can determine whether the string content of the string unit is the binary string of the attribute name android:name of attribute 1.

[0150] If the judgment is no, the electronic device 10 can traverse the next attribute unit in the first type start tag block and repeat the above process. It can be understood that if all attribute units in the first type start tag block are judged as no, the electronic device 10 can traverse the next first type start tag block in all first type start tag blocks until it is judged as yes.

[0151] If the judgment is yes, for the traversed attribute unit, the electronic device 10 may further determine whether the attribute value field of the attribute unit corresponds to the attribute value "boom.channel" of attribute 1.

[0152] Specifically, the electronic device 10 may first determine the value of the attribute value field of the attribute unit (hereinafter referred to as "attribute value field value"), and determine the array unit whose array subscript is the attribute value field value in the string pool offset array 603 of the binary XML file 1. Then, the electronic device 10 may determine the value of the array unit (hereinafter referred to as "array unit value"), and determine the string unit whose first address is the array unit value in the string pool 602 of the binary XML file 1. Then, the electronic device 10 may determine whether the string content of the string unit is the binary string of the attribute value "boom.channel" of attribute 1.

[0153] If the determination result is no, the electronic device 10 may traverse the next first-category start tag block in all first-category start tag blocks until the determination result is yes.

[0154] If the judgment is yes, the electronic device 10 can determine that the first type of start tag block currently traversed is the start tag block 605 corresponding to the binary XML element 1. Correspondingly, the attribute unit currently traversed is the attribute unit 607 corresponding to the attribute 1 of the binary XML element 1.

[0155] S702: Determine an attribute unit corresponding to attribute 2 of binary XML element 1 in the start tag block corresponding to binary XML element 1.

[0156] Exemplarily, after determining the start tag block 605 corresponding to the binary XML element 1 , the electronic device 10 may determine the attribute unit 608 corresponding to the attribute 2 of the binary XML element 1 in the start tag block 605 .

[0157] Specifically, the electronic device 10 can traverse each attribute unit in the start tag block 605. For the traversed attribute unit, the electronic device 10 can first determine the value of the attribute name field of the attribute unit (hereinafter referred to as "attribute name field value"), and determine the array unit whose array subscript is the attribute name field value in the string pool offset array 603 of the binary XML file 1. Then, the electronic device 10 can determine the value of the array unit (hereinafter referred to as "array unit value"), and determine the string unit whose first address is the array unit value in the string pool 602 of the binary XML file 1. Then, the electronic device 10 can determine whether the string content of the string unit is the binary string of the attribute name android:value of attribute 2.

[0158] If the judgment is no, the electronic device 10 may traverse the next attribute unit in the start tag block 605 and repeat the above process until the judgment is yes.

[0159] If the answer is yes, the attribute unit traversed is the attribute unit 608 corresponding to attribute 2.

[0160] S703: Modify the attribute value field of the attribute unit corresponding to attribute 2 of binary XML element 1 to the index value of the target information.

[0161] Exemplarily, after determining the attribute unit 608 in the start tag block 605 , the electronic device 10 may modify the attribute value field 608 b of the attribute unit 608 to the index value of the target information.

[0162] Specifically, the electronic device 10 has determined the index value Q of the target information based on the aforementioned S503, and then, the electronic device 10 can directly modify the attribute value field 608b in the attribute unit 608 to the index value Q of the target information.

[0163] Here, if there are other fields for recording the index value of the channel information in the attribute unit 608, the electronic device 10 can also modify the field to the index value Q of the target information. For example, there may be an attribute data field (not shown in the figure) in the attribute unit 608, and the value of the attribute data field is consistent with the value of the attribute value field 608b, and the index value of the channel information is also recorded. Therefore, the electronic device 10 can modify the value of the attribute data field to the index value Q of the target information.

[0164] Here, due to the addition of the string unit 602f and the array unit 603f, the electronic device 10 also needs to update the block size field (not shown in the figure, essentially the same as the block size field 401a), the string quantity field (not shown in the figure, essentially the same as the string quantity field 401b) in the string block 601, and the file size in the header block 600.

[0165] Based on the above S700 to S703, the electronic device 10 has modified the content of the attribute value field 608b from Z2 to the index value Q of the string unit 602f, and then, the above S505 may continue to be executed to generate the first channel package.

[0166] It is understandable that the electronic device 10 can generate multiple channel packages of the application based on the embodiment of the present application. The following takes the case where the electronic device 10 also needs to generate a second channel package corresponding to the second distribution channel as an example to illustrate the process of the electronic device 10 generating multiple channel packages.

[0167] In an example method of generating multiple channel packages, the electronic device 10 may perform substantially the same process as the aforementioned S502 to S505 on the installation package of the application to generate a second channel package. The difference between the process of generating the second channel package and the aforementioned S502 to S505 is that the target information written into the binary XML file 1 is the second channel information in binary format, and the second channel information corresponds to the second distribution channel.

[0168] In another example method of generating multiple channel packages, the electronic device 10 only needs to decompress the installation package once during the process of generating multiple channel packages. Specifically, when generating the first channel package, the electronic device 10 can copy the decompressed binary XML file 1, and then the electronic device 10 can perform the aforementioned Figure 5 When generating the second channel package, the electronic device 10 may copy the decompressed binary XML file 1 again, and then the electronic device 10 may perform the aforementioned Figure 5 The process shown is used to generate the second channel package.

[0169] In another example of multiple channel packages, the electronic device 10 only needs to decompress the installation package once in the process of generating multiple channel packages. For example, after obtaining the binary XML file 2 used to generate the first channel package, the electronic device 10 can make the second channel package based on the binary XML file 2. Specifically, after the electronic device 10 obtains the binary XML file 2, it can add a string unit corresponding to the binary second channel information in the string pool of the binary XML file 2, and add an array unit of the string unit in the string pool offset array. Then, the electronic device 10 can determine the start tag block corresponding to the binary XML element 1, and modify the attribute value field corresponding to the attribute 2 of the binary XML element 1 in the start tag block to the array subscript of the newly added array unit. Based on the above process, the electronic device 10 modifies the binary XML file 2 into a binary XML file 3 for generating the second channel package. Then, the electronic device 10 can generate the second channel package based on the binary XML file 3 according to the content substantially the same as the above S505. Here, the process of the electronic device 10 generating the first channel package based on the binary XML file 2, and the process of the electronic device 10 making the second channel package based on the binary XML file 3 can be executed in parallel.

[0170] It is understandable that the aforementioned Figure 5 and Figure 7 The process shown is a process of generating a channel package based only on the electronic device 10. In other embodiments, the channel package can also be generated based on the interaction between the electronic device 10 and the server 20. Here, the server 20 is a server accessible to the application developer, and this application does not make a restrictive description on the type of the server 20.

[0171] For example, Figure 8 A schematic diagram of interaction between an electronic device 10 and a server 20 for generating a channel package is shown.

[0172] See also Figure 8 The process of generating a channel package based on the interaction between the electronic device 10 and the server 20 may include:

[0173] S800 : The server 20 sends the XML file 1 to the electronic device 10 .

[0174] Exemplarily, a plurality of files for generating an APK may be stored in the server 20. Therefore, to generate a channel package, the server 20 may send an XML file 1 to the electronic device 10.

[0175] S801: The electronic device 10 adds a custom XML element 1 to the XML file 1.

[0176] Exemplarily, after the electronic device 10 obtains the XML file 1 based on the aforementioned S800 , a user-defined XML element 1 may be added to the XML file 1 .

[0177] Here, the specific content of the custom XML element 1 added by the electronic device 10 to the XML file 1 is substantially the same as that of the aforementioned S500. For details, please refer to the detailed description of the aforementioned S500, which will not be repeated here.

[0178] S802: The electronic device 10 sends the XML file 1 to which the XML element 1 is added to the server 20.

[0179] Exemplarily, after the electronic device 10 adds the XML element 1 to the XML file 1 based on the aforementioned S801 , the electronic device 10 may send the XML file 1 with the added XML element 1 to the server 20 .

[0180] S803: The server 20 generates an installation package of the application based on the XML file 1 to which the XML element 1 is added.

[0181] Exemplarily, after receiving the XML file 1 to which the XML element 1 is added based on the aforementioned S802, the server 20 may generate an installation package of the application based on the XML file 1 to which the XML element 1 is added.

[0182] Here, the specific content of the application installation package generated by the server 20 based on the XML file 1 with the XML element 1 added is essentially the same as the aforementioned S501, the only difference is that the execution subject is different, so please refer to the detailed description of the aforementioned S501 and no further details will be given here.

[0183] S804: The server 20 sends an installation package to the electronic device 10.

[0184] Exemplarily, after the server 20 generates the installation package based on the aforementioned S803, it can send the installation package to the electronic device 10, so that the electronic device 10 can generate a first channel package based on the first channel information and the installation package after determining the first channel information.

[0185] S805: The electronic device 10 decompresses the installation package to obtain a binary XML file 1, wherein the binary XML file 1 includes a binary XML element 1 corresponding to the XML element 1.

[0186] Exemplarily, when the electronic device 10 determines to generate a first channel package corresponding to a first distribution channel, and after determining that the channel information corresponding to the first distribution channel is the first channel information, the installation package can be decompressed to obtain a binary XML file 1, wherein the binary XML file 1 includes a binary XML element 1 corresponding to the XML element 1.

[0187] Here, the specific content of the binary XML file 1 obtained by the electronic device 10 decompressing the installation package is substantially the same as that of the aforementioned S502. For details, please refer to the detailed description of the aforementioned S502, which will not be repeated here.

[0188] S806: The electronic device 10 sends the binary XML file 1 and the first channel information to the server 20.

[0189] Exemplarily, after obtaining the binary XML file 1 based on the aforementioned S805 , the electronic device 10 may send the binary XML file 1 and the first channel information to the server 20 , so that the server 20 may generate the binary XML file 2 .

[0190] S807: The server 20 writes the target information corresponding to the first channel information into the string pool of the binary XML file 1, and determines the index value of the target information.

[0191] Exemplarily, after obtaining the binary XML file 1 and the first channel information based on the aforementioned S806, the server 20 may write the target information corresponding to the first channel information into the string pool of the binary XML file 1 and determine the index value of the target information.

[0192] Here, the server 20 writes the target information corresponding to the first channel information into the string pool of the binary XML file 1, and determines that the specific content of the index value of the target information is essentially the same as the aforementioned S503, the only difference is that the execution subject is different, so please refer to the detailed description of the aforementioned S503, which will not be repeated here.

[0193] S808: The server 20 modifies the index value used to determine the channel information in the binary XML element 1 into the index value corresponding to the target information, and generates a binary XML file 2.

[0194] Exemplarily, after determining the index value of the target information based on the aforementioned S807 , the server 20 may modify the index value used to determine the channel information in the binary XML element 1 to the index value corresponding to the target information, and generate a binary XML file 2 .

[0195] Here, the server 20 modifies the index value used to determine the channel information in the binary XML element 1 to the index value corresponding to the target information, and generates the specific content of the binary XML file 2 which is substantially the same as the aforementioned S504, the only difference being that the execution subject is different. Therefore, please refer to the detailed description of the aforementioned S504 and will not be repeated here.

[0196] S809 : The server 20 sends the binary XML file 2 to the electronic device 10 .

[0197] Exemplarily, after generating the binary XML file 2 based on the aforementioned S808, the server 20 may send it to the electronic device 10 so that the electronic device 10 can generate the first channel package.

[0198] S810: The electronic device 10 generates a first channel package based on the binary XML file 2.

[0199] Exemplarily, after the electronic device 10 acquires the binary XML file 2 based on the aforementioned S809 , it may generate a first channel package based on the binary XML file 2 .

[0200] Here, the specific content of the first channel package generated by the electronic device 10 based on the binary XML file 2 is substantially the same as the aforementioned S505. For details, please refer to the detailed description of the aforementioned S505, which will not be repeated here.

[0201] Fig. 9 According to an embodiment of the present application, a schematic structural diagram of an electronic device 10 is shown.

[0202] like Fig. 9 As shown, in some embodiments, the electronic device 10 may include one or more processors 900, a system control logic 901 connected to at least one of the processors 900, a system memory 902 connected to the system control logic 901, a non-volatile memory (NVM) 903 connected to the system control logic 901, and a network interface 904 connected to the system control logic 901.

[0203] In some embodiments, the processor 900 may include one or more single-core or multi-core processors. In some embodiments, the processor 900 may include any combination of a general-purpose processor and a dedicated processor (e.g., a graphics processor, an application processor, a baseband processor, etc.). For example, the processor 900 may include any combination of a general-purpose processor and a dedicated processor required to implement the aforementioned channel package generation method.

[0204] In some embodiments, system control logic 901 may include any suitable interface controller to provide any suitable interface to at least one of processors 900 and / or any suitable device or component in communication with system control logic 901 .

[0205] In some embodiments, the system control logic 901 may include one or more memory controllers to provide an interface to the system memory 902. The system memory 902 may be used to load and store data and / or instructions. In some embodiments, the system memory 902 of the electronic device 10 may include any suitable volatile memory, such as a suitable dynamic random access memory (DRAM).

[0206] The non-volatile memory 903 may include one or more tangible, non-transitory computer-readable media for storing data and / or instructions. In some embodiments, the non-volatile memory 903 may include any suitable non-volatile memory such as a flash memory and / or any suitable non-volatile storage device, such as at least one of a HDD (hard disk drive), a CD (compact disc) drive, and a DVD (digital versatile disc) drive.

[0207] The non-volatile memory 903 may include a portion of storage resources installed on a device of the electronic device 10 , or it may be accessible by the device but not necessarily a portion of the device. For example, the non-volatile memory 903 may be accessed over a network via the network interface 904 .

[0208] In particular, system memory 902 and non-volatile memory 903 may respectively include: a temporary copy and a permanent copy of instructions 905. In some embodiments, instructions 905, hardware, firmware and / or software components thereof may be additionally / alternatively placed in system control logic 901, network interface 904 and / or processor 900.

[0209] The network interface 904 may include a transceiver for providing a radio interface for the electronic device 10, thereby communicating with any other suitable device (such as a front-end module, an antenna, etc.) through one or more networks. In some embodiments, the network interface 904 may be integrated with other components of the electronic device 10. For example, the network interface 904 may be integrated with at least one of the processor 900, the system memory 902, the non-volatile memory 903, and a firmware device (not shown) having instructions.

[0210] The network interface 904 may further include any suitable hardware and / or firmware to provide a multiple-input multiple-output radio interface. For example, the network interface 904 may be a network adapter, a wireless network adapter, a telephone modem and / or a wireless modem.

[0211] In one embodiment, at least one of the processors 900 may be packaged with logic for one or more controllers of the system control logic 901 to form a system in package (SiP). In one embodiment, at least one of the processors 900 may be integrated on the same die with logic for one or more controllers of the system control logic 901 to form a system on chip (SoC).

[0212] The electronic device 10 may further include an input / output (I / O) device 906 . The I / O device 906 may include a user interface to enable a user to interact with the electronic device 10 ; and a peripheral component interface design to enable peripheral components to interact with the electronic device 10 .

[0213] In some embodiments, the user interface may include, but is not limited to, a display (eg, a liquid crystal display, a touch screen display, etc.), a sensor, a speaker, a microphone, a light emitting diode, and physical buttons.

[0214] In some embodiments, the peripheral component interface may include, but is not limited to, a non-volatile memory port, an audio jack, and a power interface.

[0215] In some embodiments, the sensor may include, but is not limited to, a gyroscope sensor, an acceleration sensor, a GNSS antenna, and a positioning unit. The positioning unit may also be a part of the network interface 904 or interact with the network interface 904 to communicate with components of the positioning network (e.g., GNSS satellites).

[0216] The embodiments of the present application also provide a computer program product for implementing the channel package generation method provided in the above embodiments.

[0217] The various embodiments of the mechanism disclosed in the present application can be implemented in hardware, software, firmware or a combination of these implementation methods. The embodiments of the present application can be implemented as a computer program module or module code executed on a programmable system, which includes at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device and at least one output device.

[0218] A computer program module or module code may be applied to input instructions to perform the functions described herein and generate output information. The output information may be applied to one or more output devices in a known manner. For purposes of this application, a processing system includes any system having a processor such as, for example, a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC), or a microprocessor.

[0219] Module code can be implemented with high-level modular language or object-oriented programming language to communicate with the processing system. When necessary, module code can also be implemented with assembly language or machine language. In fact, the mechanism described in this application is not limited to the scope of any specific programming language. In either case, the language can be a compiled language or an interpreted language.

[0220] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried or stored on one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, the instructions may be distributed over a network or through other computer-readable media. Therefore, a machine-readable medium may include any mechanism for storing or transmitting information in a machine (e.g., computer) readable form, including but not limited to a floppy disk, an optical disk, an optical disk, a magneto-optical disk, a read-only memory (ROM), a random access memory (RAM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic card or an optical card, a flash memory, or a tangible machine-readable memory for transmitting information (e.g., a carrier wave, an infrared signal, a digital signal, etc.) using the Internet in an electrical, optical, acoustic, or other form of propagation signal. Accordingly, machine-readable media include any type of machine-readable media suitable for storing or transmitting electronic instructions or information in a form readable by a machine (eg, a computer).

[0221] References to "one embodiment" or "an embodiment" in the specification mean that the specific features, structures, or characteristics described in conjunction with the embodiment are included in at least one exemplary implementation or technology disclosed according to the embodiment of the present application. The appearance of the phrase "in one embodiment" in various places in the specification does not necessarily all refer to the same embodiment.

[0222] The disclosure of the embodiments of the present application also relates to an operating device for executing the text. The device can be constructed specifically for the required purpose or it can include a general-purpose computer selectively activated or reconfigured by a computer program stored in the computer. Such a computer program can be stored in a computer-readable medium, such as, but not limited to, any type of disk, including a floppy disk, an optical disk, a CD-ROM, a magneto-optical disk, a read-only memory (ROM), a random access memory (RAM), an EPROM, an EEPROM, a magnetic or optical card, an application-specific integrated circuit (ASIC), or any type of medium suitable for storing electronic instructions, and each can be coupled to a computer system bus. In addition, the computer mentioned in the specification may include a single processor or may be an architecture involving multiple processors for increased computing power.

[0223] In addition, the language used in this specification has been primarily selected for readability and instructional purposes and may not be selected to describe or limit the disclosed subject matter. Therefore, the present application embodiment disclosure is intended to illustrate rather than limit the scope of the concepts discussed herein.< / application>

Claims

1. A channel package generation method, applied to electronic equipment, characterized in that: The method comprises: Presetting a first element in a first file for generating an installation package of an application, wherein the first element is used to write channel information, and the first element includes a first content attribute for determining a first character string; Compiling and packaging a plurality of files including the first file to obtain the installation package of the application; decompressing the installation package to obtain a plurality of files including a second file, wherein the second file is the first file compiled into a binary format, a second element in the second file is the first element compiled into a binary format, and the second element includes a second content attribute for determining the first string in a binary format, The second file includes a string block and a content block, the string block includes the first string in binary format and a first index value corresponding to the first string in binary format, the content block includes the second content attribute, the attribute value of the second content attribute is a second index value, wherein the second index value is used to determine the first index value; Determine the first channel information in binary format; Adding the first channel information in binary format and a third index value corresponding to the first channel information in binary format to the character string block; Modify the attribute value of the second content attribute in the content block from the second index value to a fourth index value, wherein the fourth index value is used to determine the third index value, to obtain a third file; Replacing the second file among the multiple files with the third file; compressing the plurality of files including the third file to obtain a first channel package; The first channel information is used to determine a distribution channel of the first channel package.

2. The method according to claim 1, characterized in that The first file is in XML format.

3. The method according to claim 1, characterized in that The distribution channels include: app stores, websites, social media, and peer-to-peer sharing.

4. An electronic device, characterized in that: include: one or more processors; One or more memories; the one or more memories store one or more programs, and when the one or more programs are executed by the one or more processors, the electronic device executes the channel package generation method described in any one of claims 1 to 3.

5. A computer-readable medium, characterized in that The readable medium stores instructions, which, when executed on a computer, enable the computer to execute the channel package generation method according to any one of claims 1 to 3.

6. A computer program product, characterized in that It includes computer programs / instructions, which, when executed by a processor, implement the channel package generation method described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Method for releasing application installation package, terminal device and medium

    CN109542461A

  • Application packaging method and device

    CN111078223A