Update data packaging method, device, equipment and storage medium

Through automated packaging methods, the APK file is generated and signed, which solves the problem of untimely data updates in network-free environments, and efficient and accurate data processing is achieved, improving user experience.

CN114398063BActive Publication Date: 2025-08-19PINGAN INT SMART CITY TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210059111.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-19
Publication Date
2025-08-19
Estimated Expiration
2042-01-19

AI Technical Summary

Technical Problem

In a networkless or weak network environment, data updates in the prior art are not timely and are susceptible to human factors, resulting in blanks in the application and inefficient efficiency.

Method used

Through automated packaging methods, Java files are generated, dex files are generated and packaged into APK files, including variable and fixed APK file packages, signed and stored, and data processing is automatically completed by using the program to avoid human errors.

Benefits of technology

It greatly saves developers time, reduces data processing error rate, ensures that the application can display the latest data even without a network during the first installation, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114398063B_ABST
    Figure CN114398063B_ABST
Patent Text Reader

Abstract

The present application relates to the field of development management technology, and provides a packaging method for updating data, packaging resource files, generating Java files, wherein the resource files include data to be updated stored in the application file; obtaining corresponding class files based on the search path of the Java files in a preset directory; generating dex files from the class files, and packaging the dex files to obtain APK files, wherein the APK files include: a variable APK file package and a fixed APK file package, and the variable APK files include: an original variable APK file package and a new variable APK file package; signing the APK files, packaging the signed APK files, and storing them in a designated file directory. This method can greatly save developers' time in data processing. During the packaging process, since data processing is automatically completed by the program, data errors caused by developers' misoperations or omissions are avoided, and the error rate of developers' data processing is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of development management technology, and in particular relates to a packaging method, device, equipment and storage medium for updating data. Background Art

[0002] In scenarios with no or weak network connectivity, to prevent the app from being blank and silent due to an inability to load the latest data, a default data set is built into the Android app. This built-in default data is manually downloaded from the server, placed in the app project, and then packaged into the app during the packaging process. However, this has the following drawbacks:

[0003] 1. Subjective influence is relatively large. Due to human negligence, the default data is not updated in time, or human errors occur during the data update process.

[0004] 2. Manually updating default data is time-consuming, labor-intensive, and inefficient.

[0005] Therefore, there is an urgent need for a packaging method with high automation and good precision. Summary of the Invention

[0006] In view of the above, the present invention provides a method, device, equipment and storage medium for packaging updated data, which aims to solve the technical problem of untimely updating of packaged data in the prior art.

[0007] To achieve the above object, the present invention provides a method for packaging updated data, the method comprising:

[0008] Packing resource files and generating Java files, wherein the resource files include data to be updated stored in the application files;

[0009] Get the corresponding class file based on the search path of the java file in the preset directory;

[0010] Generate a dex file from the class file, and package the dex file to obtain an APK file, wherein the APK file includes: a variable APK file package and a fixed APK file package, and the variable APK file includes: an original variable APK file package and a new variable APK file package;

[0011] Sign the APK file, package the signed APK file, and store it in a specified file directory.

[0012] Preferably, the data to be updated includes:

[0013] The script file obtains the APK packaging project code through the configuration data file, and obtains the directory of the manifest text file through the APK packaging project code;

[0014] The file of the data to be updated is obtained according to the directory of the list text file, and the file of the data to be updated is parsed to obtain the information of the data to be updated.

[0015] Preferably, the resource files include: a data build.json file, a packaging script config.gradle file and an Android signature file.

[0016] Preferably, the resource file includes:

[0017] Configuration data build.json file, wherein the configuration data build.json file includes the data file to be updated;

[0018] Configure the packaging script config.gradle file to obtain the resource file, wherein the config.gradle file includes: signingConfigs, sourceSets and productFlavors.

[0019] Preferably, the data to be updated stored in the application file includes:

[0020] The script file obtains the directory of the list text file;

[0021] Acquire a file of data to be updated according to the directory of the list text file, and parse the file of data to be updated to obtain information of data to be updated;

[0022] storing the acquired information of the data to be updated in the memory of the computer;

