CN112783512B - Application package processing method, device, equipment and storage medium - Google Patents

Application package processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN112783512B
CN112783512B CN202110277904.9A CN202110277904A CN112783512B CN 112783512 B CN112783512 B CN 112783512B CN 202110277904 A CN202110277904 A CN 202110277904A CN 112783512 B CN112783512 B CN 112783512B
Authority
CN
China
Prior art keywords
resource
package
application
file
resource files
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110277904.9A
Other languages
Chinese (zh)
Other versions
CN112783512A (en
Inventor
陈瑞坤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202110277904.9A priority Critical patent/CN112783512B/en
Publication of CN112783512A publication Critical patent/CN112783512A/en
Application granted granted Critical
Publication of CN112783512B publication Critical patent/CN112783512B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3604Software analysis for verifying properties of programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Stored Programmes (AREA)

Abstract

The application discloses an application package processing method, device, equipment and storage medium, and belongs to the technical field of artificial intelligence. The embodiment of the application provides a method for automatically processing an application program package, which is realized on the basis of an automatic script in the whole flow of application program package processing, and completely avoids manual participation, thereby greatly reducing labor cost, improving processing efficiency and improving accuracy of processing results. On the other hand, after the application package is decompressed, the resource files can be automatically analyzed in batches, the whole quantity of the resource files are analyzed instead of manually analyzing the whole application package one by means of an analysis tool, the processing efficiency is greatly improved, the analysis result can reflect the condition of the whole application package and the condition of a single resource file, the user requirement is met, the user does not need to analyze the resource files one by one, and the manual analysis time is saved.

Description

Application package processing method, device, equipment and storage medium
Technical Field
The present application relates to the field of artificial intelligence technologies, and in particular, to a method, an apparatus, a device, and a storage medium for processing an application package.
Background
Code of an application program is intended to run on a device, typically requiring compilation and then packaging into a file that can be recognized and run by the operating system of the device, i.e., an application package. A developer typically builds a code file or resource file of an application into an application package that is distributed to other devices to enable the other devices to install the application or load resource files in the application.
Currently, in the application package processing method, a related technician operates and downloads an application package on a device to decompress the application package, and then the related technician uses AssetStudio tools to load a single resource file in the application package, selects a parsing control, parses the single resource file, and displays a parsing result in an interface. The relevant technician can manually analyze based on the displayed analysis results to understand some of the conditions of the resources in the resource file. If the analysis result of the resource file is required to be recorded, manual recording is needed, or export operation is manually carried out, and the analysis result of the resource file is exported as an analysis document.
In the method, assetStudio tools are used for loading and analyzing a single resource file, if the comprehensive condition of a plurality of resource files in an application program package is needed to be known, relevant technicians are needed to load and analyze each resource file sequentially through AssetStudio tools, then record and analyze each resource file manually, and then carry out manual statistical analysis according to the records or the analysis of the plurality of resource files, so that the condition of the resource files in the application program package cannot be known quickly.
Disclosure of Invention
The embodiment of the application provides an application program package processing method, device, equipment and storage medium, which can improve the processing efficiency and the accuracy of a processing result. The technical scheme is as follows:
in one aspect, an application package processing method is provided, and the method includes:
acquiring an application program package based on an automation script, wherein the application program package comprises at least two resource files;
Decompressing the application program package based on the automation script to obtain the at least two resource files in the application program package;
Analyzing the header information of the at least two resource files obtained by decompression based on the automation script, extracting file information of the at least two resource files from the header information, wherein the file information of one resource file is used for indicating the attribute of the resource included in the resource file;
And generating an analysis result of the application program package based on the file information of the at least two resource files based on the automation script.
In some embodiments, the decompressing the application package to obtain the at least two resource files in the application package includes:
Decompressing the application program package to obtain at least two encrypted resource files in the application program package;
decrypting the at least two encrypted resource files to obtain the at least two resource files.
In one aspect, an application package processing apparatus is provided, the apparatus comprising:
the acquisition module is used for acquiring an application program package based on the automation script, wherein the application program package comprises at least two resource files;
The decompression module is used for decompressing the application program package based on the automation script to obtain the at least two resource files in the application program package;
The analysis module is used for analyzing the header information of the at least two resource files obtained by decompression based on the automation script, extracting the file information of the at least two resource files from the header information, wherein the file information of one resource file is used for indicating the attribute of the resource included in the resource file;
And the generation module is used for generating an analysis result of the application program package based on the automation script and file information of the at least two resource files.
In some embodiments, the decompression module is to:
Decompressing the application program package to obtain at least two encrypted resource files in the application program package;
decrypting the at least two encrypted resource files to obtain the at least two resource files.
In some embodiments, the file information of one resource file includes at least one of a resource name of a resource in the resource file, a type of the resource, a size of the resource, and a dependency relationship between any resource and other resources.
In some embodiments, the apparatus further comprises:
A determining module, configured to determine, based on the automation script, a type of the at least two resource files according to file names or paths of the at least two resource files;
The acquisition module is further used for acquiring resource file information of the application program package based on the automatic script and the types of the at least two resource files, wherein the resource file information comprises at least one of proportion, quantity or size of different types of resource files in the application program package;
the generating module is used for generating an analysis result of the application program package based on the file information of the at least two resource files and the resource file information.
In some embodiments, the acquisition module is configured to perform any one of:
responding to an application package processing instruction triggered by the completion of the construction of any application package, and acquiring the application package with the completed construction based on an automatic script;
Responding to an application package processing instruction triggered by processing operation on any application package, and acquiring the application package on which the processing operation is executed based on an automation script;
and responding to the application package processing instruction triggered at fixed time, and acquiring the application package constructed in the current period based on the automation script.
In some embodiments, the version of the application package is a first version; the analysis result of the application program package of the first version is a first analysis result;
The acquisition module is also used for acquiring a second analysis result of the application program package of the second version;
The apparatus further comprises:
The comparison module is used for comparing the first analysis result and the second analysis result to obtain difference information between the application program package of the first version and the application program package of the second version, wherein the difference information comprises at least one of differences among resource files, differences among resources or a range influenced by the differences of the resources.
In some embodiments, the apparatus further comprises:
And the sending module is used for responding to the analysis result to indicate that the size of the application program package exceeds a first threshold value and sending early warning information.
In some embodiments, the apparatus further comprises:
And the first setting module is used for setting a downloading mode of the resource files of the first target type as a dynamic downloading mode according to the proportion of the resource files of different types in the application program package indicated by the analysis result, wherein the proportion of the resource files of the first target type is the largest in the proportion of the resource files of different types.
In some embodiments, the apparatus further comprises:
And the second setting module is used for setting the downloading mode of the resource file of the second target type as a dynamic downloading mode in response to the size of the resource file of the second target type indicated by the analysis result being larger than a second threshold value.
In one aspect, an electronic device is provided that includes one or more processors and one or more memories having at least one computer program stored therein, the at least one computer program loaded and executed by the one or more processors to implement various alternative implementations of the above described application package processing methods.
In one aspect, a computer readable storage medium having at least one computer program stored therein is provided, the at least one computer program being loaded and executed by a processor to implement various alternative implementations of the above described application package processing method.
In one aspect, a computer program product or computer program is provided, the computer program product or computer program comprising one or more program codes, the one or more program codes being stored in a computer readable storage medium. One or more processors of the electronic device are capable of reading the one or more program codes from the computer readable storage medium, the one or more processors executing the one or more program codes so that the electronic device can execute the application package processing method of any one of the possible embodiments described above.
The embodiment of the application provides a method for automatically processing an application program package, which is characterized in that on one hand, when the application program package is processed, the processes of acquiring, decompressing, analyzing a resource file and generating an analysis result of the application program package are realized based on an automatic script, the whole process is automated, manual participation is not needed, the labor cost is greatly reduced, the processing efficiency is improved, and the accuracy of the processing result is improved. On the other hand, after the application package is decompressed, the resource files can be automatically analyzed in batches, the whole quantity of the resource files are analyzed instead of manually analyzing the resource files one by means of AssetStudio tools, the processing efficiency is greatly improved, and after analysis, an analysis result can be generated based on analysis results of a plurality of resource files, the analysis result can reflect the situation of the whole application package and is not a single resource file, the analysis result also accords with the user requirement, the user does not need to analyze the resource files one by one, and the manual analysis time is saved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of an implementation environment of an application package processing method according to an embodiment of the present application;
FIG. 2 is a flowchart of an application package processing method according to an embodiment of the present application;
FIG. 3 is a flowchart of an application package processing method according to an embodiment of the present application;
FIG. 4 is a terminal interface provided by an embodiment of the present application;
FIG. 5 is a terminal interface provided by an embodiment of the present application;
FIG. 6 is a terminal interface provided by an embodiment of the present application;
FIG. 7 is a terminal interface provided by an embodiment of the present application;
FIG. 8 is a schematic diagram of an application package processing device according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 10 is a block diagram of a terminal according to an embodiment of the present application;
Fig. 11 is a schematic structural diagram of a server according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail with reference to the accompanying drawings.
It should be noted that, the information (including but not limited to user equipment information, user personal information, etc.), data (including but not limited to data for analysis, stored data, presented data, etc.), and signals (including but not limited to signals transmitted between the user terminal and other devices, etc.) related to the present application are fully authorized by the user or related aspects, and the collection, use, and processing of the related data is required to comply with the relevant laws and regulations and standards of the relevant country and region.
The terms "first," "second," and the like in this disclosure are used for distinguishing between similar elements or items having substantially the same function and function, and it should be understood that there is no logical or chronological dependency between the terms "first," "second," and "n," and that there is no limitation on the amount and order of execution. It will be further understood that, although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another element. For example, a first image can be referred to as a second image, and similarly, a second image can be referred to as a first image, without departing from the scope of the various described examples. The first image and the second image can both be images, and in some cases, can be separate and distinct images.
The term "at least one" in the present application means one or more, and the term "plurality" in the present application means two or more, for example, a plurality of data packets means two or more data packets.
It is to be understood that the terminology used in the description of the various examples described herein is for the purpose of describing particular examples only and is not intended to be limiting. As used in the description of the various described examples and in the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It will also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. The term "and/or" is an association relationship describing an associated object, meaning that three relationships can exist, e.g., a and/or B, can be represented: a exists alone, A and B exist together, and B exists alone. In the present application, the character "/" generally indicates that the front and rear related objects are an or relationship.
It should also be understood that, in the embodiments of the present application, the sequence number of each process does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiments of the present application.
It should also be understood that determining B from a does not mean determining B from a alone, but can also determine B from a and/or other information.
It will be further understood that the terms "comprises" and/or "comprising" (also referred to as "inCludes", "inCluding", "Comprises", and/or "Comprising") when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "if" may be interpreted to mean "when" ("white" or "upon") or "in response to a determination" or "in response to detection". Similarly, the phrase "if a [ stated condition or event ] is detected" may be interpreted to mean "upon a determination" or "in response to a determination" or "upon a detection of a [ stated condition or event ] or" in response to a detection of a [ stated condition or event ], depending on the context.
The following description of the terms involved in the present application.
Unity3D: a cross-platform game engine for mobile game is used for developing mobile game.
AssetsBundle: the units run in a resource package file format of the android platform, and specific resource types such as a map, a grid model, special effect resources and the like are contained in the file package.
Android (Android) system: a smart phone system in which applications can be installed.
APK (Android application package ): an application compression file that can be installed in an Android system. For example, an APK of an electronic game application contains files such as game resources and application code.
In some embodiments, the present application may employ artificial intelligence techniques to process application packages through device automation. The artificial intelligence technique is briefly described below.
Artificial intelligence (ARTIFICIAL INTELLIGENCE, AI) is the theory, method, technique, and application system that simulates, extends, and extends human intelligence using a digital computer or a machine controlled by a digital computer, perceives the environment, obtains knowledge, and uses the knowledge to obtain optimal results. In other words, artificial intelligence is an integrated technology of computer science that attempts to understand the essence of intelligence and to produce a new intelligent machine that can react in a similar way to human intelligence. Artificial intelligence, i.e. research on design principles and implementation methods of various intelligent machines, enables the machines to have functions of sensing, reasoning and decision.
The artificial intelligence technology is a comprehensive subject, and relates to the technology with wide fields, namely the technology with a hardware level and the technology with a software level. Artificial intelligence infrastructure technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and other directions.
With research and advancement of artificial intelligence technology, research and application of artificial intelligence technology is being developed in various fields, such as common smart home, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned, automatic driving, unmanned aerial vehicles, robots, smart medical treatment, smart customer service, etc., and it is believed that with the development of technology, artificial intelligence technology will be applied in more fields and with increasing importance value.
The scheme provided by the embodiment of the application relates to the technologies of cloud computing, automation and the like of artificial intelligence, and is specifically described through the following embodiments.
The environment in which the present application is implemented is described below.
Fig. 1 is a schematic diagram of an implementation environment of an application package processing method according to an embodiment of the present application. The implementation environment includes a terminal 101 or the implementation environment includes a terminal 101 and an application package processing platform 102. The terminal 101 is connected to the application package processing platform 102 via a wireless network or a wired network.
The terminal 101 can be at least one of a smart phone, a game console, a desktop computer, a tablet computer, an electronic book reader, an MP3 (MovingPicture Experts Group Audio Layer III, dynamic video expert compression standard audio plane 3) player, or an MP4 (Moving Picture Experts Group Audio Layer IV, dynamic video expert compression standard audio plane 4) player, a laptop portable computer. The terminal 101 installs and runs an application program supporting application package processing, which can be, for example, a system application, an instant messaging application, a news push application, a shopping application, an online video application, a social application, an electronic game application, or the like.
The terminal 101 is illustratively capable of doing this independently and is also capable of providing data services to it through the application package processing platform 102. The embodiment of the present application is not limited thereto. The application package processing platform 102 is illustratively configured to process an application package, and when the terminal 101 requests the application package from the application package processing platform 102, the application package processing platform 102 is capable of distributing the processed application package to the terminal 101.
The application package processing platform 102 includes at least one of a server, a plurality of servers, a cloud computing platform, and a virtualization center. The application package processing platform 102 is configured to provide background services for applications that support application package processing. Optionally, the application package processing platform 102 takes over primary processing work and the terminal 101 takes over secondary processing work; or the application package processing platform 102 takes on secondary processing work and the terminal 101 takes on primary processing work; or the application package processing platform 102 or the terminal 101, respectively, can solely undertake processing work. Or the application package processing platform 102 and the terminal 101 adopt a distributed computing architecture to perform cooperative computing.
Optionally, the application package processing platform 102 includes at least one server 1021 and a database 1022, where the database 1022 is configured to store data, and in an embodiment of the present application, the database 1022 can store an application package or an analysis result of the application package (e.g., analysis results of multiple versions of the application package) to provide a data service for the at least one server 1021.
The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, basic cloud computing services such as big data and artificial intelligence platforms. The terminal can be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, etc.
Those skilled in the art will appreciate that the number of terminals 101 and servers 1021 can be greater or fewer. For example, the number of the terminals 101 and the servers 1021 can be only one, or the number of the terminals 101 and the servers 1021 can be tens or hundreds, or more, and the number and the device type of the terminals or the servers are not limited in the embodiment of the present application.
Fig. 2 is a flowchart of an application package processing method provided in an embodiment of the present application, where the method is performed by an electronic device, and the electronic device is a terminal or a server, and referring to fig. 2, the method includes the following steps.
201. The electronic device responds to the automatic script, and obtains an application program package, wherein the application program package comprises at least two resource files.
When a related technician needs to issue the resource of the application program to the client, the resource is packaged into a plurality of resource files, and the plurality of resource files and the application program codes are compressed together to obtain the application program package. Of course, when the application package includes only the resource files, the application package may be obtained by compressing a plurality of resource files. After the application package is generated, the application package can be obtained, the resource files in the application package can be analyzed, the inclusion of the application package can be optimized according to the analysis result, or different loading modes can be adopted for different types of resources according to the analysis result, so that the income and the like are improved.
In an embodiment of the present application, an automation Script is provided, where the Script (Script) is an executable file written according to a certain format using a specific descriptive language. The automatic script is a script which can be automatically executed without manual participation, and can be automatically executed when the execution conditions are met. The automation script includes a script required for the entire process flow of application package processing.
In some embodiments, the application package may be a Unity3D based application package for a cell phone game.
202. And the electronic equipment decompresses the application program package based on the automation script to obtain the at least two resource files in the application program package.
The application package is obtained through compression, when the electronic equipment wants to analyze the resource files in the application package, the electronic equipment can decompress the application package to restore the resource files, and after the resource files are obtained, the application package can be analyzed to determine the attributes of the resources in the resource files.
203. The electronic equipment analyzes the head information of the at least two resource files obtained by decompression based on the automation script, extracts the file information of the at least two resource files from the head information, and the file information of one resource file is used for indicating the attribute of the resource included in the resource file.
The resource file includes the resources contained in the resource file and various attributes of the resources in the resource file. The electronic device may parse the resource file to obtain attributes of the resource therein.
When the resource file is analyzed, based on the automatic script, the electronic device can automatically analyze the resource file obtained by decompression, namely, after the resource file is obtained by decompression, the analysis flow in the automatic script can be triggered to analyze the resource file obtained by decompression. The analysis process is automatically carried out, is a batch analysis process, can check the whole resource files in batches, does not need to analyze manually one by one, and further can greatly improve the analysis efficiency and the processing efficiency of application program packages.
In some embodiments, multiple stages may be included in the overall process flow, and each stage execution end may continue to execute the next flow. For example, after the end of the flow of the decompression phase, the flow of the analysis phase can be continued.
204. And the electronic equipment generates an analysis result of the application program package based on the automation script and file information of the at least two resource files.
After the electronic device analyzes the file information of each resource file, the automatic script can trigger the execution of the next process, and the analysis result of the whole resource of the application program package is obtained based on the file information of each resource file obtained by analysis, wherein the resource analysis result is a result obtained by full-scale analysis. For example, the application package includes which resources, the number, proportion or size of the different types of resources, and the like, and may also include the dependency relationship between the different resources in the application package.
In some embodiments, the overall resource distribution of the application package can be known through the analysis result, and the resource details of the application package can also be known, so that the analysis result may require a very large amount of work through manual analysis, is time-consuming, and may not be known through manual analysis.
The steps 201 to 204 can be implemented through an automation process, an automation script can be stored in the electronic device, the electronic device can obtain an application package based on the automation script, then decompress the application package based on the automation script to obtain the at least two resource files in the application package, then analyze the at least two resource files obtained by the decompression in batch based on the automation script to obtain file information of the at least two resource files, and finally generate an analysis result of the application package based on the file information of the at least two resource files based on the automation script.
The embodiment of the application provides a method for automatically processing an application program package, which is characterized in that on one hand, when the application program package is processed, the processes of acquiring, decompressing, analyzing a resource file and generating an analysis result of the application program package are realized based on an automatic script, the whole process is automated, manual participation is not needed, the labor cost is greatly reduced, the processing efficiency is improved, and the accuracy of the processing result is improved. On the other hand, after the application package is decompressed, the resource files can be automatically analyzed in batches, the whole quantity of the resource files are analyzed instead of manually analyzing the resource files one by means of AssetStudio tools, the processing efficiency is greatly improved, and after analysis, an analysis result can be generated based on analysis results of a plurality of resource files, the analysis result can reflect the situation of the whole application package and is not a single resource file, the analysis result also accords with the user requirement, the user does not need to analyze the resource files one by one, and the manual analysis time is saved.
Fig. 3 is a flowchart of an application package processing method according to an embodiment of the present application, and referring to fig. 3, the method includes the following steps.
301. The electronic device obtains an application program package based on the automation script, wherein the application program package comprises at least two resource files.
In the embodiment of the application, the electronic equipment can process the constructed application program package through an automatic flow so as to monitor the condition of the resource file or the resource in the application program package.
The automatic process is realized through an automatic script, the automatic script can be stored in the electronic equipment, and can be automatically executed without manual participation, and when the trigger condition is detected to be met, the automatic process can be executed to process the application program package.
In some embodiments, the application package process may include multiple trigger modes, i.e., a trigger mode may be set for the application package process flow, and the trigger condition may be understood as a trigger condition of the automation script. The triggering modes can include various triggering modes, and a related person can select any triggering mode according to requirements, so that the embodiment of the application is not limited.
Three triggering modes of the application package processing procedure are provided below.
Triggering mode one: and constructing a trigger.
In trigger mode one, the step 301 may be: and the electronic equipment responds to the application package processing instruction triggered by the completion of the construction of any application package, and acquires the application package with the completed construction based on the automation script. The construction triggering means that when the construction of the application program package is completed, the electronic device can be triggered to acquire the application program package after the construction is completed, and the subsequent processing process is performed.
Triggering mode II: and (5) manually triggering.
In trigger mode two, the step 301 may be: the electronic equipment responds to an application package processing instruction triggered by a processing operation of any application package, and obtains the application package which is executed with the processing operation based on an automatic script. The manual triggering refers to that a user operates an application program package to trigger the acquisition of the application program package and the subsequent processing process. If the user wants to analyze a certain application package, the application package may be selected and determined to be analyzed, and the electronic device may perform the acquiring step and subsequent processing steps.
Triggering mode III: and triggering at fixed time.
In trigger mode three, this step 301 may be: and the electronic equipment responds to the application program package processing instruction triggered at fixed time, and acquires the application program package constructed in the current period based on the automatic script. The timing triggering means that a period is set, and the electronic device periodically acquires an application package once and processes the application package.
For the acquisition process of an application package, in some embodiments, the application package is typically built by a builder. By setting, the electronic equipment can interact with the construction machine to acquire the application program package of which construction is completed from the construction machine. In particular, the process of acquiring the application package from the builder may be understood as a downloading process, that is, the electronic device may download the built application package from the builder. In other embodiments, the application package may be stored in other electronic devices after construction or in a database, and accordingly, the electronic device may also obtain the application package from other electronic devices or databases.
In some embodiments, the application package may be for running in an android operating system, i.e., the application package may be an android application package, i.e., APK. Of course, the operating system to which the application package is applicable is not limited in the embodiment of the present application, and for example, the application package may also be used to run in the IOS operating system.
302. And the electronic equipment decompresses the application program package based on the automation script to obtain the at least two resource files in the application program package.
After the electronic equipment acquires the application program package, the automation script triggers the next flow, and can automatically carry out subsequent processing on the application program package. In processing, the application package is a compressed package, so that the electronic device cannot directly analyze the resource file therein, and therefore needs to decompress the application package.
In some embodiments, the resource file is generally encrypted and then compressed to obtain the application package, so when the electronic device decompresses, the electronic device may decompress to obtain the encrypted resource file, and then decrypt the encrypted resource file to restore to obtain the resource file. Specifically, this step 303 may be: the electronic device can decompress the application program package based on the automation script to obtain at least two encrypted resource files in the application program package. The encrypted resource file is a file obtained by encrypting the resource file. The electronic device may then decrypt the at least two encrypted resource files to obtain the at least two resource files. The resource file obtained after decryption is an unencrypted resource file.
In some embodiments, the decryption process may be implemented by a decryption tool, and embodiments of the present application are not limited to which decryption tool is specifically used.
In some embodiments, the resource file may be obtained by packaging the resource based on a target packaging format. For example, the target package format may be AssetsBundle, and the resource file may also be referred to as AssetsBundle file. Taking the application package as an APK as an example, step 302 is to decompress the APK to obtain an encrypted AssetsBundle file, and then decode the encrypted AssetsBundle file to obtain an unencrypted AssetsBundle file.
303. The electronic equipment determines the types of the at least two resource files according to the file names or paths of the at least two resource files based on the automation script.
After the electronic device decompresses to obtain at least two resource files, the at least two resource files may be initially processed to obtain a statistical result of the resource files, where the initial processing process may include the step 303 and a step 304 described below, and may be automatically triggered by an automation script after decompression. Specifically, the electronic device may determine the type of the resource file through the file name or path of the resource file, where the type may be set by related technicians according to requirements, for example, scene resources, scenes, roles, monster, and the like, and for example, audio, video, pictures, special effects, and a reader, which is not limited in the embodiment of the present application.
304. The electronic equipment acquires resource file information of the application program package based on the automatic script and the types of the at least two resource files, wherein the resource file information comprises at least one of proportion, quantity or size of different types of resource files in the application program package.
After determining the type of each resource file, the electronic device can count the resource files of different types based on the type to obtain the resource file information so as to analyze at least one of the proportion, the number or the size of the resource files of different types in the application program package.
For example, the proportion of the different types of resource files, the number of the different types of resource files, or the sizes of the different types of resource files can be analyzed. For another example, any two of the above three information may be analyzed, for example, the proportion and the number of different types of resource files in the application package. For another example, the three information may be analyzed: the proportion, quantity and size of the resource files of different types in the application package.
In the step 303 and the step 304, for classifying the at least two resources obtained by decompression, the process of obtaining the resource file information of the at least two resource files can determine the distribution of different types of resource files in the application package through classification, and the subsequent related technicians can optimize the package body of the application package according to the classification result, for example, the occupation ratio of scene resources is relatively large, and the subsequent needs to reduce the occupation ratio of scene resources in the application package.
For example, a specific example is provided, taking categorizing AssetsBundle files in an APK of a certain electronic game as an example, as shown in fig. 4, decompressing the APK, and categorizing AssetsBundle files obtained by decompressing, so as to obtain the size of a resource file of a type such as audio and video in the APK, specifically, as the content in a region 401 (overview) in fig. 4:
ApkSize-677.80M (mega), that is to say the Size of the APK, is 677.80M (mega).
ObbSize A0.0 kb, that is, obb (Opaque Binary Blob, android game general packet) is 0.0kb (Kilobyte kilobytes).
ScriptSize: the size of 0.0kb, that is, script (Script) is 0.0kb.
VideoSize:45.64M, that is, the size of a Video (Video) type resource file is 45.64M.
AudioSize:248.04M, that is, the Audio (Audio) type resource file has a size of 248.04M.
AllABSize:1.61G, i.e., all (All) AB (abbreviations for AssetsBundle) files have a size of 1.61G (abbreviated herein as GB, gigabyte, gigabytes).
The AssetsBundle files are classified, the types of the resource files are determined, the resource files of the same type are classified together, such as the content in a region 402 (AssetsBundle resource analysis) in fig. 4, the region 402 is only used as an example of scene resources, and the total number of the up-to-date Jing Zi source files is 6508, and the sizes of the scene resource files are 543.30M. The statistics is performed on various resource files in the scene resource to obtain the number and the size of the various scene resource files.
305. The electronic equipment analyzes the head information of the at least two resource files obtained by decompression based on the automation script, extracts the file information of the at least two resource files from the head information, and the file information of one resource file is used for indicating the attribute of the resource included in the resource file.
After the electronic equipment decompresses to obtain the resource file, the resource file can be analyzed, and the condition of the resources in the resource file can be further obtained. The analysis process can be automatically triggered after the decompression step, and the resource file can be analyzed to obtain the file information of the resource file in response to the completion of decompression of any resource file.
The attribute of the resource included in each resource file can be stored in the header information of the resource file, and the electronic equipment analyzes the header information to extract the attribute of the required resource. Specifically, the electronic device may analyze header information of the at least two resource files obtained by decompression in batch, and extract file information of the at least two resource files from the header information.
The process of parsing the header information may be understood as a process of reading the header information, that is, the electronic device may read the header information of the resource file to obtain metadata of the resource file, where the metadata includes the file information.
In some embodiments, the file information of one resource file may include at least one of a resource name of a resource in the resource file, a type of the resource, a size of the resource, and a dependency relationship between any resource and other resources. That is, the file information may include a resource name of a resource in the resource file, or may include a type of the resource in the resource file, or may include a size of the resource in the resource file, or may include a dependency relationship between any one resource and other resources in the resource file, or may include any two or any three of these several attributes, or may include all of these several attributes. The dependency refers to a relationship in which two resources may be referenced or referred to.
For example, resource A references resource B, which may be considered to have a dependency. In turn, resource B references resource A, which may also be considered to have a dependency. In a specific possible embodiment, the application package may be an application package of an electronic game, which may be a mobile game. For example, the application package is a Unity3D based mobile game application package. Taking a scenario resource in an electronic game as an example, a tree resource and a grass resource beside the tree may have a dependency relationship, and when the tree resource is displayed, the grass resource beside the tree is also displayed.
In other embodiments, the file information may further include other attributes of the resource in the resource file, for example, a location of the resource, or a priority of the resource, and the related technician may set the attribute to be parsed according to the requirement, which is not limited in the embodiments of the present application.
In some embodiments, in the above analysis process, since the analysis of the resource files is implemented based on the automation script, the analysis step is triggered without manually selecting the resource files, so that the resource files can be analyzed in batches after being decompressed, each resource file corresponds to file information, thus the batch analysis process can obtain the file information of a plurality of resource files, and the analysis result can also be subjected to statistical analysis to obtain some total information in the whole application package. Specifically, the electronic device may record the identification information of each resource file in correspondence with the corresponding file information, and then, when summarizing the file information of the plurality of resource files, may acquire the corresponding file information of the resource file according to the recorded identification information of the resource file, and summarize the file information. The electronic device may also first create a data structure for storing the analysis result, and then record the file information of any resource file in the corresponding field of the data structure when analyzing the resource file.
306. And the electronic equipment generates an analysis result of the application program package based on the file information of the at least two resource files and the resource file information based on the automation script.
After the electronic device analyzes the resource file information of the resource file and the file information of the resource in the resource file, the automation script can trigger the next flow, the file information of the analyzed resource file is summarized and analyzed, and the information is synthesized to generate an analysis result of the application program package.
In some embodiments, the analysis results may include a list of resource files in the application package, a list of resources in each resource file, dependencies between resources, and the like. In some embodiments, the analysis results may take the form of a data structure string, which may include the information described above. For example, the data structure string may be in a target format, such as json (JavaScript Object Notation, JS object numbered musical notation) format. Of course, other formats are possible, and embodiments of the present application are not limited in this regard.
The step 306 is a process of generating the analysis result of the application package based on the automation script and the file information of the at least two resource files, and the above-mentioned steps are described by taking the classification result and the analysis result as examples when the resource files are classified after the electronic device is decompressed to generate the analysis result. In other embodiments, the electronic device may directly analyze the resource file instead of classifying, and further generate an analysis result based on the analysis result, which is not limited in the embodiment of the present application.
In some embodiments, after the electronic device generates the analysis result, the analysis result may be further processed, or the analysis result may be sent to other devices for processing. For example, the application package may be a certain version of application package, and before or after the version of application package, there may be other versions of application package, and the electronic device may compare versions of the application package according to analysis results of the application packages of different versions, so as to analyze modification situations of resources, or change situations of different types of resource files in different versions.
In the mode of subsequent processing by the electronic device, the version of the application program package is a first version; the analysis result of the first version of application program package is a first analysis result. The electronic device may further obtain a second analysis result of the second version of application package, and then compare the first analysis result with the second analysis result to obtain difference information between the first version of application package and the second version of application package, where the difference information includes at least one of a difference between resource files, a difference between resources, or a range affected by a difference between resources.
For the range affected by the resource difference, the range affected by the resource difference can be analyzed by comparing the difference between the resources and then by the dependency relationship between the resources.
In the manner of performing the subsequent processing by the other device, the electronic device may send the first analysis result of the first version of the application package to the other device, where the other device may receive the first analysis result or may receive the second analysis result, and then perform the result of the version comparison. For example, the version comparison may be performed by the background, and the electronic device may automatically upload the first analysis result to the cloud database through the interface, and then perform the step of version comparison by the background.
For example, as shown in fig. 5 and fig. 6, the electronic device may analyze the APK of two versions 0.0.1000.3646 (version number) and 0.0.1000.3651 (version number) to obtain a result, and can see comparison of different types of resource sizes, comparison of the number of resource references, and comparison of the number of referenced resources. As shown in fig. 6, by comparative analysis, it is possible to obtain which resources have been changed from one version to another.
The first analysis result can also be used for APK inclusion optimization or targeted early warning.
In some embodiments, the electronic device may also send the alert information in response to the analysis result indicating that the size of the application package exceeds a first threshold. For example, when the first threshold is 2GB and the APK is found to be greater than 2GB through analysis, the APK may not be installed and operated on the mobile phone, and the early warning information may be sent, and related technicians take measures in time to optimize the APK and reduce the size thereof.
In some embodiments, the electronic device may further set a downloading manner of the first target type of resource file to a dynamic downloading manner according to the proportion of the different types of resource files in the application package indicated by the analysis result, where the proportion of the first target type of resource file is the largest among the proportions of the different types of resource files. Through the analysis result, occupation of different types of resource files in the APK can be known, and some types of resource files with larger sizes are set to be dynamic downloading modes, so that when the APK is downloaded statically, the resource files of the first target type do not need to be downloaded, and a subsequent user can download the resource files of the first target type again when the subsequent user needs to use the resource files of the first target type, so that downloading flexibility is improved, and downloading load of the user is reduced.
In some embodiments, the electronic device may further set a download manner of the resource file of the second target type to a dynamic download manner in response to the size of the resource file of the second target type indicated by the analysis result being greater than a second threshold. The second object type is somewhat similar to the first object type, the first object type being determined by the proportion of the resource file, the second object type being determined by the size of the resource file. For example, for a game, the initial package APK size is 1.8GB, where scene resources occupy 400MB, game character resources occupy 200MB, audio and video resources occupy 300MB, and atlases and single figures occupy 200MB. The occupied space is relatively large, so that in order to save the bag body, a dynamic downloading mode can be adopted, and the benefit is maximum.
The first threshold and the second threshold may be set by a skilled person according to the need, which is not limited by the embodiment of the present application.
In some embodiments, the method provided by the application can be realized through an automation script, and the script can be deployed to a continuous integrated automation building line, for example, the continuous integrated automation building line can be some delivery platforms, such as a Jenkins platform, wherein Jenkins is an open source software project and is a continuous integration tool based on Java development. And then the script can be triggered at regular time, and full-process automation including APK downloading, APK file decompression and decoding, assetsbundle file analysis, data archiving and uploading, data comparison, mail early warning and the like can be completed. The continuous integrated assembly line is used as a platform, the technical modules related to the application are connected in series, so that an automatic flow is realized, and the test efficiency is improved.
For example, as shown in fig. 7, the PAK analysis flow may include various triggering manners, and the relevant technician may set up the PAK analysis flow herein, or may set up the PAK analysis flow herein for each processing step in the automated analysis flow, for example, may update an automation script, set up a pull tool, set up each step of unpacking, ab (i.e. Assetsbundle files) analysis, archiving a component, uploading nike (a server), archiving a report, and in what case, early warning, i.e. notification, can be performed. The notification may be by a variety of means, such as social platforms, email notifications, text messaging notifications, and the like.
The embodiment of the application provides a method for automatically processing an application program package, which is characterized in that on one hand, when the application program package is processed, the processes of acquiring, decompressing, analyzing a resource file and generating an analysis result of the application program package are realized based on an automatic script, the whole process is automated, manual participation is not needed, the labor cost is greatly reduced, the processing efficiency is improved, and the accuracy of the processing result is improved. On the other hand, after the application package is decompressed, the resource files can be automatically analyzed in batches, the whole quantity of the resource files are analyzed instead of manually analyzing the resource files one by means of AssetStudio tools, the processing efficiency is greatly improved, and after analysis, an analysis result can be generated based on analysis results of a plurality of resource files, the analysis result can reflect the situation of the whole application package and is not a single resource file, the analysis result also accords with the user requirement, the user does not need to analyze the resource files one by one, and the manual analysis time is saved.
All the above optional solutions can be combined to form an optional embodiment of the present application, and will not be described in detail herein.
Fig. 8 is a schematic structural diagram of an application package processing device according to an embodiment of the present application, referring to fig. 8, the device includes:
an obtaining module 801, configured to obtain an application package based on an automation script, where the application package includes at least two resource files;
A decompression module 802, configured to decompress the application package based on the automation script, to obtain the at least two resource files in the application package;
the parsing module 803 is configured to parse header information of the at least two resource files obtained by decompression based on the automation script, extract file information of the at least two resource files from the header information, where the file information of one resource file is used to indicate an attribute of a resource included in the resource file;
A generating module 804, configured to generate an analysis result of the application package based on the automation script and based on file information of the at least two resource files.
In some embodiments, the apparatus further comprises:
a determining module, configured to determine a type of the at least two resource files according to file names or paths of the at least two resource files;
the obtaining module 801 is further configured to obtain resource file information of the application package based on the types of the at least two resource files, where the resource file information includes at least one of a proportion, a number, or a size of resource files of different types in the application package;
The generating module 804 is configured to generate an analysis result of the application package based on file information of the at least two resource files and the resource file information.
In some embodiments, the decompression module 802 is configured to:
Decompressing the application program package to obtain at least two encrypted resource files in the application program package;
decrypting the at least two encrypted resource files to obtain the at least two resource files.
In some embodiments, the file information of one resource file includes at least one of a resource name of a resource in the resource file, a type of the resource, a size of the resource, and a dependency relationship between any resource and other resources.
In some embodiments, the apparatus further comprises:
A determining module, configured to determine, based on the automation script, a type of the at least two resource files according to file names or paths of the at least two resource files;
The obtaining module 801 is further configured to obtain, based on the automation script and based on the types of the at least two resource files, resource file information of the application package, where the resource file information includes at least one of a proportion, a number, or a size of resource files of different types in the application package;
The generating module 804 is configured to generate an analysis result of the application package based on file information of the at least two resource files and the resource file information.
In some embodiments, the obtaining module 801 is configured to perform any one of:
responding to an application package processing instruction triggered by the completion of the construction of any application package, and acquiring the application package with the completed construction based on an automatic script;
Responding to an application package processing instruction triggered by processing operation on any application package, and acquiring the application package on which the processing operation is executed based on an automation script;
and responding to the application package processing instruction triggered at fixed time, and acquiring the application package constructed in the current period based on the automation script.
In some embodiments, the version of the application package is a first version; the analysis result of the application program package of the first version is a first analysis result;
The obtaining module 801 is further configured to obtain a second analysis result of the second version of the application package;
The apparatus further comprises:
The comparison module is used for comparing the first analysis result and the second analysis result to obtain difference information between the application program package of the first version and the application program package of the second version, wherein the difference information comprises at least one of differences among resource files, differences among resources or a range influenced by the differences of the resources.
In some embodiments, the apparatus further comprises:
And the sending module is used for responding to the analysis result to indicate that the size of the application program package exceeds a first threshold value and sending early warning information.
In some embodiments, the apparatus further comprises:
And the first setting module is used for setting a downloading mode of the resource files of the first target type as a dynamic downloading mode according to the proportion of the resource files of different types in the application program package indicated by the analysis result, wherein the proportion of the resource files of the first target type is the largest in the proportion of the resource files of different types.
In some embodiments, the apparatus further comprises:
And the second setting module is used for setting the downloading mode of the resource file of the second target type as a dynamic downloading mode in response to the size of the resource file of the second target type indicated by the analysis result being larger than a second threshold value.
According to the device provided by the embodiment of the application, the application package can be automatically processed, on one hand, when the application package is processed, the processes of acquiring, decompressing, analyzing the resource file and generating the analysis result of the application package are realized based on the automation script, the whole process is automated, no manual participation is needed, the labor cost is greatly reduced, the processing efficiency is improved, and the accuracy of the processing result is improved. On the other hand, after the application package is decompressed, the resource files can be automatically analyzed in batches, the whole quantity of the resource files are analyzed instead of manually analyzing the resource files one by means of AssetStudio tools, the processing efficiency is greatly improved, and after analysis, an analysis result can be generated based on analysis results of a plurality of resource files, the analysis result can reflect the situation of the whole application package and is not a single resource file, the analysis result also accords with the user requirement, the user does not need to analyze the resource files one by one, and the manual analysis time is saved.
It should be noted that: in the application package processing device provided in the above embodiment, when processing an application package, only the division of the above functional modules is used for illustration, and in practical application, the above functional allocation can be completed by different functional modules according to needs, that is, the internal structure of the application package processing device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the application package processing device and the application package processing method embodiment provided in the foregoing embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiment and are not described herein again.
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application, where the electronic device 900 may have a relatively large difference due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 901 and one or more memories 902, where at least one computer program is stored in the memories 902, and the at least one computer program is loaded and executed by the processors 901 to implement the application package processing method provided in the foregoing method embodiments. The electronic device can also include other components for implementing device functions, for example, the electronic device can also have wired or wireless network interfaces, input-output interfaces, and the like for input-output. The embodiments of the present application are not described herein.
The electronic device in the method embodiment described above can be implemented as a terminal. For example, fig. 10 is a block diagram of a terminal according to an embodiment of the present application. The terminal 1000 can be a portable mobile terminal such as: a smart phone, a tablet computer, an MP3 (Moving Picture Experts Group Audio Layer III, motion picture expert compression standard audio plane 3) player, an MP4 (Moving Picture Experts Group Audio Layer IV, motion picture expert compression standard audio plane 4) player, a notebook computer, or a desktop computer. Terminal 1000 can also be referred to by other names of user equipment, portable terminal, laptop terminal, desktop terminal, etc.
In general, terminal 1000 can include: a processor 1001 and a memory 1002.
The processor 1001 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so on. The processor 1001 may be implemented in at least one hardware form of DSP (DIGITAL SIGNAL Processing), FPGA (Field-ProgrammableGate Array, field programmable gate array), PLA (Programmable Logic Array ). The processor 1001 may also include a main processor and a coprocessor, the main processor being a processor for processing data in an awake state, also referred to as a CPU (Central Processing Unit ); a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 1001 may be integrated with a GPU (Graphics Processing Unit, image processor) for rendering and drawing of content required to be displayed by the display screen. In some embodiments, the processor 1001 may also include an AI (ARTIFICIAL INTELLIGENCE ) processor for processing computing operations related to machine learning.
Memory 1002 may include one or more computer-readable storage media, which may be non-transitory. Memory 1002 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 1002 is used to store at least one instruction for execution by processor 1001 to implement the application package processing method provided by the method embodiments of the present application.
In some embodiments, terminal 1000 can optionally further include: a peripheral interface 1003, and at least one peripheral. The processor 1001, the memory 1002, and the peripheral interface 1003 may be connected by a bus or signal line. The various peripheral devices may be connected to the peripheral device interface 1003 via a bus, signal wire, or circuit board. Specifically, the peripheral device includes: at least one of radio frequency circuitry 1004, a display 1005, a camera assembly 1006, audio circuitry 1007, and a power supply 1009.
Peripheral interface 1003 may be used to connect I/O (Input/Output) related at least one peripheral to processor 1001 and memory 1002. In some embodiments, processor 1001, memory 1002, and peripheral interface 1003 are integrated on the same chip or circuit board; in some other embodiments, either or both of the processor 1001, memory 1002, and peripheral interface 1003 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
Radio Frequency circuit 1004 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. Radio frequency circuitry 1004 communicates with a communication network and other communication devices via electromagnetic signals. The radio frequency circuit 1004 converts an electrical signal into an electromagnetic signal for transmission, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 1004 includes: antenna systems, RF transceivers, one or more amplifiers, tuners, oscillators, digital signal processors, codec chipsets, subscriber identity module cards, and so forth. Radio frequency circuitry 1004 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: the world wide web, metropolitan area networks, intranets, generation mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and/or WiFi (WIRELESS FIDELITY ) networks. In some embodiments, the radio frequency circuit 1004 may further include NFC (NEAR FIELD Communication) related circuits, which is not limited by the present application.
The display screen 1005 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display 1005 is a touch screen, the display 1005 also has the ability to capture touch signals at or above the surface of the display 1005. The touch signal may be input to the processor 1001 as a control signal for processing. At this time, the display 1005 may also be used to provide virtual buttons and/or virtual keyboards, also referred to as soft buttons and/or soft keyboards. In some embodiments, display 1005 may be one, disposed on the front panel of terminal 1000; in other embodiments, display 1005 may be provided in at least two, separately provided on different surfaces of terminal 1000 or in a folded configuration; in other embodiments, display 1005 may be a flexible display disposed on a curved surface or a folded surface of terminal 1000. Even more, the display 1005 may be arranged in a non-rectangular irregular pattern, i.e., a shaped screen. The display 1005 may be made of LCD (Liquid CRYSTAL DISPLAY), OLED (Organic Light-Emitting Diode) or other materials.
The camera assembly 1006 is used to capture images or video. Optionally, camera assembly 1006 includes a front camera and a rear camera. Typically, the front camera is disposed on the front panel of the terminal and the rear camera is disposed on the rear surface of the terminal. In some embodiments, the at least two rear cameras are any one of a main camera, a depth camera, a wide-angle camera and a tele camera, so as to realize that the main camera and the depth camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize a panoramic shooting and Virtual Reality (VR) shooting function or other fusion shooting functions. In some embodiments, camera assembly 1006 may also include a flash. The flash lamp can be a single-color temperature flash lamp or a double-color temperature flash lamp. The dual-color temperature flash lamp refers to a combination of a warm light flash lamp and a cold light flash lamp, and can be used for light compensation under different color temperatures.
The audio circuit 1007 may include a microphone and a speaker. The microphone is used for collecting sound waves of users and environments, converting the sound waves into electric signals, and inputting the electric signals to the processor 1001 for processing, or inputting the electric signals to the radio frequency circuit 1004 for voice communication. For purposes of stereo acquisition or noise reduction, the microphone may be multiple, each located at a different portion of terminal 1000. The microphone may also be an array microphone or an omni-directional pickup microphone. The speaker is used to convert electrical signals from the processor 1001 or the radio frequency circuit 1004 into sound waves. The speaker may be a conventional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, not only the electric signal can be converted into a sound wave audible to humans, but also the electric signal can be converted into a sound wave inaudible to humans for ranging and other purposes. In some embodiments, audio circuit 1007 may also include a headphone jack.
Power supply 1009 is used to power the various components in terminal 1000. The power source 1009 may be alternating current, direct current, disposable battery or rechargeable battery. When the power source 1009 includes a rechargeable battery, the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery. The wired rechargeable battery is a battery charged through a wired line, and the wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, terminal 1000 can further include one or more sensors 1010. The one or more sensors 1010 include, but are not limited to: acceleration sensor 1011, gyro sensor 1012, pressure sensor 1013, optical sensor 1015, and proximity sensor 1016.
The acceleration sensor 1011 can detect the magnitudes of accelerations on three coordinate axes of the coordinate system established with the terminal 1000. For example, the acceleration sensor 1011 may be used to detect components of gravitational acceleration in three coordinate axes. The processor 1001 may control the display screen 1005 to display a user interface in a landscape view or a portrait view according to the gravitational acceleration signal acquired by the acceleration sensor 1011. The acceleration sensor 1011 may also be used for the acquisition of motion data of a game or a user.
The gyro sensor 1012 may detect the body direction and the rotation angle of the terminal 1000, and the gyro sensor 1012 may collect the 3D motion of the user to the terminal 1000 in cooperation with the acceleration sensor 1011. The processor 1001 may implement the following functions according to the data collected by the gyro sensor 1012: motion sensing (e.g., changing UI according to a tilting operation by a user), image stabilization at shooting, game control, and inertial navigation.
Pressure sensor 1013 may be disposed on a side frame of terminal 1000 and/or on an underlying layer of display 1005. When the pressure sensor 1013 is provided at a side frame of the terminal 1000, a grip signal of the terminal 1000 by a user can be detected, and the processor 1001 performs right-and-left hand recognition or quick operation according to the grip signal collected by the pressure sensor 1013. When the pressure sensor 1013 is provided at the lower layer of the display screen 1005, the processor 1001 controls the operability control on the UI interface according to the pressure operation of the user on the display screen 1005. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
The optical sensor 1015 is used to collect ambient light intensity. In one embodiment, the processor 1001 may control the display brightness of the display screen 1005 based on the ambient light intensity collected by the optical sensor 1015. Specifically, when the intensity of the ambient light is high, the display brightness of the display screen 1005 is turned up; when the ambient light intensity is low, the display brightness of the display screen 1005 is turned down. In another embodiment, the processor 1001 may dynamically adjust the shooting parameters of the camera module 1006 according to the ambient light intensity collected by the optical sensor 1015.
Proximity sensor 1016, also referred to as a distance sensor, is typically located on the front panel of terminal 1000. Proximity sensor 1016 is used to collect the distance between the user and the front of terminal 1000. In one embodiment, when proximity sensor 1016 detects a gradual decrease in the distance between the user and the front face of terminal 1000, processor 1001 controls display 1005 to switch from the bright screen state to the off screen state; when proximity sensor 1016 detects a gradual increase in the distance between the user and the front of terminal 1000, processor 1001 controls display 1005 to switch from the off-screen state to the on-screen state.
Those skilled in the art will appreciate that the structure shown in fig. 10 is not limiting and that terminal 1000 can include more or fewer components than shown, or certain components can be combined, or a different arrangement of components can be employed.
The electronic device in the above-described method embodiment can be implemented as a server. For example, fig. 11 is a schematic structural diagram of a server according to an embodiment of the present application, where the server 1100 may have a relatively large difference due to different configurations or performances, and may include one or more processors (Central Processing Units, CPUs) 1101 and one or more memories 1102, where at least one computer program is stored in the memories 1102, and the at least one computer program is loaded and executed by the processor 1101 to implement the application package processing method provided in the above method embodiments. Of course, the server can also have components such as a wired or wireless network interface and an input/output interface for inputting and outputting, and can also include other components for implementing the functions of the device, which are not described herein.
In an exemplary embodiment, a computer readable storage medium, e.g. a memory comprising at least one computer program executable by a processor to perform the application package processing method of the above embodiments is also provided. For example, the computer readable storage medium can be Read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), compact disk Read-Only Memory (Compact Disc Read-Only Memory, CD-ROM), magnetic tape, floppy disk, optical data storage device, and the like.
In an exemplary embodiment, a computer program product or a computer program is also provided, the computer program product or the computer program comprising one or more program codes, the one or more program codes being stored in a computer readable storage medium. The one or more processors of the electronic device are capable of reading the one or more pieces of program code from the computer-readable storage medium, the one or more processors executing the one or more pieces of program code so that the electronic device can execute the above-described application package processing method.
It should be understood that, in various embodiments of the present application, the sequence numbers of the foregoing processes do not mean the order of execution, and the order of execution of the processes should be determined by the functions and internal logic thereof, and should not constitute any limitation on the implementation process of the embodiments of the present application.
It should be understood that determining B from a does not mean determining B from a alone, but can also determine B from a and/or other information.
Those of ordinary skill in the art will appreciate that all or a portion of the steps implementing the above-described embodiments can be implemented by hardware, or can be implemented by a program instructing the relevant hardware, and the program can be stored in a computer readable storage medium, and the above-mentioned storage medium can be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only of alternative embodiments of the application and is not intended to limit the application, but any modifications, equivalents, improvements, etc. which fall within the spirit and principles of the application are intended to be included in the scope of the application.