[0023] The stored data to be updated is obtained and stored in a designated location of the application file using an interface through the http protocol, wherein the interface is a real interface within the Android application.

[0024] Preferably, the original variable APK file package includes:

[0025] Copy the original variable APK file package;

[0026] Modify the file content after decompression of the original variable APK file package;

[0027] The modified file content is compressed and packaged into a new variable APK file package.

[0028] Preferably, before storing the acquired information of the data to be updated in the memory of the computer, the method includes:

[0029] Determine whether the information of the data to be updated is abnormal according to the operation log;

[0030] If there is an exception, obtain the exception information and modify the exception file.

[0031] To achieve the above object, the present invention further provides a device for packaging updated data, the device comprising:

[0032] A generation module, used to package resource files and generate Java files, wherein the resource files include data to be updated stored in the application file;

[0033] A search module is used to obtain the corresponding class file based on the search path of the Java file in a preset directory;

[0034] A first packaging module is configured to generate a dex file from the class file and package the dex file to obtain an APK file, wherein the APK file includes a variable APK file package and a fixed APK file package, and the variable APK file includes an original variable APK file package and a new variable APK file package;

[0035] The second packaging module is used to sign the APK file, package the signed APK file, and store it in a designated file directory.

[0036] To achieve the above object, the present invention further provides an electronic device, comprising:

[0037] at least one processor; and,

[0038] a memory communicatively connected to the at least one processor; wherein,

[0039] The memory stores a program executable by the at least one processor. The program is executed by the at least one processor to enable the at least one processor to perform the update data packaging method.

[0040] To achieve the above objectives, the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a packaging program for update data, and when the packaging program for update data is executed by a processor, the steps of the update data packaging method are implemented.

[0041] This invention significantly saves developers time in data processing. During the packaging process, data processing is automatically performed by the program, avoiding data errors caused by developer misoperation or omissions, significantly reducing the developer's data processing error rate. With this reduced data error rate, when the packaged Android application is first installed, even without a network or with a weak network, the latest data will be displayed promptly, eliminating user misunderstandings caused by untimely data updates. This significantly improves the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0043] Figure 1 A schematic diagram of a preferred embodiment of an electronic device of the present invention;

[0044] Figure 2 for Figure 1 Schematic diagram of the modules of a preferred embodiment of a packaging device for updating data;

[0045] Figure 3 A flowchart of a preferred embodiment of a data updating packaging method of the present invention;

[0046] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0048] Reference Figure 1 FIG. 1 is a schematic diagram of a preferred embodiment of an electronic device 1 of the present invention.

[0049] The electronic device 1 includes, but is not limited to, a memory 11, a processor 12, a display 13, and a network interface 14. The electronic device 1 is connected to a network via the network interface 14 to obtain raw data. The network may be a wireless or wired network such as an intranet, the Internet, a Global System of Mobile communication (GSM), a Wideband Code Division Multiple Access (WCDMA), a 4G network, a 5G network, Bluetooth, or a Wi-Fi calling network.

[0050] The memory 11 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of the electronic device 1, such as a hard disk or memory of the electronic device 1. In other embodiments, the memory 11 may also be an external storage device of the electronic device 1, such as a plug-in hard disk, smart memory card (SMC), secure digital (SD) card, flash card, etc. equipped with the electronic device 1.

[0051] Of course, the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device thereof. In this embodiment, the memory 11 is generally used to store the operating system and various application software installed on the electronic device 1, such as the program code of the packager 10 for updating data. In addition, the memory 11 may also be used to temporarily store various types of data that have been output or are about to be output.

[0052] In some embodiments, the processor 12 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor 12 is generally used to control the overall operation of the electronic device 1, such as performing control and processing related to data interaction or communication. In this embodiment, the processor 12 is used to execute program code stored in the memory 11 or process data, such as executing the program code of the data packaging program 10 for updating data.

[0053] The display 13 can be referred to as a display screen or a display unit. In some embodiments, the display 13 can be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an organic light-emitting diode (OLED) touch screen. The display 13 is used to display information processed by the electronic device 1 and to display a visual working interface, such as displaying statistical data results.

[0054] The network interface 14 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface). The network interface 14 is generally used to establish a communication connection between the electronic device 1 and other electronic devices.

[0055] Figure 1 Only the electronic device 1 is shown with the components 11 - 14 and the packaging program 10 for updating data, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.

[0056] Optionally, the electronic device 1 may further include a target user interface, which may include a display and an input unit such as a keyboard. The target user interface may also include a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an organic light-emitting diode (OLED) touch device. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device 1 and to display a visual target user interface.

[0057] The electronic device 1 may further include a radio frequency (RF) circuit, a sensor, an audio circuit, etc., which will not be described in detail here.

[0058] In the above embodiment, the processor 12 may implement the following steps when executing the update data packaging program 10 stored in the memory 11:

[0059] Packing resource files and generating Java files, wherein the resource files include data to be updated stored in the application files;

[0060] Get the corresponding class file based on the search path of the java file in the preset directory;

[0061] Generate a dex file from the class file, and package the dex file to obtain an APK file, wherein the APK file includes: a variable APK file package and a fixed APK file package, and the variable APK file includes: an original variable APK file package and a new variable APK file package;

[0062] Sign the APK file, package the signed APK file, and store it in a specified file directory.

[0063] For a detailed description of the above steps, please refer to the following Figure 2 Functional module diagram of the embodiment of the packaging device 100 for updating data and Figure 3 Description of a flowchart of an embodiment of a method for packaging updated data.

[0064] Reference Figure 2 , which is a functional module diagram of the packaging device 100 for updating data according to the present invention.

[0065] The update data packaging device 100 described in the present invention can be installed in an electronic device. Depending on the functionality implemented, the update data packaging device 100 may include: a generation module 110, a search module 120, a first packaging module 130, and a second packaging module 140. A module, also referred to as a unit, is a series of computer program segments that can be executed by an electronic device processor and perform a fixed function, and is stored in the electronic device's memory.

[0066] In this embodiment, the functions of each module / unit are as follows:

[0067] The generation module 110 is used to package the resource file and generate a Java file. The resource file includes the data to be updated stored in the application file.

[0068] The method for obtaining the data to be updated includes:

[0069] The script file obtains the APK packaging project code through the configuration data file, and obtains the directory of the manifest text file through the APK packaging project code;

[0070] The file of the data to be updated is obtained according to the directory of the list text file, and the file of the data to be updated is parsed to obtain the information of the data to be updated.

[0071] Furthermore, the resource files include: a data build.json file, a packaging script config.gradle file, and an Android signature file.

[0072] It should be noted that the resource file is the configuration configFile file, which includes the data build.json file, the packaging script config.gradle file and the Android signature file.

[0073] In this embodiment, the built-in data used during app packaging is not fixed; it changes based on the specific data in the backend production environment. Therefore, the data to be updated can be manually modified before app packaging, rather than being fixed. The built-in data for app packaging can be manually added based on specific business needs by adding the corresponding data to the configuration manifest file.

[0074] Furthermore, the method for obtaining the resource file includes:

[0075] Configuration data build.json file, wherein the configuration data build.json file includes the data file to be updated;

[0076] Configure the packaging script config.gradle file, where the config.gradle file includes: signingConfigs, sourceSets, and productFlavors.

[0077] In this embodiment, the data file to be updated is typically a string ID and file location, which are entered into a manifest text file. Before the Android code is compiled, the information required for the update is read from the manifest text file. This is done by a Gradle script written in Groovy. The read information is temporarily stored in the computer's memory for use by the script.

[0078] Specifically, the data to be updated stored in the application file includes:

[0079] A1. The script file obtains the directory of the manifest text file.

[0080] In this embodiment, the configuration data file includes the APK package project code, the project's unique identifier, and the configuration server information referenced by the project; the manifest text file is included within the APK package project code. It should be noted that the manifest file for data updates is in JSON format, making it easy for programmers to edit and modify it.

[0081] A2. Obtain a file of data to be updated according to the directory of the manifest text file, and parse the file of data to be updated to obtain information of the data to be updated.