Claims (6)

1. The utility model provides an application package processing method, which is characterized in that each step in the method is automatically triggered and executed based on an automation script, the automation script is deployed to a Jenkins platform, the Jenkins is an open source software item, the Jenkins platform is used for providing a parameter setting function of each processing step in an automation analysis flow of an application package, the processing steps comprise updating of the automation script, setting a pulling tool, carrying out package downloading, assetsbundle file analysis, archiving components, uploading a server, archiving reports, early warning time and early warning modes, the Jenkins platform connects technical modules related to realizing the automation analysis flow in series so as to realize the automation analysis flow according to the execution sequence of each processing step, and the method comprises the following steps:
Responding to an application package processing instruction triggered by the completion of the construction of any application package, acquiring the constructed application package from a construction machine, wherein the application package comprises at least two resource files, and the version of the application package is a first version;
After the application program package is obtained, automatically triggering decompression of the application program package to obtain at least two encrypted resource files in the application program package; invoking a decryption tool to decrypt the at least two encrypted resource files to obtain the at least two resource files;
Determining the types of the at least two resource files according to the file names or paths of the at least two resource files; based on the types of the at least two resource files, counting the resource files of different types to obtain resource file information, wherein the resource file information comprises at least one of the proportion, the number or the size of the resource files of different types in the application program package; and
Analyzing the head information of the at least two resource files obtained by decompression in batches, extracting file information of the at least two resource files from the head information, wherein the file information of one resource file is used for indicating the attribute of the resources included in the resource files, the file information of the at least two resource files is recorded in corresponding fields of a pre-created data structure, the file information of one resource file comprises at least one of the resource name of the resources in the resource file, the type of the resources, the size of the resources, the dependency relationship between any one resource and other resources, the position of the resources and the priority of the resources, and the data structure is used for storing analysis results of statistical analysis on analysis results;
generating an analysis result of the application program package based on file information of the at least two resource files and the resource file information, wherein the analysis result comprises a resource list in each resource file and a dependency relationship between resources;
Comparing the versions of the application program package of the first version with the application program package of the second version, and determining difference information among the application program packages of different versions, wherein the difference information comprises at least one of differences among resource files, differences among resources or ranges influenced by the differences among the resources, and the ranges influenced by the differences among the resources are obtained according to analysis of the differences among the resources and the dependency relationship among the resources; and
Transmitting early warning information in response to the analysis result indicating that the size of the application program package exceeds a first threshold;
Setting a downloading mode of a first target type resource file as a dynamic downloading mode according to the proportion of different types of resource files in the application program package indicated by the analysis result, wherein the proportion of the first target type resource file is the largest in the proportion of the different types of resource files;
Setting a downloading mode of the resource file of the second target type as the dynamic downloading mode in response to the size of the resource file of the second target type indicated by the analysis result being larger than a second threshold value;
the dynamic downloading mode refers to that when the application program package is downloaded statically, the resource file of the first target type or the second target type does not need to be downloaded, and when the resource file of the first target type or the second target type is used, the resource file of the first target type or the second target type is downloaded;
the method further comprises the steps of:
displaying the analysis result through a terminal, wherein file information of the at least two resource files and the resource file information are respectively displayed in different areas of the same interface;
And displaying results obtained by analyzing application packages of different versions through the terminal, wherein the displayed result information comprises comparison of sizes of different types of resources, comparison of reference numbers of the resources and comparison of the reference numbers of the resources.
2. The method of claim 1, further comprising any one of:
Responding to an application package processing instruction triggered by processing operation on any application package, and acquiring the application package on which the processing operation is executed based on the automation script;
and responding to the application package processing instruction triggered at fixed time, and acquiring the application package constructed in the current period based on the automatic script.
3. An application package processing device, wherein steps executed by each module in the device are automatically triggered to be executed based on an automation script, the automation script is deployed to a Jenkins platform, the Jenkins platform is an open source software item, the Jenkins platform is used for providing a parameter setting function of each processing step in an automation analysis flow of an application package, the processing steps comprise updating of the automation script, setting of a pulling tool, package issuing, assetsbundle file analysis, archiving components, uploading servers, archiving reports, early warning time and early warning modes, the Jenkins platform connects technical modules involved in realizing the automation analysis flow in series so as to realize the automation analysis flow according to an execution sequence of each processing step, and the device comprises:
the system comprises an acquisition module, a construction machine and a storage module, wherein the acquisition module is used for responding to an application package processing instruction triggered by the completion of construction of any application package, acquiring the constructed application package from the construction machine, wherein the application package comprises at least two resource files, and the version of the application package is a first version;
the decompression module is used for automatically triggering the decompression of the application program package after the application program package is acquired, so as to obtain at least two encrypted resource files in the application program package; invoking a decryption tool to decrypt the at least two encrypted resource files to obtain the at least two resource files;
a determining module, configured to determine a type of the at least two resource files according to file names or paths of the at least two resource files;
The acquisition module is further configured to count different types of resource files based on the types of the at least two resource files to obtain resource file information, where the resource file information includes at least one of a proportion, a number or a size of the different types of resource files in the application package; and
The analysis module is used for analyzing the head information of the at least two resource files obtained by decompression in batches, extracting file information of the at least two resource files from the head information, wherein the file information of one resource file is used for indicating the attribute of the resource included in the resource file, the file information of the at least two resource files is recorded in a corresponding field of a pre-created data structure, the file information of one resource file comprises at least one of the resource name of the resource in the resource file, the type of the resource, the size of the resource, the dependency relationship between any resource and other resources, the position of the resource and the priority of the resource, and the data structure is used for storing an analysis result for carrying out statistical analysis on the analysis result;
The generation module is used for generating an analysis result of the application program package based on the file information of the at least two resource files and the resource file information, wherein the analysis result comprises a resource list in each resource file and a dependency relationship between resources;
The comparison module is used for comparing versions of the application program package of the first version with the application program package of the second version, and determining difference information among the application program packages of different versions, wherein the difference information comprises at least one of differences among resource files, differences among resources or ranges influenced by the differences among the resources, and the ranges influenced by the differences among the resources are obtained according to analysis of the differences among the resources and the dependency relationship among the resources; and
The sending module is used for responding to the analysis result to indicate that the size of the application program package exceeds a first threshold value and sending early warning information;
The first setting module is used for setting a downloading mode of the resource files of the first target type as a dynamic downloading mode according to the proportion of the resource files of different types in the application program package indicated by the analysis result, wherein the proportion of the resource files of the first target type is the largest in the proportion of the resource files of different types;
the second setting module is used for setting the downloading mode of the resource file of the second target type as the dynamic downloading mode in response to the fact that the size of the resource file of the second target type indicated by the analysis result is larger than a second threshold value;
the dynamic downloading mode refers to that when the application program package is downloaded statically, the resource file of the first target type or the second target type does not need to be downloaded, and when the resource file of the first target type or the second target type is used, the resource file of the first target type or the second target type is downloaded;
a module for performing the steps of: displaying the analysis result through a terminal, wherein file information of the at least two resource files and the resource file information are respectively displayed in different areas of the same interface; and displaying results obtained by analyzing application packages of different versions through the terminal, wherein the displayed result information comprises comparison of sizes of different types of resources, comparison of reference numbers of the resources and comparison of the reference numbers of the resources.
4. The apparatus of claim 3, wherein the acquisition module is further configured to perform any one of:
Responding to an application package processing instruction triggered by processing operation on any application package, and acquiring the application package on which the processing operation is executed based on the automation script;
and responding to the application package processing instruction triggered at fixed time, and acquiring the application package constructed in the current period based on the automatic script.
5. An electronic device comprising one or more processors and one or more memories, the one or more memories having stored therein at least one computer program loaded and executed by the one or more processors to implement the application package processing method of any of claims 1-2.
6. A computer readable storage medium, wherein at least one computer program is stored in the storage medium, the at least one computer program being loaded and executed by a processor to implement the application package processing method of any one of claims 1 to 2.
CN202110277904.9A 2021-03-15 2021-03-15 Application package processing method, device, equipment and storage medium Active CN112783512B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110277904.9A CN112783512B (en) 2021-03-15 2021-03-15 Application package processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110277904.9A CN112783512B (en) 2021-03-15 2021-03-15 Application package processing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112783512A CN112783512A (en) 2021-05-11
CN112783512B true CN112783512B (en) 2024-05-10