[0082] It should be noted that the directory of the manifest text file in the project information is parsed using the getmap method to parse the build.json file to obtain the build.json file data. The information of the data to be updated is set according to the actual needs of the application scenario. The frequency of obtaining the data to be updated can also be set according to actual needs. In the computer's memory, a cache database is established, and the frequency of obtaining the data to be updated is set as the matching threshold of the database. Based on the matching threshold, the data files to be updated are captured at the set frequency.

[0083] A3. The acquired information of the data to be updated is stored in the memory of the computer.

[0084] A4. Using the interface through the http protocol, the stored data to be updated is obtained and stored in a designated location of the application file, wherein the interface is a real interface within the Android application.

[0085] In this example, the latest data is retrieved from the server via HTTP based on the information and saved to a specified location. This part of the process is also automated by the script. The interface for retrieving data from the server is the actual interface for reading data in the Android application, but it is written in the script, while the interface in the application is written in the project module. After execution, the configuration data in the project is now up to date, and the original packaging process begins. The default data built into the generated Android application is now up to date.

[0086] The search module 120 is used to obtain the corresponding class file based on the search path of the Java file in a preset directory.

[0087] In this embodiment, open cmd in the bin directory under the JDK directory and find the search path of the java file to be compiled. For example, the java file to be compiled is in:

[0088] E:\IntelliJ IDEA\Workplace\SpringJdbcTest\src\BookShop\Main.java

[0089] Use the command javac E:\IntelliJ IDEA\Workplace\SpringJdbcTest\src\BookShop\Main.java to find the corresponding class file.

[0090] The first packaging module 130 is used to generate a dex file from the class file, and package the dex file to obtain an APK file, wherein the APK file includes: a variable APK file package and a fixed APK file package, and the variable APK file includes: an original variable APK file package and a new variable APK file package.

[0091] In this embodiment, the class file is generated into a dex file, and a dx.bat is required to generate dex. The specific directory is configured in Android\sdk\build-tools\21.0.1, where each tools has 21.0.1. Environment variable: The path is the directory under dx.bat. Open the command cmd. C:\Users\lenovo\Desktop\anfix\output.dex means that the package output is sent to the file C:\Users\lenovo\Desktop\anfix, named output.dex; C:\Users\lenovo\Desktop\anfix represents the path of the original file, and then the dex file is generated.

[0092] In a specific embodiment, modifying the original variable APK file package includes:

[0093] B1. Copy the original variable APK file package;

[0094] B2. Modify the file content after decompression of the original variable APK file package;

[0095] B3. Compress and package the modified file content into a new variable APK file package.

[0096] In this embodiment, the dex file is packaged to obtain an APK file, and the variable files in the APK file need to be modified accordingly. An Android application's APK file is split into a fixed APK file package consisting of unmodifiable content and a variable APK file package consisting of content that can be modified as needed. The fixed APK file package and the variable APK file package are each signed, and the signed fixed APK file package and the signed variable APK file package are each stored on a server. When the original Android application's APK file needs to be modified to generate a packaging tool that can automatically update default data, the content of the original Android application's variable APK file package is modified, the newly generated variable APK file package is signed, and the signed new variable APK file package is stored on the server, while the original variable APK file package is retained on the server. The server monitors user request information. Upon receiving a request, the server combines the fixed APK file package and the new variable APK file package corresponding to the request information into a single APK file in the APK file format and outputs it to the user terminal.

[0097] The second packaging module 140 is used to sign the APK file, package the signed APK file, and store it in a designated file directory.

[0098] As an improvement to this embodiment, before storing the acquired information of the data to be updated in the memory of the computer, the following steps are included:

[0099] Determine whether the information of the data to be updated is abnormal according to the operation log;

[0100] If there is an exception, obtain the exception information and modify the exception file.

[0101] It's important to note that Gradle-based tasks allow you to customize any variable in your project and modify any file in the project source code, enabling different installation packages to have different functionality. Gradle-based tasks are highly scalable and can determine whether the updated data contains an anomaly based on the run log. If so, the anomaly information can be replaced with the non-anomaly information.

[0102] This application can significantly save developers time in data processing. During the packaging process, since data processing is automatically completed by the program, data errors caused by developer errors or omissions are avoided, greatly reducing the developer's data processing error rate. With this reduced data error rate, when the packaged Android application is first installed, even if there is no network or the network is weak, it will see the latest data in a timely manner, eliminating user misunderstandings caused by untimely data updates, achieving the technical effect of greatly improving the user experience.

[0103] In addition, the present invention also provides a method for packaging updated data. Figure 3 FIG2 is a flow chart of an embodiment of a method for packaging update data according to the present invention. When the processor 12 of the electronic device 1 executes the update data packaging program 10 stored in the memory 11, the update data packaging method is implemented, including steps S101-S103. Each step is described in detail below.

[0104] S101. Pack resource files and generate Java files. The resource files include data to be updated stored in the application file.

[0105] The method for obtaining the data to be updated includes:

[0106] The script file obtains the APK packaging project code through the configuration data file, and obtains the directory of the manifest text file through the APK packaging project code;

[0107] The file of the data to be updated is obtained according to the directory of the list text file, and the file of the data to be updated is parsed to obtain the information of the data to be updated.

[0108] Furthermore, the resource files include: a data build.json file, a packaging script config.gradle file, and an Android signature file.

[0109] It should be noted that the resource file is the configuration configFile file, which includes the data build.json file, the packaging script config.gradle file and the Android signature file.

[0110] In this embodiment, the built-in data used during app packaging is not fixed; it changes based on the specific data in the backend production environment. Therefore, the data to be updated can be manually modified before app packaging, rather than being fixed. The built-in data for app packaging can be manually added based on specific business needs by adding the corresponding data to the configuration manifest file.

[0111] Furthermore, the method for obtaining the resource file includes:

[0112] Configuration data build.json file, wherein the configuration data build.json file includes the data file to be updated;

[0113] Configure the packaging script config.gradle file, where the config.gradle file includes: signingConfigs, sourceSets, and productFlavors.

[0114] In this embodiment, the data file to be updated is typically a string ID and file location, which are entered into a manifest text file. Before the Android code is compiled, the information required for the update is read from the manifest text file. This is done by a Gradle script written in Groovy. The read information is temporarily stored in the computer's memory for use by the script.

[0115] Specifically, the data to be updated stored in the application file includes:

[0116] A1. The script file obtains the directory of the manifest text file.

[0117] In this embodiment, the configuration data file includes the APK package project code, the project's unique identifier, and the configuration server information referenced by the project; the manifest text file is included within the APK package project code. It should be noted that the manifest file for data updates is in JSON format, making it easy for programmers to edit and modify it.

[0118] A2. Obtain a file of data to be updated according to the directory of the manifest text file, and parse the file of data to be updated to obtain information of the data to be updated.

[0119] It should be noted that the directory of the manifest text file in the project information is parsed using the getmap method to parse the build.json file to obtain the build.json file data. The information of the data to be updated is set according to the actual needs of the application scenario. The frequency of obtaining the data to be updated can also be set according to actual needs. In the computer's memory, a cache database is established, and the frequency of obtaining the data to be updated is set as the matching threshold of the database. Based on the matching threshold, the data files to be updated are captured at the set frequency.

[0120] A3. The acquired information of the data to be updated is stored in the memory of the computer.

[0121] A4. Using the interface through the http protocol, the stored data to be updated is obtained and stored in a designated location of the application file, wherein the interface is a real interface within the Android application.

[0122] In this example, the latest data is retrieved from the server via HTTP based on the information and saved to a specified location. This part of the process is also automated by the script. The interface for retrieving data from the server is the actual interface for reading data in the Android application, but it is written in the script, while the interface in the application is written in the project module. After execution, the configuration data in the project is now up to date, and the original packaging process begins. The default data built into the generated Android application is now up to date.

[0123] S102: Obtain the corresponding class file based on the search path of the Java file in the preset directory.

[0124] In this embodiment, open cmd in the bin directory under the JDK directory and find the search path of the java file to be compiled. For example, the java file to be compiled is in:

[0125] E:\IntelliJ IDEA\Workplace\SpringJdbcTest\src\BookShop\Main.java