Family

ID=75762632

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110277904.9A Active CN112783512B (en) 2021-03-15 2021-03-15 Application package processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112783512B (en)

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016000102A1 (en) * 2014-06-12 2016-01-07 华为技术有限公司 Application transferring method, terminal and application server
CN108415708A (en) * 2018-01-19 2018-08-17 五八有限公司 Processing method, device, equipment and the storage medium of application program installation kit size
CN108897546A (en) * 2018-07-03 2018-11-27 北京五八信息技术有限公司 Monitor method, apparatus, equipment and the readable storage medium storing program for executing of APK size
US10169035B1 (en) * 2017-09-06 2019-01-01 International Business Machines Corporation Customized static source code analysis
CN109799970A (en) * 2018-12-06 2019-05-24 珠海西山居移动游戏科技有限公司 A kind of quoting resource relationship generation method and system
CN109828777A (en) * 2018-12-06 2019-05-31 珠海西山居互动娱乐科技有限公司 A kind of hand trip installation kit optimization method and system
CN110069264A (en) * 2019-03-21 2019-07-30 平安普惠企业管理有限公司 Construct method, apparatus, computer equipment and the storage medium of resource packet
CN110232026A (en) * 2019-06-12 2019-09-13 苏州亿歌网络科技有限公司 AssetBundle resource detection method and system
CN111538502A (en) * 2020-03-27 2020-08-14 北京达佳互联信息技术有限公司 Installation package processing method and device, electronic equipment and storage medium
CN111666206A (en) * 2020-04-30 2020-09-15 北京百度网讯科技有限公司 Method, device, equipment and storage medium for acquiring influence range of change code
CN111679835A (en) * 2020-04-26 2020-09-18 五八有限公司 Application processing method, device, terminal and storage medium
CN112052036A (en) * 2020-09-07 2020-12-08 网易(杭州)网络有限公司 Application program management method and device, storage medium and computer equipment
CN112379888A (en) * 2020-12-02 2021-02-19 北京皮尔布莱尼软件有限公司 Code change analysis method
CN112486563A (en) * 2020-12-02 2021-03-12 车智互联(北京)科技有限公司 Code management method, system, computing device and readable storage medium

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016000102A1 (en) * 2014-06-12 2016-01-07 华为技术有限公司 Application transferring method, terminal and application server
US10169035B1 (en) * 2017-09-06 2019-01-01 International Business Machines Corporation Customized static source code analysis
CN108415708A (en) * 2018-01-19 2018-08-17 五八有限公司 Processing method, device, equipment and the storage medium of application program installation kit size
CN108897546A (en) * 2018-07-03 2018-11-27 北京五八信息技术有限公司 Monitor method, apparatus, equipment and the readable storage medium storing program for executing of APK size
CN109799970A (en) * 2018-12-06 2019-05-24 珠海西山居移动游戏科技有限公司 A kind of quoting resource relationship generation method and system
CN109828777A (en) * 2018-12-06 2019-05-31 珠海西山居互动娱乐科技有限公司 A kind of hand trip installation kit optimization method and system
CN110069264A (en) * 2019-03-21 2019-07-30 平安普惠企业管理有限公司 Construct method, apparatus, computer equipment and the storage medium of resource packet
CN110232026A (en) * 2019-06-12 2019-09-13 苏州亿歌网络科技有限公司 AssetBundle resource detection method and system
CN111538502A (en) * 2020-03-27 2020-08-14 北京达佳互联信息技术有限公司 Installation package processing method and device, electronic equipment and storage medium
CN111679835A (en) * 2020-04-26 2020-09-18 五八有限公司 Application processing method, device, terminal and storage medium
CN111666206A (en) * 2020-04-30 2020-09-15 北京百度网讯科技有限公司 Method, device, equipment and storage medium for acquiring influence range of change code
CN112052036A (en) * 2020-09-07 2020-12-08 网易(杭州)网络有限公司 Application program management method and device, storage medium and computer equipment
CN112379888A (en) * 2020-12-02 2021-02-19 北京皮尔布莱尼软件有限公司 Code change analysis method
CN112486563A (en) * 2020-12-02 2021-03-12 车智互联(北京)科技有限公司 Code management method, system, computing device and readable storage medium

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
中公教育优就业研究院.《数字视觉与虚拟交互自学指南》.陕西科学技术出版社,2020,第352页. *
安装包大小分析;小文字 吃饭,睡觉,遛狗头;《https://blog.hacktons.cn/2018/04/22/cli-apk-analyze/》;第4页 *
爱奇艺安卓app瘦身经验;爱奇艺;《https://www.iqiyi.com/common/20170920/3fbbd64d0ebb69ce.html》;第3页 *
移动性能测试 Android 包大小检查测试方案;xinxi;《https://testerhome.com/topics/17629》;第1,3,6页 *