[0126] Use the command javac E:\IntelliJ IDEA\Workplace\SpringJdbcTest\src\BookShop\Main.java to find the corresponding class file.

[0127] S103. Generate a dex file from the class file, and package the dex file to obtain an APK file, wherein the APK file includes: a variable APK file package and a fixed APK file package, and the variable APK file includes: an original variable APK file package and a new variable APK file package.

[0128] In this embodiment, the class file is generated into a dex file, and a dx.bat is required to generate dex. The specific directory is configured in Android\sdk\build-tools\21.0.1, where each tools has 21.0.1. Environment variable: The path is the directory under dx.bat. Open the command cmd. C:\Users\lenovo\Desktop\anfix\output.dex means that the package output is sent to the file C:\Users\lenovo\Desktop\anfix, named output.dex; C:\Users\lenovo\Desktop\anfix represents the path of the original file, and then the dex file is generated.

[0129] In a specific embodiment, modifying the original variable APK file package includes:

[0130] B1. Copy the original variable APK file package;

[0131] B2. Modify the file content after decompression of the original variable APK file package;

[0132] B3. Compress and package the modified file content into a new variable APK file package.

[0133] In this embodiment, the dex file is packaged to obtain an APK file, and the variable files in the APK file need to be modified accordingly. An Android application's APK file is split into a fixed APK file package consisting of unmodifiable content and a variable APK file package consisting of content that can be modified as needed. The fixed APK file package and the variable APK file package are each signed, and the signed fixed APK file package and the signed variable APK file package are each stored on a server. When the original Android application's APK file needs to be modified to generate a packaging tool that can automatically update default data, the content of the original Android application's variable APK file package is modified, the newly generated variable APK file package is signed, and the signed new variable APK file package is stored on the server, while the original variable APK file package is retained on the server. The server monitors user request information. Upon receiving a request, the server combines the fixed APK file package and the new variable APK file package corresponding to the request information into a single APK file in the APK file format and outputs it to the user terminal.

[0134] S4. Sign the APK file, package the signed APK file, and store it in a specified file directory.

[0135] As an improvement to this embodiment, before storing the acquired information of the data to be updated in the memory of the computer, the following steps are included:

[0136] Determine whether the information of the data to be updated is abnormal according to the operation log;

[0137] If there is an exception, obtain the exception information and modify the exception file.

[0138] It's important to note that Gradle-based tasks allow you to customize any variable in your project and modify any file in the project source code, enabling different installation packages to have different functionality. Gradle-based tasks are highly scalable and can determine whether the updated data contains an anomaly based on the run log. If so, the anomaly information can be replaced with the non-anomaly information.

[0139] This application can significantly save developers time in data processing. During the packaging process, since data processing is automatically completed by the program, data errors caused by developer errors or omissions are avoided, greatly reducing the developer's data processing error rate. With this reduced data error rate, when the packaged Android application is first installed, even if there is no network or the network is weak, it will see the latest data in a timely manner, eliminating user misunderstandings caused by untimely data updates, achieving the technical effect of greatly improving the user experience.

[0140] In addition, an embodiment of the present invention further provides a computer-readable storage medium, which can be any one or any combination of a hard disk, a multimedia card, an SD card, a flash memory card, an SMC, a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a portable compact disk read-only memory (CD-ROM), a USB memory, etc. The computer-readable storage medium includes a data storage area and a program storage area. The data storage area stores data created according to the use of the blockchain node, and the program storage area stores a packaging program 10 for updating data. When the packaging program 10 for updating data is executed by the processor, the operation of the packaging method for updating data is implemented.

[0141] In another embodiment, the update data packaging method provided by the present invention can further ensure the privacy and security of all the above-mentioned data, and all the above-mentioned data can also be stored in a node of a blockchain.

[0142] It should be noted that the blockchain referred to in this article refers to a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Blockchain is essentially a decentralized database, a series of data blocks generated using cryptographic methods. Each data block contains information about a batch of online transactions, which is used to verify the validity of this information (to prevent counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, the platform product service layer, and the application service layer.

[0143] The specific implementation of the computer-readable storage medium of the present invention is substantially the same as the specific implementation of the above-mentioned update data packaging method, and will not be described in detail here.

[0144] It should be noted that the serial numbers of the above-mentioned embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments. Furthermore, the terms "comprise," "include," or any other variations thereof herein are intended to encompass non-exclusive inclusion, such that a process, device, article, or method comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, device, article, or method. In the absence of further limitations, an element defined by the phrase "comprising a..." does not preclude the presence of other identical elements in the process, device, article, or method comprising that element.

[0145] It should be noted that the above-mentioned embodiments of the present invention can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results.

[0146] Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.

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

[0148] The above are only preferred embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for packaging updated data, characterized in that: The method comprises: Packing resource files and generating Java files, wherein the resource files include data to be updated stored in the application files; Get the corresponding class file based on the search path of the java file in the preset directory; Generate a dex file from the class file, and package the dex file to obtain an APK file, wherein the APK file includes: a variable APK file package and a fixed APK file package, and the variable APK file includes: an original variable APK file package and a new variable APK file package; Sign the APK file, package the signed APK file, and store it in a specified file directory; The data to be updated stored in the application file includes: The script file obtains the directory of the manifest text file; Acquire a file of data to be updated according to the directory of the list text file, and parse the file of data to be updated to obtain information of data to be updated; storing the acquired information of the data to be updated in the memory of the computer; The script automatically completes the acquisition of the data to be updated stored on the server and stores it in the specified location of the application file using the interface through the http protocol, wherein the interface is a real interface for reading data in the Android application.

2. The update data packaging method according to claim 1, wherein: The data to be updated includes: The script file obtains the APK packaging project code through the configuration data file, and obtains the directory of the manifest text file through the APK packaging project code; The file of the data to be updated is obtained according to the directory of the list text file, and the file of the data to be updated is parsed to obtain the information of the data to be updated.

3. The update data packaging method according to claim 1, wherein: The resource files include: data build.json file, packaging script config.gradle file and Android signature file.

4. The update data packaging method according to claim 1, wherein: The resource file includes: Configuration data build.json file, wherein the configuration data build.json file includes the data file to be updated; Configure the packaging script config.gradle file to obtain the resource file, wherein the config.gradle file includes: signingConfigs, sourceSets and productFlavors.

5. The update data packaging method according to claim 1, wherein: The original variable APK file package includes: Copy the original variable APK file package; Modify the file content after decompression of the original variable APK file package; The modified file content is compressed and packaged into a new variable APK file package.

6. The update data packaging method according to claim 4, characterized in that: Before storing the acquired information of the data to be updated in the memory of the computer, the method includes: Determine whether the information of the data to be updated is abnormal according to the operation log; If there is an exception, obtain the exception information and modify the exception file.

7. A packaging device for updating data, characterized in that: The device comprises: A generation module, used to package resource files and generate Java files, wherein the resource files include data to be updated stored in the application file; A search module is used to obtain the corresponding class file based on the search path of the Java file in a preset directory; A first packaging module is configured to generate a dex file from the class file and package the dex file to obtain an APK file, wherein the APK file includes a variable APK file package and a fixed APK file package, and the variable APK file includes an original variable APK file package and a new variable APK file package; A second packaging module is used to sign the APK file, package the signed APK file, and store it in a specified file directory; The data to be updated stored in the application file includes: The script file obtains the directory of the manifest text file; Acquire a file of data to be updated according to the directory of the list text file, and parse the file of data to be updated to obtain information of data to be updated; storing the acquired information of the data to be updated in the memory of the computer; The script automatically completes the acquisition of the data to be updated stored on the server and stores it in the specified location of the application file using the interface through the http protocol, wherein the interface is a real interface for reading data in the Android application.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a program executable by the at least one processor, and the program is executed by the at least one processor to enable the at least one processor to perform the update data packaging method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a packaging program for update data, and when the packaging program for update data is executed by a processor, the steps of the method for packaging update data according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • APK file storing and outputting method

    CN103177077A

  • An Android mobile terminal cloud configuration packaging method and device

    CN109828778A

  • Automatic batch packaging method for Android APP application packages with security signatures

    CN109857447A