Also Published As

Publication number Publication date
CN112783512A (en) 2021-05-11

Similar Documents

Publication Publication Date Title
CN108536463B (en) Method, device and equipment for acquiring resource package and computer readable storage medium
US10921958B2 (en) Electronic device supporting avatar recommendation and download
CN108132790B (en) Method, apparatus and computer storage medium for detecting a garbage code
CN110865837B (en) Method and terminal for system upgrade
CN112116690B (en) Video special effect generation method, device and terminal
CN112000331A (en) Page rendering method and device, electronic equipment and storage medium
CN112269853A (en) Search processing method, search processing device and storage medium
CN110569220A (en) Game resource file display method and device, terminal and storage medium
CN113138771B (en) Data processing method, device, equipment and storage medium
CN113867848A (en) Method, device and equipment for calling graphic interface and readable storage medium
CN113742366A (en) Data processing method and device, computer equipment and storage medium
CN113822322A (en) Image processing model training method and text processing model training method
KR102316846B1 (en) Method for sorting a media content and electronic device implementing the same
CN112230781A (en) Character recommendation method and device and storage medium
CN113051015A (en) Page rendering method and device, electronic equipment and storage medium
CN112783512B (en) Application package processing method, device, equipment and storage medium
CN112148499A (en) Data reporting method and device, computer equipment and medium
CN112181442A (en) Unloaded page display method, device, terminal, server and storage medium
CN114077529B (en) Log uploading method and device, electronic equipment and computer readable storage medium
US11405341B1 (en) Audience-based content optimization in a messaging system
US20210400442A1 (en) Recipient-based content optimization in a messaging system
US11317129B1 (en) Targeted content distribution in a messaging system
CN113268234A (en) Page generation method, device, terminal and storage medium
CN112783533A (en) Version information updating method, version information updating device, terminal and storage medium
CN111294320B (en) Data conversion method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40043478

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant